Provides an interface for a PARAGRAPH's factory as well as dynamic tasks to add new tasks to the PARAGRAPH during execution. More...
Public Member Functions | |
derived_tg_t & | graph () const |
Extract a reference to the currently running PARAGRAPH from a dynamic call stack of PARAGRAPH invocations maintained in the runtime. More... | |
paragraph_view (task_graph ¶graph) | |
void | add_expected_tasks (size_t count) const |
Allows locations participating in a nested PARAGRAPH that did not initiate the spawning process to convey knowledge about the number of nested paragraphs that they will participate in. Used to aid in elision of global termination detection. | |
template<typename WF , typename... Args> | |
void | add_task (std::size_t task_id, WF const &wf, std::size_t num_succs, Args const &... args) const |
Insert a new task in the currently running PARAGRAPH. More... | |
template<typename WF , typename... Args> | |
void | add_task (sched_info_type const &si, std::size_t task_id, WF const &wf, std::size_t num_succs, Args const &... args) const |
Insert a new task in the currently running PARAGRAPH. More... | |
template<typename WF , typename... Args> | |
void | add_task (std::size_t task_id, WF const &wf, pred_list_t preds, std::size_t num_succs, Args const &... args) const |
Insert a new task in the currently running PARAGRAPH. More... | |
template<typename WF , typename... Args> | |
void | add_task (sched_info_type const &si, std::size_t task_id, WF const &wf, pred_list_t preds, std::size_t num_succs, Args const &... args) const |
Insert a new task in the currently running PARAGRAPH. More... | |
template<typename WF , typename... Args> | |
std::enable_if< !std::is_integral< WF >::value &&!std::is_same< WF, sched_info_type >::value, void >::type | add_task (WF const &wf, Args const &... args) const |
Insert a new task in the currently running PARAGRAPH. More... | |
template<typename WF , typename... Args> | |
std::enable_if<!std::is_integral< WF >::value, void >::type | add_task (sched_info_type const &si, WF const &wf, Args const &... args) const |
Insert a new task in the currently running PARAGRAPH. More... | |
p_object const & | no_succs_p_object () |
void | set_num_succs (std::size_t task_id, std::size_t num_succs) const |
Allows the consumer count for a producer task to be specified independent of its add_task invocation. More... | |
void | set_result (std::size_t task_id) const |
Sets the PARAGRAPH task that will be the return value for the PARAGRAPH from this location. Can be called by a factory or any task in the PARAGRAPH with a paragraph_view . More... | |
void | set_result (std::size_t index, std::size_t task_id) const |
For port flow PARAGRAPHs, connect the output of the given task to the given index of the output port. | |
template<typename Mapper > | |
void | set_result_pg (std::size_t task_id, Mapper mapper) const |
Specify that a child PARAGRAPH with the given task id will connect to some of the ports of this parent PARAGRAPH as defined by the passed mapper. More... | |
constexpr bool | is_local (void) const |
task_graph & | container (void) const |
Provides an interface for a PARAGRAPH's factory as well as dynamic tasks to add new tasks to the PARAGRAPH during execution.
Scheduler | The type of the scheduler that the PARAGRAPH was constructed with. |
Although this class only directly uses the scheduling metadata type (i.e., Scheduler::sched_info_type) in its method signatures, it is templated with the full Scheduler type so that the PARAGRAPH intermediate base with knowledge of this type can be accessed. This allows the PARAGRAPH's internal add_task
call to invoke the task placement policy located in the scheduler object.
derived_tg_t& stapl::paragraph_impl::paragraph_view< Scheduler >::graph | ( | ) | const |
Extract a reference to the currently running PARAGRAPH from a dynamic call stack of PARAGRAPH invocations maintained in the runtime.
void stapl::paragraph_impl::paragraph_view< Scheduler >::add_task | ( | std::size_t | task_id, |
WF const & | wf, | ||
std::size_t | num_succs, | ||
Args const &... | args | ||
) | const |
Insert a new task in the currently running PARAGRAPH.
task_id | User specified identifier that other tasks and paragraph_view methods use to refer to this task. |
wf | The workfunction for this task. |
num_succs | The number of consumers for this task in the PARAGRAPH. |
v | Variadic list of view inputs to workfunction. |
void stapl::paragraph_impl::paragraph_view< Scheduler >::add_task | ( | sched_info_type const & | si, |
std::size_t | task_id, | ||
WF const & | wf, | ||
std::size_t | num_succs, | ||
Args const &... | args | ||
) | const |
Insert a new task in the currently running PARAGRAPH.
sched_info | Scheduler metadata (e.g., priority) for task. |
task_id | User specified identifier that other tasks and paragraph_view methods use to refer to this task. |
wf | The workfunction for this task. |
num_succs | The number of consumers for this task in the PARAGRAPH. |
v | Variadic list of view inputs to workfunction. |
void stapl::paragraph_impl::paragraph_view< Scheduler >::add_task | ( | std::size_t | task_id, |
WF const & | wf, | ||
pred_list_t | preds, | ||
std::size_t | num_succs, | ||
Args const &... | args | ||
) | const |
Insert a new task in the currently running PARAGRAPH.
task_id | User specified identifier that other tasks and paragraph_view methods use to refer to this task. |
wf | The workfunction for this task. |
preds | vector of predecessor task ids where there is a dependence to enforce but whose return value is not consumed on PARAGRAPH edge. |
num_succs | The number of consumers for this task in the PARAGRAPH. |
v | Variadic list of view inputs to workfunction. |
void stapl::paragraph_impl::paragraph_view< Scheduler >::add_task | ( | sched_info_type const & | si, |
std::size_t | task_id, | ||
WF const & | wf, | ||
pred_list_t | preds, | ||
std::size_t | num_succs, | ||
Args const &... | args | ||
) | const |
Insert a new task in the currently running PARAGRAPH.
sched_info | Scheduler metadata (e.g., priority) for task. |
task_id | User specified identifier that other tasks and paragraph_view methods use to refer to this task. |
wf | The workfunction for this task. |
preds | vector of predecessor task ids where there is a dependence to enforce but whose return value is not consumed on PARAGRAPH edge. |
num_succs | The number of consumers for this task in the PARAGRAPH. |
v | Variadic list of view inputs to workfunction. |
std::enable_if< !std::is_integral<WF>::value && !std::is_same<WF, sched_info_type>::value, void >::type stapl::paragraph_impl::paragraph_view< Scheduler >::add_task | ( | WF const & | wf, |
Args const &... | args | ||
) | const |
Insert a new task in the currently running PARAGRAPH.
wf | The workfunction for this task. dependence to enforce but whose return value is not consumed on PARAGRAPH edge. |
v | Variadic list of view inputs to workfunction. |
std::enable_if<!std::is_integral<WF>::value, void>::type stapl::paragraph_impl::paragraph_view< Scheduler >::add_task | ( | sched_info_type const & | si, |
WF const & | wf, | ||
Args const &... | args | ||
) | const |
Insert a new task in the currently running PARAGRAPH.
sched_info | Scheduler metadata (e.g., priority) for task. |
wf | The workfunction for this task. dependence to enforce but whose return value is not consumed on PARAGRAPH edge. |
v | Variadic list of view inputs to workfunction. |
void stapl::paragraph_impl::paragraph_view< Scheduler >::set_num_succs | ( | std::size_t | task_id, |
std::size_t | num_succs | ||
) | const |
Allows the consumer count for a producer task to be specified independent of its add_task
invocation.
task_id | Task identifier of task to have consumer count set. |
num_succs | The consumer count for the task. |
add_task
must be passed the defer_spec constant, denoting that the successor count will be separately specified by a call to this method. void stapl::paragraph_impl::paragraph_view< Scheduler >::set_result | ( | std::size_t | task_id | ) | const |
Sets the PARAGRAPH task that will be the return value for the PARAGRAPH from this location. Can be called by a factory or any task in the PARAGRAPH with a paragraph_view
.
task_id | Task identifier of task to be used as a result |
void stapl::paragraph_impl::paragraph_view< Scheduler >::set_result_pg | ( | std::size_t | task_id, |
Mapper | mapper | ||
) | const |
Specify that a child PARAGRAPH with the given task id will connect to some of the ports of this parent PARAGRAPH as defined by the passed mapper.