source: XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/pool_ressource.hpp @ 2274

Last change on this file since 2274 was 2274, checked in by ymipsl, 2 years ago

Tracking memory leak : release memory statically alocated

YM

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#ifndef __POOL_RESSOURCE_HPP__
2#define __POOL_RESSOURCE_HPP__
3
4#include "mpi.hpp"
5#include "window_manager.hpp"
6#include "services_manager.hpp"
7
8
9namespace xios
10{
11 
12  class CService ;
13
14  class CPoolRessource 
15  {
16    private:
17     
18    const size_t maxBufferSize_=1024*1024 ;
19    const int localLeader_ = 0 ;
20
21    CWindowManager* winNotify_ ;
22   
23   public:
24    CPoolRessource(MPI_Comm poolComm, const std::string& Id) ;
25    ~CPoolRessource() ;
26   
27    void createService(const std::string& serviceId, int type, int size, int nbPartition) ;
28    void createService(MPI_Comm serviceComm, const std::string& serviceId, int partitionId, int type, int nbPartitions) ; 
29    void createServiceNotify(int rank, const std::string& serviceId, int type, int size, int nbPartitions, bool in) ;
30    void createServiceDumpOut(CBufferOut& buffer) ;
31    void createServiceDumpIn(CBufferIn& buffer) ;
32    void checkCreateServiceNotification(void) ;
33    void createNewService(const std::string& serviceId, int type, int size, int nbPartitions, bool in) ;
34     bool eventLoop(bool serviceOnly=false) ;
35    CService* getService(const std::string serviceId, int partitionId) { return services_[make_tuple(serviceId,partitionId)]; }
36    void finalizeSignal(void) ;
37    string getId(void) { return Id_; }
38   
39   private:
40    MPI_Comm poolComm_ ;
41   
42    std::multimap<int,int> occupancy_ ;
43    std::list<std::tuple<std::string, int, int, int, bool> > notifications_;
44    std::map< std::tuple<std::string, int>, CService*> services_ ;
45    std::string Id_ ;
46    bool finalizeSignal_ ;
47   
48    const double eventLoopLatency_=0; 
49    double lastEventLoop_=0. ;
50  };
51
52}
53
54
55
56#endif
Note: See TracBrowser for help on using the repository browser.