![]() |
Peano
|
Represents one node in task graph. More...
#include <dynamic_task_graph_node.h>
Public Member Functions | |
dynamic_task_graph_node (std::function< void()> functor) | |
Create new task graph node. | |
dynamic_task_graph_node (std::function< void()> functor, const std::string &task_description) | |
Second parameter will be ignored if you work without debugg info. | |
dynamic_task_graph_node (const dynamic_task_graph_node &node) | |
You can copy a task graph node after it has been submitted. | |
void | add_dependency (const dynamic_task_graph_node &node) |
Add a single dependency. | |
void | add_dependencies (const std::set< dynamic_task_graph_node > &nodes) |
Wrapper around add_dependency() | |
bool | is_submitted () const |
Has task been submitted. | |
std::string | to_string () const |
Private Attributes | |
std::function< void()> | _functor |
std::shared_ptr< dynamic_task_graph_spawned_node > | _spawned_task |
std::vector< std::shared_ptr< dynamic_task_graph_spawned_node > > | _in_dependency |
In dependencies. | |
Friends | |
class | dynamic_task_graph |
class | dynamic_task_graph_spawned_node |
Represents one node in task graph.
Definition at line 26 of file dynamic_task_graph_node.h.
tbb::dynamic_task_graph_node::dynamic_task_graph_node | ( | std::function< void()> | functor | ) |
Create new task graph node.
Each task graph node is tied to a functor. When we create a task graph node, the task is not yet submitted or ready. We have to explicitly put() it into the task graph.
Definition at line 9 of file dynamic_task_graph_node.cpp.
tbb::dynamic_task_graph_node::dynamic_task_graph_node | ( | std::function< void()> | functor, |
const std::string & | task_description ) |
Second parameter will be ignored if you work without debugg info.
Definition at line 18 of file dynamic_task_graph_node.cpp.
tbb::dynamic_task_graph_node::dynamic_task_graph_node | ( | const dynamic_task_graph_node & | node | ) |
You can copy a task graph node after it has been submitted.
If you do so before, there might be two copies of this one task graph node, and they both might add in-dependencies independently. You might even submit this handle twice.
Also consult dynamic_task_graph::put() which
Definition at line 31 of file dynamic_task_graph_node.cpp.
References is_submitted().
void tbb::dynamic_task_graph_node::add_dependencies | ( | const std::set< dynamic_task_graph_node > & | nodes | ) |
Wrapper around add_dependency()
Definition at line 49 of file dynamic_task_graph_node.cpp.
void tbb::dynamic_task_graph_node::add_dependency | ( | const dynamic_task_graph_node & | node | ) |
Add a single dependency.
This works if and only if node has already been put into the task graph. You cannot add any dependency before that (cmp concept of anti-dependencies in OpenMP).
Definition at line 42 of file dynamic_task_graph_node.cpp.
References _spawned_task, and is_submitted().
bool tbb::dynamic_task_graph_node::is_submitted | ( | ) | const |
Has task been submitted.
After you have submitted a node, you can use it as input dependency for other nodes. However, you cannot add further dependencies to itself anymore.
Definition at line 56 of file dynamic_task_graph_node.cpp.
Referenced by add_dependency(), dynamic_task_graph_node(), and tbb::dynamic_task_graph::wait().
std::string tbb::dynamic_task_graph_node::to_string | ( | ) | const |
Definition at line 61 of file dynamic_task_graph_node.cpp.
|
friend |
Definition at line 28 of file dynamic_task_graph_node.h.
|
friend |
Definition at line 29 of file dynamic_task_graph_node.h.
|
private |
Definition at line 81 of file dynamic_task_graph_node.h.
Referenced by peano4.visualisation.filters.Calculator.Calculator::render().
|
private |
In dependencies.
Can only refer to submitted tasks. If a task is given a number and it also depends on another task with the same number, this number is not stored within this array. Instead, _depends_on_previous_task_with_same_number is set.
See dynamic_task_graph_spawned_node for a documentation why we have to use shared pointers here.
Definition at line 96 of file dynamic_task_graph_node.h.
Referenced by tbb::dynamic_task_graph::put().
|
private |
Definition at line 83 of file dynamic_task_graph_node.h.
Referenced by add_dependency(), tbb::dynamic_task_graph::put(), and tbb::dynamic_task_graph::wait().