Ignore:
Timestamp:
08/28/17 12:15:49 (7 years ago)
Author:
oabramkina
Message:

Modifications allowing secondary-server pools of different size. It's controlled by a new parameter number_pools_server2.
Tests: complete, toy, ipsl.

This functionality is to be used in future. For now it is disabled and XIOS works as before with one process assigned per pool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/cxios.cpp

    r1234 r1243  
    2828  bool CXios::usingServer2 = false; 
    2929  int CXios::ratioServer2 = 50; 
     30  int CXios::nbPoolsServer2 = 1; 
    3031  double CXios::bufferSizeFactor = 1.0; 
    3132  const double CXios::defaultBufferSizeFactor = 1.0; 
     
    5556    usingServer2=getin<bool>("using_server2",false) ; 
    5657    ratioServer2=getin<int>("ratio_server2",50); 
     58    nbPoolsServer2=getin<int>("number_pools_server2",1); 
    5759    info.setLevel(getin<int>("info_level",0)) ; 
    5860    report.setLevel(getin<int>("info_level",50)); 
     
    197199    else 
    198200    { 
    199       // If using two server levels, first merge globalRegistry of each server pool into one registry on the first pool 
     201      // If using two server levels: 
     202      // (1) merge registries on each pool 
     203      // (2) send merged registries to the first pool 
     204      // (3) merge received registries on the first pool 
    200205      if (CServer::serverLevel == 2) 
    201206      { 
     
    205210        MPI_Comm_rank(globalComm, &rankGlobal); 
    206211 
     212        // Merge registries defined on each pools 
     213        CRegistry globalRegistrySndServers (CServer::intraComm); 
     214 
    207215        // All pools (except the first): send globalRegistry to the first pool 
    208         if (rankGlobal != firstPoolGlobalRank) 
     216        for (int i=1; i<secondaryServerGlobalRanks.size(); i++) 
    209217        { 
    210           int registrySize = globalRegistry->size(); 
    211           MPI_Send(&registrySize,1,MPI_LONG,firstPoolGlobalRank,15,CXios::globalComm) ; 
    212           CBufferOut buffer(registrySize) ; 
    213           globalRegistry->toBuffer(buffer) ; 
    214           MPI_Send(buffer.start(),registrySize,MPI_CHAR,firstPoolGlobalRank,15,CXios::globalComm) ; 
     218          if (rankGlobal == secondaryServerGlobalRanks[i]) 
     219          { 
     220            globalRegistrySndServers.mergeRegistry(*globalRegistry) ; 
     221            int registrySize = globalRegistrySndServers.size(); 
     222            MPI_Send(&registrySize,1,MPI_LONG,firstPoolGlobalRank,15,CXios::globalComm) ; 
     223            CBufferOut buffer(registrySize) ; 
     224            globalRegistrySndServers.toBuffer(buffer) ; 
     225            MPI_Send(buffer.start(),registrySize,MPI_CHAR,firstPoolGlobalRank,15,CXios::globalComm) ; 
     226          } 
    215227        } 
    216228 
    217229        // First pool: receive globalRegistry of all secondary server pools, merge and write the resultant registry 
    218         else 
     230        if (rankGlobal == firstPoolGlobalRank) 
    219231        { 
    220232          MPI_Status status; 
    221233          char* recvBuff; 
    222234 
    223           CRegistry globalRegistrySndServers (CServer::intraComm); 
    224235          globalRegistrySndServers.mergeRegistry(*globalRegistry) ; 
    225236 
Note: See TracChangeset for help on using the changeset viewer.