44 #ifndef Foam_Pstream_H 45 #define Foam_Pstream_H 83 const label bufSize = 0
113 template<
class Type,
class... Args>
114 static void broadcasts(
const label comm, Type& arg1, Args&&...
args);
120 template<
class ListType>
133 template<
class T,
class BinaryOp>
178 template<
class T,
class CombineOp>
183 const CombineOp& cop,
194 template<
class T,
class CombineOp>
199 const CombineOp& cop,
205 template<
class T,
class CombineOp>
209 const CombineOp& cop,
222 template<
class T,
class CombineOp>
227 const CombineOp& cop,
235 template<
class T,
class CombineOp>
240 const CombineOp& cop,
246 template<
class T,
class CombineOp>
251 const CombineOp& cop,
265 template<
class Container,
class CombineOp>
269 const CombineOp& cop,
281 template<
class Container,
class CombineOp>
285 const CombineOp& cop,
291 template<
class Container,
class CombineOp>
295 const CombineOp& cop,
372 template<
class Container>
377 const Container& sendBufs,
384 template<
class Container>
388 const Container& sendBufs,
399 template<
class Container>
402 const Container& sendBufs,
419 template<
class Container>
432 template<
class Container,
class Type>
440 const bool wait =
true 448 template<
class Container,
class Type>
456 const bool wait =
true 463 template<
class Container,
class Type>
470 const bool wait =
true 477 template<
class Container,
class Type>
484 const bool wait =
true 498 template<
class Container,
class Type>
505 const bool wait =
true 520 template<
class Container,
class Type>
527 const bool wait =
true 537 template<
class Container,
class Type>
543 const bool wait =
true 589 template<
class Container>
static void listCombineGather(UList< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combines List elements.
static void mapCombineGather(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combine Map elements.
static T listScatterValues(const UList< T > &allValues, const label comm=UPstream::worldComm, const int tag=UPstream::msgType())
Scatter individual values from list locations.
Gather data from all processors onto single processor according to some communication schedule (usual...
static void combineScatter(T &value, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
static void scatter(T &value, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
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...
static void scatterList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Inverse of gatherList. Uses the specified communication schedule.
static void gatherList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
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 List< T > listGatherValues(const T &localValue, const label comm=UPstream::worldComm, const int tag=UPstream::msgType())
Gather individual values into list locations.
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...
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static void gather(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather (reduce) data, applying bop to combine value from different processors. The basis for Foam::re...
Inter-processor communications stream.
static void combineReduce(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...
static void combineGather(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, applying cop to inplace combine value from different processors.
Variant of gather. 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.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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 ...
UPstream(const commsTypes commsType) noexcept
Construct for given communication type.
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 void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual linear/tree communicat...
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...
DynamicList< char > transferBuf_
Allocated transfer buffer (can be used for send or receive)
static void listCombineScatter(List< T > &value, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
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 mapCombineScatter(Container &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
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)
Combines List elements. After completion all processors have the same data.