SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | List of all members
Reducer< T > Class Template Reference

#include <Reducer.h>

Inheritance diagram for Reducer< T >:
Barrier

Public Types

typedef T(* ReductionOp )(const T &, const T &)
 The function that performs the reduction. More...
 

Public Member Functions

 Reducer (const char *name, ReductionOp)
 
virtual ~Reducer ()
 Destroy the Reducer and free associated memory. More...
 
reduce (int myrank, int numThreads, const T &value)
 
- Public Member Functions inherited from Barrier
 Barrier (const char *name)
 
virtual ~Barrier ()
 Destroy the barrier. More...
 
void wait (int numThreads)
 

Member Typedef Documentation

typedef T(* ReductionOp)(const T &, const T &)

The function that performs the reduction.

Constructor & Destructor Documentation

Reducer ( const char *  name,
ReductionOp   
)

Create a Reducer. At each operation, a barrier wait is performed, and the operation will be performed to compute the global balue. name should be a static string which describes the primitive for debugging purposes. op is a function which will compute a reduced value from a pair of values. op should be associative and commutative, even up to floating point errors.

~Reducer ( )
virtual

Destroy the Reducer and free associated memory.

Member Function Documentation

T reduce ( int  myrank,
int  numThreads,
const T &  value 
)

Performs a global reduction over all of the threads. As soon as each thread has called reduce with their local value, each thread will return the same global reduced value.


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