source: XIOS/dev/dev_trunk_graph/src/context_server.hpp @ 2299

Last change on this file since 2299 was 2137, checked in by yushan, 3 years ago

temporal commit for merging graph into XIOS_coupling

  • 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.7 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"
[2019]7#include "event_scheduler.hpp"
[300]8
[335]9namespace xios
[300]10{
[345]11  class CContext ;
[2019]12  class CContextClient;
[511]13
[300]14  class CContextServer
15  {
16    public:
[511]17
[1158]18    CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
[1054]19    bool eventLoop(bool enableEventsProcessing = true);
[300]20    void listen(void) ;
[1228]21    bool listenPendingRequest(MPI_Status& status) ;
[300]22    void checkPendingRequest(void) ;
[2019]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) ;
[2019]30    bool isAttachedModeEnabled() const;
31    void releaseBuffers(void) ;
32    void notifyClientsFinalize(void) ;
33   
[300]34    MPI_Comm intraComm ;
35    int intraCommSize ;
36    int intraCommRank ;
[511]37
[300]38    MPI_Comm interComm ;
39    int commSize ;
[511]40
[2019]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 ;
[2019]46    map<int,size_t> lastTimeLine ; //!< last event time line for a processed request
47    map<int,size_t>::iterator itLastTimeLine ; //!< iterator on lastTimeLine
[300]48    map<int,MPI_Request> pendingRequest ;
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 ? */
[2019]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
[2019]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_;
[2019]70      vector<MPI_Win> windows ; //! one sided mpi windows to expose client buffers to servers ; No memory will be attached on server side.
71      CEventScheduler* eventScheduler_ ;
72      bool isProcessingEvent_ ;
73      CContextClient* associatedClient_ ;
[2137]74      size_t remoteHashId_; //!< the hash is of the calling context client
[300]75  } ;
76
77}
78
79#endif
Note: See TracBrowser for help on using the repository browser.