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

Last change on this file since 2549 was 2547, checked in by ymipsl, 10 months ago

Major update :

  • New method to lock and unlock one-sided windows (window_dynamic) to avoid network overhead
  • Introducing multithreading on server sided to manage more efficiently dead-lock occuring (similar to co-routine which will be available and implemented in futur c++ standard), based on c++ threads
  • Suprression of old "attached mode" which is replaced by online writer and reder filters

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