source: XIOS/dev/dev_ym/XIOS_COUPLING/src/buffer_server.hpp @ 2246

Last change on this file since 2246 was 2246, checked in by ymipsl, 3 years ago
  • Update of the tranfer protocol using one sided communication
  • Introduce MPI_Improb/MPI_mrecv to listen incomming request
  • Introducing latency when looping over managers

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: 1.4 KB
Line 
1#ifndef __BUFFER_SERVER_HPP__
2#define __BUFFER_SERVER_HPP__
3
4#include "buffer_cs_base.hpp"
5#include "xios_spl.hpp"
6#include "buffer.hpp"
7#include "mpi.hpp"
8#include "cxios.hpp"
9
10namespace xios
11{
12  class CServerBuffer : public CBufferClientServerBase
13  {
14    public:
15      CServerBuffer(vector<MPI_Win>& windows, vector<MPI_Aint>& winAddress, int windowsRank, StdSize bufSize) ;
16      ~CServerBuffer() ;
17
18      bool isBufferFree(size_t count) ;
19      void* getBuffer(size_t count) ;
20      void freeBuffer(size_t count) ;
21      void createWindows(MPI_Comm oneSidedComm) ;
22      bool freeWindows(void) ;
23      bool getBufferFromClient(size_t timeLine, char* & buffer, size_t& count) ;
24      bool isBufferEmpty(void) ;
25      void updateCurrentWindows(void) ;
26      void lockBuffer(void) ;
27      void unlockBuffer(void) ;
28      void notifyClientFinalize(void) ;
29      void notifyBufferResizing(void) ;
30    private:
31      char* buffer;
32      size_t first;   // first occupied element
33      size_t current; // first free element
34      size_t end;
35      size_t size;
36      size_t used ;  // count of element occupied
37      std::vector<MPI_Win> windows_ ;
38      std::vector<MPI_Aint> winAddress_ ;
39      bool resizingBuffer_ = false ;
40      int currentWindows ;
41      bool hasWindows ;
42      int windowsRank_ ;
43      double bufferFromClientLatency_=1e-1 ;
44      double bufferFromClientTime_ = 0;
45
46  };
47}
48
49#endif
Note: See TracBrowser for help on using the repository browser.