Changeset 1060 for XIOS


Ignore:
Timestamp:
02/23/17 15:51:56 (7 years ago)
Author:
yushan
Message:

minor corrections + clean up

Location:
XIOS/dev/branch_yushan
Files:
15 edited

Legend:

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

    r1058 r1060  
    3636#test_remap.exe 
    3737#bld::target test_new_features.exe test_unstruct_complete.exe  
    38 bld::target test_client.exe test_complete.exe 
     38bld::target test_client.exe #test_complete.exe 
    3939bld::exe_dep 
    4040 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_create.cpp

    r1037 r1060  
    185185    } 
    186186 
    187     printf("ep_lib::MPI_Comm_create_endpoints()       OK from void*\n"); 
     187    //printf("ep_lib::MPI_Comm_create_endpoints()       OK from void*\n"); 
    188188 
    189189    return 0; 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_fortran.cpp

    r1056 r1060  
    3232    { 
    3333      fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm)); 
    34       printf("EP_Comm_c2f : MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm); 
     34      //printf("EP_Comm_c2f : MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm); 
    3535    } 
    3636     
     
    5252      MPI_Comm comm_ptr; 
    5353      comm_ptr =  it->second; 
    54       printf("EP_Comm_f2c : MAP find: %d, %d, %p\n", it->first.first, it->first.second, &comm_ptr); 
     54      //printf("EP_Comm_f2c : MAP find: %d, %d, %p\n", it->first.first, it->first.second, &comm_ptr); 
    5555      return  comm_ptr; 
    5656    } 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_intercomm.cpp

    r1053 r1060  
    5656      if( leader_ranks[1] * leader_ranks[4] == 1) 
    5757      { 
    58         if(ep_rank == local_leader) printf("calling MPI_Intercomm_create_unique_leader\n"); 
     58        if(ep_rank == local_leader) Debug("calling MPI_Intercomm_create_unique_leader\n"); 
    5959        local_comm.ep_comm_ptr->comm_label = -99; 
    6060 
     
    6464      { 
    6565        // change leader 
    66         if(ep_rank == local_leader) printf("calling MPI_Intercomm_create_from_world\n"); 
     66        if(ep_rank == local_leader) Debug("calling MPI_Intercomm_create_from_world\n"); 
    6767 
    6868        int new_local_leader; 
     
    179179    } 
    180180 
    181     if(ep_rank == local_leader) printf("calling MPI_Intercomm_create_kernel\n"); 
     181    if(ep_rank == local_leader) Debug("calling MPI_Intercomm_create_kernel\n"); 
    182182 
    183183    return MPI_Intercomm_create_kernel(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm); 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_lib.cpp

    r1037 r1060  
    5252      if(  comm.ep_comm_ptr->intercomm->remote_rank_map->at(i).first  == inter_rank  ) 
    5353      { 
    54         printf("get_ep_rank for intercomm, ep_rank_loc = %d, mpi_rank = %d => ep_src = %d\n", ep_rank_loc, mpi_rank, i); 
     54        //printf("get_ep_rank for intercomm, ep_rank_loc = %d, mpi_rank = %d => ep_src = %d\n", ep_rank_loc, mpi_rank, i); 
    5555        return i; 
    5656      } 
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_probe.cpp

    r1053 r1060  
    3636 
    3737    #pragma omp critical (_query) 
    38     if(comm.ep_comm_ptr->message_queue->size() > 0) 
     38    if(!comm.ep_comm_ptr->message_queue->empty()) 
    3939    { 
    40       for(Message_list::iterator it = comm.ep_comm_ptr->message_queue->begin(); it!= comm.ep_comm_ptr->message_queue->end(); it++) 
     40      for(Message_list::iterator it = comm.ep_comm_ptr->message_queue->begin(); it!= comm.ep_comm_ptr->message_queue->end(); ++it) 
    4141      { 
    4242        bool src_matched = src<0? true: it->ep_src == src; 
     
    107107 
    108108    #pragma omp critical (_query) 
    109     if(comm.ep_comm_ptr->message_queue->size() > 0) 
     109    if(! comm.ep_comm_ptr->message_queue->empty()) 
    110110    { 
    111       for(Message_list::iterator it = comm.ep_comm_ptr->message_queue->begin(); it!= comm.ep_comm_ptr->message_queue->end(); it++) 
     111      for(Message_list::iterator it = comm.ep_comm_ptr->message_queue->begin(); it!= comm.ep_comm_ptr->message_queue->end(); ++it) 
    112112      { 
    113113        bool src_matched = src<0? true: it->ep_src == src; 
  • XIOS/dev/branch_yushan/inputs/iodef.xml

    r1056 r1060  
    1212 
    1313 
    14    <file_definition type="one_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 
     14   <file_definition type="multiple_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 
    1515     <file id="output" name="output"> 
    1616        <field field_ref="field_A_zoom" name="field_A" /> 
  • XIOS/dev/branch_yushan/src/client.cpp

    r1053 r1060  
    2424    StdOFStream CClient::m_errorStream; 
    2525 
    26     void CClient::initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm) 
     26    void CClient::initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 
    2727    { 
    2828      int initialized ; 
     
    161161 
    162162      if (!CXios::isServer) 
    163       { 
    164        
    165          
    166          
     163      {       
    167164        int size,rank,globalRank ; 
    168165        size_t message_size ; 
     
    191188        delete [] buff ; 
    192189         
    193         printf("====== Client: begin context_init \n"); 
     190        //printf("====== Client: begin context_init \n"); 
    194191       
    195192 
     
    197194        info(10)<<"Register new Context : "<<id<<endl ; 
    198195         
    199         cout<<"Register new Context : "<<id<<endl ; 
     196        //cout<<"Register new Context : "<<id<<endl ; 
    200197               
    201198 
    202         MPI_Comm inter ; 
    203         MPI_Intercomm_merge(contextInterComm,0,&inter) ; 
    204         MPI_Barrier(inter) ; 
     199        // MPI_Comm inter ; 
     200        // MPI_Intercomm_merge(contextInterComm,0,&inter) ; 
     201        // MPI_Barrier(inter) ; 
    205202         
    206203         
    207204        context->initClient(contextComm,contextInterComm) ; 
    208205         
    209         printf("====== Client: context_init OK\n"); 
     206        //printf("====== Client: context_init OK\n"); 
    210207 
    211208        contextInterComms.push_back(contextInterComm); 
    212         MPI_Comm_free(&inter); 
     209        // MPI_Comm_free(&inter); 
    213210      } 
    214211      else 
     
    252249      for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++) 
    253250        MPI_Comm_free(&(*it)); 
     251       
    254252      MPI_Comm_free(&interComm); 
    255253      MPI_Comm_free(&intraComm); 
  • XIOS/dev/branch_yushan/src/context_client.cpp

    r1053 r1060  
    199199      map<int,CClientBuffer*>::iterator itBuff; 
    200200      bool pending = false; 
     201      if(! buffers.empty()) 
    201202      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) pending |= itBuff->second->checkBuffer(); 
    202203      return pending; 
     
    307308       checkBuffers(); 
    308309       stop = false; 
    309        for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop |= itBuff->second->hasPendingRequest(); 
     310       for (itBuff = buffers.begin(); itBuff != buffers.end(); ++itBuff) stop |= itBuff->second->hasPendingRequest(); 
    310311     } 
    311312     CTimer::get("Blocking time").suspend(); 
  • XIOS/dev/branch_yushan/src/context_server.cpp

    r1053 r1060  
    122122 
    123123    //printf("enter checkPendingRequest\n"); 
    124  
     124    if(!pendingRequest.empty()) 
    125125    for(it=pendingRequest.begin();it!=pendingRequest.end();it++) 
    126126    { 
  • XIOS/dev/branch_yushan/src/cxios.cpp

    r1053 r1060  
    3333  //! Parse configuration file and create some objects from it 
    3434  void CXios::initialize() 
    35   { 
    36      
    37      
     35  {     
    3836    set_new_handler(noMemory); 
    3937    parseFile(rootFile); 
     
    8583    int tmp_size; 
    8684    MPI_Comm_size(globalComm, &tmp_size); 
    87     printf("globalcomm size = %d\n", tmp_size); 
     85    if(isClient) printf("Client : globalcomm size = %d\n", tmp_size); 
     86    if(isServer) printf("Server : globalcomm size = %d\n", tmp_size); 
    8887 
    8988     
     
    176175    // Initialize all aspects MPI 
    177176    CServer::initialize(); 
     177     
    178178    if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ; 
    179179     
     
    193193    CServer::eventLoop(); 
    194194     
    195     printf("server eventloop OK\n"); 
     195    printf("server start finalize \n"); 
    196196 
    197197    // Finalize 
  • XIOS/dev/branch_yushan/src/interface/c/icdata.cpp

    r1053 r1060  
    6363      int initialized; 
    6464      MPI_Initialized(&initialized); 
    65       //if (initialized) local_comm.mpi_comm = MPI_Comm_f2c(*f_local_comm); 
     65 
    6666      if (initialized) local_comm = ep_lib::EP_Comm_f2c(static_cast< int >(*f_local_comm)); 
    6767      else local_comm = MPI_COMM_NULL; 
     
    7373      *f_return_comm = ep_lib::EP_Comm_c2f(return_comm); 
    7474 
    75       printf("in icdata.cpp, f_return_comm = %d\n", *f_return_comm); 
     75      //printf("in icdata.cpp, f_return_comm = %d\n", *f_return_comm); 
    7676 
    7777      CTimer::get("XIOS init").suspend(); 
     
    9191     CClient::registerContext(str, comm); 
    9292      
    93      printf("icdata.cpp: client register context OK\n"); 
     93     //printf("icdata.cpp: client register context OK\n"); 
    9494      
    9595     CTimer::get("XIOS init context").suspend(); 
     
    128128      
    129129     CContext* context = CContext::getCurrent(); 
    130      //printf("CContext* context = CContext::getCurrent();\n"); 
    131130     context->finalize(); 
    132131      
    133      //printf("client context_finalize OK\n"); 
     132     printf("client context_finalize OK\n"); 
    134133      
    135134     CTimer::get("XIOS context finalize").suspend(); 
  • XIOS/dev/branch_yushan/src/node/context.cpp

    r1056 r1060  
    369369          closeAllFile(); 
    370370          registryOut->hierarchicalGatherRegistry() ; 
    371           //registryOut->gatherRegistry() ; 
    372371          if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ; 
    373372        } 
  • XIOS/dev/branch_yushan/src/server.cpp

    r1037 r1060  
    3232    void CServer::initialize(void) 
    3333    { 
     34      // int initialized ; 
     35      // MPI_Initialized(&initialized) ; 
     36      // if (initialized) is_MPI_Initialized=true ; 
     37      // else is_MPI_Initialized=false ; 
     38 
    3439      // Not using OASIS 
    3540      if (!CXios::usingOasis) 
    3641      { 
     42        // if (!is_MPI_Initialized) 
     43        // { 
     44        //   MPI_Init(NULL, NULL); 
     45        // } 
    3746 
    3847        CTimer::get("XIOS").resume() ; 
     
    7988 
    8089         serverLeader=leaders[hashServer] ; 
    81          for(it=leaders.begin();it!=leaders.end();it++) 
     90         for(it=leaders.begin();it!=leaders.end();++it) 
    8291         { 
    8392           if (it->first!=hashServer) 
     
    92101             MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ; 
    93102             interComm.push_back(newComm) ; 
    94              printf("after inter create, interComm.size = %lu\n", interComm.size()); 
     103             //printf("after inter create, interComm.size = %lu\n", interComm.size()); 
    95104           } 
    96105         } 
     
    131140      } 
    132141 
    133 //      int rank; 
    134142      MPI_Comm_rank(intraComm,&rank) ; 
    135143      if (rank==0) isRoot=true; 
     
    147155       
    148156 
    149       for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++) 
     157      for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); ++it) 
    150158        MPI_Comm_free(&(*it)); 
    151159 
    152       for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++) 
     160      for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); ++it) 
    153161        MPI_Comm_free(&(*it)); 
    154162 
     
    214222           { 
    215223              MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ; 
    216               printf(" CServer : Receive client finalize\n"); 
     224              printf(" CServer : Receive finalize sign from client 0\n"); 
    217225              info(20)<<" CServer : Receive client finalize"<<endl ; 
    218226 
     
    410418       MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm); 
    411419 
    412        MPI_Comm inter; 
    413        MPI_Intercomm_merge(contextIntercomm,1,&inter); 
    414        MPI_Barrier(inter); 
     420       // MPI_Comm inter; 
     421       // MPI_Intercomm_merge(contextIntercomm,1,&inter); 
     422       // MPI_Barrier(inter); 
    415423        
    416424 
     
    424432        
    425433        
    426        MPI_Comm_free(&inter); 
    427         
    428        printf(" ****   server: register context OK\n"); 
     434       // MPI_Comm_free(&inter); 
     435        
     436       //printf(" ****   server: register context OK\n"); 
    429437     } 
    430438 
  • XIOS/dev/branch_yushan/src/xios_server.f90

    r501 r1060  
    11PROGRAM server_main 
    22  USE xios 
     3  USE mod_wait 
    34  IMPLICIT NONE 
    45  INCLUDE "mpif.h" 
    56  INTEGER :: ierr 
    6    
     7     
     8    CALL MPI_INIT(ierr) 
     9    CALL init_wait 
    710    CALL xios_init_server 
    811 
Note: See TracChangeset for help on using the changeset viewer.