Ignore:
Timestamp:
06/20/18 09:09:23 (6 years ago)
Author:
ymipsl
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/context_client.hpp

    r1232 r1547  
    3131      // Send event to server 
    3232      void sendEvent(CEventClient& event); 
    33       bool sendTemporarilyBufferedEvent(); 
    3433      void waitEvent(list<int>& ranks); 
    3534 
    3635      // Functions to set/get buffers 
    37       bool getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false); 
     36      bool getBuffers(const size_t timeLine, const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false); 
    3837      void newBuffer(int rank); 
    3938      bool checkBuffers(list<int>& ranks); 
     
    4847 
    4948      bool isAttachedModeEnabled() const; 
    50       bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); }; 
    5149 
    5250      static void computeLeader(int clientRank, int clientSize, int serverSize, 
     
    7169      int serverSize; //!< Size of server group 
    7270 
    73       MPI_Comm interComm; //!< Communicator of server group 
     71      MPI_Comm interComm; //!< Communicator of server group (interCommunicator) 
     72 
     73      MPI_Comm interCommMerged; //!< Communicator of the client group + server group (intraCommunicator) needed for one sided communication. 
    7474 
    7575      MPI_Comm intraComm; //!< Communicator of client group 
    7676 
     77      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 
     78 
    7779      map<int,CClientBuffer*> buffers; //!< Buffers for connection to servers 
    7880 
     81      bool pureOneSided ; //!< if true, client will communicated with servers only trough one sided communication. Otherwise the hybrid mode P2P /One sided is used. 
     82 
    7983    private: 
     84      void lockBuffers(list<int>& ranks) ; 
     85      void unlockBuffers(list<int>& ranks) ; 
     86       
    8087      //! Mapping of server and buffer size for each connection to server 
    8188      std::map<int,StdSize> mapBufferSize_; 
     
    8491      //! Maximum number of events that can be buffered 
    8592      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) 
    10293 
    10394      //! Context for server (Only used in attached mode) 
Note: See TracChangeset for help on using the changeset viewer.