PFUNC 1.0
Public Types | Public Member Functions | Private Attributes
pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType > Struct Template Reference

#include <pfunc/parallel_reduce.hpp>

Inheritance diagram for pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >:
pfunc::virtual_functor

List of all members.

Public Types

typedef PFuncInstanceType::taskmgr TaskMgrType
typedef PFuncInstanceType::task TaskType

Public Member Functions

 parallel_reduce (SpaceType space, ReduceExecutable &func, TaskMgrType &taskmgr)
void operator() (void)

Private Attributes

SpaceType space
ReduceExecutable & func
TaskMgrTypetaskmgr

Detailed Description

template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
struct pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >

A function much akin to accumulate in STL. Takes in a range and a functor. The assumption is that the functor has the access to the entire container and hence all the harness needs to do is provide access to the correct range.

Parameters:
[in]spaceThe iteration space. space is a model of Space concept.
[in]funcThe function object to be applied to every element. This function object has to take in an object of space_1D. i.e., void operator (const space_1D& space) { ... } must be defined on func. func is a model of ReduceExecutable concept.

NOTE: This function currently uses a local task manager.

NOTE: To use parallel_reduce, the Functor used in PFuncInstanceType must be pfunc::use_default! If a definite type is given, parallel_reduce fails to execute.


Member Typedef Documentation

template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
typedef PFuncInstanceType::taskmgr pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::TaskMgrType
template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
typedef PFuncInstanceType::task pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::TaskType

Constructor & Destructor Documentation

template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::parallel_reduce ( SpaceType  space,
ReduceExecutable &  func,
TaskMgrType taskmgr 
) [inline]

Constructor

Parameters:
[in]spaceThe space over which to iterate
[in]funcThe function to execute over elements in this space
[in]taskmgrThe task manager to use for this parallel_reduce

TODO: Make parallel_reduce work with global task manager.


Member Function Documentation

template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
void pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::operator() ( void  ) [inline, virtual]

Member Data Documentation

template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
ReduceExecutable& pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::func [private]
template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
SpaceType pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::space [private]
template<typename PFuncInstanceType, typename ReduceExecutable, typename SpaceType>
TaskMgrType& pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::taskmgr [private]

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