35#ifndef Foam_PstreamReduceOps_H
36#define Foam_PstreamReduceOps_H
50template<
class T,
class BinaryOp>
62 Pout<<
"** reducing:" << value <<
" with comm:" << comm <<
endl;
72template<
class T,
class BinaryOp>
89template<
class T,
class BinaryOp>
99 reduce(work, bop, tag, comm);
125template<
class T,
class BinaryOp>
140template<
class T,
class BinaryOp>
156template<
class T,
class BinaryOp>
198#undef Pstream_CommonReductions
199#define Pstream_CommonReductions(Native) \
205 const minOp<Native>&, \
206 const int tag = UPstream::msgType(), \
207 const label comm = UPstream::worldComm \
214 const maxOp<Native>&, \
215 const int tag = UPstream::msgType(), \
216 const label comm = UPstream::worldComm \
223 const sumOp<Native>&, \
224 const int tag = UPstream::msgType(), \
225 const label comm = UPstream::worldComm \
233 const sumOp<Native>&, \
239template<unsigned N> \
242 FixedList<Native, N>& values, \
243 const sumOp<Native>&, \
244 const int tag = UPstream::msgType(), \
245 const label comm = UPstream::worldComm \
248 reduce(values.data(), int(values.size()), sumOp<Native>(), tag, comm); \
259#undef Pstream_CommonReductions
266#undef Pstream_FloatReductions
267#define Pstream_FloatReductions(Native) \
274 const int tag = UPstream::msgType(), \
275 const label comm = UPstream::worldComm \
282 const sumOp<Native>&, \
293 const sumOp<Native>&, \
303#undef Pstream_FloatReductions
#define Pstream_FloatReductions(Native)
#define Pstream_CommonReductions(Native)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void gather(const List< commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
static int & msgType() noexcept
Message tag of standard messages.
static label worldComm
Default communicator (all processors)
static const List< commsStruct > & whichCommunication(const label communicator=worldComm)
static bool & parRun() noexcept
Test if this a parallel run.
static void printStack(Ostream &os)
Helper function to print a stack.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
void sumReduce(T &value, label &count, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...