ALPSCore reference
Public Member Functions | List of all members
alps::alea::reducer Struct Referenceabstract

#include <core.hpp>

Inheritance diagram for alps::alea::reducer:
Inheritance graph
Collaboration diagram for alps::alea::reducer:
Collaboration graph

Public Member Functions

virtual reducer_setup get_setup () const =0
 
virtual long get_max (long value) const =0
 
virtual void reduce (view< double > data) const =0
 
virtual void reduce (view< long > data) const =0
 
virtual void commit () const =0
 
virtual reducerclone ()
 
virtual ~reducer ()
 
void reduce (view< std::complex< double > > data) const
 
void reduce (view< complex_op< double > > data) const
 
void reduce (view< unsigned long > data) const
 

Detailed Description

Interface to performing sum-reduction with data from reducer source.

Applications will typically start by checking get_setup() to find out whether this core/thread will get a copy of the result, but this is not required

The reduce() family of methods take the data view and add to it the data from the reducers source (possibly by performing an MPI/OpenMP reduction or gathering data from files, etc.).

Reducers need not perform the reductions immediately (they are allowed to group them for increased performance.) A call to commit() marks a synchronization point, after which the sum-reduced data must be available on all instances which have reducer_setup.have_result set.

This facade allows us to abstract away the type of reduction, but most importantly does not pull in a mandatory MPI dependency for the use of the accumulators.

See also
alps::alea::mpi_reducer

Definition at line 265 of file core.hpp.

Constructor & Destructor Documentation

virtual alps::alea::reducer::~reducer ( )
inlinevirtual

Destructor

Definition at line 286 of file core.hpp.

Member Function Documentation

virtual reducer* alps::alea::reducer::clone ( )
inlinevirtual

Returns a copy of *this created using new

Definition at line 283 of file core.hpp.

virtual void alps::alea::reducer::commit ( ) const
pure virtual

Finish reduction of all data if deferred

Implemented in alps::alea::mpi_reducer.

virtual long alps::alea::reducer::get_max ( long  value) const
pure virtual

Get maximum of scalar value over all instances (immediate)

Implemented in alps::alea::mpi_reducer.

virtual reducer_setup alps::alea::reducer::get_setup ( ) const
pure virtual

Set-up reduction operation

Implemented in alps::alea::mpi_reducer.

virtual void alps::alea::reducer::reduce ( view< double >  data) const
pure virtual

Reduce double data-set into data

Implemented in alps::alea::mpi_reducer.

virtual void alps::alea::reducer::reduce ( view< long >  data) const
pure virtual

Reduce long data-set into data

Implemented in alps::alea::mpi_reducer.

void alps::alea::reducer::reduce ( view< std::complex< double > >  data) const
inline

Definition at line 290 of file core.hpp.

void alps::alea::reducer::reduce ( view< complex_op< double > >  data) const
inline

Definition at line 293 of file core.hpp.

void alps::alea::reducer::reduce ( view< unsigned long >  data) const
inline

Definition at line 296 of file core.hpp.


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