Changeset 2238 for XIOS/dev


Ignore:
Timestamp:
09/29/21 09:44:59 (3 years ago)
Author:
ymipsl
Message:

Bug fix in when split global communicator between clients and servers. Did'nt work with cyclic distribution of servers because it was assume than clients and servers partionning was contiguous
YM

File:
1 edited

Legend:

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

    r2209 r2238  
    9090           
    9191          size_t* hashAll = new size_t[commSize] ; 
    92           MPI_Allgather(&hashClient,1,MPI_UNSIGNED_LONG,hashAll,1,MPI_LONG,globalComm) ; 
     92          MPI_Allgather(&hashClient,1,MPI_SIZE_T,hashAll,1,MPI_SIZE_T,globalComm) ; 
    9393           
    9494          int color=0 ; 
    95           set<size_t> listHash ; 
    96           for(int i=0 ; i<=commRank ; i++)  
    97             if (listHash.count(hashAll[i])==0) 
     95          map<size_t,int> listHash ; 
     96          for(int i=0 ; i<=commSize ; i++)  
     97            if (listHash.count(hashAll[i])==0)  
    9898            { 
    99               listHash.insert(hashAll[i]) ; 
     99              listHash[hashAll[i]]=color ; 
    100100              color=color+1 ; 
    101101            } 
     102            color=listHash[hashClient] ; 
    102103          delete[] hashAll ; 
    103104 
     
    428429      int type=CServicesManager::CLIENT ; 
    429430      string name = CXios::getContextsManager()->getServerContextName(getPoolRessource()->getId(), id, 0, type, id) ; 
    430       while (!CXios::getContextsManager()->hasContext(name, contextComm) ) 
    431       { 
    432         CXios::getDaemonsManager()->eventLoop() ; 
     431      double time ; 
     432      double lastTime=0 ; 
     433      double latency=1e-2 ; 
     434      bool out=false ; 
     435      while (!out) 
     436      { 
     437        time=MPI_Wtime() ; 
     438        if (time-lastTime > latency)  
     439        { 
     440          out=CXios::getContextsManager()->hasContext(name, contextComm); 
     441          lastTime=time ; 
     442        } 
     443        if (!out) CXios::getDaemonsManager()->eventLoop() ; 
    433444      } 
    434445 
Note: See TracChangeset for help on using the changeset viewer.