MADNESS  version 0.9
Classes | Public Member Functions | Friends | List of all members
madness::WorldTaskQueue Class Reference

Multi-threaded queue to manage and run tasks. More...

#include <worldtask.h>

Inheritance diagram for madness::WorldTaskQueue:
Inheritance graph
[legend]
Collaboration diagram for madness::WorldTaskQueue:
Collaboration graph
[legend]

Public Member Functions

 WorldTaskQueue (World &world)
 
size_t size () const
 Returns the number of pending tasks. More...
 
void add (TaskInterface *t)
 Add a new local task taking ownership of the pointer. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
TaskFn< fnT, a1T, a2T, a3T,
a4T, a5T, a6T, a7T, a8T, a9T >
::futureT 
add (TaskFn< fnT, a1T, a2T, a3T, a4T, a5T, a6T, a7T, a8T, a9T > *t)
 
template<typename resultT , typename rangeT , typename opT >
Future< resultT > reduce (const rangeT &range, const opT &op)
 Reduce op(item) for all items in range using op(sum,op(item)) More...
 
template<typename rangeT , typename opT >
Future< bool > for_each (const rangeT &range, const opT &op)
 Apply op(item) for all items in range. More...
 
template<typename fnT >
detail::function_enabler< fnT >
::type 
add (fnT fn, const TaskAttributes &attr=TaskAttributes())
 Spawn a local task. More...
 
template<typename fnT , typename a1T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T , typename a3T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::function_enabler< fnT >
::type 
add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes &attr=TaskAttributes())
 
template<typename fnT >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const TaskAttributes &attr=TaskAttributes())
 Spawn a remote task. More...
 
template<typename fnT , typename a1T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const TaskAttributes &attr=TaskAttributes())
 Spawn a remote task. More...
 
template<typename fnT , typename a1T , typename a2T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T)" as a task, local or remote. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T,a3T)" as a task, local or remote. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T,a3T,a4T)" as a task, local or remote. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T)" as a task, local or remote. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T)" as a task, local or remote. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T,a7T)" as a task, local or remote. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T,a7T,a8T)" as a task, local or remote. More...
 
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::function_enabler< fnT >
::type 
add (ProcessID dest, fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T,a7T,a8T,a9T)" as a task, local or remote. More...
 
template<typename objT , typename memfnT >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)()" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::memfunc_enabler
< memfnT >::type 
add (objT &obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8,a9)" as a local task. More...
 
template<typename objT , typename memfnT >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)()" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8)" as a local task. More...
 
template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::memfunc_enabler
< memfnT >::type 
add (objT *obj, memfnT memfun, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes attr=TaskAttributes())
 Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8,a9)" as a local task. More...
 
void fence ()
 Returns after all local tasks have completed. More...
 
- Public Member Functions inherited from madness::CallbackInterface
virtual ~CallbackInterface ()
 

Friends

class TaskInterface
 

Detailed Description

Multi-threaded queue to manage and run tasks.

Constructor & Destructor Documentation

madness::WorldTaskQueue::WorldTaskQueue ( World world)

Member Function Documentation

void madness::WorldTaskQueue::add ( TaskInterface t)
inline
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
TaskFn<fnT, a1T, a2T, a3T, a4T, a5T, a6T, a7T, a8T, a9T>::futureT madness::WorldTaskQueue::add ( TaskFn< fnT, a1T, a2T, a3T, a4T, a5T, a6T, a7T, a8T, a9T > *  t)
inline
template<typename fnT >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const TaskAttributes attr = TaskAttributes() 
)
inline

Spawn a local task.

Spawns a task on on process. An argument that is a future may be used to carry dependencies tasks.

Template Parameters
fnTA function pointer or functor
Parameters
fnThe function to be called in the task
attrThe task attributes
Returns
A future to the task function's results. If the task function return type is void , a Future<void> object is return that may be ignored.

References add().

template<typename fnT , typename a1T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T , typename a3T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const a9T &  a9,
const TaskAttributes attr = TaskAttributes() 
)
inline

References add().

template<typename fnT >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const TaskAttributes attr = TaskAttributes() 
)
inline

Spawn a remote task.

Spawns a task on process dest , which may or may not be this process. An argument that is a future may be used to carry dependencies for local tasks. An future that is not ready cannot be used as an argument for a remote tasks – i.e., remote tasks must be ready to execute (you can work around this by making a local task to submit the remote task once everything is ready).

Template Parameters
fnTA function pointer or functor type
Parameters
destThe process where the task will be spawned
fnThe function to be called in the task
attrThe task attributes
Returns
A future to the task function's results. If the task function return type is void , a Future<void> object is return that may be ignored.
Note
Arguments must be (de)serializable and must of course make sense at the remote destination. Fundamental types, simple STL containers, and pointers to World, WorldContainer, and user-defined types derived from WorldObject<> are automatically handled. Anything else is your problem.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const TaskAttributes attr = TaskAttributes() 
)
inline

