source: XIOS/trunk/src/context_client.hpp @ 591

Last change on this file since 591 was 591, checked in by rlacroix, 9 years ago

Remove leftovers from the XMLIO age.

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 2.4 KB
Line 
1#ifndef __CONTEXT_CLIENT_HPP__
2#define __CONTEXT_CLIENT_HPP__
3
4#include "xios_spl.hpp"
5#include "buffer_out.hpp"
6#include "buffer_client.hpp"
7#include "event_client.hpp"
8#include "mpi.hpp"
9
10namespace xios
11{
12  class CContext ;
13
14  /*!
15  \class CContextClient
16  A context can be both on client and on server side. In order to differenciate the role of
17  context on each side, e.x client sending events, server receiving and processing events, there is a need of
18  concrete "context" classes for both sides.
19  CContextClient processes and sends events from client to server where CContextServer receives these events
20  and processes them.
21  */
22  class CContextClient
23  {
24    public:
25    // Contructor
26    CContextClient(CContext* parent,MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0) ;
27
28    // Send event to server
29    void sendEvent(CEventClient& event) ;
30    void waitEvent(list<int>& ranks) ;
31
32    // Functions relates to set/get buffers
33    list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList) ;
34    void newBuffer(int rank) ;
35    bool checkBuffers(list<int>& ranks) ;
36    bool checkBuffers(void);
37    void releaseBuffers(void);
38
39    bool isServerLeader(void) ;
40    int getServerLeader(void) ;
41
42    // Close and finalize context client
43    void closeContext(void) ;
44    void finalize(void) ;
45
46    void setBufferSize(const std::map<int, StdSize>& mapSize);
47    void sendBufferSizeEvent();
48
49    public:
50      CContext* context ; //!< Context for client
51
52      size_t timeLine ; //!< Timeline of each event
53
54      int clientRank ; //!< Rank of current client
55
56      int clientSize ; //!< Size of client group
57
58      int serverSize ; //!< Size of server group
59
60      MPI_Comm interComm ; //!< Communicator of server group
61
62      MPI_Comm intraComm ; //!< Communicator of client group
63
64      map<int,CClientBuffer*> buffers ; //!< Buffers for connection to servers
65
66    private:
67      //! Mapping of server and buffer size for each connection to server
68      std::map<int, StdSize> mapBufferSize_;
69
70      //! Context for server (Only used in attached mode)
71      CContext* parentServer;
72
73    public: // Some function should be removed in the future
74      //    void registerEvent(CEventClient& event) ;
75//    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes) ;
76//    bool locked ;
77//    set<int> connectedServer ;
78
79  } ;
80}
81
82#endif // __CONTEXT_CLIENT_HPP__
Note: See TracBrowser for help on using the repository browser.