source: XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/context_server.hpp @ 1550

Last change on this file since 1550 was 1547, checked in by ymipsl, 6 years ago

New communication protocol between clients and servers, using hybrid mode of p2p mixt with one_sided communication in order to avoid dead-locking. The constraint of the maximum number of event that can be bufferized on client side is released.

Dev branch is created to be tested before merging.

YM

  • 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.1 KB
Line 
1#ifndef __CONTEXT_SERVER_HPP__
2#define __CONTEXT_SERVER_HPP__
3#include "xios_spl.hpp"
4#include "event_server.hpp"
5#include "buffer_server.hpp"
6#include "mpi.hpp"
7
8namespace xios
9{
10  class CContext ;
11
12  class CContextServer
13  {
14    public:
15
16    CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
17    bool eventLoop(bool enableEventsProcessing = true);
18    void listen(void) ;
19    bool listenPendingRequest(MPI_Status& status) ;
20    void checkPendingRequest(void) ;
21    void getBufferFromClient(size_t timeLine) ;
22    void processRequest(int rank, char* buff,int count) ;
23    void processEvents(void) ;
24    bool hasFinished(void);
25    void dispatchEvent(CEventServer& event) ;
26    void setPendingEvent(void) ;
27    bool hasPendingEvent(void) ;
28    bool isAttachedModeEnabled() const;
29    void releaseBuffers(void) ;
30   
31    MPI_Comm intraComm ;
32    int intraCommSize ;
33    int intraCommRank ;
34
35    MPI_Comm interComm ;
36    int commSize ;
37
38    MPI_Comm interCommMerged; //!< Communicator of the client group + server group (intraCommunicator) needed for one sided communication.
39
40    MPI_Comm commSelf; //!< Communicator of the server alone. Needed to create a new communicator between 1 proc client and 1 proc server for one sided communication
41
42    map<int,CServerBuffer*> buffers ;
43    map<int,size_t> lastTimeLine ; //!< last event time line for a processed request
44    map<int,size_t>::iterator itLastTimeLine ; //!< iterator on lastTimeLine
45    map<int,MPI_Request> pendingRequest ;
46    map<int,char*> bufferRequest ;
47
48    map<size_t,CEventServer*> events ;
49    size_t currentTimeLine ;
50    CContext* context ;
51     
52    bool finished ;
53    bool pendingEvent ;
54    bool scheduled  ;    /*!< event of current timeline is alreading scheduled ? */
55    bool attachedMode ;  //! true if attached mode is enabled otherwise false
56    bool pureOneSided ; //!< if true, client will communicated with servers only trough one sided communication. Otherwise the hybrid mode P2P /One sided is used.
57         
58    size_t hashId ;
59
60    ~CContextServer() ;
61
62    private:
63      std::map<int, StdSize> mapBufferSize_;
64  } ;
65
66}
67
68#endif
Note: See TracBrowser for help on using the repository browser.