Galois
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
galois::DGReduceMax< Ty > Class Template Reference

Distributed max-reducer for getting the max of some value across multiple hosts. More...

#include <DReducible.h>

Public Member Functions

 DGReduceMax ()
 Default constructor; initializes everything to 0. More...
 
void update (const Ty rhs)
 Update the local max-reduced value. More...
 
Ty read_local ()
 Read the local reduced max value; if it has never been reduced, it will attempt get the global value through a reduce (i.e. More...
 
Ty read ()
 Read the global reduced max value. More...
 
Ty reset ()
 Reset this accumulator. More...
 
Ty reduce (std::string runID=std::string())
 Do a max reduction across all hosts by sending data to all other hosts and reducing received data. More...
 

Detailed Description

template<typename Ty>
class galois::DGReduceMax< Ty >

Distributed max-reducer for getting the max of some value across multiple hosts.

Template Parameters
Tytype of value to max-reduce

Constructor & Destructor Documentation

template<typename Ty >
galois::DGReduceMax< Ty >::DGReduceMax ( )
inline

Default constructor; initializes everything to 0.

Member Function Documentation

template<typename Ty >
Ty galois::DGReduceMax< Ty >::read ( )
inline

Read the global reduced max value.

For accurate results, you should call reduce before calling this.

Returns
the global value stored in the accumulator
template<typename Ty >
Ty galois::DGReduceMax< Ty >::read_local ( )
inline

Read the local reduced max value; if it has never been reduced, it will attempt get the global value through a reduce (i.e.

all other hosts should call reduce as well).

Returns
the local value stored in the accumulator or a global value if reduce has never been called
template<typename Ty >
Ty galois::DGReduceMax< Ty >::reduce ( std::string  runID = std::string())
inline

Do a max reduction across all hosts by sending data to all other hosts and reducing received data.

Returns
the max-reduced value after reducing from all hosts.
template<typename Ty >
Ty galois::DGReduceMax< Ty >::reset ( )
inline

Reset this accumulator.

Returns
the previous global value stored in this accumulator (note if never reduced, it will be 0
template<typename Ty >
void galois::DGReduceMax< Ty >::update ( const Ty  rhs)
inline

Update the local max-reduced value.

Parameters
rhsValue to max-reduce locally with

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