27#ifndef EWOMS_MPI_BUFFER_HH
28#define EWOMS_MPI_BUFFER_HH
44template <
class DataType>
59 data_ =
new DataType[
size];
91 static_cast<int>(peerRank),
117 static_cast<int>(peerRank),
160 {
return dataSize_; }
181 void setMpiDataType_()
185 if (std::is_same<DataType, char>::value)
187 else if (std::is_same<DataType, unsigned char>::value)
189 else if (std::is_same<DataType, short>::value)
191 else if (std::is_same<DataType, unsigned short>::value)
193 else if (std::is_same<DataType, int>::value)
195 else if (std::is_same<DataType, unsigned>::value)
197 else if (std::is_same<DataType, long>::value)
199 else if (std::is_same<DataType, unsigned long>::value)
201 else if (std::is_same<DataType, long long>::value)
203 else if (std::is_same<DataType, unsigned long long>::value)
205 else if (std::is_same<DataType, float>::value)
207 else if (std::is_same<DataType, double>::value)
209 else if (std::is_same<DataType, long double>::value)
217 void updateMpiDataSize_()
Simplifies handling of buffers to be used in conjunction with MPI.
Definition mpibuffer.hh:46
size_t size() const
Returns the number of data objects in the buffer.
Definition mpibuffer.hh:159
void resize(size_t newSize)
Set the size of the buffer.
Definition mpibuffer.hh:74
const DataType & operator[](size_t i) const
Provide access to the buffer data.
Definition mpibuffer.hh:174
DataType & operator[](size_t i)
Provide access to the buffer data.
Definition mpibuffer.hh:165
void wait()
Wait until the buffer was send to the peer completely.
Definition mpibuffer.hh:101
void send(unsigned peerRank)
Send the buffer asyncronously to a peer process.
Definition mpibuffer.hh:85
void receive(unsigned peerRank)
Receive the buffer syncronously from a peer rank.
Definition mpibuffer.hh:111
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242