source: XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.hpp @ 1878

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

Coupling branch : replace hasServer and hasClient combination by the name of correct service : CLIENT, GATHERER or OUT_SERVER.

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