Changeset 2324
- Timestamp:
- 04/15/22 13:05:33 (2 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_client.cpp
r2298 r2324 144 144 if (hasWindows) 145 145 { 146 if (winState[current]==true) ERROR("CClientBuffer::lockBuffer(void)",<<"Try lo lock client buffer but winState said it is already locked") ; 146 147 MPI_Win_lock(MPI_LOCK_EXCLUSIVE,clientRank_, 0, windows_[current]) ; 147 148 winState[current]=true ; … … 155 156 if (hasWindows) 156 157 { 158 if (winState[current]==false) ERROR("CClientBuffer::lockBuffer(void)",<<"Try lo unlock client buffer but winState said it is already unlocked") ; 157 159 MPI_Win_unlock(clientRank_, windows_[current]) ; 158 160 winState[current]=false ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.cpp
r2310 r2324 175 175 if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode 176 176 { 177 while (checkBuffers(ranks)) c ontext_->globalEventLoop() ;177 while (checkBuffers(ranks)) callGlobalEventLoop() ; 178 178 179 179 CXios::getDaemonsManager()->scheduleContext(hashId_) ; 180 while (CXios::getDaemonsManager()->isScheduledContext(hashId_)) c ontext_->globalEventLoop() ;180 while (CXios::getDaemonsManager()->isScheduledContext(hashId_)) callGlobalEventLoop() ; 181 181 } 182 182 … … 287 287 checkBuffers(); 288 288 289 c ontext_->globalEventLoop() ;289 callGlobalEventLoop() ; 290 290 } 291 291 … … 301 301 } 302 302 303 void CContextClient::eventLoop(void) 304 { 305 if (!locked_) checkBuffers() ; 306 } 307 308 void CContextClient::callGlobalEventLoop(void) 309 { 310 locked_=true ; 311 context_->globalEventLoop() ; 312 locked_=false ; 313 } 303 314 /*! 304 315 Make a new buffer for a certain connection to server with specific rank -
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp
r2260 r2324 39 39 bool checkBuffers(list<int>& ranks); 40 40 bool checkBuffers(void); 41 void eventLoop(void) ; 42 void callGlobalEventLoop() ; 41 43 void releaseBuffers(void); 42 44 bool havePendingRequests(void); … … 129 131 130 132 double latency_=0e-2 ; 133 134 bool locked_ = false ; //!< The context client is locked to avoid recursive checkBuffer 131 135 }; 132 136 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r2321 r2324 684 684 setCurrent(getId()) ; 685 685 686 if (client!=nullptr && !finalized) client-> checkBuffers();686 if (client!=nullptr && !finalized) client->eventLoop(); 687 687 688 688 for (int i = 0; i < clientPrimServer.size(); ++i) 689 689 { 690 if (!finalized) clientPrimServer[i]-> checkBuffers();690 if (!finalized) clientPrimServer[i]->eventLoop(); 691 691 if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing); 692 692 } 693 693 694 694 for (auto couplerOut : couplerOutClient_) 695 if (!finalized) couplerOut.second-> checkBuffers();695 if (!finalized) couplerOut.second->eventLoop(); 696 696 697 697 for (auto couplerIn : couplerInClient_) 698 if (!finalized) couplerIn.second-> checkBuffers();698 if (!finalized) couplerIn.second->eventLoop(); 699 699 700 700 for (auto couplerOut : couplerOutServer_) … … 788 788 client->finalize(); 789 789 info(100)<<"DEBUG: context "<<getId()<<" Client finalize sent"<<endl ; 790 while (client->havePendingRequests()) client-> checkBuffers();790 while (client->havePendingRequests()) client->eventLoop(); 791 791 info(100)<<"DEBUG: context "<<getId()<<" no pending request ok"<<endl ; 792 792 bool notifiedFinalized=false ; … … 808 808 do 809 809 { 810 clientPrimServer[i]-> checkBuffers();810 clientPrimServer[i]->eventLoop(); 811 811 bufferReleased = !clientPrimServer[i]->havePendingRequests(); 812 812 } while (!bufferReleased); … … 1099 1099 { 1100 1100 for(auto field : fileOutField) slaveServers_.insert(field->getContextClient()) ; 1101 for(auto field : fileInField) slaveServers_.insert(field->getContextClient()) ;1102 1101 } 1103 1102 … … 1709 1708 TRY 1710 1709 { 1711 CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR);1712 1710 for(auto client : slaveServers_) 1713 1711 { 1712 CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR); 1714 1713 if (client->isServerLeader()) 1715 1714 {
Note: See TracChangeset
for help on using the changeset viewer.