41template<
class T,
class BinaryOp>
57 for (
const label belowID : myComm.
below())
67 reinterpret_cast<char*
>(&received),
83 fromBelow >> received;
86 value = bop(value, received);
90 if (myComm.
above() != -1)
98 reinterpret_cast<const char*
>(&value),
130 #ifndef Foam_Pstream_scatter_nobroadcast
139 if (myComm.
above() != -1)
147 reinterpret_cast<char*
>(&value),
172 const label belowID = myComm.
below()[belowI];
180 reinterpret_cast<const char*
>(&value),
204template<
class T,
class BinaryOp>
220 #ifndef Foam_Pstream_scatter_nobroadcast
Input inter-processor communications stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output inter-processor communications stream.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void gather(const List< commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
static void scatter(const List< commsStruct > &comms, T &value, const int tag, const label comm)
Broadcast data: Distribute without modification.
virtual bool read()
Re-read model coefficients if they have changed.
Structure for communicating between processors.
const labelList & below() const noexcept
The procIDs of all processors directly below.
label above() const noexcept
The procID of the processor directly above.
static const List< commsStruct > & whichCommunication(const label communicator=worldComm)
static bool & parRun() noexcept
Test if this a parallel run.
virtual bool write()
Write the output fields.
int myProcNo() const noexcept
Return processor number.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
A template class to specify that a data type can be considered as being contiguous in memory.