source: XIOS3/trunk/src/manager/servers_ressource.hpp @ 2542

Last change on this file since 2542 was 2523, checked in by ymipsl, 13 months ago

Adaptation to new hyper event scheduler.
YM

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