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

Tracking memory leak : release memory statically alocated

YM

File:
1 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    /*! 
Note: See TracChangeset for help on using the changeset viewer.