Changeset 1878
- Timestamp:
- 05/13/20 23:15:06 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/cxios.cpp
r1765 r1878 55 55 CServicesManager* CXios::servicesManager_=nullptr ; 56 56 CContextsManager* CXios::contextsManager_=nullptr ; 57 CCouplerManager* CXios::couplerManager_=nullptr ; 57 58 58 59 //! Parse configuration file and create some objects from it … … 221 222 } 222 223 224 void CXios::launchCouplerManager(bool isXiosServer) 225 { 226 couplerManager_ = new CCouplerManager(isXiosServer) ; 227 } 228 223 229 void CXios::launchServicesManager(bool isXiosServer) 224 230 { … … 240 246 { 241 247 delete ressourcesManager_; 248 } 249 250 void CXios::finalizeCouplerManager() 251 { 252 delete couplerManager_; 242 253 } 243 254 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/cxios.hpp
r1764 r1878 9 9 #include "contexts_manager.hpp" 10 10 #include "daemons_manager.hpp" 11 #include "coupler_manager.hpp" 11 12 12 13 namespace xios … … 68 69 69 70 static CRessourcesManager* ressourcesManager_ ; 71 static CCouplerManager* couplerManager_ ; 70 72 static CServicesManager* servicesManager_ ; 71 73 static CContextsManager* contextsManager_ ; … … 90 92 static void launchDaemonsManager(bool isXiosServer) ; 91 93 static void launchRessourcesManager(bool isXiosServer) ; 92 94 static void launchCouplerManager(bool isXiosServer) ; 95 93 96 static void finalizeServicesManager() ; 94 97 static void finalizeContextsManager() ; 95 98 static void finalizeDaemonsManager() ; 96 99 static void finalizeRessourcesManager() ; 100 static void finalizeCouplerManager() ; 97 101 98 102 static CRessourcesManager* getRessourcesManager(void) { return ressourcesManager_ ;} 103 static CCouplerManager* getCouplerManager(void) { return couplerManager_ ;} 99 104 static CServicesManager* getServicesManager(void) { return servicesManager_ ;} 100 105 static CContextsManager* getContextsManager(void) { return contextsManager_ ;} -
XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/daemons_manager.cpp
r1764 r1878 22 22 CXios::launchServicesManager(isXiosServer) ; 23 23 CXios::launchContextsManager(isXiosServer) ; 24 CXios::launchCouplerManager(isXiosServer) ; 25 24 26 if (isXiosServer) CServer::launchServersRessource(splitComm) ; 25 27 MPI_Comm_free(&splitComm) ; … … 29 31 { 30 32 CXios::finalizeContextsManager() ; 33 CXios::finalizeCouplerManager() ; 31 34 CXios::finalizeServicesManager() ; 32 35 CXios::finalizeRessourcesManager() ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r1875 r1878 2446 2446 TRY 2447 2447 { 2448 // juste for test now, in future need an scheduler to avoid dead-lock 2449 for(auto it=enabledCouplerOut.begin();it!=enabledCouplerOut.end();++it) 2450 { 2451 (*it)->createInterCommunicator() ; 2452 } 2453 2454 for(auto it=enabledCouplerIn.begin();it!=enabledCouplerIn.end();++it) 2455 { 2456 (*it)->createInterCommunicator() ; 2457 } 2448 int rank=this->getIntraCommRank() ; 2449 map<string,list<CCouplerOut*>> listCouplerOut ; 2450 map<string,list<CCouplerIn*>> listCouplerIn ; 2451 2452 for(auto couplerOut : enabledCouplerOut) listCouplerOut[couplerOut->getCouplingContextId()].push_back(couplerOut) ; 2453 for(auto couplerIn : enabledCouplerIn) listCouplerIn[couplerIn->getCouplingContextId()].push_back(couplerIn) ; 2454 2455 CCouplerManager* couplerManager = CXios::getCouplerManager() ; 2456 if (rank==0) 2457 { 2458 for(auto couplerOut : listCouplerOut) couplerManager->registerCoupling(this->getContextId(),couplerOut.first) ; 2459 for(auto couplerIn : listCouplerIn) couplerManager->registerCoupling(couplerIn.first,this->getContextId()) ; 2460 } 2461 2462 do 2463 { 2464 for(auto couplerOut : listCouplerOut) 2465 { 2466 bool isNextCoupling ; 2467 if (rank==0) isNextCoupling = couplerManager->isNextCoupling(this->getContextId(),couplerOut.first) ; 2468 MPI_Bcast(&isNextCoupling,1,MPI_C_BOOL, 0, getIntraComm()) ; 2469 if (isNextCoupling) 2470 { 2471 addCouplingChanel(couplerOut.first, true) ; 2472 listCouplerOut.erase(couplerOut.first) ; 2473 break ; 2474 } 2475 } 2476 for(auto couplerIn : listCouplerIn) 2477 { 2478 bool isNextCoupling ; 2479 if (rank==0) isNextCoupling = couplerManager->isNextCoupling(couplerIn.first,this->getContextId()); 2480 MPI_Bcast(&isNextCoupling,1,MPI_C_BOOL, 0, getIntraComm()) ; 2481 if (isNextCoupling) 2482 { 2483 addCouplingChanel(couplerIn.first, false) ; 2484 listCouplerIn.erase(couplerIn.first) ; 2485 break ; 2486 } 2487 } 2488 2489 } while (!listCouplerOut.empty() || !listCouplerIn.empty()) ; 2490 2458 2491 } 2459 2492 CATCH_DUMP_ATTR -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp
r1875 r1878 2862 2862 { 2863 2863 bounds_lat_1d.resize(nvertex, nbLatInd) ; 2864 bounds_l on_1d = bounds_lonvalue ;2864 bounds_lat_1d = bounds_latvalue ; 2865 2865 } 2866 2866 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
r1875 r1878 580 580 // for coupling, it would be after the first freq_op, because for now we don't have 581 581 // restart mecanism to send the value at ts=0. It mus be changed in future 582 lastDataReceivedFromServer = context->getCalendar()->getInitDate() +freq_op;582 lastDataReceivedFromServer = context->getCalendar()->getInitDate(); 583 583 wasDataAlreadyReceivedFromServer = true; 584 584 } … … 659 659 do 660 660 { 661 const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + freq_op) : context->getCalendar()->getInitDate();661 const CDate nextDataDue = (wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + freq_op) : context->getCalendar()->getInitDate()) + freq_offset; 662 662 isDataLate = (nextDataDue <= currentDate); 663 663
Note: See TracChangeset
for help on using the changeset viewer.