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

Last change on this file since 2246 was 2246, checked in by ymipsl, 3 years ago
  • Update of the tranfer protocol using one sided communication
  • Introduce MPI_Improb/MPI_mrecv to listen incomming request
  • Introducing latency when looping over managers

YM

  • Property svn:executable set to *
File size: 1.4 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    void createPool(const string& poolId, const int size) ;
27    void createPool(void) ;
28    bool eventLoop(bool serviceOnly=false) ;
29    void sendNotification(int rank) ;
30    void notificationsDumpOut(CBufferOut& buffer) ;
31    void notificationsDumpIn(CBufferIn& buffer) ;
32    void checkNotifications(void) ;
33    CPoolRessource* getPoolRessource(void) { return poolRessource_; } 
34    bool isServerLeader(void) ;
35    void finalize(void) ;
36    void finalizeSignal(void) ;
37
38    const int localLeader_=0 ;
39    vector<int> freeRessourcesRank_ ; // only for leader
40    MPI_Comm serverComm_ ;
41    MPI_Comm freeRessourcesComm_ ;
42
43
44    const size_t maxBufferSize_=1024*1024 ;
45    CWindowManager* winNotify_ ;
46   
47    int notifyInType_,notifyOutType_ ;
48    std::tuple<std::string, bool> notifyInCreatePool_,notifyOutCreatePool_ ;
49    CPoolRessource* poolRessource_ ;
50    bool finalizeSignal_ ;
51
52    const double eventLoopLatency_=1e-2; 
53    double lastEventLoop_=0. ;
54
55    friend class CWindowManager ;
56  } ;
57
58}
59
60
61
62#endif
Note: See TracBrowser for help on using the repository browser.