Spawn a remote task.

Spawns a task on process dest , which may or may not be this process. An argument that is a future may be used to carry dependencies for local tasks. An unready future cannot be used as an argument for a remote tasks – i.e., remote tasks must be ready to execute (you can work around this by making a local task to submit the remote task once everything is ready).

Parameters
destThe process where the task will be spawned
fnThe function to be called in the task
attrThe task attributes
Returns
A future to the task function's results. If the task function return type is void , a Future<void> object is return that may be ignored. Invoke "resultT (*fn)(a1T)" as a task, local or remote A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.
Note
Arguments must be (de)serializable and must of course make sense at the remote destination. Fundamental types, simple STL containers, and pointers to World, WorldContainer, and user-defined types derived from WorldObject<> are automatically handled. Anything else is your problem.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T , typename a3T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T,a3T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T,a3T,a4T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T,a7T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T,a7T,a8T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add(), and madness::Future< void >::value.

template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::function_enabler<fnT>::type madness::WorldTaskQueue::add ( ProcessID  dest,
fnT  fn,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const a9T &  a9,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (*fn)(a1T,a2T,a3T,a4T,a5T,a6T,a7T,a8T,a9T)" as a task, local or remote.

A future is returned to hold the eventual result of the task. Future<void> is an empty class that may be ignored.

References add().

template<typename objT , typename memfnT >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)()" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const TaskAttributes  attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const TaskAttributes  attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT &  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const a9T &  a9,
const TaskAttributes  attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8,a9)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)()" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const TaskAttributes  attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const TaskAttributes attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const TaskAttributes  attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

template<typename objT , typename memfnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
detail::memfunc_enabler<memfnT>::type madness::WorldTaskQueue::add ( objT *  obj,
memfnT  memfun,
const a1T &  a1,
const a2T &  a2,
const a3T &  a3,
const a4T &  a4,
const a5T &  a5,
const a6T &  a6,
const a7T &  a7,
const a8T &  a8,
const a9T &  a9,
const TaskAttributes  attr = TaskAttributes() 
)
inline

Invoke "resultT (obj.*memfun)(a1T,a2T,a3,a4,a5,a6,a7,a8,a9)" as a local task.

References add(), and madness::detail::wrap_mem_fn().

void madness::WorldTaskQueue::fence ( )
inline

Returns after all local tasks have completed.

While waiting the calling thread will run tasks.

References madness::ThreadPool::await().

Referenced by madness::WorldGopInterface::fence(), and madness::inner().

template<typename rangeT , typename opT >
Future<bool> madness::WorldTaskQueue::for_each ( const rangeT &  range,
const opT &  op 
)
inline

Apply op(item) for all items in range.

The operation must provide the following interface of which the operator() method is required by for_each() and the rest by the task interface.

struct opT {
opT();
opT(const opT&);
bool operator()(const rangeT::iterator& it) const;
template <typename Archive> void serialize(const Archive& ar);
};

Note that the serialize method does not actually have to work unless you want to have the task be stealable.

Adjust the chunksize in the range to control granularity.

Your operation should return true/false for success failure and the logical and of all results is returned as the future result.

You can ignore the result if you are interested in neither synchronization nor result status.

References add(), op(), and madness::detail::ForEachRootTask< rangeT, opT >::result().

Referenced by madness::FunctionImpl< Q, NDIM >::flo_unary_op_node_inplace(), madness::FunctionImpl< Q, NDIM >::gaxpy_inplace(), and madness::FunctionImpl< Q, NDIM >::unary_op_value_inplace().

template<typename resultT , typename rangeT , typename opT >
Future<resultT> madness::WorldTaskQueue::reduce ( const rangeT &  range,
const opT &  op 
)
inline

Reduce op(item) for all items in range using op(sum,op(item))

The operation must provide the following interface of which the operator() methods are required by reduce() and the rest by the task interface.

struct opT {
opT();
opT(const &opT);
resultT operator()(const rangeT::iterator& it) const;
resultT operator()(const resultT& left, const resultT& right);
template <typename Archive> void serialize(const Archive& ar);
}

Note that the serialize method does not actually have to work unless you want to have the task be stealable. Adjust the chunksize in the range to control granularity.

References add(), op(), and mpfr::sum().

Referenced by madness::FunctionImpl< Q, NDIM >::errsq_local(), and madness::FunctionImpl< Q, NDIM >::inner_ext_local().

size_t madness::WorldTaskQueue::size ( ) const
inline

Returns the number of pending tasks.

Referenced by madness::WorldGopInterface::fence().

Friends And Related Function Documentation

friend class TaskInterface
friend

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