41 template<
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),
124 const List<UPstream::commsStruct>& comms,
130 #ifndef Foam_Pstream_scatter_nobroadcast 139 if (myComm.above() != -1)
141 if (is_contiguous<T>::value)
147 reinterpret_cast<char*
>(&value),
172 const label belowID = myComm.below()[belowI];
174 if (is_contiguous<T>::value)
180 reinterpret_cast<const char*>(&value),
204 template<
class T,
class BinaryOp>
220 #ifndef Foam_Pstream_scatter_nobroadcast const labelList & below() const noexcept
The procIDs of all processors directly below.
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Write buffer contents to given processor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static bool & parRun() noexcept
Test if this a parallel run.
static const List< commsStruct > & whichCommunication(const label communicator=worldComm)
Communication schedule for linear/tree all-to-master (proc 0). Chooses based on the value of UPstream...
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
label above() const noexcept
The procID of the processor directly above.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
static void gather(const List< commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Gather (reduce) data, appyling bop to combine value from different processors. The basis for Foam::re...
Input inter-processor communications stream.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator) is 1 for serial run.
"scheduled" : (MPI_Send, MPI_Recv)
Structure for communicating between processors.
Output inter-processor communications stream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A template class to specify that a data type can be considered as being contiguous in memory...
#define forAllReverse(list, i)
Reverse loop across all elements in list.
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Read buffer contents from given processor.
static void scatter(const List< commsStruct > &comms, T &value, const int tag, const label comm)
Broadcast data: Distribute without modification.