Ignore:
Timestamp:
04/02/21 21:06:04 (3 years ago)
Author:
ymipsl
Message:

Possibly fix deadlock in attched mode
YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp

    r2022 r2123  
    5454  //  if (contextInfo.serviceType != CServicesManager::CLIENT) // we must have an event scheduler => to be retrieve from the associated services 
    5555  //  { 
    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 
    5759  //  } 
    5860 
     
    316318      if (event->isFull()) 
    317319      { 
    318         if (!scheduled && eventScheduler_) // Skip event scheduling for attached mode and reception on client side 
     320        if (!scheduled && !isAttachedModeEnabled()) // Skip event scheduling for attached mode and reception on client side 
    319321        { 
    320322          eventScheduler_->registerEvent(currentTimeLine,hashId); 
    321323          scheduled=true; 
    322324        } 
    323         else if (!eventScheduler_ || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 
     325        else if (isAttachedModeEnabled() || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 
    324326        { 
    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) ; 
    326339         // When using attached mode, synchronise the processes to avoid that differents event be scheduled by differents processes 
    327340         // The best way to properly solve this problem will be to use the event scheduler also in attached mode 
Note: See TracChangeset for help on using the changeset viewer.