79 #undef Pstream_CommonReductions 80 #define Pstream_CommonReductions(Native, TaggedType) \ 86 const minOp<Native>&, \ 91 PstreamDetail::allReduce<Native> \ 93 values, size, TaggedType, MPI_MIN, comm \ 101 const maxOp<Native>&, \ 106 PstreamDetail::allReduce<Native> \ 108 values, size, TaggedType, MPI_MAX, comm \ 116 const sumOp<Native>&, \ 121 PstreamDetail::allReduce<Native> \ 123 values, size, TaggedType, MPI_SUM, comm \ 130 const minOp<Native>&, \ 135 PstreamDetail::allReduce<Native> \ 137 &value, 1, TaggedType, MPI_MIN, comm \ 144 const maxOp<Native>&, \ 149 PstreamDetail::allReduce<Native> \ 151 &value, 1, TaggedType, MPI_MAX, comm \ 158 const sumOp<Native>&, \ 163 PstreamDetail::allReduce<Native> \ 165 &value, 1, TaggedType, MPI_SUM, comm \ 174 #undef Pstream_FloatReductions 175 #define Pstream_FloatReductions(Native, TaggedType) \ 177 Pstream_CommonReductions(Native, TaggedType); \ 183 const sumOp<Native>&, \ 189 PstreamDetail::allReduce<Native> \ 191 values, size, TaggedType, MPI_SUM, comm, &requestID \ 198 const sumOp<Native>&, \ 204 PstreamDetail::allReduce<Native> \ 206 &value, 1, TaggedType, MPI_SUM, comm, &requestID \ 210 void Foam::sumReduce \ 218 if (UPstream::parRun() && UPstream::nProcs(comm) > 1) \ 221 values[0] = static_cast<Native>(count); \ 224 PstreamDetail::allReduce<Native> \ 226 values, 2, TaggedType, MPI_SUM, comm \ 229 count = static_cast<label>(values[0]); \ 248 #undef Pstream_CommonReductions 249 #undef Pstream_FloatReductions #define Pstream_CommonReductions(Native, TaggedType)
Inter-processor communication reduction functions.
#define Pstream_FloatReductions(Native, TaggedType)
static void reduceOr(bool &value, const label communicator=worldComm)
Logical (or) reduction (cf. MPI AllReduce)
void allReduce(Type *values, int count, MPI_Datatype datatype, MPI_Op optype, const label comm, label *requestID=nullptr)
static void reduceAnd(bool &value, const label communicator=worldComm)
Logical (and) reduction (cf. MPI AllReduce)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.