Changeset 1079


Ignore:
Timestamp:
03/17/17 18:02:20 (7 years ago)
Author:
yushan
Message:

backup modification

Location:
XIOS/dev/branch_yushan
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/bld.cfg

    r1073 r1079  
    3333#bld::target libxios.a  
    3434#bld::target generate_fortran_interface.exe  
    35 #bld::target xios_server.exe  
     35bld::target xios_server.exe  
    3636#bld::target test_remap.exe 
    3737#bld::target test_new_features.exe test_unstruct_complete.exe  
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_fortran.cpp

    r1072 r1079  
    2626    { 
    2727      fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm)); 
    28       // printf("EP_Comm_c2f : MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm); 
     28      printf("EP_Comm_c2f : MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), comm.ep_comm_ptr); 
    2929    } 
    3030     
     
    4646      MPI_Comm comm_ptr; 
    4747      comm_ptr = it->second; 
    48       // printf("EP_Comm_f2c : MAP find: %d, %d, %p\n", it->first.first, it->first.second, it->second); 
     48      printf("EP_Comm_f2c : MAP find: %d, %d, %p\n", it->first.first, it->first.second, comm_ptr.ep_comm_ptr); 
    4949      return  comm_ptr; 
    5050    } 
  • XIOS/dev/branch_yushan/src/client.cpp

    r1074 r1079  
    3838// localComm doesn't given 
    3939 
    40         printf("check : localComm == MPI_COMM_NULL = %d\n", localComm == MPI_COMM_NULL); 
    41  
    4240        if (localComm == MPI_COMM_NULL) 
    4341        { 
     
    6967          MPI_Comm_rank(CXios::globalComm,&rank); 
    7068 
    71           printf("client init : codeId = %s, xiosCodeId = %s, rank = %d(%d), size = %d\n", codeId, CXios::xiosCodeId, rank, omp_get_thread_num(), size); 
     69          printf("client init : rank = %d, size = %d\n", rank, size); 
    7270           
    7371 
     
    107105          if (CXios::usingServer) 
    108106          { 
    109             int clientLeader=leaders[hashClient] ; 
     107            //int clientLeader=leaders[hashClient] ; 
    110108            serverLeader=leaders[hashServer] ; 
    111109 
     
    116114            { 
    117115              info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 
    118                  <<" intraCommRank :"<<intraCommRank<<"  serverLeader "<< serverLeader<<endl ;   
     116                 <<" intraCommRank :"<<intraCommRank<<"  serverLeader "<< serverLeader 
     117                 <<" globalComm : "<< &(CXios::globalComm) << endl ;   
    119118            } 
    120119             
    121120            MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ; 
     121 
     122            int interCommSize, interCommRank ; 
     123            MPI_Comm_size(interComm,&interCommSize) ; 
     124            MPI_Comm_rank(interComm,&interCommRank) ; 
     125 
     126            #pragma omp critical(_output) 
     127            { 
     128              info(50)<<" interCommRank :"<<interCommRank 
     129                 <<" interCommSize : "<< interCommSize << endl ;   
     130            } 
     131 
    122132 
    123133          } 
     
    176186    void CClient::registerContext(const string& id,MPI_Comm contextComm) 
    177187    { 
     188      //info(50) << "Client "<<getRank() << " start registerContext using info output" << endl; 
     189      printf("Client %d start registerContext\n", getRank()); 
     190      //printf("Client start registerContext\n"); 
     191 
    178192      CContext::setCurrent(id) ; 
    179       CContext* context=CContext::create(id); 
     193      printf("Client %d CContext::setCurrent OK\n", getRank()); 
     194      CContext* context = CContext::create(id); 
     195      printf("Client %d context=CContext::create(%s) OK\n", getRank(), id); 
     196       
    180197      StdString idServer(id); 
    181198      idServer += "_server"; 
    182199 
    183       if (!CXios::isServer) 
     200      if (!CXios::isServer)  // server mode 
    184201      {       
    185202        int size,rank,globalRank ; 
     
    211228 
    212229        MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 
    213         //info(10)<<"Register new Context : "<<id<<endl ; 
     230         
     231        #pragma omp critical (_output) 
     232        info(10)<<"Register new Context : "<<id<<endl ; 
    214233                       
    215234 
     
    217236        MPI_Intercomm_merge(contextInterComm,0,&inter) ; 
    218237        MPI_Barrier(inter) ; 
     238 
     239        #pragma omp critical (_output) 
     240        printf("Client %d : MPI_Intercomm_merge OK \n", getRank()) ; 
    219241         
    220242         
    221243        context->initClient(contextComm,contextInterComm) ; 
     244        #pragma omp critical (_output) 
     245        printf("Client %d : context->initClient(contextComm,contextInterComm) OK \n", getRank()) ; 
    222246         
    223247 
     
    225249        MPI_Comm_free(&inter); 
    226250      } 
    227       else 
     251      else  // attached mode 
    228252      { 
    229253        MPI_Comm contextInterComm ; 
  • XIOS/dev/branch_yushan/src/client.hpp

    r1073 r1079  
    2525 
    2626        static int serverLeader; 
    27         #pragma omp threadprivate(serverLeader) 
     27        //#pragma omp threadprivate(serverLeader) 
    2828 
    2929        static bool is_MPI_Initialized ; 
    30         #pragma omp threadprivate(is_MPI_Initialized) 
     30        //#pragma omp threadprivate(is_MPI_Initialized) 
    3131 
    3232        //! Get rank of the current process 
     
    5252 
    5353        static StdOFStream m_infoStream; 
    54         #pragma omp threadprivate(m_infoStream)  
     54        //#pragma omp threadprivate(m_infoStream)  
    5555 
    5656        static StdOFStream m_errorStream; 
    57         #pragma omp threadprivate(m_errorStream) 
     57        //#pragma omp threadprivate(m_errorStream) 
    5858 
    5959        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); 
  • XIOS/dev/branch_yushan/src/cxios.cpp

    r1074 r1079  
    2222  bool CXios::isServer ; 
    2323  MPI_Comm CXios::globalComm ; 
     24   
    2425  bool CXios::usingOasis ; 
    2526  bool CXios::usingServer = false; 
     
    7273    {  
    7374      num_ep = omp_get_num_threads(); 
    74       printf("Client %d: num_ep = %d\n", omp_get_thread_num(), num_ep); 
     75      //printf("Client %d: num_ep = %d\n", omp_get_thread_num(), num_ep); 
    7576    } 
    7677     
     
    7879    {  
    7980      num_ep = omp_get_num_threads(); 
    80       printf("Server %d: num_ep = %d\n", omp_get_thread_num(), num_ep);  
     81      //printf("Server %d: num_ep = %d\n", omp_get_thread_num(), num_ep);  
    8182    } 
    8283     
     
    9091     
    9192    #pragma omp barrier 
    92        
    93     globalComm = passage[omp_get_thread_num()]; 
    94  
    95     int tmp_rank; 
    96     MPI_Comm_rank(globalComm, &tmp_rank); 
    97     if(isClient) printf("client thread %d/%d\n", omp_get_thread_num(), tmp_rank); 
    98     if(isServer) printf("server thread %d/%d\n", omp_get_thread_num(), tmp_rank); 
     93 
     94       
     95    CXios::globalComm = passage[omp_get_thread_num()]; 
     96 
     97    // int tmp_rank; 
     98    // MPI_Comm_rank(CXios::globalComm, &tmp_rank); 
     99    // if(isClient) printf("client thread %d/%d, globalComm = %p\n", omp_get_thread_num(), tmp_rank, &(CXios::globalComm)); 
     100    //if(isServer) printf("server thread %d/%d, globalComm = %p\n", omp_get_thread_num(), tmp_rank, &globalComm); 
    99101     
    100102  } 
     
    112114    initialize() ; 
    113115 
    114  
    115  
    116116    CClient::initialize(codeId,localComm,returnComm) ; 
    117  
    118117 
    119118    if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ; 
  • XIOS/dev/branch_yushan/src/cxios.hpp

    r1074 r1079  
    4444 
    4545     static bool isClient ; //!< Check if xios is client 
    46      #pragma omp threadprivate(isClient) 
     46     //#pragma omp threadprivate(isClient) 
    4747 
    4848     static bool isServer ; //!< Check if xios is server 
    49      #pragma omp threadprivate(isServer) 
     49     //#pragma omp threadprivate(isServer) 
    5050 
    5151     static MPI_Comm globalComm ; //!< Global communicator 
     
    5353 
    5454     static bool printLogs2Files; //!< Printing out logs into files 
    55      #pragma omp threadprivate(printLogs2Files) 
     55     //#pragma omp threadprivate(printLogs2Files) 
    5656 
    5757     static bool usingOasis ; //!< Using Oasis 
    58      #pragma omp threadprivate(usingOasis) 
     58     //#pragma omp threadprivate(usingOasis) 
    5959 
    6060     static bool usingServer ; //!< Using server (server mode) 
    61      #pragma omp threadprivate(usingServer) 
     61     //#pragma omp threadprivate(usingServer) 
    6262 
    6363     static double bufferSizeFactor; //!< Factor used to tune the buffer size 
    64      #pragma omp threadprivate(bufferSizeFactor) 
     64     //#pragma omp threadprivate(bufferSizeFactor) 
    6565 
    6666     static const double defaultBufferSizeFactor; //!< Default factor value 
    67      #pragma omp threadprivate(defaultBufferSizeFactor) 
     67     //#pragma omp threadprivate(defaultBufferSizeFactor) 
    6868 
    6969     static StdSize minBufferSize; //!< Minimum buffer size 
    70      #pragma omp threadprivate(minBufferSize) 
     70     //#pragma omp threadprivate(minBufferSize) 
    7171 
    7272     static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) 
    73      #pragma omp threadprivate(isOptPerformance) 
     73     //#pragma omp threadprivate(isOptPerformance) 
    7474 
    7575     static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 
    76      #pragma omp threadprivate(globalRegistry) 
     76     //#pragma omp threadprivate(globalRegistry) 
    7777 
    7878    public: 
  • XIOS/dev/branch_yushan/src/indent_xml.cpp

    r1072 r1079  
    1515   { 
    1616      static unsigned int LineNB = 1; 
    17       #pragma omp threadprivate(LineNB) 
     17      //#pragma omp threadprivate(LineNB) 
    1818       
    1919      if (CIndent::WithLine) out << LineNB++ << ". "; 
  • XIOS/dev/branch_yushan/src/io/netCdf_cf_constant.hpp

    r1072 r1079  
    1616  static const StdString XIOS_CF_coordinates; 
    1717  static const StdString XIOS_CF_bounds; 
     18}; 
    1819 
    19   #pragma omp threadprivate(XIOS_CF_units, XIOS_CF_standard_name, XIOS_CF_coordinates, XIOS_CF_bounds) 
    20 }; 
    2120const StdString CCFKeywords::XIOS_CF_units("units"); 
    2221const StdString CCFKeywords::XIOS_CF_standard_name("standard_name"); 
  • XIOS/dev/branch_yushan/src/node/context.cpp

    r1074 r1079  
    240240     hasClient=true; 
    241241     client = new CContextClient(this,intraComm, interComm, cxtServer); 
     242 
     243     int tmp_rank; 
     244     MPI_Comm_rank(intraComm, &tmp_rank); 
     245      
     246     #pragma omp critical (_output) 
     247     printf("Client %d : client = new CContextClient(this,intraComm, interComm, cxtServer) \n", tmp_rank) ; 
     248      
    242249     registryIn=new CRegistry(intraComm); 
    243250     registryIn->setPath(getId()) ; 
     
    247254     registryOut=new CRegistry(intraComm) ; 
    248255     registryOut->setPath(getId()) ; 
     256     #pragma omp critical (_output) 
     257     printf("Client %d : registryOut->setPath(getId()) \n", tmp_rank) ; 
    249258 
    250259     ep_lib::MPI_Comm intraCommServer, interCommServer; 
  • XIOS/dev/branch_yushan/src/parse_expr/lex_parser.cpp

    r1072 r1079  
    264264static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 
    265265static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 
    266 #pragma omp threadprivate(yy_buffer_stack_top, yy_buffer_stack_max, yy_buffer_stack) 
     266//#pragma omp threadprivate(yy_buffer_stack_top, yy_buffer_stack_max, yy_buffer_stack) 
    267267 
    268268/* We provide macros for accessing buffer states in case in the 
     
    284284static char yy_hold_char; 
    285285static yy_size_t yy_n_chars;            /* number of characters read into yy_ch_buf */ 
    286 #pragma omp threadprivate(yy_hold_char, yy_n_chars) 
     286//#pragma omp threadprivate(yy_hold_char, yy_n_chars) 
    287287 
    288288yy_size_t yyleng; 
     
    292292static int yy_init = 0;         /* whether we need to initialize */ 
    293293static int yy_start = 0;        /* start state number */ 
    294 #pragma omp threadprivate(yy_c_buf_p, yy_init, yy_start) 
     294//#pragma omp threadprivate(yy_c_buf_p, yy_init, yy_start) 
    295295 
    296296/* Flag which is used to allow yywrap()'s to do buffer switches 
     
    298298 */ 
    299299static int yy_did_buffer_switch_on_eof; 
    300 #pragma omp threadprivate(yy_did_buffer_switch_on_eof) 
     300//#pragma omp threadprivate(yy_did_buffer_switch_on_eof) 
    301301 
    302302void yyrestart (FILE *input_file  ); 
     
    987987 
    988988    } ; 
    989 #pragma omp threadprivate(yy_nxt) 
     989//#pragma omp threadprivate(yy_nxt) 
    990990 
    991991static yy_state_type yy_get_previous_state (void ); 
     
    10321032    } ; 
    10331033 
    1034 #pragma omp threadprivate(yy_accept, yy_last_accepting_state, yy_last_accepting_cpos, yy_NUL_trans) 
     1034//#pragma omp threadprivate(yy_accept, yy_last_accepting_state, yy_last_accepting_cpos, yy_NUL_trans) 
    10351035 
    10361036extern int yy_flex_debug; 
  • XIOS/dev/branch_yushan/src/server.cpp

    r1072 r1079  
    268268       int flag = false ; 
    269269       static void* buffer ; 
    270        #pragma omp threadprivate(buffer) 
     270       //#pragma omp threadprivate(buffer) 
    271271 
    272272       static MPI_Request request ; 
    273        #pragma omp threadprivate(request) 
     273       //#pragma omp threadprivate(request) 
    274274 
    275275       static bool recept=false ; 
    276        #pragma omp threadprivate(recept) 
     276       //#pragma omp threadprivate(recept) 
    277277 
    278278       int rank ; 
     
    370370       int flag ; 
    371371       static void* buffer ; 
    372        #pragma omp threadprivate(buffer) 
     372       //#pragma omp threadprivate(buffer) 
    373373 
    374374       static MPI_Request request ; 
    375        #pragma omp threadprivate(request) 
     375       //#pragma omp threadprivate(request) 
    376376 
    377377       static bool recept=false ; 
    378        #pragma omp threadprivate(recept) 
     378       //#pragma omp threadprivate(recept) 
    379379        
    380380       int rank ; 
     
    432432        
    433433 
    434        CContext* context=CContext::create(contextId); 
     434       CContext* context = CContext::create(contextId); 
    435435       contextList[contextId]=context; 
    436436       context->initServer(intraComm,contextIntercomm); 
  • XIOS/dev/branch_yushan/src/test/test_client.f90

    r1073 r1079  
    3737  CALL init_wait 
    3838 
    39   CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 
    40   if(rank < 2) then 
     39  !CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 
     40  !if(rank < 2) then 
    4141 
    4242   
     
    153153  print *, "Client : xios_finalize " 
    154154 
    155    else 
     155!    else 
    156156 
    157    CALL xios_init_server 
    158    print *, "Server : xios_finalize " 
     157!    CALL xios_init_server 
     158!    print *, "Server : xios_finalize " 
    159159   
    160    endif 
     160!    endif 
    161161     
    162162 
  • XIOS/dev/branch_yushan/src/test/test_omp.f90

    r1074 r1079  
    7979  print*, "xios init OK", rank, size 
    8080 
    81 !   CALL xios_context_initialize("test",comm) 
     81   CALL xios_context_initialize("test",comm) 
    8282 
    83 !   print*, "xios_context init OK", rank, size  
     83   print*, "xios_context init OK", rank, size  
    8484 
    8585  !CALL xios_context_finalize() 
     
    8888  !print*, "xios_context finalize OK", rank, size  
    8989 
     90 
     91 
    9092  !$omp end parallel 
    9193 
     94  call MPI_Abort(ierr) 
    9295 
    9396   
  • XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp

    r1072 r1079  
    5959  typedef std::map<EReductionType, CreateOperationCallBack> CallBackMap; 
    6060  static CallBackMap* reductionCreationCallBacks_; 
    61   #pragma omp threadprivate(reductionCreationCallBacks_) 
     61  //#pragma omp threadprivate(reductionCreationCallBacks_) 
    6262 
    6363  static bool registerOperation(EReductionType reduceType, CreateOperationCallBack createFn); 
     
    6767  static bool initReductionOperation(std::map<StdString,EReductionType>& m); 
    6868  static bool _dummyInit; 
    69   #pragma omp threadprivate(_dummyInit) 
     69  //#pragma omp threadprivate(_dummyInit) 
    7070}; 
    7171 
  • XIOS/dev/branch_yushan/src/transformation/grid_transformation_factory_impl.hpp

    r1072 r1079  
    5757  typedef std::map<ETranformationType, CreateTransformationCallBack> CallBackMap; 
    5858  static CallBackMap* transformationCreationCallBacks_; 
    59   #pragma omp threadprivate(transformationCreationCallBacks_) 
     59  //#pragma omp threadprivate(transformationCreationCallBacks_) 
    6060   
    6161  static bool registerTransformation(ETranformationType transType, CreateTransformationCallBack createFn); 
    6262  static bool unregisterTransformation(ETranformationType transType); 
    6363  static bool initializeTransformation_; 
    64   #pragma omp threadprivate(initializeTransformation_) 
     64  //#pragma omp threadprivate(initializeTransformation_) 
    6565}; 
    6666 
Note: See TracChangeset for help on using the changeset viewer.