Intermediate class in task_base
/ Task
inheritance relationship which encodes the scheduler metadata type so that a virtual function signature can be defined and polymorphically invoked by the scheduler (who doesn't know concrete type of Task
) to initiate task migration.
More...
Public Member Functions | |
task_base_intermediate (void) | |
Constructor used by factory tasks. | |
template<typename SchedulerInfoParam > | |
task_base_intermediate (detail::edge_entry_base *edge_entry_ptr, SchedulerInfoParam &&sched_info) | |
Constructor used by standard (i.e., non factory) tasks. | |
virtual void | migrate (size_t, tg_callback const &) |
Method overridden in Task to request migration of this task by task_graph. 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 result_type | operator() (tg_callback const &cb)=0 |
Invoke the task. Called by the executor. Implemented in derived class that knows the workfunction and view types. More... | |
virtual bool | migratable (void) const noexcept |
Return true if task can be migrated. 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_factory_task (void) const noexcept=0 |
Pure virtual method implemented by derived classes to report whether or not they are instance of the class template factory_task . 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. | |
Public Types | |
enum | status_type { Active, Idle, Finished } |
Return values for function operator. More... | |
Protected Member Functions | |
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... | |
Protected Types | |
using | result_type = runnable_base::status_type |
the type returned by the function operator with status information for the executor. | |
Intermediate class in task_base
/ Task
inheritance relationship which encodes the scheduler metadata type so that a virtual function signature can be defined and polymorphically invoked by the scheduler (who doesn't know concrete type of Task
) to initiate task migration.
SchedInfo | The type of per task scheduler metadata, as defined by the scheduler type parameter of the PARAGRAPH. |
The scheduler framework knows the SchedInfo type and can perform a downcast of the task_base
to this base, allowing it to invoke migration.
|
inherited |
|
virtual |
Method overridden in Task
to request migration of this task by task_graph.
dest_loc | The location the task should be migrated to. |
cb | Callback wrapper to the associated PARAGRAPH. |
Reimplemented in stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, ViewSet >, stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, Storage< lazy_edge_reference< T > > >, and stapl::paragraph_impl::Task< SchedulerEntry, EnableMigration, EnablePersistence, WF, ViewSet >.
|
protectedinherited |
Extract the has successors boolean trait from the bit field and return.
|
protectedinherited |
Notify the PARAGRAPH that the task has finished execution and provide the return value to trigger data flow. Signature for void return values.
ignore | Parameter passed in place of void for genericity. Unused. |
Called from derived class function operator implementations.
|
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.
val | The return value of the workfunction invocation. |
Called from derived class function operator implementations.
|
inherited |
Use presence/lack of intra-PARAGRAPH successors to inform the execution in which task communication group this task's traffic should be placed.
cb | Callback mechanism to PARAGRAPH passed to task by its executor. |
|
pure virtualinherited |
Invoke the task. Called by the executor. Implemented in derived class that knows the workfunction and view types.
cb | Callback mechanism to PARAGRAPH passed to task by its executor. |
Implemented in stapl::paragraph_impl::nested_pg_task< SchedulerEntry, PG >, stapl::paragraph_impl::factory_task< Factory, ViewSet, SchedulerEntry, PGV >, stapl::paragraph_impl::factory_task< Factory, view_manager< coarsener_type< Factory >::type, Views... >::result_type, Scheduler::entry_type, paragraph_impl::paragraph_view< Scheduler > >, stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, ViewSet >, stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, Storage< lazy_edge_reference< T > > >, and stapl::paragraph_impl::Task< SchedulerEntry, EnableMigration, EnablePersistence, WF, ViewSet >.
|
virtualnoexceptinherited |
Return true
if task can be migrated.
This default implementation is used by the factory task, where migration is not allowed.
Reimplemented in stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, ViewSet >, stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, Storage< lazy_edge_reference< T > > >, and stapl::paragraph_impl::Task< SchedulerEntry, EnableMigration, EnablePersistence, WF, ViewSet >.
|
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.
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 > >.
|
pure virtualnoexceptinherited |
Pure virtual method implemented by derived classes to report whether or not they are instance of the class template factory_task
.
Used by the runtime executor and scheduler to specialize scheduling (i.e., execute once immediately upon being made runnable).
Implemented in stapl::paragraph_impl::nested_pg_task< SchedulerEntry, PG >, stapl::paragraph_impl::factory_task< Factory, ViewSet, SchedulerEntry, PGV >, stapl::paragraph_impl::factory_task< Factory, view_manager< coarsener_type< Factory >::type, Views... >::result_type, Scheduler::entry_type, paragraph_impl::paragraph_view< Scheduler > >, stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, ViewSet >, stapl::paragraph_impl::identity_task_impl< SchedulerEntry, EnableMigration, EnablePersistence, Storage< lazy_edge_reference< T > > >, and stapl::paragraph_impl::Task< SchedulerEntry, EnableMigration, EnablePersistence, WF, ViewSet >.