source: XIOS3/trunk/src/buffer_server.hpp @ 2628

Last change on this file since 2628 was 2558, checked in by ymipsl, 9 months ago

p2p transport protocol

  • bug fix
  • more diagnostics
  • set buffer parameters to realistic values

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