Changeset 1243 for XIOS/dev/XIOS_DEV_CMIP6/src/cxios.cpp
- Timestamp:
- 08/28/17 12:15:49 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/cxios.cpp
r1234 r1243 28 28 bool CXios::usingServer2 = false; 29 29 int CXios::ratioServer2 = 50; 30 int CXios::nbPoolsServer2 = 1; 30 31 double CXios::bufferSizeFactor = 1.0; 31 32 const double CXios::defaultBufferSizeFactor = 1.0; … … 55 56 usingServer2=getin<bool>("using_server2",false) ; 56 57 ratioServer2=getin<int>("ratio_server2",50); 58 nbPoolsServer2=getin<int>("number_pools_server2",1); 57 59 info.setLevel(getin<int>("info_level",0)) ; 58 60 report.setLevel(getin<int>("info_level",50)); … … 197 199 else 198 200 { 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 200 205 if (CServer::serverLevel == 2) 201 206 { … … 205 210 MPI_Comm_rank(globalComm, &rankGlobal); 206 211 212 // Merge registries defined on each pools 213 CRegistry globalRegistrySndServers (CServer::intraComm); 214 207 215 // All pools (except the first): send globalRegistry to the first pool 208 if (rankGlobal != firstPoolGlobalRank)216 for (int i=1; i<secondaryServerGlobalRanks.size(); i++) 209 217 { 210 int registrySize = globalRegistry->size(); 211 MPI_Send(®istrySize,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(®istrySize,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 } 215 227 } 216 228 217 229 // First pool: receive globalRegistry of all secondary server pools, merge and write the resultant registry 218 else230 if (rankGlobal == firstPoolGlobalRank) 219 231 { 220 232 MPI_Status status; 221 233 char* recvBuff; 222 234 223 CRegistry globalRegistrySndServers (CServer::intraComm);224 235 globalRegistrySndServers.mergeRegistry(*globalRegistry) ; 225 236
Note: See TracChangeset
for help on using the changeset viewer.