source: XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/servers_ressource.hpp @ 2338

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

Tracking memory leak : release memory statically alocated

YM

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#ifndef __SERVERS_RESSOURCE_HPP__
2#define __SERVERS_RESSOURCE_HPP__
3
4#include "window_manager.hpp"
5#include "mpi.hpp"
6#include <vector>
7#include <string>
8
9
10
11namespace xios
12{
13
14  class CPoolRessource ;
15
16  class CServersRessource
17  {
18
19    const int NOTIFY_NOTHING=0 ;
20    const int NOTIFY_CREATE_POOL=1 ;
21    const int NOTIFY_FINALIZE=2 ;
22
23    public:
24   
25    CServersRessource(MPI_Comm serverComm) ;
26    ~CServersRessource() ;
27    void createPool(const string& poolId, const int size) ;
28    void createPool(void) ;
29    bool eventLoop(bool serviceOnly=false) ;
30    void sendNotification(int rank) ;
31    void notificationsDumpOut(CBufferOut& buffer) ;
32    void notificationsDumpIn(CBufferIn& buffer) ;
33    void checkNotifications(void) ;
34    CPoolRessource* getPoolRessource(void) { return poolRessource_; } 
35    bool isServerLeader(void) ;
36    void finalize(void) ;
37    void finalizeSignal(void) ;
38
39    const int localLeader_=0 ;
40    vector<int> freeRessourcesRank_ ; // only for leader
41    MPI_Comm serverComm_ ;
42    MPI_Comm freeRessourcesComm_ ;
43
44
45    const size_t maxBufferSize_=1024*1024 ;
46    CWindowManager* winNotify_ ;
47   
48    int notifyInType_,notifyOutType_ ;
49    std::tuple<std::string, bool> notifyInCreatePool_,notifyOutCreatePool_ ;
50    CPoolRessource* poolRessource_ ;
51    bool finalizeSignal_ ;
52
53    const double eventLoopLatency_=0; 
54    double lastEventLoop_=0. ;
55
56    friend class CWindowManager ;
57  } ;
58
59}
60
61
62
63#endif
Note: See TracBrowser for help on using the repository browser.