30 template<
class Type,
class BinaryOp>
39 const label communicator
42 if (!UPstream::parRun())
47 if (UPstream::nProcs(communicator) <= UPstream::nProcsSimpleSum)
49 if (UPstream::master(communicator))
53 int slave=UPstream::firstSlave();
54 slave<=UPstream::lastSlave(communicator);
79 Value = bop(Value, value);
104 if (UPstream::master(communicator))
108 int slave=UPstream::firstSlave();
109 slave<=UPstream::lastSlave(communicator);
141 UPstream::masterNo(),
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Various functions to wrap MPI_Allreduce.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
errorManip< error > abort(error &err)
DynamicList< MPI_Comm > MPICommunicators_
void allReduce(Type &Value, int count, MPI_Datatype MPIType, MPI_Op op, const BinaryOp &bop, const int tag, const label communicator)