Changeset 2230 for XIOS/dev/dev_ym
- Timestamp:
- 09/14/21 15:17:59 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp
r2223 r2230 56 56 // { 57 57 //if (!isAttachedModeEnabled()) eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 58 59 58 eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 59 MPI_Comm_dup(intraComm, &processEventBarrier_) ; 60 60 // } 61 61 … … 92 92 } 93 93 else MPI_Comm_split(interCommMerged, interCommMergedRank, rank, &winComm); 94 MPI_Comm_free(&winComm) ; 94 // ym : Warning : intelMPI doesn't support that communicator of windows be deallocated before the windows deallocation, crash at MPI_Win_lock 95 // Bug or not ? 96 // MPI_Comm_free(&winComm) ; 95 97 } 96 98 } … … 346 348 else if (isAttachedModeEnabled() || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 347 349 { 348 MPI_Request req ; 349 MPI_Status status ; 350 351 MPI_Ibarrier(intraComm,&req) ; 352 int flag=false ; 353 do 350 351 if (!eventScheduled_) 354 352 { 355 eventScheduler_->checkEvent() ; 356 MPI_Test(&req,&flag,&status) ; 357 } while (!flag) ; 358 353 MPI_Ibarrier(processEventBarrier_,&processEventRequest_) ; 354 eventScheduled_=true ; 355 return ; 356 } 357 else 358 { 359 MPI_Status status ; 360 int flag ; 361 MPI_Test(&processEventRequest_, &flag, &status) ; 362 if (!flag) return ; 363 eventScheduled_=false ; 364 } 365 366 if (!isAttachedModeEnabled()) eventScheduler_->popEvent() ; 359 367 //MPI_Barrier(intraComm) ; 360 368 // When using attached mode, synchronise the processes to avoid that differents event be scheduled by differents processes … … 469 477 } 470 478 } 479 480 bool CContextServer::isCollectiveEvent(CEventServer& event) 481 { 482 if (event.classId==CField::GetType()) return CField::isCollectiveEvent(event); 483 else return true ; 484 } 471 485 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.hpp
r2130 r2230 26 26 bool hasFinished(void); 27 27 void dispatchEvent(CEventServer& event) ; 28 bool isCollectiveEvent(CEventServer& event) ; 28 29 void setPendingEvent(void) ; 29 30 bool hasPendingEvent(void) ; … … 67 68 68 69 private: 70 69 71 std::map<int, StdSize> mapBufferSize_; 70 72 vector<MPI_Win> windows ; //! one sided mpi windows to expose client buffers to servers ; No memory will be attached on server side. … … 73 75 CContextClient* associatedClient_ ; 74 76 size_t remoteHashId_; //!< the hash is of the calling context client 77 78 MPI_Comm processEventBarrier_ ; 79 bool eventScheduled_=false; 80 MPI_Request processEventRequest_ ; 75 81 } ; 76 82 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/event_scheduler.cpp
r2022 r2230 98 98 if (! eventStack.empty() && eventStack.front().first==timeLine && eventStack.front().second==contextHashId) 99 99 { 100 eventStack.pop() ;100 //eventStack.pop() ; 101 101 return true ; 102 102 } 103 103 else return false ; 104 104 } 105 105 106 106 void CEventScheduler::checkEvent(void) 107 107 { -
XIOS/dev/dev_ym/XIOS_COUPLING/src/event_scheduler.hpp
r1639 r2230 52 52 */ 53 53 bool queryEvent(const size_t timeLine, const size_t contextHashId) ; 54 void popEvent() { eventStack.pop() ; } 54 55 55 56 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/server_context.cpp
r2220 r2230 216 216 if (eventScheduler->queryEvent(currentTimeLine,hashId)) 217 217 { 218 eventScheduler->popEvent() ; 218 219 if (notifyInType_==NOTIFY_CREATE_INTERCOMM) createIntercomm() ; 219 220 hasNotification_=false ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services.cpp
r2220 r2230 181 181 if (eventScheduler_->queryEvent(currentTimeLine,hashId)) 182 182 { 183 eventScheduler_->popEvent() ; 183 184 if (notifyInType_==NOTIFY_CREATE_CONTEXT) createContext() ; 184 185 hasNotification_=false ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r2209 r2230 612 612 { 613 613 finished=eventLoop(enableEventsProcessing) ; 614 if (serviceType_==CServicesManager::CLIENT) out = eventScheduler_->queryEvent(timeLine,hashId_) ; 614 if (serviceType_==CServicesManager::CLIENT) 615 { 616 out = eventScheduler_->queryEvent(timeLine,hashId_) ; 617 if (out) eventScheduler_->popEvent() ; 618 } 619 615 620 else out=true ; 616 621 } while(!out) ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
r2206 r2230 135 135 } 136 136 CATCH 137 137 138 bool CField::isCollectiveEvent(CEventServer& event) 139 TRY 140 { 141 switch(event.type) 142 { 143 case EVENT_ID_UPDATE_DATA : 144 recvUpdateData(event); 145 return true; 146 break; 147 148 case EVENT_ID_READ_DATA : 149 recvReadDataRequest(event); 150 return true; 151 break; 152 153 case EVENT_ID_READ_DATA_READY : 154 recvReadDataReady(event); 155 return false; 156 break; 157 158 case EVENT_ID_ADD_VARIABLE : 159 recvAddVariable(event); 160 return false; 161 break; 162 163 case EVENT_ID_ADD_VARIABLE_GROUP : 164 recvAddVariableGroup(event); 165 return false; 166 break; 167 168 case EVENT_ID_GRID_COMPLETED : 169 recvGridCompleted(event); 170 return true; 171 break; 172 default : 173 ERROR("bool CField::dispatchEvent(CEventServer& event)", << "Unknown Event"); 174 return false; 175 } 176 } 177 CATCH 138 178 139 179 void CField::recvUpdateData(CEventServer& event) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
r2206 r2230 179 179 template <int N> void setData(const CArray<double, N>& _data); 180 180 static bool dispatchEvent(CEventServer& event); 181 static bool isCollectiveEvent(CEventServer& event); 181 182 void sendAllAttributesToServer(CContextClient* client) ; 182 183
Note: See TracChangeset
for help on using the changeset viewer.