73 template <
typename T, std::
size_t N>
74 auto mpi_reduce(std::array<T, N>
const &arr,
communicator c = {},
int root = 0,
bool all =
false, MPI_Op op = MPI_SUM) {
75 using value_t = std::remove_cvref_t<decltype(reduce(std::declval<T>()))>;
76 std::array<value_t, N> res{};
98 template <
typename T1, std::
size_t N1,
typename T2, std::
size_t N2>
100 MPI_Op op = MPI_SUM) {
C++ wrapper around MPI_Comm providing various convenience functions.
Provides a C++ wrapper class for an MPI_Comm object.
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.
void mpi_reduce_into(std::array< T1, N1 > const &arr_in, std::array< T2, N2 > &arr_out, communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Implementation of an MPI reduce for a std::array that reduces directly into an existing output array.
void reduce_range(R1 &&in_rg, R2 &&out_rg, communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Implementation of an MPI reduce for std::ranges::sized_range objects.
void broadcast_range(R &&rg, communicator c={}, int root=0)
Implementation of an MPI broadcast for std::ranges::sized_range objects.
void mpi_broadcast(std::array< T, N > &arr, communicator c={}, int root=0)
Implementation of an MPI broadcast for a std::array.
Provides an MPI broadcast, reduce, scatter and gather for generic ranges.
Provides general utilities related to MPI.