ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::DistributedMin< T > Class Template Reference

the minimum over the processes of a value of each, by reductions that do not block More...

#include <ADS/distributed/MPIExecutor.h>

Public member functions

 DistributedMin (MPI_Comm comm=MPI_COMM_WORLD)
 the minima over the processes of comm
 DistributedMin (const DistributedMin &)=delete
 no copy, since MPI writes into the object
DistributedMin & operator= (const DistributedMin &)=delete
 no copy, since MPI writes into the object
 ~DistributedMin ()
 waits for the reduction in flight, if any
bool start (T v)
 starts the reduction of the value \( v \) of this process, unless one is in flight, and tells whether it did
std::optional< T > test (void)
 the minimum of the last reduction if it has completed, nothing if it is still in flight or none was started
T wait (void)
 the minimum of the reduction in flight, waiting for it
bool inFlight (void) const
 whether a reduction is in flight

Detailed description

template<class T>
class ADS::DistributedMin< T >

the minimum over the processes of a value of each, by reductions that do not block

Constructor and destructor documentation

◆ DistributedMin() [1/2]

template<class T>
ADS::DistributedMin< T >::DistributedMin ( MPI_Comm comm = MPI_COMM_WORLD)
inlineexplicit

the minima over the processes of comm

◆ DistributedMin() [2/2]

template<class T>
ADS::DistributedMin< T >::DistributedMin ( const DistributedMin< T > & )
delete

no copy, since MPI writes into the object

◆ ~DistributedMin()

template<class T>
ADS::DistributedMin< T >::~DistributedMin ( )
inline

waits for the reduction in flight, if any

Member function documentation

◆ inFlight()

template<class T>
bool ADS::DistributedMin< T >::inFlight ( void ) const
inlinenodiscard

whether a reduction is in flight

◆ operator=()

template<class T>
DistributedMin & ADS::DistributedMin< T >::operator= ( const DistributedMin< T > & )
delete

no copy, since MPI writes into the object

◆ start()

template<class T>
bool ADS::DistributedMin< T >::start ( T v)
inline

starts the reduction of the value \( v \) of this process, unless one is in flight, and tells whether it did

In pseudocode (beyond the book):

\[\class{pseudocode}{\begin{array}{r@{\quad}l} 1 & \textbf{function}\ \mathrm{start}( v ) \cr 2 & \quad \textbf{if}\ \text{a reduction is in flight}\ \textbf{then} \ \textbf{return false} \cr 3 & \quad \mathit{in} \gets v;\ \mathrm{MPI\_Iallreduce}( \mathit{in} , \mathit{out} , \min );\ \textbf{return true} \end{array}} \]

◆ test()

template<class T>
std::optional< T > ADS::DistributedMin< T >::test ( void )
inlinenodiscard

the minimum of the last reduction if it has completed, nothing if it is still in flight or none was started

◆ wait()

template<class T>
T ADS::DistributedMin< T >::wait ( void )
inline

the minimum of the reduction in flight, waiting for it

Precondition
a reduction is in flight

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