43 #ifndef Foam_Pstream_H 44 #define Foam_Pstream_H 69 template<
class Container,
class T>
70 static void exchangeContainer
83 static void exchangeBuf
115 const label bufSize = 0
144 template<
class Type,
class... Args>
145 static void broadcasts(
const label comm, Type& arg1, Args&&...
args);
153 template<
class T,
class BinaryOp>
166 template<
class T,
class BinaryOp>
183 template<
class T,
class CombineOp>
188 const CombineOp& cop,
196 template<
class T,
class CombineOp>
200 const CombineOp& cop,
211 template<
class T,
class CombineOp>
216 const CombineOp& cop,
227 template<
class T,
class CombineOp>
231 const CombineOp& cop,
237 template<
class T,
class CombineOp>
241 const CombineOp& cop,
252 template<
class T,
class CombineOp>
255 const List<commsStruct>& comms,
257 const CombineOp& cop,
263 template<
class T,
class CombineOp>
267 const CombineOp& cop,
273 template<
class T,
class CombineOp>
277 const CombineOp& cop,
283 template<
class T,
class CombineOp>
287 const CombineOp& cop,
299 template<
class Container,
class CombineOp>
304 const CombineOp& cop,
310 template<
class Container,
class CombineOp>
314 const CombineOp& cop,
326 template<
class Container,
class CombineOp>
330 const CombineOp& cop,
336 template<
class Container,
class CombineOp>
340 const CombineOp& cop,
459 template<
class Container>
469 template<
class Container>
502 template<
class Container>
507 const Container& sendData,
516 template<
class Container>
519 const Container& sendData,
528 template<
class Container,
class T>
536 const bool wait =
true 543 template<
class Container,
class T>
550 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 exchange(const UList< Container > &sendData, const labelUList &recvSizes, List< Container > &recvData, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool wait=true)
Helper: exchange contiguous data. Sends sendData, receives into recvData.
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
Types of communications.
Pstream(const UPstream::commsTypes commsType, const label bufSize=0)
Construct for given commsTypes, with optional buffer size.
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
Default world communicator (all processors). May differ from globalComm if local worlds are in use...
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...
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.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all processes in communicator.
static void combineAllGather(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Same as Pstream::combineReduce.
static void exchangeSizes(const labelUList &sendProcs, const labelUList &recvProcs, const Container &sendData, labelList &sizes, const label tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Helper: exchange sizes of sendData for specified set of send/receive processes.
static void listCombineGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
static bool broadcast(char *buf, const std::streamsize bufSize, const label communicator=worldComm, const int rootProcNo=masterNo())
Broadcast buffer contents to all processes in communicator. The sizes must match on all processes...
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.
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.