source: XIOS3/trunk/src/buffer_client.hpp @ 2509

Last change on this file since 2509 was 2458, checked in by ymipsl, 17 months ago

Merge XIOS_FILE_SERVICE dev branch into trunk

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: 2.3 KB
RevLine 
[300]1#ifndef __BUFFER_CLIENT_HPP__
2#define __BUFFER_CLIENT_HPP__
3
[2246]4#include "buffer_cs_base.hpp"
[591]5#include "xios_spl.hpp"
[300]6#include "buffer_out.hpp"
[382]7#include "mpi.hpp"
[509]8#include "cxios.hpp"
[300]9
[335]10namespace xios
[300]11{
[2246]12  class CClientBuffer : public CBufferClientServerBase
[300]13  {
14    public:
[732]15      static size_t maxRequestSize;
[509]16
[2259]17      CClientBuffer(MPI_Comm intercomm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize);
[732]18      ~CClientBuffer();
[1757]19//      void createWindows(MPI_Comm oneSidedComm) ;
20      void freeWindows(void) ;
21      void lockBuffer(void) ;
22      void unlockBuffer(void) ;
23     
[1227]24      bool isBufferFree(StdSize size);
[1757]25      CBufferOut* getBuffer(size_t timeLine, StdSize size);
26      bool checkBuffer(bool send=false);
[732]27      bool hasPendingRequest(void);
[1227]28      StdSize remain(void);
[1757]29      MPI_Aint getWinAddress(int numWindows) ;
30      void infoBuffer(void) ;
31      bool isNotifiedFinalized(void) ;
[2130]32      void setGrowableBuffer(double growFactor) { growFactor_=growFactor ; isGrowableBuffer_=true ;}
33      void fixBufferSize(size_t bufferSize) { newBufferSize_=bufferSize ; isGrowableBuffer_=false ; resizingBufferStep_=1 ;}
34      void fixBuffer(void) { isGrowableBuffer_=false ;}
[2259]35      void attachWindows(vector<MPI_Win>& windows) ;
[2458]36      bool isAttachedWindows(void) { return isAttachedWindows_ ;}
[732]37    private:
[2130]38       void resizeBuffer(size_t newSize) ;
39       void resizeBufferNotify(void) ;
[2246]40       bool isNotifiedChangeBufferSize(void) ;
[2130]41
42
[732]43      char* buffer[2];
[1757]44      char* bufferHeader[2];
45      size_t* firstTimeLine[2] ;
46      size_t* bufferCount[2] ;
47      size_t* control[2] ;
[2246]48      size_t* notify[2] ;
[1757]49      bool winState[2] ;
[732]50      int current;
[2130]51     
52      double growFactor_=1.2 ;
53      bool isGrowableBuffer_=true ;
[1227]54
[2130]55      int resizingBufferStep_ = 0 ;
56      size_t newBufferSize_ ;
[1227]57      StdSize count;
58      StdSize maxEventSize;
[2130]59      StdSize bufferSize;
[1227]60      const StdSize estimatedMaxEventSize;
[2258]61      bool isFinalized_=false ;
[1227]62
[917]63      const int serverRank;
[1757]64      const int clientRank_;
[732]65      bool pending;
[509]66
[1639]67      MPI_Request request;
[509]68
[732]69      CBufferOut* retBuffer;
[1639]70      const MPI_Comm interComm;
[1757]71      std::vector<MPI_Win> windows_ ;
[2458]72      bool hasWindows=false ;
73      bool isAttachedWindows_=false ;
[2260]74      double latency_=0 ;
[2246]75      double lastCheckedWithNothing_=0 ;
[2258]76      double lastCheckedNotify_=0 ;
[732]77  };
[300]78}
79#endif
Note: See TracBrowser for help on using the repository browser.