Definition
MPI_Reduce is the means by which MPI process can apply a reduction calculation. The values sent by the MPI processes will be combined using the reduction operation given and the result will be stored on the MPI process specified as root. MPI_Reduce is a collective operation; it must be called by every MPI process in the communicator given. Predefined operations are: MPI_MIN, MPI_MAX, MPI_MINLOC, MPI_MAXLOC, MPI_BOR, MPI_BXOR, MPI_LOR, MPI_LXOR, MPI_BAND, MPI_LAND, MPI_SUM and MPI_PROD. Other variants of MPI_Reduce are MPI_Ireduce, MPI_Allreduce, MPI_Iallreduce. Refer to MPI_Ireduce to see the non-blocking counterpart of MPI_Reduce.
int MPI_Reduce(const void* send_buffer,
void* receive_buffer,
int count,
MPI_Datatype datatype,
MPI_Op operation,
int root,
MPI_Comm communicator);