STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Member Functions
stapl::paragraph_impl::factory_task< Factory, ViewSet, SchedulerEntry, PGV > Class Template Reference

Concrete implementation of abstract class task_base, used to invoke the factory (the initial task executed for any PARAGRAPH which populates the graph with additional tasks) from the PARAGRAPH's executor. More...

Public Member Functions

 factory_task (Factory factory, ViewSet &&vs)
 
Factory const & factory (void) const
 
ViewSet & views (void)
 
result_type operator() (tg_callback const &cb) final
 Invokes factory to populate PARAGRAPH with tasks.
 
bool finished (void) const final
 Return true if the factory has created all tasks it wishes to insert into the PARAGRAPH.
 
bool reinvoke (tg_callback const &cb) final
 Used by PARAGRAPH for subsequent calls to the factory to create any additional tasks. More...
 
bool is_factory_task (void) const noexcept final
 Implementation of pure virtual method defined in abstract class task. More...
 
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 bool migratable (void) const noexcept
 Return true if task can be migrated. 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...
 

Detailed Description

template<typename Factory, typename ViewSet, typename SchedulerEntry, typename PGV>
class stapl::paragraph_impl::factory_task< Factory, ViewSet, SchedulerEntry, PGV >

Concrete implementation of abstract class task_base, used to invoke the factory (the initial task executed for any PARAGRAPH which populates the graph with additional tasks) from the PARAGRAPH's executor.

Template Parameters
FactoryType type of the factory passed to the PARAGRAPH at initialization.
ViewSetThe type of the post coarsening set of PARAGRAPH input views to be passed to the factory.
PGVThe type of the paragraph_view for this PARAGRAPH. No need for member, can be trivially default constructed.

Member Enumeration Documentation

◆ status_type

Return values for function operator.

Enumerator
Active 

Runnable object is active.

Idle 

Runnable object is idle.

Finished 

Runnable object has finished.

Member Function Documentation

◆ reinvoke()

template<typename Factory, typename ViewSet, typename SchedulerEntry, typename PGV>
bool stapl::paragraph_impl::factory_task< Factory, ViewSet, SchedulerEntry, PGV >::reinvoke ( tg_callback const &  cb)
finalvirtual

Used by PARAGRAPH for subsequent calls to the factory to create any additional tasks.

Guards reinvocation with finished == false to avoid calling a factory with no further tasks to create.

Returns
true if it needs to be reinvoked again, otherwise false.

Reimplemented from stapl::paragraph_impl::task_base.

◆ is_factory_task()

template<typename Factory, typename ViewSet, typename SchedulerEntry, typename PGV>
bool stapl::paragraph_impl::factory_task< Factory, ViewSet, SchedulerEntry, PGV >::is_factory_task ( void  ) const
finalvirtualnoexcept

Implementation of pure virtual method defined in abstract class task.

See also
task::is_factory_task

Implements stapl::paragraph_impl::task_base.

◆ migrate()

template<typename SchedulerEntry>
virtual void stapl::paragraph_impl::task_base_intermediate< SchedulerEntry >::migrate ( size_t  ,
tg_callback const &   
)
virtualinherited

◆ 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
ignoreParameter 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
valThe 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
cbCallback mechanism to PARAGRAPH passed to task by its executor.

◆ migratable()

virtual bool stapl::paragraph_impl::task_base::migratable ( void  ) const
virtualnoexceptinherited

The documentation for this class was generated from the following files: