Changeset 1764 for XIOS/dev/dev_ym/XIOS_SERVICES/src/context_server.cpp
- Timestamp:
- 11/05/19 16:02:34 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_SERVICES/src/context_server.cpp
r1761 r1764 30 30 using namespace std ; 31 31 32 CContextServer::CContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) 32 CContextServer::CContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) : eventScheduler_(nullptr), isProcessingEvent_(false) 33 33 { 34 34 context=parent; … … 53 53 if (contextInfo.serviceType != CServicesManager::CLIENT) // we must have an event scheduler => to be retrieve from the associated services 54 54 { 55 eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ;55 if (!isAttachedModeEnabled()) eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 56 56 } 57 57 … … 321 321 CEventServer* event; 322 322 323 if (context->isProcessingEvent()) return ; 323 // if (context->isProcessingEvent()) return ; 324 if (isProcessingEvent_) return ; 324 325 325 326 it=events.find(currentTimeLine); … … 330 331 if (event->isFull()) 331 332 { 332 if (!scheduled && CServer::eventScheduler) // Skip event scheduling for attached mode and reception on client side333 if (!scheduled && eventScheduler_) // Skip event scheduling for attached mode and reception on client side 333 334 { 334 CServer::eventScheduler->registerEvent(currentTimeLine,hashId);335 eventScheduler_->registerEvent(currentTimeLine,hashId); 335 336 scheduled=true; 336 337 } 337 else if (! CServer::eventScheduler || CServer::eventScheduler->queryEvent(currentTimeLine,hashId) )338 else if (!eventScheduler_ || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 338 339 { 339 340 // When using attached mode, synchronise the processes to avoid that differents event be scheduled by differents processes 340 341 // The best way to properly solve this problem will be to use the event scheduler also in attached mode 341 342 // for now just set up a MPI barrier 342 if (!CServer::eventScheduler && CXios::isServer) MPI_Barrier(intraComm) ; 343 344 context->setProcessingEvent() ; 343 if (!eventScheduler_ && CXios::isServer) MPI_Barrier(intraComm) ; 344 345 // context->setProcessingEvent() ; 346 isProcessingEvent_=true ; 345 347 CTimer::get("Process events").resume(); 346 348 dispatchEvent(*event); 347 349 CTimer::get("Process events").suspend(); 348 context->unsetProcessingEvent() ; 350 isProcessingEvent_=false ; 351 // context->unsetProcessingEvent() ; 349 352 pendingEvent=false; 350 353 delete event;
Note: See TracChangeset
for help on using the changeset viewer.