Changeset 2564


Ignore:
Timestamp:
09/13/23 12:28:29 (8 months ago)
Author:
jderouillat
Message:

Clean memory leaks

Location:
XIOS3/trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/event_scheduler.cpp

    r2522 r2564  
    33#include "mpi.hpp" 
    44#include "tracer.hpp" 
     5#include "cxios.hpp" 
    56 
    67namespace xios 
     
    2728  { 
    2829    MPI_Comm_dup(comm, &communicator_) ; 
     30    CXios::getMpiGarbageCollector().registerCommunicator(communicator_) ; 
    2931    MPI_Comm_size(communicator_,&mpiSize_) ; 
    3032    MPI_Comm_rank(communicator_,&mpiRank_); 
     
    100102    else color=0 ; 
    101103    MPI_Comm_split(communicator_, color, mpiRank_, &newComm) ; 
     104    CXios::getMpiGarbageCollector().registerCommunicator(newComm) ; 
    102105 
    103106    parent = make_shared<CEventScheduler>(newComm , schedulerLevel_) ; 
  • XIOS3/trunk/src/node/context.cpp

    r2547 r2564  
    7777     if (registryIn!=nullptr) delete registryIn ; 
    7878     if (registryOut!=nullptr) delete registryOut ; 
     79 
     80     if (onlineContextClient_!=nullptr) delete onlineContextClient_; 
    7981   } 
    8082 
  • XIOS3/trunk/src/transport/context_client.hpp

    r2556 r2564  
    3535            // Contructor 
    3636      CContextClient(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0); 
     37      virtual ~CContextClient() {}  
    3738 
    3839      bool isServerLeader(void) const; 
  • XIOS3/trunk/src/transport/context_server.hpp

    r2556 r2564  
    2222     
    2323    CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ; 
    24     ~CContextServer() {}  
     24    virtual ~CContextServer() {}  
    2525    void setAssociatedClient(CContextClient* associatedClient) {associatedClient_=associatedClient ;} 
    2626    CContextClient* getAssociatedClient(void) { return associatedClient_ ;} 
  • XIOS3/trunk/src/transport/p2p_server_buffer.cpp

    r2558 r2564  
    113113 
    114114    if (buffers_.size()>1)  
    115      if (buffers_.front()->getCount()==0) buffers_.pop_front() ; // if buffer is empty free buffer 
     115    { 
     116      if (buffers_.front()->getCount()==0) { 
     117        delete buffers_.front(); 
     118        buffers_.pop_front() ; // if buffer is empty free buffer 
     119      } 
     120    } 
    116121  } 
    117122 
     
    422427      bloc.buffer->free(bloc.start, bloc.count) ; // free bloc 
    423428      addr=bloc.addr ; 
    424       if (bloc.buffer->getCount()==0) if (buffers_.size() > 1) buffers_.pop_front() ; // if buffer is empty free buffer 
     429      if (bloc.buffer->getCount()==0) 
     430      { 
     431        if (buffers_.size() > 1) 
     432        { 
     433          delete buffers_.front(); 
     434          buffers_.pop_front() ; // if buffer is empty free buffer 
     435        } 
     436      } 
    425437    } 
    426438    event.push(clientRank_, nullptr, buffer, size) ; 
  • XIOS3/trunk/src/transport/p2p_server_buffer.hpp

    r2558 r2564  
    3636          {  
    3737            if (count_>0) ERROR("COneSidedServerBuffer::~CBuffer()",<<"Try to delete buffer that is not empty"<<std::endl) ; 
    38             MPI_Free_mem(&buffer_) ; 
     38            MPI_Free_mem(buffer_) ; 
    3939          } 
    4040        
     
    106106                             map<size_t, SPendingEvent>& completedEvents, vector<char>& buffer)  ; 
    107107       
     108      ~CP2pServerBuffer() 
     109      { 
     110          while (!buffers_.empty()) { 
     111              delete buffers_.front(); 
     112              buffers_.pop_front() ; // if buffer is empty free buffer 
     113          } 
     114      }; 
     115 
    108116      void receivedRequest(vector<char>& buffer) ; 
    109117      void eventLoop(void) ; 
Note: See TracChangeset for help on using the changeset viewer.