Ignore:
Timestamp:
10/18/19 14:55:57 (5 years ago)
Author:
ymipsl
Message:

Implement one sided communication in client/server protocol to avoid dead-lock when some buffer are full.

YM

File:
1 edited

Legend:

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

    r1639 r1757  
    1414      static size_t maxRequestSize; 
    1515 
    16       CClientBuffer(MPI_Comm intercomm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents); 
     16      CClientBuffer(MPI_Comm intercomm, vector<MPI_Win>& windows, int clientRank, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize); 
    1717      ~CClientBuffer(); 
    18  
     18//      void createWindows(MPI_Comm oneSidedComm) ; 
     19      void freeWindows(void) ; 
     20      void lockBuffer(void) ; 
     21      void unlockBuffer(void) ; 
     22       
    1923      bool isBufferFree(StdSize size); 
    20       CBufferOut* getBuffer(StdSize size); 
    21       bool checkBuffer(void); 
     24      CBufferOut* getBuffer(size_t timeLine, StdSize size); 
     25      bool checkBuffer(bool send=false); 
    2226      bool hasPendingRequest(void); 
    2327      StdSize remain(void); 
    24  
     28      MPI_Aint getWinAddress(int numWindows) ; 
     29      void infoBuffer(void) ; 
     30      bool isNotifiedFinalized(void) ; 
    2531    private: 
    2632      char* buffer[2]; 
    27  
     33      char* bufferHeader[2]; 
     34      size_t* firstTimeLine[2] ; 
     35      size_t* bufferCount[2] ; 
     36      size_t* control[2] ; 
     37      size_t* finalize[2] ; 
     38      bool winState[2] ; 
    2839      int current; 
    2940 
    3041      StdSize count; 
    31       StdSize bufferedEvents; 
    3242      StdSize maxEventSize; 
    33       const StdSize maxBufferedEvents; 
    3443      const StdSize bufferSize; 
    3544      const StdSize estimatedMaxEventSize; 
     
    3746 
    3847      const int serverRank; 
     48      const int clientRank_; 
    3949      bool pending; 
    4050 
     
    4353      CBufferOut* retBuffer; 
    4454      const MPI_Comm interComm; 
     55      std::vector<MPI_Win> windows_ ; 
     56      bool hasWindows ; 
     57      static const int headerSize=4*sizeof(size_t); 
    4558  }; 
    4659} 
Note: See TracChangeset for help on using the changeset viewer.