Changeset 2209 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node
- Timestamp:
- 08/25/21 19:31:05 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/node
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r2199 r2209 428 428 429 429 string contextRegistryId=getId() ; 430 registryIn=new CRegistry( intraComm);430 registryIn=new CRegistry(CXios::getRegistryManager()->getRegistryIn()); 431 431 registryIn->setPath(contextRegistryId) ; 432 432 433 int commRank ;434 MPI_Comm_rank(intraComm_,&commRank) ;435 if (commRank==0) registryIn->fromFile("xios_registry.bin") ;436 registryIn->bcastRegistry() ;437 433 registryOut=new CRegistry(intraComm_) ; 438 434 registryOut->setPath(contextRegistryId) ; … … 465 461 CXios::getContextsManager()->getContextId(getId(), contextId_, intraComm) ; 466 462 467 registryIn=new CRegistry(intraComm); 468 registryIn->setPath(contextId_) ; 469 470 int commRank ; 471 MPI_Comm_rank(intraComm_,&commRank) ; 472 if (commRank==0) registryIn->fromFile("xios_registry.bin") ; 473 474 registryIn->bcastRegistry() ; 475 registryOut=new CRegistry(intraComm) ; 476 registryOut->setPath(contextId_) ; 463 string contextRegistryId=getId() ; 464 registryIn=new CRegistry(CXios::getRegistryManager()->getRegistryIn()); 465 registryIn->setPath(contextRegistryId) ; 466 467 registryOut=new CRegistry(intraComm_) ; 468 registryOut->setPath(contextRegistryId) ; 477 469 478 470 } … … 715 707 { 716 708 registryOut->hierarchicalGatherRegistry() ; 717 if (server->intraCommRank==0) CXios::g lobalRegistry->mergeRegistry(*registryOut) ;709 if (server->intraCommRank==0) CXios::getRegistryManager()->merge(*registryOut) ; 718 710 719 711 if (serviceType_==CServicesManager::CLIENT) … … 1574 1566 return true; 1575 1567 break; 1576 case EVENT_ID_SEND_REGISTRY:1577 recvRegistry(event);1578 return true;1579 break;1580 1568 case EVENT_ID_COUPLER_IN_READY: 1581 1569 recvCouplerInReady(event); … … 2106 2094 CATCH 2107 2095 2108 //! Server side: Receive a message to do some post processing2109 void CContext::recvRegistry(CEventServer& event)2110 TRY2111 {2112 CBufferIn* buffer=event.subEvents.begin()->buffer;2113 getCurrent()->recvRegistry(*buffer);2114 }2115 CATCH2116 2117 void CContext::recvRegistry(CBufferIn& buffer)2118 TRY2119 {2120 if (server->intraCommRank==0)2121 {2122 CRegistry registry(server->intraComm) ;2123 registry.fromBuffer(buffer) ;2124 registryOut->mergeRegistry(registry) ;2125 }2126 }2127 CATCH_DUMP_ATTR2128 2129 void CContext::sendRegistry(void)2130 TRY2131 {2132 registryOut->hierarchicalGatherRegistry() ;2133 2134 int nbSrvPools ;2135 if (serviceType_==CServicesManager::CLIENT) nbSrvPools = 1 ;2136 else if (serviceType_==CServicesManager::GATHERER) nbSrvPools = this->clientPrimServer.size() ;2137 else nbSrvPools = 0 ;2138 CContextClient* contextClientTmp ;2139 2140 for (int i = 0; i < nbSrvPools; ++i)2141 {2142 if (serviceType_==CServicesManager::CLIENT) contextClientTmp = client ;2143 else if (serviceType_==CServicesManager::GATHERER ) contextClientTmp = clientPrimServer[i] ;2144 2145 CEventClient event(CContext::GetType(), CContext::EVENT_ID_SEND_REGISTRY);2146 if (contextClientTmp->isServerLeader())2147 {2148 CMessage msg ;2149 if (contextClientTmp->clientRank==0) msg<<*registryOut ;2150 const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();2151 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)2152 event.push(*itRank,1,msg);2153 contextClientTmp->sendEvent(event);2154 }2155 else contextClientTmp->sendEvent(event);2156 }2157 }2158 CATCH_DUMP_ATTR2159 2160 2096 2161 2097 void CContext::sendFinalizeClient(CContextClient* contextClient, const string& contextClientId) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp
r2204 r2209 55 55 EVENT_ID_CLOSE_DEFINITION,EVENT_ID_UPDATE_CALENDAR, 56 56 EVENT_ID_CREATE_FILE_HEADER,EVENT_ID_CONTEXT_FINALIZE, 57 EVENT_ID_SEND_REGISTRY,58 57 EVENT_ID_CONTEXT_FINALIZE_CLIENT, 59 58 EVENT_ID_COUPLER_IN_READY, … … 170 169 void sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles); 171 170 //!< after be gathered to the root process of the context, merged registry is sent to the root process of the servers 172 void sendRegistry(void) ;173 171 void sendFinalizeClient(CContextClient* contextClient, const string& contextClientId); 174 172 … … 189 187 static void recvSolveInheritanceContext(CEventServer& event); 190 188 void recvSolveInheritanceContext(CBufferIn& buffer); 191 static void recvRegistry(CEventServer& event) ;192 void recvRegistry(CBufferIn& buffer) ; //!< registry is received by the servers193 189 static void recvFinalizeClient(CEventServer& event) ; 194 190 void recvFinalizeClient(CBufferIn& buffer);
Note: See TracChangeset
for help on using the changeset viewer.