|
PFUNC
1.0
|
#include <pfunc/parallel_reduce.hpp>
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 |
| TaskMgrType & | taskmgr |
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.
| [in] | space | The iteration space. space is a model of Space concept. |
| [in] | func | The 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.
| typedef PFuncInstanceType::taskmgr pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::TaskMgrType |
| typedef PFuncInstanceType::task pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::TaskType |
| pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::parallel_reduce | ( | SpaceType | space, |
| ReduceExecutable & | func, | ||
| TaskMgrType & | taskmgr | ||
| ) | [inline] |
Constructor
| [in] | space | The space over which to iterate |
| [in] | func | The function to execute over elements in this space |
| [in] | taskmgr | The task manager to use for this parallel_reduce |
TODO: Make parallel_reduce work with global task manager.
| void pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::operator() | ( | void | ) | [inline, virtual] |
Implements pfunc::virtual_functor.
ReduceExecutable& pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::func [private] |
SpaceType pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::space [private] |
TaskMgrType& pfunc::parallel_reduce< PFuncInstanceType, ReduceExecutable, SpaceType >::taskmgr [private] |
1.7.6.1