Ignore:
Timestamp:
12/01/21 14:29:36 (3 years ago)
Author:
ymipsl
Message:

Fix problem from previous commit when deallocating context.
YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src/manager
Files:
2 edited

Legend:

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

    r2246 r2266  
    3232  CDaemonsManager::~CDaemonsManager() 
    3333  { 
    34     CXios::finalizeContextsManager() ; 
    35     CXios::finalizeCouplerManager() ; 
    36     CXios::finalizeServicesManager() ; 
    37     CXios::finalizeRessourcesManager() ; 
    38     CXios::finalizeRegistryManager() ; 
     34    finalize() ; 
    3935  } 
    4036 
     
    5854  }  
    5955 
     56  bool CDaemonsManager::finalize(void) 
     57  { 
     58    if (!isFinalized_) 
     59    { 
     60      if (isServer_) CServer::getServersRessource()->finalizeSignal() ; 
     61      else CXios::getPoolRessource()->finalizeSignal() ; 
     62      while(!eventLoop()) ; 
     63      MPI_Barrier( CXios::getXiosComm()) ; 
     64      CXios::finalizeContextsManager() ; 
     65      CXios::finalizeCouplerManager() ; 
     66      CXios::finalizeServicesManager() ; 
     67      CXios::finalizeRessourcesManager() ; 
     68      CXios::finalizeRegistryManager() ; 
     69      isFinalized_=true ; 
     70    } 
     71  } 
     72 
    6073} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/daemons_manager.hpp

    r2130 r2266  
    2020    bool isScheduledContext(size_t hashId) { return scheduledContext_==hashId ;} //!< for attached mode, return true if context server is sceduled 
    2121    void unscheduleContext(void) { scheduledContext_=0 ;} //!< for attached mode : unschedule context 
    22  
     22    bool finalize(void) ; 
    2323    private: 
    2424    bool isServer_ ; 
    2525    size_t scheduledContext_ = 0 ; //!< Hash id of the next scehduled context for attached mode 
     26    bool isFinalized_=false ; 
    2627  } ; 
    2728} 
Note: See TracChangeset for help on using the changeset viewer.