#ifndef __ONE_SIDED_CLIENT_BUFFER_HPP__ #define __ONE_SIDED_CLIENT_BUFFER_HPP__ #include "xios_spl.hpp" #include "buffer_out.hpp" #include "mpi.hpp" #include "cxios.hpp" #include "event_client.hpp" #include "one_sided_cs_buffer_base.hpp" namespace xios { extern CLogType logProtocol ; class COneSidedClientBuffer : public COneSidedCSBufferBase { class CBuffer { char* buffer_ ; size_t start_ ; size_t end_ ; size_t count_ ; size_t size_ ; bool fixed_ ; MPI_Win window_ ; public: CBuffer(MPI_Win window, size_t size, bool fixed) : start_(size), end_(0), count_(0), size_(size), fixed_(fixed), window_(window) { size_t trueSize = (size/8 + 1)*8 + 8 ; // seems to have some problem with OpenMPi/UCX when trying to tranfer 1 byte // at the end of the buffer. Alignment problem ? Or simple bug ? Seems that allocate // greater buffer solves the problem MPI_Alloc_mem(trueSize, MPI_INFO_NULL, &buffer_) ; info(logProtocol)<<"Attach memory to windows : addr="<<(MPI_Aint)buffer_<<" count="<0) ERROR("COneSidedClientBuffer::~CBuffer()",<<"Try to delete buffer that is not empty"< windows_ ; vector usedWindows_ ; int currentWindow_ ; int maxWindows_ ; MPI_Win winControl_ ; int serverRank_ ; std::list buffers_ ; std::list blocs_ ; std::list::iterator lastBlocEvent_ ; CBuffer* currentBuffer_=nullptr ; std::list requests_ ; bool fixed_=false; size_t fixedSize_ = 0 ; size_t currentBufferSize_=0 ; double growingFactor_ = 2. ; MPI_Aint lastFreedBloc_=0 ; bool isFinalized_ = false ; } ; } #endif