Ignore:
Timestamp:
10/02/14 17:34:02 (7 years ago)
Author:
ymipsl
Message:

Add event scheduler functionnality in order to schedule events from different context, that cause Deadlock or crash when using collective MPI communication in netcdf/hdf5 library.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/context_server.cpp

    r489 r492  
    1414#include "timer.hpp" 
    1515#include "cxios.hpp" 
     16#include "event_scheduler.hpp" 
     17#include "server.hpp" 
     18#include <boost/functional/hash.hpp> 
    1619 
    1720 
     
    3235    else  MPI_Comm_size(interComm,&commSize) ; 
    3336    currentTimeLine=0 ; 
     37    scheduled=false ; 
    3438    finished=false ; 
     39     
     40    boost::hash<string> hashString ; 
     41    hashId=hashString(context->getId()) ; 
     42 
    3543  } 
    3644  void CContextServer::setPendingEvent(void) 
     
    150158    { 
    151159      event=it->second ; 
     160       
    152161      if (event->isFull()) 
    153162      { 
     163        if (!scheduled && !CXios::isServer) 
     164        { 
     165          CServer::eventScheduler->registerEvent(currentTimeLine,hashId) ;   
     166          scheduled=true ; 
     167        } 
     168        else if (CXios::isServer || CServer::eventScheduler->queryEvent(currentTimeLine,hashId) )  
     169        { 
    154170         CTimer::get("Process events").resume() ; 
    155171         dispatchEvent(*event) ; 
     
    159175         events.erase(it) ; 
    160176         currentTimeLine++ ; 
    161        } 
    162      } 
    163    } 
     177         scheduled = false ; 
     178        } 
     179      } 
     180    } 
     181  } 
    164182 
    165183  CContextServer::~CContextServer() 
Note: See TracChangeset for help on using the changeset viewer.