Ignore:
Timestamp:
01/22/21 12:00:29 (3 years ago)
Author:
yushan
Message:

Graph intermedia commit to a tmp branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_graph/src/context_client.hpp

    r1232 r2019  
    1414{ 
    1515  class CContext; 
    16  
     16  class CContextServer ; 
    1717  /*! 
    1818  \class CContextClient 
     
    3131      // Send event to server 
    3232      void sendEvent(CEventClient& event); 
    33       bool sendTemporarilyBufferedEvent(); 
    3433      void waitEvent(list<int>& ranks); 
     34      void waitEvent_old(list<int>& ranks); 
    3535 
    3636      // Functions to set/get buffers 
    37       bool getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false); 
     37      bool getBuffers(const size_t timeLine, const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false); 
    3838      void newBuffer(int rank); 
    3939      bool checkBuffers(list<int>& ranks); 
     
    4747      const std::list<int>& getRanksServerNotLeader(void) const; 
    4848 
    49       bool isAttachedModeEnabled() const; 
    50       bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); }; 
     49  /*! 
     50   * Check if the attached mode is used. 
     51   * 
     52   * \return true if and only if attached mode is used 
     53   */ 
     54      bool isAttachedModeEnabled() const { return isAttached_ ; }  
    5155 
    5256      static void computeLeader(int clientRank, int clientSize, int serverSize, 
     
    5660      // Close and finalize context client 
    5761//      void closeContext(void);  Never been implemented. 
     62      bool isNotifiedFinalized(void) ; 
    5863      void finalize(void); 
    5964 
    6065      void setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize); 
     66 
     67      int getRemoteSize(void) {return serverSize;} 
     68      int getServerSize(void) {return serverSize;} 
     69      MPI_Comm getIntraComm(void)  {return intraComm ;}  
     70      int getIntraCommSize(void) {return clientSize ;} 
     71      int getIntraCommRank(void) {return clientRank ;} 
     72 
     73      /*! set the associated server (dual chanel client/server) */       
     74      void setAssociatedServer(CContextServer* associatedServer) { associatedServer=associatedServer_;} 
     75      /*! get the associated server (dual chanel client/server) */       
     76      CContextServer* getAssociatedServer(void) { return associatedServer_;} 
    6177 
    6278    public: 
     
    7187      int serverSize; //!< Size of server group 
    7288 
    73       MPI_Comm interComm; //!< Communicator of server group 
     89      MPI_Comm interComm; //!< Communicator of server group (interCommunicator) 
     90 
     91      MPI_Comm interCommMerged; //!< Communicator of the client group + server group (intraCommunicator) needed for one sided communication. 
    7492 
    7593      MPI_Comm intraComm; //!< Communicator of client group 
    7694 
     95      MPI_Comm commSelf; //!< Communicator of the client alone. Needed to create a new communicator between 1 proc client and 1 proc server for one sided communication 
     96 
    7797      map<int,CClientBuffer*> buffers; //!< Buffers for connection to servers 
    7898 
     99      bool pureOneSided ; //!< if true, client will communicated with servers only trough one sided communication. Otherwise the hybrid mode P2P /One sided is used. 
     100 
    79101    private: 
     102      void lockBuffers(list<int>& ranks) ; 
     103      void unlockBuffers(list<int>& ranks) ; 
     104       
    80105      //! Mapping of server and buffer size for each connection to server 
    81106      std::map<int,StdSize> mapBufferSize_; 
     
    84109      //! Maximum number of events that can be buffered 
    85110      StdSize maxBufferedEvents; 
    86  
    87       struct { 
    88         std::list<int> ranks, sizes; 
    89         std::list<CBufferOut*> buffers; 
    90  
    91         bool isEmpty() const { return ranks.empty(); }; 
    92         void clear() { 
    93           ranks.clear(); 
    94           sizes.clear(); 
    95  
    96           for (std::list<CBufferOut*>::iterator it = buffers.begin(); it != buffers.end(); it++) 
    97             delete *it; 
    98  
    99           buffers.clear(); 
    100         }; 
    101       } tmpBufferedEvent; //! Event temporarily buffered (used only on the server) 
    102111 
    103112      //! Context for server (Only used in attached mode) 
     
    110119      std::list<int> ranksServerNotLeader; 
    111120 
     121      std::vector<std::vector<MPI_Win> >windows ; //! one sided mpi windows to expose client buffers to servers == windows[nbServers][2] 
     122      bool isAttached_ ; 
     123      CContextServer* associatedServer_ ; //!< The server associated to the pair client/server 
     124 
    112125  }; 
    113126} 
Note: See TracChangeset for help on using the changeset viewer.