source: XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/pool_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.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   
26    void createService(const std::string& serviceId, int type, int size, int nbPartition) ;
27    void createService(MPI_Comm serviceComm, const std::string& serviceId, int partitionId, int type, int nbPartitions) ; 
28    void createServiceNotify(int rank, const std::string& serviceId, int type, int size, int nbPartitions, bool in) ;
29    void createServiceDumpOut(CBufferOut& buffer) ;
30    void createServiceDumpIn(CBufferIn& buffer) ;
31    void checkCreateServiceNotification(void) ;
32    void createNewService(const std::string& serviceId, int type, int size, int nbPartitions, bool in) ;
33     bool eventLoop(bool serviceOnly=false) ;
34    CService* getService(const std::string serviceId, int partitionId) { return services_[make_tuple(serviceId,partitionId)]; }
35    void finalizeSignal(void) ;
36    string getId(void) { return Id_; }
37   
38   private:
39    MPI_Comm poolComm_ ;
40   
41    std::multimap<int,int> occupancy_ ;
42    std::list<std::tuple<std::string, int, int, int, bool> > notifications_;
43    std::map< std::tuple<std::string, int>, CService*> services_ ;
44    std::string Id_ ;
45    bool finalizeSignal_ ;
46   
47    const double eventLoopLatency_=1e-2; 
48    double lastEventLoop_=0. ;
49  };
50
51}
52
53
54
55#endif
Note: See TracBrowser for help on using the repository browser.