- Timestamp:
- 06/15/22 15:20:29 (2 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/client.cpp
r2333 r2335 106 106 MPI_Comm_split(globalComm, color, commRank, &clientComm) ; 107 107 } 108 else // using oasis to split communicator 109 { 110 if (!is_MPI_Initialized) oasis_init(codeId) ; 111 oasis_get_localcomm(clientComm) ; 108 else 109 { 110 ERROR("void CClient::initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm)", <<"OASIS usage is set. In these conditions, XIOS initialization needs the local_comm created by OASIS."<<endl) ; 112 111 } 113 112 } … … 507 506 if (!is_MPI_Initialized) 508 507 { 509 if (CXios::usingOasis) oasis_finalize(); 510 else MPI_Finalize() ; 508 if (!CXios::usingOasis) MPI_Finalize() ; 511 509 } 512 510 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/cxios.cpp
r2329 r2335 27 27 const string CXios::defaultServerId="default_server_id" ; 28 28 const string CXios::defaultGathererId="default_gatherer_id" ; 29 const string CXios::defaultServicesId="default_services_id" ; 29 30 30 31 bool CXios::xiosStack = true; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/cxios.hpp
r2329 r2335 71 71 static const string defaultServerId ; 72 72 static const string defaultGathererId ; 73 73 static const string defaultServicesId ; 74 74 75 75 static CRegistryManager* registryManager_ ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services_manager.hpp
r2260 r2335 23 23 static const int IO_SERVER=2 ; 24 24 static const int OUT_SERVER=3 ; 25 static const int ALL_SERVICES=4 ; 25 26 26 27 public: -
XIOS/dev/dev_ym/XIOS_COUPLING/src/server.cpp
r2334 r2335 48 48 CEventScheduler* CServer::eventScheduler = 0; 49 49 CServersRessource* CServer::serversRessource_=nullptr ; 50 CThirdPartyDriver* CServer::driver_ =nullptr ; 50 51 51 52 … … 97 98 else // using OASIS 98 99 { 99 if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId);100 101 oasis_get_localcomm(serverComm);100 if (!is_MPI_Initialized) driver_ = new CThirdPartyDriver(); 101 102 driver_->getComponentCommunicator( serverComm ); 102 103 } 103 104 MPI_Comm_dup(serverComm, &intraComm_); … … 200 201 servicesManager->createServices(CXios::defaultPoolId, CXios::defaultGathererId, CServicesManager::GATHERER, nprocsGatherer, 1) ; 201 202 servicesManager->createServices(CXios::defaultPoolId, CXios::defaultServerId, CServicesManager::OUT_SERVER, nprocsServer, nbPoolsServer2) ; 203 204 202 205 } 206 servicesManager->createServices(CXios::defaultPoolId, CXios::defaultServicesId, CServicesManager::ALL_SERVICES, nbRessources, 1) ; 203 207 } 204 208 CTimer::get("XIOS initialize").suspend() ; … … 381 385 boost::hash<string> hashString; 382 386 size_t hashId = hashString("oasis_enddef"); 383 if (CXios::getPoolRessource()->getService(CXios::defaultServ erId,0)->getEventScheduler()->queryEvent(0,hashId))387 if (CXios::getPoolRessource()->getService(CXios::defaultServicesId,0)->getEventScheduler()->queryEvent(0,hashId)) 384 388 { 385 CXios::getPoolRessource()->getService(CXios::defaultServ erId,0)->getEventScheduler()->popEvent() ;386 oasis_enddef() ;389 CXios::getPoolRessource()->getService(CXios::defaultServicesId,0)->getEventScheduler()->popEvent() ; 390 driver_->endSynchronizedDefinition() ; 387 391 eventSent=false ; 388 392 } … … 397 401 boost::hash<string> hashString; 398 402 size_t hashId = hashString("oasis_enddef"); 399 CXios::getPoolRessource()->getService(CXios::defaultServ erId,0)->getEventScheduler()->registerEvent(0,hashId);403 CXios::getPoolRessource()->getService(CXios::defaultServicesId,0)->getEventScheduler()->registerEvent(0,hashId); 400 404 eventSent=true ; 401 405 } … … 427 431 if (!is_MPI_Initialized) 428 432 { 429 if (CXios::usingOasis) oasis_finalize();433 if (CXios::usingOasis) delete driver_; 430 434 else MPI_Finalize() ; 431 435 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/server.hpp
r2333 r2335 7 7 #include "mpi.hpp" 8 8 #include "event_scheduler.hpp" 9 #include "oasis_cinterface.hpp" 9 10 10 11 namespace xios … … 12 13 class CServersRessource ; 13 14 15 class CThirdPartyDriver 16 { 17 public: 18 CThirdPartyDriver() 19 { 20 oasis_init(CXios::xiosCodeId); 21 }; 22 virtual ~CThirdPartyDriver() 23 { 24 oasis_finalize(); 25 }; 26 virtual void endSynchronizedDefinition() 27 { 28 oasis_enddef(); 29 }; 30 virtual void getComponentCommunicator(MPI_Comm &intraComm) 31 { 32 oasis_get_localcomm(intraComm); 33 }; 34 }; 35 14 36 class CServer 15 37 { … … 80 102 static StdOFStream m_errorStream; 81 103 static CServersRessource* serversRessource_ ; 104 105 static CThirdPartyDriver* driver_; 82 106 }; 83 107 }
Note: See TracChangeset
for help on using the changeset viewer.