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),
151 {
return data_.size(); }
172 void setMpiDataType_()
176 if constexpr (std::is_same_v<DataType, char>) {
179 else if constexpr (std::is_same_v<DataType, unsigned char>) {
182 else if constexpr (std::is_same_v<DataType, short>) {
185 else if constexpr (std::is_same_v<DataType, unsigned short>) {
188 else if constexpr (std::is_same_v<DataType, int>) {
191 else if constexpr (std::is_same_v<DataType, unsigned>) {
194 else if constexpr (std::is_same_v<DataType, long>) {
197 else if constexpr (std::is_same_v<DataType, unsigned long>) {
200 else if constexpr (std::is_same_v<DataType, long long>) {
203 else if constexpr (std::is_same_v<DataType, unsigned long long>) {
206 else if constexpr (std::is_same_v<DataType, float>) {
209 else if constexpr (std::is_same_v<DataType, double>) {
212 else if constexpr (std::is_same_v<DataType, long double>) {
221 void updateMpiDataSize_()
231 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:156
const DataType & operator[](std::size_t i) const
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: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:150
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 blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240