* communicator.
*/
template <typename T>
- std::vector<T>
+ [[nodiscard]] std::vector<T>
all_gather(const MPI_Comm comm, const T &object_to_send);
/**
* communicator. All other processes receive an empty vector.
*/
template <typename T>
- std::vector<T>
+ [[nodiscard]] std::vector<T>
gather(const MPI_Comm comm,
const T &object_to_send,
const unsigned int root_process = 0);
* @return Every process receives an object from the root_process.
*/
template <typename T>
- T
+ [[nodiscard]] T
scatter(const MPI_Comm comm,
const std::vector<T> &objects_to_send,
const unsigned int root_process = 0);
* `MPI_Bcast` and return the result.
*/
template <typename T>
- T
+ [[nodiscard]] T
broadcast(const MPI_Comm comm,
const T &object_to_send,
const unsigned int root_process = 0);
* single rank. On all other processes, the returned value is undefined.
*/
template <typename T>
- T
+ [[nodiscard]] T
reduce(const T &local_value,
const MPI_Comm comm,
const std::function<T(const T &, const T &)> &combiner,
* by MPI.
*/
template <typename T, typename = std::enable_if_t<is_mpi_type<T> == true>>
- std::pair<T, T>
+ [[nodiscard]] std::pair<T, T>
partial_and_total_sum(const T &value, const MPI_Comm comm);
* can be handled.
*/
template <typename T>
- T
+ [[nodiscard]] T
all_reduce(const T &local_value,
const MPI_Comm comm,
const std::function<T(const T &, const T &)> &combiner);