Concrete implementation of abstract class task
, used to invoke user workfunction with views that were defined as task via an add_task
method call on the paragraph_view.
More...
|
template<typename SchedInfoParam , typename WFParam , typename ... ViewParams> |
| Task (detail::edge_entry_base *edge_entry_ptr, SchedInfoParam &&si, WFParam &&wf, ViewParams &&... views) |
|
storage_t | invoke (std::false_type) |
| Used internally to generically invoke workfunctions with nonvoid return types. More...
|
|
empty_class | invoke (std::true_type) |
| Used internally to generically invoke workfunctions with a void return type. More...
|
|
result_type | operator() (tg_callback const &cb) final |
| Invokes workfunction with the specified view set.
|
|
bool | migratable (void) const noexcept final |
| Return true if this task can be migrated. More...
|
|
void | migrate (std::size_t dest, tg_callback const &cb) final |
| Initiates migration of this task to a new execution location dest along with associated scheduling metadata sched_info . More...
|
|
bool | is_factory_task (void) const noexcept final |
| Implementation of pure virtual method defined in abstract class task . More...
|
|
std::size_t | task_id () const |
| Extract task identifier from bit field and return it.
|
|
p_object const & | comm_p_object (tg_callback const &cb) const |
| Use presence/lack of intra-PARAGRAPH successors to inform the execution in which task communication group this task's traffic should be placed. More...
|
|
virtual bool | finished (void) const |
| Return true if task has completed and does not need reinvocation. This default implementation is used by the non factory tasks, where the method should never be called.
|
|
virtual bool | reinvoke (tg_callback const &) |
| Reinvoke the task if it has not completed. This default implementation is used by the non factory tasks, where the method should never be called. More...
|
|
virtual bool | is_nested_pg_task (void) const noexcept |
| Allows detection of derived class acting as holder for nested paragraph. Used paragraph::operator() to detect starting tasks which are actually nested paragraphs to avoid passing them to the executor.
|
|
|
bool | has_succs () const |
| Extract the has successors boolean trait from the bit field and return. More...
|
|
void | processed (empty_class &&ignore, bool b_has_succs, tg_callback const &) const |
| Notify the PARAGRAPH that the task has finished execution and provide the return value to trigger data flow. Signature for void return values. More...
|
|
template<typename Return > |
void | processed (Return &&val, bool b_has_succs, tg_callback const &) const |
| Notify the PARAGRAPH that the task has finished execution and provide the return value to trigger data flow. Signature for non void return values. More...
|
|
template<typename SchedulerEntry, typename EnableMigration, typename EnablePersistence, typename WF, typename ViewSet>
class stapl::paragraph_impl::Task< SchedulerEntry, EnableMigration, EnablePersistence, WF, ViewSet >
Concrete implementation of abstract class task
, used to invoke user workfunction with views that were defined as task via an add_task
method call on the paragraph_view.
- Template Parameters
-
SchedulerEntry | The entry type required to store this task and the associated scheduler info metadata in the Scheduler. |
EnableMigration | Boolean type parameter denoting whether migration is enabled for the associated PARAGRAPH. |
EnablePersistence | Boolean type parameter denoting whether persistency is enabled for the associated PARAGRAPH. |
WF | The workfunction type. |
ViewSet | The type of the set of views passed to the workfunction. |
◆ status_type
Return values for function operator.
Enumerator |
---|
Active | Runnable object is active.
|
Idle | Runnable object is idle.
|
Finished | Runnable object has finished.
|
◆ invoke() [1/2]
template<typename SchedulerEntry , typename EnableMigration , typename EnablePersistence , typename WF , typename ViewSet >
Used internally to generically invoke workfunctions with nonvoid return types.
Unused parameter is type tag dispatch from operator()
.
◆ invoke() [2/2]
template<typename SchedulerEntry , typename EnableMigration , typename EnablePersistence , typename WF , typename ViewSet >
Used internally to generically invoke workfunctions with a void return type.
Unused parameter is type tag dispatch from operator()
.
◆ migratable()
template<typename SchedulerEntry , typename EnableMigration , typename EnablePersistence , typename WF , typename ViewSet >
Return true
if this task can be migrated.
In this context, this is true if migration was enabled in the PARAGRAPH.
Reimplemented from stapl::paragraph_impl::task_base.
◆ migrate()
template<typename SchedulerEntry , typename EnableMigration , typename EnablePersistence , typename WF , typename ViewSet >
Initiates migration of this task to a new execution location dest
along with associated scheduling metadata sched_info
.
Called by schedulers if they wish to change the initial PARAGRAPH task distribution induced by their task placement policy.
Reimplemented from stapl::paragraph_impl::task_base_intermediate< SchedulerEntry >.
◆ is_factory_task()
template<typename SchedulerEntry , typename EnableMigration , typename EnablePersistence , typename WF , typename ViewSet >
◆ has_succs()
bool stapl::paragraph_impl::task_base::has_succs |
( |
| ) |
const |
|
protectedinherited |
Extract the has successors boolean trait from the bit field and return.
- Returns
- True if this task has successors in the PARAGRAPH.
◆ processed() [1/2]
void stapl::paragraph_impl::task_base::processed |
( |
empty_class && |
ignore, |
|
|
bool |
b_has_succs, |
|
|
tg_callback const & |
cb |
|
) |
| const |
|
protectedinherited |
Notify the PARAGRAPH that the task has finished execution and provide the return value to trigger data flow. Signature for void return values.
- Parameters
-
ignore | Parameter passed in place of void for genericity. Unused. |
Called from derived class function operator implementations.
◆ processed() [2/2]
template<typename Return >
void stapl::paragraph_impl::task_base::processed |
( |
Return && |
val, |
|
|
bool |
b_has_succs, |
|
|
tg_callback const & |
cb |
|
) |
| const |
|
protectedinherited |
Notify the PARAGRAPH that the task has finished execution and provide the return value to trigger data flow. Signature for non void return values.
- Parameters
-
val | The return value of the workfunction invocation. |
Called from derived class function operator implementations.
◆ comm_p_object()
p_object const & stapl::paragraph_impl::task_base::comm_p_object |
( |
tg_callback const & |
cb | ) |
const |
|
inherited |
Use presence/lack of intra-PARAGRAPH successors to inform the execution in which task communication group this task's traffic should be placed.
- Parameters
-
cb | Callback mechanism to PARAGRAPH passed to task by its executor. |
◆ reinvoke()
virtual bool stapl::paragraph_impl::task_base::reinvoke |
( |
tg_callback const & |
| ) |
|
|
virtualinherited |
Reinvoke the task if it has not completed. This default implementation is used by the non factory tasks, where the method should never be called.
- Returns
true
if it needs to be reinvoked again, otherwise false
.
Reimplemented in stapl::paragraph_impl::factory_task< Factory, ViewSet, SchedulerEntry, PGV >, and stapl::paragraph_impl::factory_task< Factory, view_manager< coarsener_type< Factory >::type, Views... >::result_type, Scheduler::entry_type, paragraph_impl::paragraph_view< Scheduler > >.
The documentation for this class was generated from the following files: