Ignore:
Timestamp:
12/01/21 16:52:24 (3 years ago)
Author:
ymipsl
Message:

tracking memory leak
Elements, views, and connectors are now managed with shared pointer.
YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/gatherer_connector.hpp

    r2118 r2267  
    1717  { 
    1818    private: 
    19       CDistributedView* srcView_; 
    20       CLocalView* dstView_; 
     19      shared_ptr<CDistributedView> srcView_; 
     20      shared_ptr<CLocalView> dstView_; 
    2121      map<int, vector<int>> connector_ ; 
    2222      map<int, vector<bool>> mask_ ;  // mask is on src view 
     
    2525 
    2626    public: 
    27       CGathererConnector(CDistributedView* srcView, CLocalView* dstView) : srcView_(srcView), dstView_(dstView) {} ; 
     27      CGathererConnector(shared_ptr<CDistributedView> srcView, shared_ptr<CLocalView> dstView) : srcView_(srcView), dstView_(dstView) {} ; 
    2828      void computeConnector(void) ; 
    2929       
     
    7575 
    7676      template<typename T> 
    77       void transfer(int rank,  CGathererConnector** connectors, int nConnectors, const T* input, T* output) 
     77      void transfer(int rank,  shared_ptr<CGathererConnector>* connectors, int nConnectors, const T* input, T* output) 
    7878      { 
    7979        auto& connector = connector_[rank] ; // probably costly, find a better way to avoid the map 
     
    111111 
    112112      // hook for transfering mask in grid connector, maybe find an other way to doing that... 
    113       void transfer_or(int rank,  CGathererConnector** connectors, int nConnectors, const bool* input, bool* output) 
     113      void transfer_or(int rank,  shared_ptr<CGathererConnector>* connectors, int nConnectors, const bool* input, bool* output) 
    114114      { 
    115115        auto& connector = connector_[rank] ; // probably costly, find a better way to avoid the map 
     
    210210      } 
    211211 
    212     int getSrcSliceSize(int rank, CGathererConnector** connectors, int nConnectors)  
     212    int getSrcSliceSize(int rank, shared_ptr<CGathererConnector>* connectors, int nConnectors)  
    213213    { if (nConnectors==0) return srcSize_[rank] ; else return srcSize_[rank] * (*(connectors-1))->getSrcSliceSize(rank, connectors-1,nConnectors-1) ; } 
    214214 
    215     int getDstSliceSize(CGathererConnector** connectors, int nConnectors)  
     215    int getDstSliceSize(shared_ptr<CGathererConnector>* connectors, int nConnectors)  
    216216    { if (nConnectors==0) return dstSize_ ; else return dstSize_ * (*(connectors-1))->getDstSliceSize(connectors-1,nConnectors-1) ; } 
    217217   
Note: See TracChangeset for help on using the changeset viewer.