Changeset 2123 for XIOS/dev/dev_ym/XIOS_COUPLING
- Timestamp:
- 04/02/21 21:06:04 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp
r2022 r2123 54 54 // if (contextInfo.serviceType != CServicesManager::CLIENT) // we must have an event scheduler => to be retrieve from the associated services 55 55 // { 56 if (!isAttachedModeEnabled()) eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 56 //if (!isAttachedModeEnabled()) eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 57 eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 58 57 59 // } 58 60 … … 316 318 if (event->isFull()) 317 319 { 318 if (!scheduled && eventScheduler_) // Skip event scheduling for attached mode and reception on client side320 if (!scheduled && !isAttachedModeEnabled()) // Skip event scheduling for attached mode and reception on client side 319 321 { 320 322 eventScheduler_->registerEvent(currentTimeLine,hashId); 321 323 scheduled=true; 322 324 } 323 else if ( !eventScheduler_|| eventScheduler_->queryEvent(currentTimeLine,hashId) )325 else if (isAttachedModeEnabled() || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 324 326 { 325 MPI_Barrier(intraComm) ; 327 MPI_Request req ; 328 MPI_Status status ; 329 330 MPI_Ibarrier(intraComm,&req) ; 331 int flag=false ; 332 do 333 { 334 eventScheduler_->checkEvent() ; 335 MPI_Test(&req,&flag,&status) ; 336 } while (!flag) ; 337 338 //MPI_Barrier(intraComm) ; 326 339 // When using attached mode, synchronise the processes to avoid that differents event be scheduled by differents processes 327 340 // The best way to properly solve this problem will be to use the event scheduler also in attached mode -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r2022 r2123 716 716 CATCH_DUMP_ATTR 717 717 718 719 720 bool CContext::eventLoop(bool enableEventsProcessing) 718 bool CContext::scheduledEventLoop(bool enableEventsProcessing) 721 719 { 722 bool finished=true; 723 bool out; 720 bool out, finished; 724 721 size_t timeLine=timeLine_ ; 725 722 if (serviceType_==CServicesManager::CLIENT) … … 731 728 do 732 729 { 733 if (client!=nullptr && !finalized) client->checkBuffers(); 734 735 for (int i = 0; i < clientPrimServer.size(); ++i) 736 { 737 if (!finalized) clientPrimServer[i]->checkBuffers(); 738 if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing); 739 } 740 741 for (auto couplerOut : couplerOutClient_) 742 if (!finalized) couplerOut.second->checkBuffers(); 743 744 for (auto couplerIn : couplerInClient_) 745 if (!finalized) couplerIn.second->checkBuffers(); 746 747 for (auto couplerOut : couplerOutServer_) 748 if (!finalized) couplerOut.second->eventLoop(enableEventsProcessing); 749 750 for (auto couplerIn : couplerInServer_) 751 if (!finalized) couplerIn.second->eventLoop(enableEventsProcessing); 752 753 if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing); 754 730 finished=eventLoop(enableEventsProcessing) ; 755 731 if (serviceType_==CServicesManager::CLIENT) out = eventScheduler_->queryEvent(timeLine,hashId_) ; 756 732 else out=true ; 757 733 } while(!out) ; 734 735 return finished ; 736 } 737 738 bool CContext::eventLoop(bool enableEventsProcessing) 739 { 740 bool finished; 741 if (client!=nullptr && !finalized) client->checkBuffers(); 742 743 for (int i = 0; i < clientPrimServer.size(); ++i) 744 { 745 if (!finalized) clientPrimServer[i]->checkBuffers(); 746 if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing); 747 } 748 749 for (auto couplerOut : couplerOutClient_) 750 if (!finalized) couplerOut.second->checkBuffers(); 751 752 for (auto couplerIn : couplerInClient_) 753 if (!finalized) couplerIn.second->checkBuffers(); 754 755 for (auto couplerOut : couplerOutServer_) 756 if (!finalized) couplerOut.second->eventLoop(enableEventsProcessing); 757 758 for (auto couplerIn : couplerInServer_) 759 if (!finalized) couplerIn.second->eventLoop(enableEventsProcessing); 760 761 if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing); 758 762 return finalized && finished ; 759 763 } … … 1059 1063 couplersReady &= ready ; 1060 1064 } 1061 this-> eventLoop() ;1065 this->scheduledEventLoop() ; 1062 1066 1063 1067 } while (!couplersReady) ; 1064 1068 1065 1069 first=false ; 1066 this-> eventLoop() ;1070 this->scheduledEventLoop() ; 1067 1071 1068 1072 } while (!workflowGraphIsCompleted) ; … … 1198 1202 ok = true ; 1199 1203 for(auto& couplerOutClient : couplerOutClient_) ok &= isCouplerInCloseDefinition(couplerOutClient.second) ; 1200 this-> eventLoop() ;1204 this->scheduledEventLoop() ; 1201 1205 } while (!ok) ; 1202 1206 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp
r2022 r2123 109 109 // Put sever or client into loop state 110 110 bool eventLoop(bool enableEventsProcessing=true); 111 bool scheduledEventLoop(bool enableEventsProcessing=true) ; 111 112 void globalEventLoop(void); 112 113
Note: See TracChangeset
for help on using the changeset viewer.