38 #ifndef MADNESS_WORLD_WORLD_TASK_QUEUE_H__INCLUDED
39 #define MADNESS_WORLD_WORLD_TASK_QUEUE_H__INCLUDED
41 #include <type_traits>
48 # include <tbb/parallel_reduce.h>
70 template <
typename ... argsT>
71 struct taskattr_is_last_arg :
public std::integral_constant<bool, std::is_same<std::decay_t<typename meta::last_type<argsT...>::type>,
72 TaskAttributes>::value> {};
80 template <
typename ptrT,
typename memfnT,
typename resT>
83 template <
typename,
typename>
84 class ForEachRootTask;
92 template <
typename refT,
typename functionT>
112 template <
typename Archive>
114 serialize_internal<functionT>(ar);
124 template <
typename fnT,
typename Archive>
125 typename std::enable_if<is_any_function_pointer_v<fnT>>
::type
135 template <
typename fnT,
typename Archive>
136 typename std::enable_if<!is_any_function_pointer_v<fnT>>
::type
150 template <
bool B,
class returnT>
158 template <
class returnT>
165 template <
typename fnT>
168 function_traits<fnT>::value || is_functor<fnT>::value,
169 task_result_type<fnT> >
176 template <
typename callableT,
typename Enabler =
void>
178 template <
typename callableT>
180 std::enable_if_t<callable_traits<callableT>::value>>
189 template <
typename objT,
typename memfnT,
typename enableT =
void>
200 template <
typename objT,
typename resT,
typename baseT,
typename ... paramT>
202 typename std::enable_if<std::is_base_of<baseT, objT>::value>
::type >
215 template <
typename objT,
typename resT,
typename baseT,
typename ... paramT>
217 typename std::enable_if<std::is_base_of<baseT, objT>::value>
::type >
228 template <
typename objT,
typename memfnT>
238 template <
typename objT,
typename memfnT>
248 template <
typename objT,
typename memfnT>
258 template <
typename objT,
typename memfnT>
268 template <
typename objT,
typename memfnT>
278 template <
typename objT,
typename memfnT>
288 template <
typename objT,
typename memfnT>
298 template <
typename objT,
typename memfnT>
308 template <
typename objT,
typename memfnT>
341 template <
typename resultT,
typename opT>
342 static resultT
sum(
const resultT& left,
const resultT& right,
const opT&
op) {
344 return op(left,right);
352 template <
typename taskT>
364 taskT*
task =
new taskT(
typename taskT::futureT(info.ref),
365 info.func, info.attr, input_arch);
368 arg.get_world()->taskq.add(
task);
376 template <
typename T>
388 template <
typename T>
423 template <
typename taskT,
typename fnT,
typename a1T,
typename a2T,
typename a3T,
424 typename a4T,
typename a5T,
typename a6T,
typename a7T,
425 typename a8T,
typename a9T>
426 inline typename taskT::futureT
428 const a2T&
a2,
const a3T& a3,
const a4T& a4,
const a5T& a5,
429 const a6T& a6,
const a7T& a7,
const a8T& a8,
const a9T& a9,
432 typename taskT::futureT result;
434 world.
am.
send(where, & WorldTaskQueue::template remote_task_handler<taskT>,
490 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
491 typename a4T,
typename a5T,
typename a6T,
typename a7T,
typename a8T,
526 template <
typename resultT,
typename rangeT,
typename opT>
528 if (range.size() <= range.get_chunksize()) {
529 resultT
sum = resultT();
530 for (
typename rangeT::iterator it=range.begin(); it != range.end(); ++it)
sum =
op(
sum,
op(it));
534 rangeT right(left,
Split());
538 return add(&WorldTaskQueue::sum<resultT,opT>, leftsum, rightsum,
op);
571 template <
typename rangeT,
typename opT>
580 #if MADNESS_TASKQ_VARIADICS
601 template <
typename fnT,
typename... argsT,
602 typename = std::enable_if_t<
605 add(fnT&& fn, argsT&&... args) {
608 std::remove_cv_t<std::remove_reference_t<argsT>>...>
::type;
609 return add(
new taskT(
typename taskT::futureT(), std::forward<fnT>(fn),
610 std::forward<argsT>(args)...));
613 template <
typename fnT,
typename... argsT,
614 typename = std::enable_if_t<
615 !meta::taskattr_is_last_arg<argsT...>::value>>
616 typename detail::function_enabler<fnT(future_to_ref_t<argsT>...)>
::type add(
617 fnT&& fn, argsT&&... args) {
618 using taskT = TaskFn<std::decay_t<fnT>, std::remove_cv_t<std::remove_reference_t<argsT>>...>;
619 return add(
new taskT(
typename taskT::futureT(), std::forward<fnT>(fn),
620 std::forward<argsT>(args)..., TaskAttributes()));
634 template <
typename fnT>
635 typename detail::function_enabler<fnT()>
::type
638 return add(
new taskT(
typename taskT::futureT(),
654 template <
typename fnT,
typename a1T>
658 return add(
new taskT(
typename taskT::futureT(),
676 template <
typename fnT,
typename a1T,
typename a2T>
680 return add(
new taskT(
typename taskT::futureT(),
700 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T>
702 add(fnT fn,
const a1T&
a1,
const a2T&
a2,
const a3T& a3,
706 return add(
new taskT(
typename taskT::futureT(),
707 fn,
a1,
a2, a3, attr));
728 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
typename a4T>
730 add(fnT fn,
const a1T&
a1,
const a2T&
a2,
const a3T& a3,
const a4T& a4,
734 return add(
new taskT(
typename taskT::futureT(),
735 fn,
a1,
a2, a3, a4, attr));
758 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
typename a4T,
761 add(fnT fn,
const a1T&
a1,
const a2T&
a2,
const a3T& a3,
const a4T& a4,
765 return add(
new taskT(
typename taskT::futureT(),
766 fn,
a1,
a2, a3, a4, a5, attr));
791 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
typename a4T,
792 typename a5T,
typename a6T>
794 add(fnT fn,
const a1T&
a1,
const a2T&
a2,
const a3T& a3,
const a4T& a4,
798 return add(
new taskT(
typename taskT::futureT(),
799 fn,
a1,
a2, a3, a4, a5, a6, attr));
826 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
typename a4T,
827 typename a5T,
typename a6T,
typename a7T>
829 add(fnT fn,
const a1T&
a1,
const a2T&
a2,
const a3T& a3,
const a4T& a4,
830 const a5T& a5,
const a6T& a6,
const a7T& a7,
834 return add(
new taskT(
typename taskT::futureT(),
835 fn,
a1,
a2, a3, a4, a5, a6, a7, attr));
864 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
typename a4T,
865 typename a5T,
typename a6T,
typename a7T,
typename a8T>
867 add(fnT fn,
const a1T&
a1,
const a2T&
a2,
const a3T& a3,
const a4T& a4,
868 const a5T& a5,
const a6T& a6,
const a7T& a7,
const a8T& a8,
872 return add(
new taskT(
typename taskT::futureT(),
873 fn,
a1,
a2, a3, a4, a5, a6, a7, a8, attr));
904 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
typename a4T,
905 typename a5T,
typename a6T,
typename a7T,
typename a8T,
typename a9T>
907 add(fnT fn,
const a1T&
a1,
const a2T&
a2,
const a3T& a3,
const a4T& a4,
908 const a5T& a5,
const a6T& a6,
const a7T& a7,
const a8T& a8,
const a9T& a9,
912 return add(
new taskT(
typename taskT::futureT(),
913 fn,
a1,
a2, a3, a4, a5, a6, a7, a8, a9, attr));
937 template <
typename fnT>
943 return add(fn, attr);
969 template <
typename fnT,
typename a1T>
975 return add(fn,
a1, attr);
1003 template <
typename fnT,
typename a1T,
typename a2T>
1040 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T>
1047 return add(fn,
a1,
a2, a3, attr);
1079 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
1087 return add(fn,
a1,
a2, a3, a4, attr);
1121 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
1122 typename a4T,
typename a5T>
1129 return add(fn,
a1,
a2, a3, a4, a5, attr);
1165 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
1166 typename a4T,
typename a5T,
typename a6T>
1169 const a4T& a4,
const a5T& a5,
const a6T& a6,
1174 return add(fn,
a1,
a2, a3, a4, a5, a6, attr);
1212 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
1213 typename a4T,
typename a5T,
typename a6T,
typename a7T>
1216 const a4T& a4,
const a5T& a5,
const a6T& a6,
const a7T& a7,
1221 return add(fn,
a1,
a2, a3, a4, a5, a6, a7, attr);
1261 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
1262 typename a4T,
typename a5T,
typename a6T,
typename a7T,
1266 const a4T& a4,
const a5T& a5,
const a6T& a6,
const a7T& a7,
1271 return add(fn,
a1,
a2, a3, a4, a5, a6, a7, a8, attr);
1314 template <
typename fnT,
typename a1T,
typename a2T,
typename a3T,
1315 typename a4T,
typename a5T,
typename a6T,
typename a7T,
1316 typename a8T,
typename a9T>
1319 const a4T& a4,
const a5T& a5,
const a6T& a6,
const a7T& a7,
1324 return add(fn,
a1,
a2, a3, a4, a5, a6, a7, a8, a9, attr);
1351 template <
typename objT,
typename memfnT,
typename... argT>
1353 add(objT&& obj, memfnT memfn, argT&&... args)
1388 fprintf(stderr,
"!!MADNESS ERROR: Exception thrown in WorldTaskQueue::fence() with %i pending task(s)\n",
int(
nregistered));
1396 #ifdef HAVE_INTEL_TBB
1405 template <
typename rangeT,
typename opT>
1440 tbb::parallel_reduce(
range_,
true,
1441 [
this](
const rangeT& r,
bool init) ->
bool {
1442 for(
typename rangeT::iterator it = r.begin(); it != r.end(); ++it)
1443 init = init &&
op_(it);
1446 [](
const bool left,
const bool right) ->
bool {
1447 return left && right;
1458 virtual void get_id(std::pair<void*,unsigned short>&
id)
const {
1471 template <
typename rangeT,
typename opT>
1476 ForEachRootTask<rangeT, opT>& root_;
1479 ForEachTask(
const ForEachTask<rangeT, opT>& fet) =
delete;
1480 ForEachTask& operator=(
const ForEachTask<rangeT, opT>& fet) =
delete;
1490 ForEachTask(
const rangeT range,
const opT&
op, ForEachRootTask<rangeT, opT>& root) :
1498 virtual ~ForEachTask() =
default;
1504 virtual void run(
const TaskThreadEnv& tte) {
1506 while(range_.size() > range_.get_chunksize()) {
1507 rangeT right(range_,
Split());
1508 ForEachTask<rangeT,opT>* leaf =
new ForEachTask<rangeT,opT>(right, op_, root_);
1509 root_.world().taskq.add(leaf);
1514 for(
typename rangeT::iterator it = range_.begin(); it != range_.end(); ++it)
1527 virtual void get_id(std::pair<void*,unsigned short>&
id)
const {
1540 template <
typename rangeT,
typename opT>
1541 class ForEachRootTask :
public TaskInterface {
1557 status_ = - (range.size());
1559 world_.taskq.add(
new ForEachTask<rangeT,opT>(range,
op, *
this));
1568 World&
world()
const {
1575 const Future<bool>&
result()
const {
1582 void complete(
const int status) {
1590 virtual void run(
const TaskThreadEnv&) {
1599 virtual void get_id(std::pair<void*,unsigned short>&
id)
const {
Disables default copy constructor and assignment operators.
Definition: nodefaults.h:49
World active message that extends an RMI message.
Definition: worldam.h:80
An integer with atomic set, get, read+increment, read+decrement, and decrement+test operations.
Definition: atomicint.h:126
The class used for callbacks (e.g., dependency tracking).
Definition: dependency_interface.h:61
void inc()
Increment the number of dependencies.
Definition: dependency_interface.h:251
void notify()
Invoked by callbacks to notify of dependencies being satisfied.
Definition: dependency_interface.h:183
Specialization of Future<void> for internal convenience. This does nothing useful!
Definition: future.h:736
static const Future< void > value
Definition: future.h:742
A future is a possibly yet unevaluated value.
Definition: future.h:373
void set(const Future< T > &other)
A.set(B), where A and B are futures ensures A has/will have the same value as B.
Definition: future.h:508
static std::enable_if< detail::function_traits< fnT >::value||detail::memfunc_traits< fnT >::value >::type make_id(std::pair< void *, unsigned short > &id, fnT fn)
Definition: thread.h:916
static const attrT ATTR_UNORDERED
Definition: worldrmi.h:180
Contains attributes of a task.
Definition: thread.h:323
static TaskAttributes hipri()
Definition: thread.h:450
TaskAttributes(unsigned long flags=0)
Sets the attributes to the desired values.
Definition: thread.h:337
All world tasks must be derived from this public interface.
Definition: taskfn.h:69
void set_info(World *w, CallbackInterface *c)
Set task info.
Definition: taskfn.h:89
void register_submit_callback()
Adds call back to schedule task when outstanding dependencies are satisfied.
Definition: taskfn.h:95
TaskInterface(int ndepend=0, const TaskAttributes attr=TaskAttributes())
Create a new task with ndepend dependencies (default 0) and given attributes.
Definition: taskfn.h:104
volatile World * world
Definition: taskfn.h:72
Used to pass information about the thread environment to a user's task.
Definition: thread.h:466
static void await(const Probe &probe, bool dowork=true, bool sleep=false)
Gracefully wait for a condition to become true, executing any tasks in the queue.
Definition: thread.h:1444
void send(ProcessID dest, am_handlerT op, const AmArg *arg, const int attr=RMI::ATTR_ORDERED)
Sends a managed non-blocking active message.
Definition: worldam.h:278
Multi-threaded queue to manage and run tasks.
Definition: world_task_queue.h:319
WorldTaskQueue(World &world)
Constructor requiring a communication context (World).
Definition: world_task_queue.cc:54
detail::memfunc_enabler< objT, memfnT >::type add(objT &&obj, memfnT memfn, argT &&... args)
Invoke resultT (obj.*memfn)(args...) as a local task.
Definition: world_task_queue.h:1353
detail::voidT voidT
Definition: world_task_queue.h:394
const ProcessID me
This process.
Definition: world_task_queue.h:323
const T & am_arg(const T &t)
Definition: world_task_queue.h:389
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.
Definition: world_task_queue.h:907
size_t size() const
Returns the number of pending tasks.
Definition: world_task_queue.h:451
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.
Definition: world_task_queue.h:1265
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.
Definition: world_task_queue.h:1042
void notify()
Definition: world_task_queue.h:327
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.
Definition: world_task_queue.h:730
Future< bool > for_each(const rangeT &range, const opT &op)
Apply op(item) on all items in range.
Definition: world_task_queue.h:572
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.
Definition: world_task_queue.h:1005
detail::function_enabler< fnT >::type add(ProcessID dest, fnT fn, const TaskAttributes &attr=TaskAttributes())
Create a remote task.
Definition: world_task_queue.h:939
static void remote_task_handler(const AmArg &arg)
Definition: world_task_queue.h:353
World & world
The communication context.
Definition: world_task_queue.h:322
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.
Definition: world_task_queue.h:867
Future< resultT > reduce(const rangeT &range, const opT &op)
Reduce op(item) for all items in range using op(sum,op(item)).
Definition: world_task_queue.h:527
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.
Definition: world_task_queue.h:794
detail::function_enabler< fnT()>::type add(fnT fn, const TaskAttributes &attr=TaskAttributes())
Create a local task with no arguments.
Definition: world_task_queue.h:636
static resultT sum(const resultT &left, const resultT &right, const opT &op)
Definition: world_task_queue.h:342
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.
Definition: world_task_queue.h:829
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.
Definition: world_task_queue.h:702
detail::function_enabler< fnT(a1T)>::type add(fnT fn, const a1T &a1, const TaskAttributes &attr=TaskAttributes())
Create a local task with one argument.
Definition: world_task_queue.h:656
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.
Definition: world_task_queue.h:761
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.
Definition: world_task_queue.h:1082
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.
Definition: world_task_queue.h:1318
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.
Definition: world_task_queue.h:1215
AtomicInt nregistered
Count of pending tasks.
Definition: world_task_queue.h:324
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.
Definition: world_task_queue.h:678
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.
Definition: world_task_queue.h:971
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.
Definition: world_task_queue.h:1124
void add(TaskInterface *t)
Add a new local task, taking ownership of the pointer.
Definition: world_task_queue.h:466
const T & am_arg(const Future< T > &f)
Definition: world_task_queue.h:377
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.
Definition: world_task_queue.h:1168
void fence()
Returns after all local tasks have completed.
Definition: world_task_queue.h:1384
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)
Definition: world_task_queue.h:494
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)
Definition: world_task_queue.h:427
A parallel world class.
Definition: world.h:132
WorldAmInterface & am
AM interface.
Definition: world.h:203
Apply an operation to a range of iterators.
Definition: world_task_queue.h:1406
virtual ~ForEachRootTask()=default
Virtual destructor.
virtual void run(World &, const TaskThreadEnv &)
Task run work.
Definition: world_task_queue.h:1434
opT op_
The foreach function.
Definition: world_task_queue.h:1409
rangeT range_
The range.
Definition: world_task_queue.h:1408
Future< bool > completion_status_
The result of this set of tasks.
Definition: world_task_queue.h:1410
const Future< bool > & result() const
Result accessor.
Definition: world_task_queue.h:1429
virtual void get_id(std::pair< void *, unsigned short > &id) const
Get the task ID.
Definition: world_task_queue.h:1458
ForEachRootTask(World &, const rangeT range, const opT &op)
Constructor.
Definition: world_task_queue.h:1419
void run(World &world, ansatzT ansatz, const int nuclear_charge, const commandlineparser &parser, const int nstates)
Definition: dirac-hatom.cc:1388
auto T(World &world, response_space &f) -> response_space
Definition: global_functions.cc:34
tbb::split Split
Dummy class, a la Intel TBB, used to distinguish splitting constructor.
Definition: range.h:54
Tensor< typename Tensor< T >::scalar_type > arg(const Tensor< T > &t)
Return a new tensor holding the argument of each element of t (complex types only)
Definition: tensor.h:2502
Tensor< double > op(const Tensor< double > &x)
Definition: kain.cc:508
Macros and tools pertaining to the configuration of MADNESS.
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition: madness_exception.h:134
Function< double, 3 > functionT
Definition: mcpfit.cc:50
Defines tools for encapsulating a pointer to a member function.
MemFuncWrapper< objT *, memfnT, typename result_of< memfnT >::type > wrap_mem_fn(objT &obj, memfnT memfn)
Create a member function wrapper (MemFuncWrapper) from an object and a member function pointer.
Definition: mem_func_wrapper.h:251
memfnT get_mem_func_ptr(const MemFuncWrapper< ptrT, memfnT, resT > &wrapper)
Returns the member function pointer from a wrapper.
Definition: mem_func_wrapper.h:339
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
AmArg * new_am_arg(const argT &... args)
Convenience template for serializing arguments into a new AmArg.
Definition: worldam.h:194
NDIM & f
Definition: mra.h:2416
std::string type(const PairType &n)
Definition: PNOParameters.h:18
Implement the Range class for parallel iteration.
Wrap a callable object and its arguments into a task function.
Definition: taskfn.h:473
const futureT & result() const
Definition: taskfn.h:854
Definition: world_task_queue.h:66
Definition: world_task_queue.h:67
Definition: world_task_queue.h:1361
bool operator()() const
Determine if all tasks in the queue are complete.
Definition: world_task_queue.h:1374
ProbeAllDone(WorldTaskQueue *tq)
Construct a ProbeAllDone for a given task queue.
Definition: world_task_queue.h:1367
WorldTaskQueue * tq
The task queue.
Definition: world_task_queue.h:1362
Serialization container for sending tasks to remote nodes.
Definition: world_task_queue.h:93
std::enable_if<!is_any_function_pointer_v< fnT > >::type serialize_internal(const Archive &ar)
Serialization for non- function pointers and member function pointers.
Definition: world_task_queue.h:137
functionT func
A task function.
Definition: world_task_queue.h:95
TaskHandlerInfo(const refT &ref, functionT func, const TaskAttributes &attr)
Construct task info object.
Definition: world_task_queue.h:105
void serialize(const Archive &ar)
Serialization of an object.
Definition: world_task_queue.h:113
TaskAttributes attr
Task attributes.
Definition: world_task_queue.h:96
std::enable_if< is_any_function_pointer_v< fnT > >::type serialize_internal(const Archive &ar)
Serialization for function pointers and member function pointers.
Definition: world_task_queue.h:126
TaskHandlerInfo()=default
refT ref
Remote reference for a task result future.
Definition: world_task_queue.h:94
typename callable_traits< callableT >::result_type type
Definition: world_task_queue.h:181
Definition: world_task_queue.h:177
Function traits in the spirit of boost function traits.
Definition: function_traits.h:17
Behave like a lazy std::enable_if.
Definition: world_task_queue.h:151
returnT::type type
Definition: world_task_queue.h:152
Definition: world_task_queue.h:170
add_future< resT >::type type
Definition: world_task_queue.h:220
add_future< resT >::type type
Definition: world_task_queue.h:205
Definition: world_task_queue.h:191
Definition: world_task_queue.h:231
int task(int i)
Definition: test_runtime.cpp:4
const char * status[2]
Definition: testperiodic.cc:43
Wrappers around platform dependent timers and performance info.
const double a2
Definition: vnucso.cc:86
const double a1
Definition: vnucso.cc:85
int ProcessID
Used to clearly identify process number/rank.
Definition: worldtypes.h:43