KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::plugin::reproducible_reduce::ReproducibleCommunicator< T, Communicator > Class Template Reference

Communicator that can reproducibly reduce an array of a fixed size according to a binary tree scheme. More...

#include <reproducible_reduce.hpp>

Public Member Functions

 ReproducibleCommunicator (Communicator const &comm, std::map< size_t, size_t > const start_indices, size_t const region_begin, size_t const region_size)
 Create a new reproducible communicator.
 
template<typename... Args>
T const reproducible_reduce (Args... args)
 Reproducible reduction according to pre-initialized scheme. The following parameters are required:
 

Detailed Description

template<typename T, typename Communicator>
class kamping::plugin::reproducible_reduce::ReproducibleCommunicator< T, Communicator >

Communicator that can reproducibly reduce an array of a fixed size according to a binary tree scheme.

Template Parameters
TType of the elements that are to be reduced.
DefaultContainerTypeContainer type of the original communicator.

Constructor & Destructor Documentation

◆ ReproducibleCommunicator()

template<typename T , typename Communicator >
kamping::plugin::reproducible_reduce::ReproducibleCommunicator< T, Communicator >::ReproducibleCommunicator ( Communicator const & comm,
std::map< size_t, size_t > const start_indices,
size_t const region_begin,
size_t const region_size )
inline

Create a new reproducible communicator.

Template Parameters
CommType of the communicator.
Parameters
commUnderlying communicator to transport messages.
start_indicesMap from global array indices onto ranks on which they are held. Must have no gaps, start at index 0 and contain a sentinel element at the end.
region_beginIndex of the first element that is held locally.
region_sizeNumber of elements assigned to the current rank.

Member Function Documentation

◆ reproducible_reduce()

template<typename T , typename Communicator >
template<typename... Args>
T const kamping::plugin::reproducible_reduce::ReproducibleCommunicator< T, Communicator >::reproducible_reduce ( Args... args)
inline

Reproducible reduction according to pre-initialized scheme. The following parameters are required:

Parameters
argsAll required arguments as described above.
Returns
Final reduction result obtained by applying the operation in a fixed order to all input elements across PEs.

The documentation for this class was generated from the following file: