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/server.cpp

    r491 r492  
    1212#include "tracer.hpp" 
    1313#include "timer.hpp" 
     14#include "event_scheduler.hpp" 
    1415 
    1516namespace xios 
     
    2324    bool CServer::finished=false ; 
    2425    bool CServer::is_MPI_Initialized ; 
     26    CEventScheduler* CServer::eventScheduler ; 
    2527 
    2628    void CServer::initialize(void) 
     
    8688           { 
    8789             clientLeader=it->second ; 
     90             int intraCommSize, intraCommRank ; 
     91             MPI_Comm_size(intraComm,&intraCommSize) ; 
     92             MPI_Comm_rank(intraComm,&intraCommRank) ; 
     93             cout<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize 
     94                 <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ; 
    8895 
    8996             MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ; 
     
    122129          interComm.push_back(newComm) ; 
    123130        } 
    124         oasis_enddef() ; 
     131              oasis_enddef() ; 
    125132      } 
    126133 
     
    129136      if (rank==0) isRoot=true; 
    130137      else isRoot=false; 
    131 //      eventLoop() ; 
    132 //      finalize() ; 
     138       
     139      eventScheduler = new CEventScheduler(intraComm) ; 
    133140    } 
    134141 
     
    136143    { 
    137144      CTimer::get("XIOS").suspend() ; 
     145       
     146      delete eventScheduler ; 
     147       
    138148      if (!is_MPI_Initialized) 
    139149      { 
     
    166176         contextEventLoop() ; 
    167177         if (finished && contextList.empty()) stop=true ; 
     178         if (! CXios::isServer) eventScheduler->checkEvent() ; 
    168179       } 
    169180       CTimer::get("XIOS server").suspend() ; 
Note: See TracChangeset for help on using the changeset viewer.