source: XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/buffer_server.hpp @ 1853

Last change on this file since 1853 was 1757, checked in by ymipsl, 5 years ago

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

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