Changeset 2569


Ignore:
Timestamp:
09/14/23 14:55:37 (8 months ago)
Author:
jderouillat
Message:

Clean memory associated to EventScheduler? hierarchy and MpiGarbageCollector?

Location:
XIOS3/trunk/src
Files:
3 edited

Legend:

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

    r2564 r2569  
    9292      checkEvent_() ; 
    9393    }  
     94    cleanSplitSchedulers(); 
     95  } 
     96     
     97  void CEventScheduler::cleanSplitSchedulers() 
     98  { 
     99    // Cleaning is operated recursively going from parent to child 
     100    if (parentScheduler_) 
     101    { 
     102      if (parentScheduler_->childScheduler_.get() == this) 
     103      { 
     104        parentScheduler_.reset(); 
     105      } 
     106      else // if orphan (due to splitScheduler) : clean parent tree (it does not have child) 
     107      { 
     108        parentScheduler_->cleanSplitSchedulers(); 
     109        parentScheduler_.reset(); 
     110      } 
     111    }                    
     112    if (childScheduler_) 
     113    { 
     114      childScheduler_->cleanSplitSchedulers(); 
     115      childScheduler_.reset(); 
     116    } 
    94117  }  
    95118 
  • XIOS3/trunk/src/event_scheduler.hpp

    r2522 r2569  
    7171       private: 
    7272         void initialize(const MPI_Comm& comm) ; 
     73         void cleanSplitSchedulers(); 
    7374        
    7475       //! Send an event to the parent of level `lev+1` 
  • XIOS3/trunk/src/mpi_garbage_collector.hpp

    r2310 r2569  
    2727          if (it.type==SType::COMM) MPI_Comm_free(&it.comm); 
    2828          else if (it.type==SType::WIN) MPI_Win_free(&it.win); 
     29        stack_.clear(); 
    2930      } 
    3031  } ; 
Note: See TracChangeset for help on using the changeset viewer.