Changeset 2274


Ignore:
Timestamp:
12/09/21 12:28:20 (2 years ago)
Author:
ymipsl
Message:

Tracking memory leak : release memory statically alocated

YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
3 added
32 edited

Legend:

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

    r2266 r2274  
    1717#include <cstdio> 
    1818#include "workflow_graph.hpp" 
     19#include "release_static_allocation.hpp" 
    1920 
    2021namespace xios 
     
    422423 
    423424      getPoolRessource()->createService(contextComm, id, 0, CServicesManager::CLIENT, 1) ; 
    424       getPoolRessource()->createService(contextComm, CXios::defaultServerId, 0, CServicesManager::IO_SERVER, 1) ; 
     425      getPoolRessource()->createService(contextComm, id+"_"+CXios::defaultServerId, 0, CServicesManager::IO_SERVER, 1) ; 
    425426 
    426427      if (commRank==0) while (!CXios::getServicesManager()->hasService(getPoolRessource()->getId(), id, 0)) { CXios::getDaemonsManager()->eventLoop();} 
     
    488489      CTimer::get("XIOS").suspend() ; 
    489490      CXios::finalizeDaemonsManager() ; 
     491      finalizePoolRessource() ; 
    490492      CContext::removeAllContexts() ; // free memory for related context  
    491       
     493 
    492494 
    493495      if (!is_MPI_Initialized) 
     
    507509      report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 
    508510      report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
     511      CWorkflowGraph::drawWorkFlowGraph_client(); 
     512 
     513      xios::releaseStaticAllocation() ; 
     514 
     515    } 
    509516     
    510       CWorkflowGraph::drawWorkFlowGraph_client(); 
    511     } 
    512      
     517    void CClient::finalizePoolRessource()  
     518    {  
     519      delete poolRessource_ ; poolRessource_=nullptr ; 
     520    } 
    513521 
    514522    /*! 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/client.hpp

    r2212 r2274  
    4545        static void closeErrorStream(); 
    4646        static CPoolRessource* getPoolRessource(void) { return poolRessource_ ; } 
     47        static void finalizePoolRessource() ; 
    4748 
    4849        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/cxios.cpp

    r2243 r2274  
    306306  } 
    307307   
    308  
    309308  CPoolRessource* CXios::getPoolRessource(void) 
    310309  { 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/event_scheduler.cpp

    r2230 r2274  
    7070  CEventScheduler::~CEventScheduler() 
    7171  { 
    72  
     72    while (!pendingSentParentRequest.empty() || !pendingRecvParentRequest.empty() || !pendingRecvChildRequest.empty() ||  !pendingSentChildRequest.empty()) 
     73    { 
     74      checkEvent() ; 
     75    }  
    7376  }  
    7477 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/group_factory.hpp

    r1542 r2274  
    1818         /// Mutateurs /// 
    1919         static void SetCurrentContextId(const StdString & context); 
     20         static void clearCurrentContextId() {CurrContext.clear(); CurrContext.shrink_to_fit();}  
    2021 
    2122         template <typename U> 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/io/inetcdf4.cpp

    r1639 r2274  
    763763      { 
    764764        StdString unit = this->getAttributeValue(CCFKeywords::XIOS_CF_units, &(*itList), path); 
    765         if (CCFConvention::XIOS_CF_Longitude_units.end() != CCFConvention::XIOS_CF_Longitude_units.find(unit)) 
     765        if (CCFConvention::XIOS_CF_Longitude_units().end() != CCFConvention::XIOS_CF_Longitude_units().find(unit)) 
    766766        { 
    767767          lonName = *itList; 
     
    785785      { 
    786786        StdString unit = this->getAttributeValue(CCFKeywords::XIOS_CF_units, &(*itList), path); 
    787         if (CCFConvention::XIOS_CF_Latitude_units.end() != CCFConvention::XIOS_CF_Latitude_units.find(unit)) 
     787        if (CCFConvention::XIOS_CF_Latitude_units().end() != CCFConvention::XIOS_CF_Latitude_units().find(unit)) 
    788788        { 
    789789          latName = *itList; 
     
    811811    { 
    812812      StdString unit = this->getAttributeValue(CCFKeywords::XIOS_CF_units, &varname, path); 
    813       return      (CCFConvention::XIOS_CF_Latitude_units.end() != CCFConvention::XIOS_CF_Latitude_units.find(unit) 
    814                 || CCFConvention::XIOS_CF_Longitude_units.end() != CCFConvention::XIOS_CF_Longitude_units.find(unit)); 
     813      return      (CCFConvention::XIOS_CF_Latitude_units().end() != CCFConvention::XIOS_CF_Latitude_units().find(unit) 
     814                || CCFConvention::XIOS_CF_Longitude_units().end() != CCFConvention::XIOS_CF_Longitude_units().find(unit)); 
    815815    } 
    816816    else return false ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/io/netCdf_cf_constant.hpp

    r782 r2274  
    77namespace xios 
    88{ 
    9 const StdString CFLatUnits[] = {"degrees_north", "degree_north", "degree_N", "degrees_N", "degreeN", "degreesN"}; 
    10 const StdString CFLonUnits[] = {"degrees_east", "degree_east", "degree_E", "degrees_E", "degreeE", "degreesE"}; 
     9//const StdString CFLatUnits[] = {"degrees_north", "degree_north", "degree_N", "degrees_N", "degreeN", "degreesN"}; 
     10//const StdString CFLonUnits[] = {"degrees_east", "degree_east", "degree_E", "degrees_E", "degreeE", "degreesE"}; 
    1111 
    1212struct CCFKeywords 
     
    1717  static const StdString XIOS_CF_bounds; 
    1818}; 
    19 const StdString CCFKeywords::XIOS_CF_units("units"); 
    20 const StdString CCFKeywords::XIOS_CF_standard_name("standard_name"); 
    21 const StdString CCFKeywords::XIOS_CF_coordinates("coordinates"); 
    22 const StdString CCFKeywords::XIOS_CF_bounds("bounds"); 
    2319 
    2420struct CCFConvention 
    2521{ 
    26   static const std::set<StdString> XIOS_CF_Latitude_units; 
    27   static const std::set<StdString> XIOS_CF_Longitude_units; 
     22  static const std::set<StdString>& XIOS_CF_Latitude_units() 
     23  { 
     24    if (XIOS_CF_Longitude_units_.empty()) XIOS_CF_Latitude_units_= {"degrees_north", "degree_north", "degree_N", "degrees_N", "degreeN", "degreesN"}; 
     25    return XIOS_CF_Latitude_units_ ; 
     26  } 
    2827 
     28  static const std::set<StdString>& XIOS_CF_Longitude_units() 
     29  { 
     30    if (XIOS_CF_Longitude_units_.empty()) XIOS_CF_Longitude_units_= {"degrees_east", "degree_east", "degree_E", "degrees_E", "degreeE", "degreesE"}; 
     31    return XIOS_CF_Longitude_units_ ; 
     32  } 
     33  static void releaseStaticAllocation(void) { XIOS_CF_Latitude_units_.clear() ; XIOS_CF_Longitude_units_.clear() ; } 
    2934private: 
    3035  CCFConvention(); 
     36  static std::set<StdString> XIOS_CF_Latitude_units_; 
     37  static std::set<StdString> XIOS_CF_Longitude_units_; 
    3138}; 
    32  
    33 const std::set<StdString> CCFConvention::XIOS_CF_Latitude_units(CFLatUnits, CFLatUnits+sizeof(CFLatUnits)/sizeof(CFLatUnits[0])); 
    34 const std::set<StdString> CCFConvention::XIOS_CF_Longitude_units(CFLonUnits, CFLonUnits+sizeof(CFLonUnits)/sizeof(CFLonUnits[0])); 
    3539 
    3640} // namespace xios 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/pool_ressource.cpp

    r2260 r2274  
    118118      if (it->second->eventLoop(serviceOnly)) 
    119119      { 
     120        delete it->second ; 
    120121        services_.erase(it) ; 
    121122        // don't forget to free service later 
     
    196197    finalizeSignal_=true ; 
    197198    for (auto it=services_.begin(); it!=services_.end() ; ++it) it->second->finalizeSignal() ; 
    198   } 
    199  
     199  }   
     200   
     201  CPoolRessource::~CPoolRessource() 
     202  { 
     203    delete winNotify_ ; 
     204    for(auto& service : services_) delete service.second ; 
     205  } 
    200206} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/pool_ressource.hpp

    r2260 r2274  
    2323   public: 
    2424    CPoolRessource(MPI_Comm poolComm, const std::string& Id) ; 
     25    ~CPoolRessource() ; 
    2526     
    2627    void createService(const std::string& serviceId, int type, int size, int nbPartition) ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/server_context.cpp

    r2265 r2274  
    5454  CServerContext::~CServerContext() 
    5555  { 
    56  
     56    cout<<"Server Context destructor"<<endl; 
    5757  }  
    5858 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/server_context.hpp

    r2260 r2274  
    1919                  const int& partitionId, const std::string& contextId) ; 
    2020    ~CServerContext() ; 
     21    static void releaseStaticAllocation(void) { overlapedComm_.clear() ;} 
    2122 
    2223    bool createIntercomm(const string& poolId, const string& serviceId, const int& partitionId, const string& contextId,  
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/servers_ressource.cpp

    r2260 r2274  
    131131      if (poolRessource_->eventLoop(serviceOnly)) 
    132132      { 
     133        delete poolRessource_ ; 
    133134        poolRessource_=nullptr ; 
    134135        // don't forget to free pool ressource later 
     
    188189    else return false ; 
    189190  } 
     191 
     192  CServersRessource::~CServersRessource() 
     193  { 
     194    delete winNotify_ ; 
     195  } 
    190196} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/servers_ressource.hpp

    r2260 r2274  
    2424     
    2525    CServersRessource(MPI_Comm serverComm) ; 
     26    ~CServersRessource() ; 
    2627    void createPool(const string& poolId, const int size) ; 
    2728    void createPool(void) ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services.cpp

    r2260 r2274  
    4242    name_= poolId+"::"+serviceId+"_"+oss.str(); 
    4343  } 
     44 
     45  CService::~CService() 
     46  { 
     47    delete eventScheduler_ ; 
     48    delete winNotify_ ; 
     49    for(auto& it : contexts_) delete it.second ; 
     50  } 
     51 
    4452 
    4553  void CService::createContext( const std::string& poolId, const std::string& serviceId, const int& partitionId, const std::string& contextId) 
     
    121129      if (it->second->eventLoop(serviceOnly)) 
    122130      { 
     131        delete it->second ;  
    123132        contexts_.erase(it) ; 
    124133        // destroy server_context -> to do later 
     
    235244     auto& arg=notifyInCreateContext_ ; 
    236245     string poolId = get<0>(arg) ; 
    237      string& serviceId = get<1>(arg) ; 
     246     string serviceId = get<1>(arg) ; 
    238247     int partitionId = get<2>(arg) ; 
    239248     string contextId = get<3>(arg) ; 
    240      contexts_[contextId] = new CServerContext(this, serviceComm_, poolId, serviceId, partitionId, contextId) ;  
     249     contexts_[contextId] = new CServerContext(this, serviceComm_, poolId, serviceId, partitionId, contextId) ; 
    241250   } 
    242251 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/services.hpp

    r2260 r2274  
    2121    CService(MPI_Comm serviceComm, const std::string& poolId, const std::string& serviceId, const int& partitionId,  
    2222             int type, int nbPartitions) ; 
     23    ~CService() ; 
     24 
    2325    bool eventLoop(bool serviceOnly=false) ; 
    2426    void createContext(const std::string& poolId, const std::string& serviceId, const int& partitionId, const std::string& contextId) ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/mem_checker.hpp

    r2212 r2274  
    2020      static void disable(void) { enabled_=false ;} 
    2121      static void enable(void) {enabled_=true ;} 
     22      static void release(void) {allMemChecker_.clear();} 
    2223    private: 
    2324      static void check(void) ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/memtrack.cpp

    r2267 r2274  
    494494        } 
    495495         
    496         //xios::CAddr2line myaddr2line ; 
     496        xios::CAddr2line myaddr2line ; 
    497497        size_t i = 0 ; 
    498498        for(auto& it : orderedBlocks) 
     
    510510            sprintf(strbuff,"... %s:%d\n", fileName, lineNum); 
    511511            memReport<<strbuff ; 
    512             //pBlockHeader->backTrace(memReport, myaddr2line); 
    513             pBlockHeader->backTrace(memReport); 
     512            pBlockHeader->backTrace(memReport, myaddr2line); 
     513            //pBlockHeader->backTrace(memReport); 
    514514            i++ ; 
    515515        } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp

    r2267 r2274  
    5959   } 
    6060   CATCH 
     61    
     62   void CAxis::releaseStaticAllocation(void) 
     63   { 
     64     transformationMapList_.clear() ; 
     65     CTransformation<CAxis>::unregisterAllTransformations() ; 
     66     CGridTransformationFactory<CAxis>::unregisterAllTransformations() ; 
     67   } 
    6168 
    6269   ///--------------------------------------------------------------- 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp

    r2270 r2274  
    2323#include "distribution_type.hpp" 
    2424#include "generic_algorithm_transformation.hpp" 
     25#include "grid_transformation_factory_impl.hpp" 
    2526 
    2627 
     
    6869         CAxis(const CAxis & axis);       // Not implemented yet. 
    6970         CAxis(const CAxis * const axis); // Not implemented yet. 
     71         static void releaseStaticAllocation(void) ; // release static allocation on heap 
    7072 
    7173         static CAxis* createAxis(); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp

    r2265 r2274  
    6363     for (std::vector<CContextClient*>::iterator it = clientPrimServer.begin(); it != clientPrimServer.end(); it++)  delete *it; 
    6464     for (std::vector<CContextServer*>::iterator it = serverPrimServer.begin(); it != serverPrimServer.end(); it++)  delete *it; 
    65  
     65     if (registryIn!=nullptr) delete registryIn ; 
     66     if (registryOut!=nullptr) delete registryOut ; 
    6667   } 
    6768 
     
    100101   CATCH 
    101102 
     103   void CContext::releaseStaticAllocation(void) 
     104   TRY 
     105   { 
     106      CDomain::releaseStaticAllocation(); 
     107      CAxis::releaseStaticAllocation(); 
     108      CScalar::releaseStaticAllocation(); 
     109      if (root) root.reset() ; 
     110   } 
     111   CATCH 
     112    
    102113   //---------------------------------------------------------------- 
    103114 
     
    326337  #include "node_type.conf" 
    327338*/ 
     339  CObjectFactory::deleteAllContexts<CContext>() ; 
     340  CObjectFactory::deleteAllContexts<CContextGroup>() ; 
     341  CObjectFactory::clearCurrentContextId(); 
     342  CGroupFactory::clearCurrentContextId(); 
    328343} 
    329344   ///--------------------------------------------------------------- 
     
    538553      if (commRank==0) 
    539554      { 
    540         if (attached_mode) CXios::getContextsManager()->createServerContext(CClient::getPoolRessource()->getId(), CXios::defaultServerId, 0, getContextId()) ; 
     555        if (attached_mode) CXios::getContextsManager()->createServerContext(CClient::getPoolRessource()->getId(), getContextId()+"_"+CXios::defaultServerId, 0, getContextId()) ; 
    541556        else if (CXios::usingServer2) CXios::getContextsManager()->createServerContext(CXios::defaultPoolId, CXios::defaultGathererId, 0, getContextId()) ; 
    542557        else  CXios::getContextsManager()->createServerContext(CXios::defaultPoolId, CXios::defaultServerId, 0, getContextId()) ; 
     
    547562      if (attached_mode) 
    548563      { 
    549         parentServerContext_->createIntercomm(CClient::getPoolRessource()->getId(), CXios::defaultServerId, 0, getContextId(), intraComm_,  
     564        parentServerContext_->createIntercomm(CClient::getPoolRessource()->getId(), getContextId()+"_"+CXios::defaultServerId, 0, getContextId(), intraComm_,  
    550565                                              interCommClient, interCommServer) ; 
    551566        int type ;  
     
    811826        closeAllFile(); 
    812827        client->releaseBuffers(); 
     828        server->releaseBuffers(); 
    813829      } 
    814830 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp

    r2265 r2274  
    8282         /// Destructeur /// 
    8383         virtual ~CContext(void); 
     84 
     85         static void releaseStaticAllocation(void) ; 
    8486 
    8587         //--------------------------------------------------------- 
     
    229231        // Get context root 
    230232        static CContextGroup* getRoot(void); 
    231  
     233        
    232234        // Set current context 
    233235        static void setCurrent(const string& id); 
     
    329331         std::vector<std::string> primServerId_; 
    330332 
    331          CRegistry* registryIn ;    //!< input registry which is read from file 
    332          CRegistry* registryOut ;   //!< output registry which will be written into file at the finalize 
     333         CRegistry* registryIn=nullptr ;    //!< input registry which is read from file 
     334         CRegistry* registryOut=nullptr ;   //!< output registry which will be written into file at the finalize 
    333335 
    334336 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp

    r2267 r2274  
    2525#include "grid_gatherer_connector.hpp" 
    2626#include "transformation_path.hpp" 
     27#include "grid_transformation_factory_impl.hpp" 
    2728 
    2829#include <algorithm> 
     
    6263   } 
    6364 
     65   void CDomain::releaseStaticAllocation(void) 
     66   { 
     67     transformationMapList_.clear() ; 
     68     CTransformation<CDomain>::unregisterAllTransformations() ; 
     69     CGridTransformationFactory<CDomain>::unregisterAllTransformations() ; 
     70   } 
    6471   ///--------------------------------------------------------------- 
    6572 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp

    r2270 r2274  
    7171         CDomain(const CDomain & domain);       // Not implemented yet. 
    7272         CDomain(const CDomain * const domain); // Not implemented yet. 
    73         
     73         static void releaseStaticAllocation(void) ; // release static allocation on heap 
     74 
    7475         static CDomain* createDomain(); 
    7576         static CDomain* get(const string& id, bool noError=false) ; //<! return domain pointer using id 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp

    r2267 r2274  
    3232  { /* Ne rien faire de plus */ } 
    3333 
     34  void CScalar::releaseStaticAllocation(void) 
     35  { 
     36    transformationMapList_.clear() ; 
     37    CTransformation<CScalar>::unregisterAllTransformations() ; 
     38    CGridTransformationFactory<CScalar>::unregisterAllTransformations() ; 
     39  } 
     40   
    3441  std::map<StdString, ETranformationType> CScalar::transformationMapList_ = std::map<StdString, ETranformationType>(); 
    3542  bool CScalar::dummyTransformationMapList_ = CScalar::initializeTransformationMap(CScalar::transformationMapList_); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp

    r2270 r2274  
    2020#include "distribution_type.hpp" 
    2121#include "generic_algorithm_transformation.hpp" 
     22#include "grid_transformation_factory_impl.hpp" 
    2223 
    2324 
     
    6768      CScalar(const CScalar & var);       // Not implemented yet. 
    6869      CScalar(const CScalar * const var); // Not implemented yet. 
    69  
     70      static void releaseStaticAllocation(void) ; // release static allocation on heap 
     71       
    7072      /// Destructeur /// 
    7173      virtual ~CScalar(void); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/object_factory.hpp

    r2265 r2274  
    2121         /// Accesseurs /// 
    2222         static StdString & GetCurrentContextId(void); 
     23         static void clearCurrentContextId(void) {CurrContext.clear(); CurrContext.shrink_to_fit(); } 
    2324 
    2425         template <typename U> 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/parse_expr/operator_expr.hpp

    r1481 r2274  
    435435    } 
    436436 
     437    void release(void) 
     438    {  
     439      opScalar.clear(); 
     440      opScalarScalar.clear(); 
     441      opScalarScalarScalar.clear(); 
     442      opField.clear(); 
     443      opFieldField.clear(); 
     444      opFieldScalar.clear(); 
     445      opScalarField.clear(); 
     446      opScalarScalarField.clear(); 
     447      opScalarFieldScalar.clear(); 
     448      opScalarFieldField.clear(); 
     449      opFieldScalarScalar.clear(); 
     450      opFieldScalarField.clear(); 
     451      opFieldFieldScalar.clear(); 
     452      opFieldFieldField.clear(); 
     453    } 
    437454  }; 
    438455 
    439456  extern COperatorExpr operatorExpr; 
     457 
    440458} 
    441459 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/server.cpp

    r2266 r2274  
    2121#include <cstdio> 
    2222#include "workflow_graph.hpp" 
     23#include "release_static_allocation.hpp" 
     24 
    2325 
    2426 
     
    207209 
    208210      // Delete CContext 
    209       CObjectTemplate<CContext>::cleanStaticDataStructure(); 
     211      //CObjectTemplate<CContext>::cleanStaticDataStructure(); 
    210212    } 
    211213 
     
    314316//      MPI_Comm_free(&intraComm); 
    315317      CXios::finalizeDaemonsManager(); 
    316       CContext::removeAllContexts() ; // free memory for related context  
    317        
     318      finalizeServersRessource(); 
     319       
     320      CContext::removeAllContexts() ; // free memory for related context 
     321           
    318322      if (!is_MPI_Initialized) 
    319323      { 
     
    325329      report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl  ; 
    326330      report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
    327  
     331       
    328332      CWorkflowGraph::drawWorkFlowGraph_server(); 
     333      xios::releaseStaticAllocation() ; // free memory from static allocation 
    329334    } 
    330335 
     
    420425      serversRessource_ = new CServersRessource(serverComm) ; 
    421426    } 
     427 
     428    void  CServer::finalizeServersRessource(void)  
     429    {  
     430      delete serversRessource_; serversRessource_=nullptr ; 
     431    } 
    422432} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/server.hpp

    r2212 r2274  
    6767        static CServersRessource* getServersRessource(void) { return serversRessource_;} 
    6868        static void launchServersRessource(MPI_Comm commServer) ; 
     69        static void finalizeServersRessource(void) ; 
    6970        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); 
    7071       
     
    7576        static StdOFStream m_infoStream; 
    7677        static StdOFStream m_errorStream; 
    77         static CServersRessource* serversRessource_ ; 
     78        static CServersRessource* serversRessource_  ; 
    7879    }; 
    7980} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/timer.hpp

    r1750 r2274  
    2525      static CTimer& get(std::string name, bool trace=true); 
    2626      static std::string getAllCumulatedTime(void) ; 
     27      static void release(void) { allTimer.clear() ;} 
    2728  }; 
    2829} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation_factory_impl.hpp

    r2270 r2274  
    6060  static bool unregisterTransformation(ETranformationType transType); 
    6161  static bool initializeTransformation_; 
     62  static void unregisterAllTransformations(void) ; 
    6263}; 
    6364 
     
    9899bool CGridTransformationFactory<T>::registerTransformation(ETranformationType transType, CreateTransformationCallBack createFn) 
    99100{ 
    100   if (0 == transformationCreationCallBacks_) 
     101  if (nullptr == transformationCreationCallBacks_) 
    101102    transformationCreationCallBacks_ = new CallBackMap(); 
    102103 
     
    110111} 
    111112 
     113template<typename T> 
     114void CGridTransformationFactory<T>::unregisterAllTransformations(void) 
     115{ 
     116  if (nullptr != transformationCreationCallBacks_)  
     117  { 
     118    transformationCreationCallBacks_->clear() ; 
     119    delete transformationCreationCallBacks_; 
     120  } 
     121} 
    112122 
    113123} 
     124 
    114125#endif // __XIOS_GRID_TRANSFORMATION_FACTORY_HPP__ 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/transformation.hpp

    r2270 r2274  
    5353    public: 
    5454      virtual ~CTransformation(void) {} 
    55  
     55      static void unregisterAllTransformations(); 
    5656    protected: 
    5757      typedef CTransformation<T>* (*createTransformationCallBack)(const StdString&, xml::CXMLNode*); 
     
    6262      static bool registerTransformation(ETranformationType transType, tuple<createTransformationCallBack,getIdTransformationCallBack> callBackFunctions); 
    6363      static bool unregisterTransformation(ETranformationType transType); 
     64      
     65 
    6466 
    6567    protected: 
     
    113115  } 
    114116 
     117  template<typename T> 
     118  void CTransformation<T>::unregisterAllTransformations(void) 
     119  { 
     120    if (0 != callBacks_) 
     121    { 
     122      callBacks_->clear(); 
     123      delete callBacks_ ;   
     124    } 
     125  } 
     126 
    115127} // namespace xios 
    116128 
Note: See TracChangeset for help on using the changeset viewer.