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 the processors directly below.
static label read(const UPstream::commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, UPstream::Request *req=nullptr)
Read buffer contents from given processor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
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 communicator ranks. Does nothing in non-paral...
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.
"scheduled" : (MPI_Send, MPI_Recv)
static bool is_parallel(const label communicator=worldComm)
True if parallel algorithm or exchange is required.
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...
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, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal)
Write buffer contents to given processor.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
static void scatter(const List< commsStruct > &comms, T &value, const int tag, const label comm)
Broadcast data: Distribute without modification.