78 #undef Pstream_CommonReductions 79 #define Pstream_CommonReductions(Native, TaggedType) \ 85 const minOp<Native>&, \ 90 PstreamDetail::allReduce<Native> \ 92 values, size, TaggedType, MPI_MIN, comm \ 100 const maxOp<Native>&, \ 105 PstreamDetail::allReduce<Native> \ 107 values, size, TaggedType, MPI_MAX, comm \ 115 const sumOp<Native>&, \ 120 PstreamDetail::allReduce<Native> \ 122 values, size, TaggedType, MPI_SUM, comm \ 129 const minOp<Native>&, \ 134 PstreamDetail::allReduce<Native> \ 136 &value, 1, TaggedType, MPI_MIN, comm \ 143 const maxOp<Native>&, \ 148 PstreamDetail::allReduce<Native> \ 150 &value, 1, TaggedType, MPI_MAX, comm \ 157 const sumOp<Native>&, \ 162 PstreamDetail::allReduce<Native> \ 164 &value, 1, TaggedType, MPI_SUM, comm \ 173 #undef Pstream_FloatReductions 174 #define Pstream_FloatReductions(Native, TaggedType) \ 176 Pstream_CommonReductions(Native, TaggedType); \ 182 const sumOp<Native>&, \ 185 UPstream::Request& req \ 188 PstreamDetail::allReduce<Native> \ 190 values, size, TaggedType, MPI_SUM, comm, &req, nullptr \ 199 const sumOp<Native>&, \ 205 PstreamDetail::allReduce<Native> \ 207 values, size, TaggedType, MPI_SUM, comm, nullptr, &requestID \ 214 const sumOp<Native>&, \ 217 UPstream::Request& req \ 220 PstreamDetail::allReduce<Native> \ 222 &value, 1, TaggedType, MPI_SUM, comm, &req, nullptr \ 230 const sumOp<Native>&, \ 236 PstreamDetail::allReduce<Native> \ 238 &value, 1, TaggedType, MPI_SUM, comm, nullptr, &requestID \ 242 void Foam::sumReduce \ 250 if (UPstream::is_parallel(comm)) \ 253 values[0] = static_cast<Native>(count); \ 256 PstreamDetail::allReduce<Native> \ 258 values, 2, TaggedType, MPI_SUM, comm \ 261 count = static_cast<label>(values[0]); \ 271 #undef Pstream_BitwiseReductions 272 #define Pstream_BitwiseReductions(Native, TaggedType) \ 278 const bitOrOp<Native>&, \ 283 PstreamDetail::allReduce<Native> \ 285 values, size, TaggedType, MPI_BOR, comm \ 292 const bitOrOp<Native>&, \ 297 PstreamDetail::allReduce<Native> \ 299 &value, 1, TaggedType, MPI_BOR, comm \ 319 #undef Pstream_CommonReductions 320 #undef Pstream_FloatReductions 321 #undef Pstream_BitwiseReductions #define Pstream_CommonReductions(Native, TaggedType)
Inter-processor communication reduction functions.
#define Pstream_FloatReductions(Native, TaggedType)
Functions to wrap MPI_Bcast, MPI_Allreduce, MPI_Iallreduce etc.
static void reduceOr(bool &value, const label communicator=worldComm)
Logical (or) reduction (MPI_AllReduce)
static void reduceAnd(bool &value, const label communicator=worldComm)
Logical (and) reduction (MPI_AllReduce)
#define Pstream_BitwiseReductions(Native, TaggedType)
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
void allReduce(Type *values, int count, MPI_Datatype datatype, MPI_Op optype, const label comm, UPstream::Request *req=nullptr, label *requestID=nullptr)