Ignore:
Timestamp:
12/12/19 18:15:14 (5 years ago)
Author:
ymipsl
Message:
  • Preparing coupling functionalities.
  • Make some cleaner things

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp

    r1761 r1784  
    302302     // For now the assumption is that secondary server pools consist of the same number of procs. 
    303303     // CHANGE the line below if the assumption changes. 
    304      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client; 
    305      int rankClient = client->clientRank; 
     304 
     305     int rankClient = context->intraCommRank_; 
    306306     int rankOnDomain = rankClient%nbLocalDomain; 
    307307 
     
    680680    // For now the assumption is that secondary server pools consist of the same number of procs. 
    681681    // CHANGE the line below if the assumption changes. 
    682     CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client; 
     682     int clientSize = context->intraCommSize_ ; 
    683683     lon_g.resize(ni_glo) ; 
    684684     lat_g.resize(nj_glo) ; 
    685685 
    686686 
    687      int* ibegin_g = new int[client->clientSize] ; 
    688      int* jbegin_g = new int[client->clientSize] ; 
    689      int* ni_g = new int[client->clientSize] ; 
    690      int* nj_g = new int[client->clientSize] ; 
     687     int* ibegin_g = new int[clientSize] ; 
     688     int* jbegin_g = new int[clientSize] ; 
     689     int* ni_g = new int[clientSize] ; 
     690     int* nj_g = new int[clientSize] ; 
    691691     int v ; 
    692692     v=ibegin ; 
    693      MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ; 
     693     MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,context->intraComm_) ; 
    694694     v=jbegin ; 
    695      MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ; 
     695     MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,context->intraComm_) ; 
    696696     v=ni ; 
    697      MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ; 
     697     MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,context->intraComm_) ; 
    698698     v=nj ; 
    699      MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ; 
    700  
    701      MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ; 
    702      MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ; 
     699     MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,context->intraComm_) ; 
     700 
     701     MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,context->intraComm_) ; 
     702     MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,context->intraComm_) ; 
    703703 
    704704      delete[] ibegin_g ; 
     
    18311831  { 
    18321832    CContext* context=CContext::getCurrent() ; 
    1833      
    1834     // This line should be changed soon. 
    1835     int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 
    1836  
    1837     nbSenders.clear(); 
    1838     connectedServerRank_.clear(); 
    1839  
    1840     for (int p = 0; p < nbSrvPools; ++p) 
     1833    set<int> listNbServer ; 
     1834 
     1835    for (auto client : clients) 
    18411836    { 
    1842       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 
     1837 
    18431838      int nbServer = client->serverSize; 
    18441839      int nbClient = client->clientSize; 
    18451840      int rank     = client->clientRank; 
    18461841      bool doComputeGlobalIndexServer = true; 
    1847  
    1848       if (connectedServerRank_.find(nbServer) == connectedServerRank_.end()) 
    1849       { 
     1842    
     1843      if (listNbServer.find(nbServer)==listNbServer.end()) 
     1844      { 
     1845        listNbServer.insert(nbServer) ; 
     1846  
     1847        if (connectedServerRank_.find(nbServer) != connectedServerRank_.end()) 
     1848        { 
     1849          nbSenders.erase(nbServer); 
     1850          connectedServerRank_.erase(nbServer); 
     1851        } 
    18501852 
    18511853        if (indSrv_.find(nbServer) == indSrv_.end()) 
Note: See TracChangeset for help on using the changeset viewer.