|
template<typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, a3T &&a3, a4T &&a4, a5T &&a5, a6T &&a6, a7T &&a7, a8T &&a8, a9T &&a9, const TaskAttributes &attr) |
|
template<typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, a3T &&a3, a4T &&a4, a5T &&a5, a6T &&a6, a7T &&a7, a8T &&a8, const TaskAttributes &attr) |
|
template<typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, a3T &&a3, a4T &&a4, a5T &&a5, a6T &&a6, a7T &&a7, const TaskAttributes &attr) |
|
template<typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, a3T &&a3, a4T &&a4, a5T &&a5, a6T &&a6, const TaskAttributes &attr) |
|
template<typename a1T , typename a2T , typename a3T , typename a4T , typename a5T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, a3T &&a3, a4T &&a4, a5T &&a5, const TaskAttributes &attr) |
|
template<typename a1T , typename a2T , typename a3T , typename a4T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, a3T &&a3, a4T &&a4, const TaskAttributes &attr) |
|
template<typename a1T , typename a2T , typename a3T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, a3T &&a3, const TaskAttributes &attr) |
|
template<typename a1T , typename a2T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, a2T &&a2, const TaskAttributes &attr) |
|
template<typename a1T > |
| TaskFn (const futureT &result, functionT func, a1T &&a1, const TaskAttributes &attr) |
|
| TaskFn (const futureT &result, functionT func, const TaskAttributes &attr) |
|
| TaskFn (const futureT &result, functionT func, const TaskAttributes &attr, archive::BufferInputArchive &input_arch) |
|
virtual | ~TaskFn () |
|
const futureT & | result () const |
|
| TaskInterface (const TaskAttributes &attr) |
| Create a new task with zero dependencies and given attributes. More...
|
|
| TaskInterface (int ndepend, const char *caller, const TaskAttributes attr=TaskAttributes()) |
|
| TaskInterface (int ndepend=0, const TaskAttributes attr=TaskAttributes()) |
| Create a new task with ndepend dependencies (default 0) and given attributes. More...
|
|
virtual | ~TaskInterface () |
|
World * | get_world () const |
|
virtual void | run (World &) |
| Runs a single-threaded task ... derived classes must implement this. More...
|
|
| PoolTaskInterface () |
| Default constructor. More...
|
|
| PoolTaskInterface (const TaskAttributes &attr) |
|
virtual | ~PoolTaskInterface ()=default |
| Destructor. More...
|
|
void | execute () |
|
void | set_nthread (int nthread) |
| Call this to reset the number of threads before the task is submitted. More...
|
|
| TaskAttributes (const TaskAttributes &attr) |
| Copy constructor. More...
|
|
| TaskAttributes (unsigned long flags=0) |
| Sets the attributes to the desired values. More...
|
|
virtual | ~TaskAttributes () |
|
int | get_nthread () const |
| Get the number of threads. More...
|
|
bool | is_generator () const |
| Test if the generator attribute is true. More...
|
|
bool | is_high_priority () const |
| Test if the high priority attribute is true. More...
|
|
bool | is_stealable () const |
| Test if the stealable attribute is true. More...
|
|
template<typename Archive > |
void | serialize (Archive &ar) |
| Serializes the attributes for I/O. More...
|
|
TaskAttributes & | set_generator (bool generator_hint) |
| Sets the generator attribute. More...
|
|
TaskAttributes & | set_highpriority (bool hipri) |
| Sets the high priority attribute. More...
|
|
void | set_nthread (int nthread) |
| Set the number of threads. More...
|
|
TaskAttributes & | set_stealable (bool stealable) |
| Sets the stealable attribute. More...
|
|
| DependencyInterface (int ndep, const char *caller) |
|
| DependencyInterface (int ndep=0) |
|
virtual | ~DependencyInterface () |
| Destructor. More...
|
|
void | dec () |
| Decrement the number of dependencies and invoke the callback if ndepend==0 . More...
|
|
void | dec_debug (const char *caller) |
|
void | inc () |
| Increment the number of dependencies. More...
|
|
void | inc_debug (const char *caller) |
| Same as inc(), but keeps track of caller ; calling dec_debug() will signal error if no matching inc_debug() had been invoked
More...
|
|
int | ndep () const |
| Returns the number of unsatisfied dependencies. More...
|
|
void | notify () |
| Invoked by callbacks to notify of dependencies being satisfied. More...
|
|
void | notify_debug (const char *caller) |
| Overload of CallbackInterface::notify_debug(), updates dec() More...
|
|
bool | probe () const |
| Returns true if ndepend == 0 (no unsatisfied dependencies). More...
|
|
void | register_callback (CallbackInterface *callback) |
| Registers a callback that will be executed when ndepend==0 ; immediately invoked if ndepend==0 . More...
|
|
void | register_final_callback (CallbackInterface *callback) |
| Registers the final callback to be executed when ndepend==0 ; immediately invoked if ndepend==0 . More...
|
|
virtual | ~CallbackInterface () |
|
template<typename fnT, typename arg1T = void, typename arg2T = void, typename arg3T = void, typename arg4T = void, typename arg5T = void, typename arg6T = void, typename arg7T = void, typename arg8T = void, typename arg9T = void>
struct madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >
Wrap a callable object and its arguments into a task function.
The callable object may have up to 10 arguments
- Note
- arg*T cannot be a reference type
template<typename fnT , typename arg1T = void, typename arg2T = void, typename arg3T = void, typename arg4T = void, typename arg5T = void, typename arg6T = void, typename arg7T = void, typename arg8T = void, typename arg9T = void>
template<typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T >
madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::TaskFn |
( |
const futureT & |
result, |
|
|
functionT |
func, |
|
|
a1T && |
a1, |
|
|
a2T && |
a2, |
|
|
a3T && |
a3, |
|
|
a4T && |
a4, |
|
|
a5T && |
a5, |
|
|
a6T && |
a6, |
|
|
a7T && |
a7, |
|
|
a8T && |
a8, |
|
|
const TaskAttributes & |
attr |
|
) |
| |
|
inline |
References madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arity, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::check_dependencies(), and MADNESS_ASSERT.
template<typename fnT , typename arg1T = void, typename arg2T = void, typename arg3T = void, typename arg4T = void, typename arg5T = void, typename arg6T = void, typename arg7T = void, typename arg8T = void, typename arg9T = void>
template<typename a1T , typename a2T , typename a3T , typename a4T , typename a5T , typename a6T , typename a7T , typename a8T , typename a9T >
madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::TaskFn |
( |
const futureT & |
result, |
|
|
functionT |
func, |
|
|
a1T && |
a1, |
|
|
a2T && |
a2, |
|
|
a3T && |
a3, |
|
|
a4T && |
a4, |
|
|
a5T && |
a5, |
|
|
a6T && |
a6, |
|
|
a7T && |
a7, |
|
|
a8T && |
a8, |
|
|
a9T && |
a9, |
|
|
const TaskAttributes & |
attr |
|
) |
| |
|
inline |
References madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arity, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::check_dependencies(), and MADNESS_ASSERT.
template<typename fnT , typename arg1T = void, typename arg2T = void, typename arg3T = void, typename arg4T = void, typename arg5T = void, typename arg6T = void, typename arg7T = void, typename arg8T = void, typename arg9T = void>
void madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::check_dependencies |
( |
| ) |
|
|
inlineprivate |
Check dependencies and register callbacks where necessary.
References madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg1_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg2_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg3_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg4_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg5_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg6_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg7_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg8_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg9_, and madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::check_dependency().
Referenced by madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::TaskFn().
template<typename fnT , typename arg1T = void, typename arg2T = void, typename arg3T = void, typename arg4T = void, typename arg5T = void, typename arg6T = void, typename arg7T = void, typename arg8T = void, typename arg9T = void>
virtual void madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::run |
( |
World & |
world, |
|
|
const TaskThreadEnv & |
env |
|
) |
| |
|
inlineprotectedvirtual |
Runs a multi-threaded task.
Reimplemented from madness::TaskInterface.
References madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg1_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg2_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg3_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg4_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg5_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg6_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg7_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg8_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::arg9_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::func_, madness::TaskFn< fnT, arg1T, arg2T, arg3T, arg4T, arg5T, arg6T, arg7T, arg8T, arg9T >::result_, and madness::detail::run_function().