Changeset 2242


Ignore:
Timestamp:
09/30/21 16:37:30 (2 months 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 (missing file in commit)
YM

File:
1 edited

Legend:

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

    r2146 r2242  
    5858      ///////////// PART 1 //////////////////// 
    5959      ///////////////////////////////////////// 
    60  
     60      CTimer::get("XIOS").resume() ; 
     61      CTimer::get("XIOS initialize").resume() ; 
    6162      // don't use OASIS 
    6263      if (!CXios::usingOasis) 
     
    7677           
    7778        size_t* hashAll = new size_t[commSize] ; 
    78         MPI_Allgather(&hashServer,1,MPI_UNSIGNED_LONG,hashAll,1,MPI_LONG,globalComm) ; 
     79        MPI_Allgather(&hashServer,1,MPI_SIZE_T,hashAll,1,MPI_SIZE_T,globalComm) ; 
    7980           
    8081        int color=0 ; 
    81         set<size_t> listHash ; 
    82         for(int i=0 ; i<=commRank ; i++)  
    83           if (listHash.count(hashAll[i])==1) 
     82        map<size_t,int> listHash ; 
     83        for(int i=0 ; i<=commSize ; i++)  
     84          if (listHash.count(hashAll[i])==0)  
    8485          { 
    85             listHash.insert(hashAll[i]) ; 
     86            listHash[hashAll[i]]=color ; 
    8687            color=color+1 ; 
    8788          } 
     89        color=listHash[hashServer] ; 
    8890        delete[] hashAll ; 
    8991 
     
    9496        if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId); 
    9597 
    96         CTimer::get("XIOS").resume() ; 
    9798        oasis_get_localcomm(serverComm); 
    9899      } 
     
    189190        } 
    190191      } 
     192      CTimer::get("XIOS initialize").suspend() ; 
    191193 
    192194      ///////////////////////////////////////// 
     
    196198 
    197199      bool finished=false ; 
     200      CTimer::get("XIOS event loop").resume() ; 
     201 
    198202      while (!finished) 
    199203      { 
    200204        finished=daemonsManager->eventLoop() ; 
    201205      } 
    202  
     206      CTimer::get("XIOS event loop").suspend() ; 
    203207    } 
    204208 
Note: See TracChangeset for help on using the changeset viewer.