Go to the documentation of this file.
41 commsType_(commsType),
45 sendBuf_(UPstream::nProcs(comm)),
46 recvBuf_(UPstream::nProcs(comm)),
47 recvBufPos_(UPstream::nProcs(comm),
Zero),
48 finishedSendsCalled_(
false)
59 if (recvBufPos_[proci] < recvBuf_[proci].size())
62 <<
"Message from processor " << proci
63 <<
" Only consumed " << recvBufPos_[proci] <<
" of "
64 << recvBuf_[proci].size() <<
" bytes" <<
nl
76 finishedSendsCalled_ =
true;
80 Pstream::exchange<DynamicList<char>,
char>
95 finishedSendsCalled_ =
true;
101 Pstream::exchange<DynamicList<char>,
char>
114 <<
"Obtaining sizes not supported in "
116 <<
" since transfers already in progress. Use non-blocking instead."
136 finishedSendsCalled_ =
false;
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
~PstreamBuffers()
Destructor - checks that all data have been consumed.
static constexpr const zero Zero
Global zero (0)
static void exchangeSizes(const Container &sendData, labelList &sizes, const label comm=UPstream::worldComm)
Helper: exchange sizes of sendData. sendData is the data per.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void clear()
Reset (clear) individual buffers and reset state.
#define forAll(list, i)
Loop across all elements in list.
static const Enum< commsTypes > commsTypeNames
Names of the communication types.
void finishedSends(const bool block=true)
Mark all sends as having been done.
streamFormat
Data format (ascii | binary)
errorManip< error > abort(error &err)
errorManipArg< error, int > exit(error &err, const int errNo=1)
commsTypes
Types of communications.
PstreamBuffers(const UPstream::commsTypes commsType, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct given comms type, communication options, IO format.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.