source: XIOS/dev/dev_ym/XIOS_SERVICES/src/context_server.hpp @ 1764

Last change on this file since 1764 was 1764, checked in by ymipsl, 4 years ago

Some Update on XIOS services
Seems to work on Irène for :

  • first level of servers
  • fisrt + second level of servers
  • attached mode

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