mpi::reduce

#include <mpi.hpp>

Synopsis

template<typename T>
decltype(auto) reduce (T && x, communicator c = {}, int root = 0, bool all = false, MPI_Op op = MPI_SUM)

Template parameters

  • T Type to be reduced.

Parameters

  • x Object to be reduced.

  • c mpi::communicator.

  • root Rank of the root process.

  • all Should all processes receive the result of the reduction.

  • op MPI_Op used in the reduction.

Returns

The result of the specialized mpi_reduce call.