MADNESS
0.10.1
|
Multi-threaded queue to manage and run tasks. More...
#include <world_task_queue.h>
Classes | |
struct | ProbeAllDone |
Public Member Functions | |
WorldTaskQueue (World &world) | |
Constructor requiring a communication context (World ). 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(a1T, a2T, a3T, a4T, a5T, a6T, a7T, a8T, a9T)>::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()) |
Create a local task with nine arguments. More... | |
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T > | |
detail::function_enabler< fnT(a1T, a2T, a3T, a4T, a5T, a6T, a7T, a8T)>::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()) |
Create a local task with eight arguments. More... | |
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T > | |
detail::function_enabler< fnT(a1T, a2T, a3T, a4T, a5T, a6T, a7T)>::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()) |
Create a local task with seven arguments. More... | |
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T > | |
detail::function_enabler< fnT(a1T, a2T, a3T, a4T, a5T, a6T)>::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()) |
Create a local task with six arguments. More... | |
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T > | |
detail::function_enabler< fnT(a1T, a2T, a3T, a4T, a5T)>::type | add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes()) |
Create a local task with five arguments. More... | |
template<typename fnT , typename a1T , typename a2T , typename a3T , typename a4T > | |
detail::function_enabler< fnT(a1T, a2T, a3T, a4T)>::type | add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes()) |
Create a local task with four arguments. More... | |
template<typename fnT , typename a1T , typename a2T , typename a3T > | |
detail::function_enabler< fnT(a1T, a2T, a3T)>::type | add (fnT fn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes()) |
Create a local task with three arguments. More... | |
template<typename fnT , typename a1T , typename a2T > | |
detail::function_enabler< fnT(a1T, a2T)>::type | add (fnT fn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes()) |
Create a local task with two arguments. More... | |
template<typename fnT , typename a1T > | |
detail::function_enabler< fnT(a1T)>::type | add (fnT fn, const a1T &a1, const TaskAttributes &attr=TaskAttributes()) |
Create a local task with one argument. More... | |
template<typename fnT > | |
detail::function_enabler< fnT()>::type | add (fnT fn, const TaskAttributes &attr=TaskAttributes()) |
Create a local task with no arguments. More... | |
template<typename objT , typename memfnT , typename... argT> | |
detail::memfunc_enabler< objT, memfnT >::type | add (objT &&obj, memfnT memfn, argT &&... args) |
Invoke resultT (obj.*memfn)(args...) as a local task. 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 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 > | |
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 > | |
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 > | |
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 > | |
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 > | |
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 > | |
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 > | |
detail::function_enabler< fnT >::type | add (ProcessID dest, fnT fn, const a1T &a1, const TaskAttributes &attr=TaskAttributes()) |
Invoke resultT (*fn)(a1T) as a task, local or remote. More... | |
template<typename fnT > | |
detail::function_enabler< fnT >::type | add (ProcessID dest, fnT fn, const TaskAttributes &attr=TaskAttributes()) |
Create a remote task. 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) |
void | add (TaskInterface *t) |
Add a new local task, taking ownership of the pointer. More... | |
void | fence () |
Returns after all local tasks have completed. More... | |
template<typename rangeT , typename opT > | |
Future< bool > | for_each (const rangeT &range, const opT &op) |
Apply op(item) on all items in range. More... | |
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... | |
size_t | size () const |
Returns the number of pending tasks. More... | |
Public Member Functions inherited from madness::CallbackInterface | |
virtual | ~CallbackInterface () |
virtual void | notify_debug (const char *caller) |
Same as notify(), but tracks how many times called from each caller . More... | |
Private Types | |
typedef detail::voidT | voidT |
Private Member Functions | |
template<typename T > | |
const T & | am_arg (const Future< T > &f) |
template<typename T > | |
const T & | am_arg (const T &t) |
void | notify () |
template<typename taskT , typename fnT , typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T > | |
taskT::futureT | send_task (ProcessID where, 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) |
Private Member Functions inherited from NO_DEFAULTS | |
NO_DEFAULTS () | |
NO_DEFAULTS (const NO_DEFAULTS &)=delete | |
NO_DEFAULTS (NO_DEFAULTS &&)=delete | |
NO_DEFAULTS & | operator= (const NO_DEFAULTS &)=delete |
NO_DEFAULTS & | operator= (NO_DEFAULTS &&)=delete |
Static Private Member Functions | |
template<typename taskT > | |
static void | remote_task_handler (const AmArg &arg) |
template<typename resultT , typename opT > | |
static resultT | sum (const resultT &left, const resultT &right, const opT &op) |
Private Attributes | |
const ProcessID | me |
This process. More... | |
AtomicInt | nregistered |
Count of pending tasks. More... | |
World & | world |
The communication context. More... | |
Friends | |
class | TaskInterface |
Additional Inherited Members | |
Protected Member Functions inherited from madness::CallbackInterface | |
virtual void | notify_debug_impl (const char *caller) |
|
private |
madness::WorldTaskQueue::WorldTaskQueue | ( | World & | world | ) |
Constructor requiring a communication context (World
).
[in,out] | world | The communication context. |
References nregistered.
|
inline |
Create a local task with nine arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
a8T | Type of argument 8. |
a9T | Type of argument 9. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | a7 | Argument 7. |
[in] | a8 | Argument 8. |
[in] | a9 | Argument 9. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with eight arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
a8T | Type of argument 8. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | a7 | Argument 7. |
[in] | a8 | Argument 8. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with seven arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | a7 | Argument 7. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with six arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with five arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with four arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with three arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with two arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with one argument.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
a1T | Type of argument 1. |
[in,out] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored.
|
inline |
Create a local task with no arguments.
Creates a task in this process. An argument that is a future may be used to carry dependencies.
fnT | A function pointer or functor. |
[in,out] | fn | The function to be called in the task. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is returned that may be ignored. References add().
|
inline |
Invoke resultT (obj.*memfn)(args...)
as a local task.
Future<void>
is an empty class that may be ignored. objT | The object type. |
memfnT | The member function type. |
argT | Variadic template for arguments. |
[in] | obj | The associated object for invoking the member function pointer. |
[in] | memfn | The member function pointer. |
[in] | args | The argument pack. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References add(), and madness::detail::wrap_mem_fn().
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
a8T | Type of argument 8. |
a9T | Type of argument 9. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | a7 | Argument 7. |
[in] | a8 | Argument 8. |
[in] | a9 | Argument 9. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem.
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
a8T | Type of argument 8. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | a7 | Argument 7. |
[in] | a8 | Argument 8. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, a2, add(), am_arg(), me, and madness::Future< void >::value.
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | a7 | Argument 7. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, a2, add(), am_arg(), me, and madness::Future< void >::value.
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, a2, add(), am_arg(), me, and madness::Future< void >::value.
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, a2, add(), am_arg(), me, and madness::Future< void >::value.
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, a2, add(), am_arg(), me, and madness::Future< void >::value.
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, a2, add(), am_arg(), me, and madness::Future< void >::value.
|
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, a2, add(), am_arg(), me, and madness::Future< void >::value.
|
inline |
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.
fnT | A function pointer or functor type. |
a1T | Type of argument 1. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | a1 | Argument 1. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject
are automatically handled. Anything else is your problem. References a1, add(), am_arg(), me, and madness::Future< void >::value.
|
inline |
Create a remote task.
Creates a task in 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. A future that is not ready cannot be used as an argument for 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).
fnT | A function pointer or functor type. |
[in] | dest | The process where the task will be created. |
[in] | fn | The function to be called in the task. |
[in] | attr | The task attributes. |
void
, a Future<void>
object is return that may be ignored. World
, WorldContainer
, and user-defined types derived from WorldObject<>
are automatically handled. Anything else is your problem. References add(), me, and madness::Future< void >::value.
|
inline |
fnT | Description needed. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
a8T | Type of argument 8. |
a9T | Type of argument 9. |
[in] | t | Description needed. |
References add(), and madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::result().
|
inline |
Add a new local task, taking ownership of the pointer.
The task pointer (t
) is assumed to have been created with new
and when the task is eventually run the queue will call the task's destructor using delete
.
Once the task is complete it will execute task_complete_callback
to decrement the number of pending tasks and be deleted.
[in] | t | Pointer to the task. |
References nregistered, madness::TaskInterface::register_submit_callback(), madness::TaskInterface::set_info(), and world.
Referenced by madness::CubicInterpolationTable< T >::CubicInterpolationTable(), madness::CoeffTracker< T, NDIM >::activate(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::activate(), madness::FunctionImpl< T, NDIM >::add_op::activate(), madness::FunctionImpl< T, NDIM >::hartree_op< LDIM, leaf_opT >::activate(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::activate(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::activate(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::activate(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::activate(), add(), madness::WorldGopInterface::bcast_internal(), madness::distributed_localize_PM(), for_each(), madness::WorldGopInterface::lazy_sync(), madness::WorldGopInterface::lazy_sync_internal(), main(), madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values(), madness::FunctionImpl< T, NDIM >::multiop_values(), reduce(), madness::WorldGopInterface::reduce_internal(), Task::run(), madness::WorldGopInterface::send_internal(), madness::archive::ArchiveStoreImpl< ParallelOutputArchive< VectorOutputArchive >, WorldContainer< keyT, valueT > >::store(), madness::WorldObject< Derived >::task(), test10(), test5(), test9(), test_multi(), and madness::FunctionImpl< T, NDIM >::vtransform().
|
inlineprivate |
T | Description needed. |
[in] | f | Description needed. |
References madness::f, and MADNESS_ASSERT.
Referenced by add().
|
inline |
Returns after all local tasks have completed.
While waiting, the calling thread will run tasks.
References madness::ThreadPool::await(), and nregistered.
Referenced by madness::CubicInterpolationTable< T >::CubicInterpolationTable(), madness::distributed_localize_PM(), madness::WorldGopInterface::fence_impl(), madness::inner(), main(), madness::archive::ArchiveStoreImpl< ParallelOutputArchive< VectorOutputArchive >, WorldContainer< keyT, valueT > >::store(), and test9().
|
inline |
Apply op(item)
on 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.
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.
rangeT | Description needed. |
opT | Funtion type of the operation. This function should have a return type of bool . |
[in] | range | The range of items. |
[in] | op | The operation. |
and
of all op(item)
calls. References add(), op(), madness::detail::ForEachRootTask< rangeT, opT >::result(), and world.
Referenced by madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::redistribute_phase2(), and madness::FunctionImpl< T, NDIM >::unary_op_value_inplace().
|
inlineprivatevirtual |
|
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.
Adjust the chunksize in the range to control granularity.
resultT | The result type of the operation. |
rangeT | Description needed. |
opT | Function type of the operation. |
[in] | range | The range of items. |
[in] | op | The operation. |
References add(), op(), and sum().
Referenced by madness::FunctionImpl< T, NDIM >::errsq_local(), madness::FunctionImpl< T, NDIM >::inner_adaptive_local(), and madness::FunctionImpl< T, NDIM >::inner_ext_local().
|
inlinestaticprivate |
taskT | Description needed. |
arg | Description needed. |
References madness::arg(), MADNESS_ASSERT, and task().
|
inlineprivate |
taskT | Description needed. |
fnT | Description needed. |
a1T | Type of argument 1. |
a2T | Type of argument 2. |
a3T | Type of argument 3. |
a4T | Type of argument 4. |
a5T | Type of argument 5. |
a6T | Type of argument 6. |
a7T | Type of argument 7. |
a8T | Type of argument 8. |
a9T | Type of argument 9. |
where | Description needed. | |
fn | Description needed. | |
[in] | a1 | Argument 1. |
[in] | a2 | Argument 2. |
[in] | a3 | Argument 3. |
[in] | a4 | Argument 4. |
[in] | a5 | Argument 5. |
[in] | a6 | Argument 6. |
[in] | a7 | Argument 7. |
[in] | a8 | Argument 8. |
[in] | a9 | Argument 9. |
[in] | attr | Description needed. |
References a1, a2, madness::World::am, madness::RMI::ATTR_UNORDERED, madness::new_am_arg(), madness::WorldAmInterface::send(), and world.
|
inline |
Returns the number of pending tasks.
References nregistered.
Referenced by madness::WorldGopInterface::fence_impl().
|
inlinestaticprivate |
This template is used in the reduce kernel.
resultT | Return type of the operation. |
opT | The operation. |
[in] | left | Description needed. |
[in] | right | Description needed. |
[in] | op | The operation used in the reduce. |
left
and right
using op
. References op().
Referenced by reduce().
|
friend |
|
private |
Count of pending tasks.
Referenced by WorldTaskQueue(), add(), fence(), notify(), madness::WorldTaskQueue::ProbeAllDone::operator()(), and size().
|
private |
The communication context.
Referenced by add(), for_each(), and send_task().