- Timestamp:
- 10/11/21 14:41:56 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/server_context.cpp
r2230 r2246 6 6 #include "register_context_info.hpp" 7 7 #include "services.hpp" 8 #include "timer.hpp" 8 9 9 10 … … 18 19 hasNotification_(false) 19 20 { 21 info(40)<<"CCServerContext::CServerContext : new context creation ; contextId : "<<contextId<<endl ; 20 22 int localRank, globalRank, commSize ; 21 23 … … 58 60 const MPI_Comm& intraComm, MPI_Comm& interCommClient, MPI_Comm& interCommServer, bool wait) 59 61 { 62 info(40)<<"CServerContext::createIntercomm : context intercomm creation ; contextId : "<<contextId<<endl ; 60 63 int intraCommRank ; 61 64 MPI_Comm_rank(intraComm, &intraCommRank) ; … … 145 148 int commSize ; 146 149 MPI_Comm_size(contextComm_,&commSize) ; 150 info(40)<<"CServerContext::createIntercomm : notify createContextIntercomm to all context members ; sourceContext : "<<sourceContext<<endl ; 151 147 152 for(int rank=0; rank<commSize; rank++) 148 153 { … … 191 196 if (!hasNotification_) 192 197 { 193 int commRank ; 194 MPI_Comm_rank(contextComm_, &commRank) ; 195 winNotify_->lockWindow(commRank,0) ; 196 winNotify_->popFromWindow(commRank, this, &CServerContext::notificationsDumpIn) ; 197 winNotify_->unlockWindow(commRank,0) ; 198 double time=MPI_Wtime() ; 199 if (time-lastEventLoop_ > eventLoopLatency_) 200 { 201 int commRank ; 202 MPI_Comm_rank(contextComm_, &commRank) ; 203 winNotify_->lockWindow(commRank,0) ; 204 winNotify_->popFromWindow(commRank, this, &CServerContext::notificationsDumpIn) ; 205 winNotify_->unlockWindow(commRank,0) ; 198 206 199 if (notifyInType_!= NOTIFY_NOTHING) 200 { 201 hasNotification_=true ; 202 auto eventScheduler=parentService_->getEventScheduler() ; 203 std::hash<string> hashString ; 204 size_t hashId = hashString(name_) ; 205 size_t currentTimeLine=0 ; 206 eventScheduler->registerEvent(currentTimeLine,hashId); 207 if (notifyInType_!= NOTIFY_NOTHING) 208 { 209 hasNotification_=true ; 210 auto eventScheduler=parentService_->getEventScheduler() ; 211 std::hash<string> hashString ; 212 size_t hashId = hashString(name_) ; 213 size_t currentTimeLine=0 ; 214 eventScheduler->registerEvent(currentTimeLine,hashId); 215 } 216 lastEventLoop_=time ; 207 217 } 208 218 } … … 225 235 bool CServerContext::eventLoop(bool serviceOnly) 226 236 { 237 CTimer::get("CServerContext::eventLoop").resume(); 227 238 bool finished=false ; 228 if (winNotify_!=nullptr) checkNotifications() ; 239 240 // double time=MPI_Wtime() ; 241 // if (time-lastEventLoop_ > eventLoopLatency_) 242 // { 243 if (winNotify_!=nullptr) checkNotifications() ; 244 // lastEventLoop_=time ; 245 // } 246 247 229 248 if (!serviceOnly && context_!=nullptr) 230 249 { … … 235 254 } 236 255 } 237 256 CTimer::get("CServerContext::eventLoop").suspend(); 238 257 if (context_==nullptr && finalizeSignal_) finished=true ; 239 258 return finished ; … … 242 261 void CServerContext::createIntercomm(void) 243 262 { 263 info(40)<<"CServerContext::createIntercomm : received createIntercomm notification"<<endl ; 264 244 265 MPI_Comm interCommServer, interCommClient ; 245 266 auto& arg=notifyInCreateIntercomm_ ;
Note: See TracChangeset
for help on using the changeset viewer.