source: XIOS/dev/dev_ym/XIOS_SERVICES/src/manager/server_context.hpp @ 1761

Last change on this file since 1761 was 1761, checked in by ymipsl, 5 years ago

implementing first guess for service functionnalities.

YM

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#ifndef __SERVER_CONTEXT_HPP__
2#define __SERVER_CONTEXT_HPP__
3#include "xios_spl.hpp"
4#include "window_manager.hpp"
5#include "mpi.hpp"
6
7namespace xios
8{
9  class CContext ;
10  class CService ;
11
12  class CServerContext
13  {
14    const int NOTIFY_NOTHING=0 ;
15    const int NOTIFY_CREATE_INTERCOMM=1 ;
16   
17    public:
18    CServerContext(CService* parentService, MPI_Comm contextComm, const std::string& poolId, const std::string& serviceId, 
19                  const int& partitionId, const std::string& contextId) ;
20
21    bool createIntercomm(const string& poolId, const string& serviceId, const int& partitionId, const string& contextId, 
22                         const MPI_Comm& intraComm, MPI_Comm& interCommClient, MPI_Comm& interCommServer, bool wait=true) ;
23    void createIntercomm(int remoteLeader, const string& sourceContext) ;
24
25    void sendNotification(int rank); 
26    void checkNotifications(void) ;
27
28    bool eventLoop(void) ;
29    void notificationsDumpOut(CBufferOut& buffer) ;
30    void notificationsDumpIn(CBufferIn& buffer) ;
31    void finalizeSignal(void) ;
32    private:
33    void createIntercomm(void) ;
34   
35    static std::map<std::string, std::tuple<bool, MPI_Comm, MPI_Comm> > overlapedComm_ ;
36
37    MPI_Comm contextComm_ ;
38    MPI_Comm xiosComm_ ;
39
40    CContext* context_ ;
41    CService* parentService_ ;
42    std::string name_ ;
43
44    vector<MPI_Comm> clientsInterComm_ ;
45
46
47    const size_t maxBufferSize_=1024*1024 ;
48    CWindowManager* winNotify_ ;
49    int notifyType_ ;
50    tuple<int, std::string> notifyCreateIntercomm_ ;
51
52    const int localLeader_=0 ;
53    int globalLeader_ ;
54    bool finalizeSignal_ ;
55
56    friend class CWindowManager ;
57  } ;
58
59}
60
61#endif
Note: See TracBrowser for help on using the repository browser.