67 template <
typename T1,
typename T2>
68 auto mpi_reduce(std::pair<T1, T2>
const &p,
communicator c = {},
int root = 0,
bool all =
false, MPI_Op op = MPI_SUM) {
69 return std::make_pair(
reduce(p.first, c, root, all, op),
reduce(p.second, c, root, all, op));
C++ wrapper around MPI_Comm providing various convenience functions.
auto mpi_reduce(std::array< T, N > const &arr, communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Implementation of an MPI reduce for a std::array.
decltype(auto) reduce(T &&x, communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Generic MPI reduce.
void mpi_broadcast(std::array< T, N > &arr, communicator c={}, int root=0)
Implementation of an MPI broadcast for a std::arr.
void broadcast(T &&x, communicator c={}, int root=0)
Generic MPI broadcast.
Includes all relevant mpi headers.