44 #ifndef Foam_Pstream_H 45 #define Foam_Pstream_H 86 const label bufSize = 0
116 template<
class Type,
class... Args>
117 static void broadcasts(
const label comm, Type& arg1, Args&&...
args);
123 template<
class ListType>
136 template<
class T,
class BinaryOp>
149 template<
class T,
class BinaryOp>
166 template<
class T,
class CombineOp>
171 const CombineOp& cop,
179 template<
class T,
class CombineOp>
183 const CombineOp& cop,
194 template<
class T,
class CombineOp>
199 const CombineOp& cop,
210 template<
class T,
class CombineOp>
214 const CombineOp& cop,
220 template<
class T,
class CombineOp>
224 const CombineOp& cop,
235 template<
class T,
class CombineOp>
238 const List<commsStruct>& comms,
240 const CombineOp& cop,
246 template<
class T,
class CombineOp>
250 const CombineOp& cop,
256 template<
class T,
class CombineOp>
260 const CombineOp& cop,
266 template<
class T,
class CombineOp>
270 const CombineOp& cop,
282 template<
class Container,
class CombineOp>
287 const CombineOp& cop,
293 template<
class Container,
class CombineOp>
297 const CombineOp& cop,
309 template<
class Container,
class CombineOp>
313 const CombineOp& cop,
319 template<
class Container,
class CombineOp>
323 const CombineOp& cop,
442 template<
class Container>
452 template<
class Container>
484 template<
class Container>
489 const Container& sendBufs,
496 template<
class Container>
500 const Container& sendBufs,
511 template<
class Container>
514 const Container& sendBufs,
531 template<
class Container>
544 template<
class Container,
class Type>
552 const bool wait =
true 560 template<
class Container,
class Type>
568 const bool wait =
true 575 template<
class Container,
class Type>
582 const bool wait =
true 589 template<
class Container,
class Type>
596 const bool wait =
true 610 template<
class Container,
class Type>
617 const bool wait =
true 632 template<
class Container,
class Type>
639 const bool wait =
true 649 template<
class Container,
class Type>
655 const bool wait =
true static void mapCombineGather(const List< commsStruct > &comms, Container &values, const CombineOp &cop, const int tag, const label comm)
Gather data from all processors onto single processor according to some communication schedule (usual...
static void combineScatter(const List< commsStruct > &comms, T &value, const int tag, const label comm)
Broadcast data: Distribute without modification.
static void mapCombineScatter(const List< commsStruct > &comms, Container &values, const int tag, const label comm)
Broadcast data: Distribute without modification.
static void mapCombineAllGather(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Same as Pstream::mapCombineReduce.
commsTypes
Communications types.
Pstream(const UPstream::commsTypes commsType, const label bufSize=0)
Construct for given communication type, with optional buffer size.
static void broadcastList(ListType &list, const label comm=UPstream::worldComm)
Broadcast list content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setCapacity(const label len)
Alter the size of the underlying storage.
static int & msgType() noexcept
Message tag of standard messages.
Gather data from all processors onto single processor according to some communication schedule (usual...
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
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...
static void allGatherList(List< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses linear/tree communication. ...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
static void combineGather(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag, const label comm)
Gather data, applying cop to inplace combine value from different processors.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &value, const int tag, const label comm)
Broadcast data: Distribute without modification.
Inter-processor communications stream.
Variant of gather, scatter. Normal gather uses:
static void listCombineAllGather(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Same as Pstream::listCombineReduce.
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
commsTypes commsType() const noexcept
Get the communications type of the stream.
static void exchange(const UList< Container > &sendBufs, const labelUList &recvSizes, List< Container > &recvBufs, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool wait=true)
Helper: exchange contiguous data. Sends sendBufs, receives into recvBufs using predetermined receive ...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
ClassName("Pstream")
Declare name of the class and its debug switch.
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all communicator ranks. Does nothing in non-parallel. ...
static bool broadcast(char *buf, const std::streamsize bufSize, const label communicator, const int rootProcNo=masterNo())
Broadcast buffer contents to all processes in given communicator. The sizes must match on all process...
static void exchangeSizes(const labelUList &sendProcs, const labelUList &recvProcs, const Container &sendBufs, labelList &sizes, const label tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Helper: exchange sizes of sendBufs for specified send/recv ranks.
static void combineAllGather(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Same as Pstream::combineReduce.
static void exchangeConsensus(const UList< Container > &sendBufs, List< Container > &recvBufs, const int tag, const label comm, const bool wait=true)
Exchange contiguous data using non-blocking consensus (NBX) Sends sendData, receives into recvData...
static void listCombineGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
DynamicList< char > transferBuf_
Allocated transfer buffer (can be used for send or receive)
static void mapCombineReduce(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine map values from different processo...
Foam::argList args(argc, argv)
Inter-processor communications stream.
static void scatter(const List< commsStruct > &comms, T &value, const int tag, const label comm)
Broadcast data: Distribute without modification.
A HashTable to objects of type <T> with a label key.
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
After completion all processors have the same data.
static void scatterList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Scatter data. Reverse of gatherList.