27#ifndef EWOMS_MPI_BUFFER_HH
28#define EWOMS_MPI_BUFFER_HH
44template <
class DataType>
80 static_cast<int>(peerRank),
106 static_cast<int>(peerRank),
149 {
return data_.size(); }
170 void setMpiDataType_()
174 if (std::is_same_v<DataType, char>)
176 else if (std::is_same_v<DataType, unsigned char>)
178 else if (std::is_same_v<DataType, short>)
180 else if (std::is_same_v<DataType, unsigned short>)
182 else if (std::is_same_v<DataType, int>)
184 else if (std::is_same_v<DataType, unsigned>)
186 else if (std::is_same_v<DataType, long>)
188 else if (std::is_same_v<DataType, unsigned long>)
190 else if (std::is_same_v<DataType, long long>)
192 else if (std::is_same_v<DataType, unsigned long long>)
194 else if (std::is_same_v<DataType, float>)
196 else if (std::is_same_v<DataType, double>)
198 else if (std::is_same_v<DataType, long double>)
206 void updateMpiDataSize_()
215 std::vector<DataType> data_;
Simplifies handling of buffers to be used in conjunction with MPI.
Definition mpibuffer.hh:46
DataType & operator[](std::size_t i)
Provide access to the buffer data.
Definition mpibuffer.hh:154
const DataType & operator[](std::size_t i) const
Provide access to the buffer data.
Definition mpibuffer.hh:163
void wait()
Wait until the buffer was send to the peer completely.
Definition mpibuffer.hh:90
void resize(std::size_t newSize)
Set the size of the buffer.
Definition mpibuffer.hh:65
void send(unsigned peerRank)
Send the buffer asyncronously to a peer process.
Definition mpibuffer.hh:74
std::size_t size() const
Returns the number of data objects in the buffer.
Definition mpibuffer.hh:148
void receive(unsigned peerRank)
Receive the buffer syncronously from a peer rank.
Definition mpibuffer.hh:100
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