40#ifndef Foam_OPstream_H
41#define Foam_OPstream_H
68 const int bufferSize = 0,
165 template<
class Type,
class... Args>
168 const int communicator,
streamFormat
Data format (ascii | binary | coherent).
OPBstream(const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct with optional communicator and write format.
static void send(const Type &value, const int communicator=UPstream::worldComm)
Serialize a value and broadcast (root == UPstream::masterNo()). Uses operator<< for serialization.
static void sends(const int communicator, Type &value, Args &&... values)
Serialize multiple items and broadcast the buffer Uses operator<< for serialization.
static void send(const Type &value, const int toProcNo, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Serialize a value and send (standard mode). Uses operator<< for serialization.
OPstream(const UPstream::commsTypes commsType, const int toProcNo, const int bufferSize=0, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct for given process index to send to.
static void send(const Type &value, const UPstream::commsTypes commsType, const int toProcNo, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Serialize a value and send (buffered/blocking or standard mode). Uses operator<< for serialization.
Pstream(const UPstream::commsTypes commsType) noexcept
Construct for communication type with empty buffer.
UOPBstream(DynamicList< char > &sendBuf, const int communicator=UPstream::worldComm, const bool sendAtDestruct=true, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct with attached send buffer, optional communication characteristics and IO format.
static void send(Foam::zero, int communicator, int root=0)
Broadcast a zero value (buffer) size that can be matched by the UIPBstream constructor.
UOPstream(const UPstream::commsTypes commsType, const int toProcNo, DynamicList< char > &sendBuf, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, const bool sendAtDestruct=true, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct given process index to write to using the given attached send buffer, optional communicatio...
bool send()
Send buffer contents now and not in destructor [advanced usage]. Returns true on success.
Wrapper for internally indexed communicator label. Always invokes UPstream::allocateCommunicatorCompo...
commsTypes
Communications types.
@ scheduled
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
static int & msgType() noexcept
Message tag of standard messages.
commsTypes commsType() const noexcept
Get the communications type of the stream.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
OBJstream os(runTime.globalPath()/outputName)
void outputLoop(OS &os, const Type &arg1, Args &&... args)
Output looping. Write first parameter and recurse.