The PARAGRAPH is the dependence graph representation of programs in STAPL. It's generally not advised for users to instantiate it directly, but rather use stapl::make_paragraph.
More...
|
| paragraph (paragraph const &other) |
|
| paragraph (Factory factory, Views const &... views, Scheduler scheduler=Scheduler(), const bool enable_migration=false, rmi_handle::reference parent_handle_ref=rmi_handle::reference(), location_type parent_location=invalid_location_id, bool b_parent_notify_all_locations=false, size_t task_id=0, std::size_t num_succs=0) |
| Constructor called to initialize a new PARAGRAPH collectively. More...
|
|
template<typename ... PackagedViews> |
| paragraph (nested_tag const &ignored, Factory factory, Scheduler const &scheduler, const bool enable_migration, rmi_handle::reference parent_handle_ref, location_type parent_location, bool b_parent_notify_all_locations, size_t task_id, std::size_t num_succs, PackagedViews &&... packaged_views) |
| Constructor for one-sided initialization of a new PARAGRAPH. More...
|
|
bool | has_span (void) const final |
|
void | pulse_terminator (void) final |
| Starts termination detection.
|
|
void | set_result (std::size_t index, task_graph::task_id_t task_id) final |
| For port flow PARAGRAPHs, connect the output of the given task to the given index of the output port.
|
|
result_type | operator() (int unused, bool blocking=false, bool force_evaluation=false, bool one_sided=false) |
| Method that starts population and execution of a PARAGRAPH. More...
|
|
result_type | operator() (void) |
| Function operator signature that engages blocking semantic of the PARAGRAPH. The function call does not return until termination detection has succeeded and the result value for this location is available.
|
|
factory_task< Factory, view_manager< coarsener_type< Factory >::type, Views... >::result_type, Scheduler::entry_type, paragraph_impl::paragraph_view< Scheduler > > & | get (void) |
|
factory_task< Factory, view_manager< coarsener_type< Factory >::type, Views... >::result_type, Scheduler::entry_type, paragraph_impl::paragraph_view< Scheduler > > const & | get (void) const |
|
bool | has_only_local_tasks (void) const override |
| Return true if PARAGRAPH scheduler has signalled that all tasks are locally executed.
|
|
bool | is_persistent (void) const final |
| Indicate if the task_graph is persistent.
|
|
template<typename WF , typename ExplicitPreds , typename ... Args> |
std::enable_if<!is_factory< WF >::value, void >::type | add_task (std::size_t tid, WF const &wf, sched_info_type const &si, ExplicitPreds const &pred_list, std::size_t num_succs, loc_qual qualifier, Args const &... args) |
| Construct non-factory tasks of the PARAGRAPH. More...
|
|
template<typename Factory , typename ExplicitPreds , typename ... Args> |
std::enable_if< is_factory< Factory >::value, void >::type | add_task (std::size_t tid, Factory const &f, sched_info_type const &si, ExplicitPreds const &pred_list, std::size_t num_succs, loc_qual qualifier, Args const &... args) |
| Construct a nested PARAGRAPH task. More...
|
|
template<typename T , typename PortFilter , typename ValueFilter , typename LocationMapper > |
void | child_setup_flow (size_t producer, rmi_handle::reference consumer_handle, location_type consumer_location, PortFilter port_filter, ValueFilter value_filter, LocationMapper location_mapper) |
| Forward dataflow setup request from child PARAGRAPH to the nested PARAGRAPH directory data member. More...
|
|
template<typename T , typename PortFilter , typename ValueFilter , typename LocationMapper > |
void | request_out_flow (rmi_handle::reference consumer, location_type parent_location, PortFilter port_filter, ValueFilter value_filter, LocationMapper location_mapper) |
| Forward sibling PARAGRAPH dataflow request to result_container (the output port of this PARAGRAPH).
|
|
template<typename Mapper > |
void | request_parent_out_flow (Mapper mapper) |
| Forward parent PARAGRAPH output port dataflow request to result_container (the output port of this PARAGRAPH).
|
|
template<typename T > |
void | child_add_producer (rmi_handle::reference child, size_t index) |
| Forward dataflow initialization from a given index of a producer PARAGRAPH output port to the input port on this PARAGRAPH with the specified handle.
|
|
template<typename T > |
void | child_set_element (rmi_handle::reference child, size_t index, T const &val) |
| Forward dataflow from a given index of a producer PARAGRAPH output port to the input port on this PARAGRAPH with the specified handle.
|
|
bool | called_before (void) const |
| Returns true if the given PARAGRAPH has been called at least once before (i.e., this is a reinvocation).
|
|
trivial_p_object const & | succs_p_object (void) const |
| Return successor task p_object used in gang switcher.
|
|
trivial_p_object const & | no_succs_p_object (void) const |
| Return no successor task p_object used in gang switcher.
|
|
bool | has_successors (void) const |
|
std::size_t | num_successors (void) const |
|
rmi_handle::reference const & | parent_handle (void) const |
|
location_type | parent_location (void) const |
|
bool | parent_notify_all_locations (void) const |
|
size_t | task_id (void) const |
|
edge_container & | edges (void) |
|
nested_pg_directory & | nested_pgs (void) |
|
nested_pg_directory const & | nested_pgs (void) const |
|
void | try_os_delete (void) |
| Called by task wrapper of one-sided, persistent paragraphs to signal time for deletion. More...
|
|
bool | migration_enabled () const |
| Indicate if the task_graph was instantiated with task migration support enabled.
|
|
executor_base * | executor_ptr (void) const |
| Return a pointer to the executor responsible for processing this instance. More...
|
|
executor_base & | executor (void) const |
| Return the executor responsible for processing this instance.
|
|
void | set_executor (executor_base *exec_base_ptr) |
| Receive the pointer to the executor from the PARAGRAPH function operator.
|
|
void | set_result (task_id_t task_id) |
| Allows the factory to specify which task produces the PARAGRAPH result on this location, which can be used to customize termination detection.
|
|
template<typename Mapper > |
void | set_result_pg (task_id_t task_id, Mapper mapper) |
| 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.
|
|
template<typename Result , typename Notifier > |
void | request_notify (size_t tid, Notifier const ¬ifier) |
| Receive the request from a task to receive notification when a task has been processed. More...
|
|
void | notify_termination () |
| Method invoked by a notifier when the PARAGRAPH has terminated.
|
|
template<typename SchedulerEntry , typename WF , typename ViewSet , std::size_t ... Indices> |
void | add_migrated_task (std::size_t tid, size_t unknown_consumer_cnt, typename SchedulerEntry::sched_info_type const &sched_info, WF const &wf, ViewSet const &, index_sequence< Indices... > const &) |
| Receive a task being migrated from another location. More...
|
|
void | count_local_task (size_t cnt=1) |
| Increment the count of tasks placed on this location.
|
|
void | count_task (size_t cnt=1) |
| Increment the count of tasks specified on this location. More...
|
|
void | processed_local (void) |
|
void | processed_remote_void (task_id_t tid, bool b_has_succs) |
| Receive notification from a task that it has executed. Method is called by task_base::processed when the task has a void return value and possibly intra-PARAGRAPH successors.
|
|
template<typename ReturnValue > |
void | processed_remote (task_id_t tid, bool has_succs, ReturnValue &&val) |
| Receive notification from a task that it has executed. More...
|
|
void | result_processed () |
| Invoked by the result notifier.
|
|
void | set_num_succs (std::size_t task_id, std::size_t num_succs) const |
| Set the number of successors that will require notification of a tasks execution. More...
|
|
template<typename SchedulerEntry , typename WF , typename ViewWrapper , std::size_t ... Indices> |
void | migrate_task (Task< SchedulerEntry, std::true_type, std::false_type, WF, ViewWrapper > *task, std::size_t dest, index_sequence< Indices... > const &) |
| Migrate a task to another location. More...
|
|
template<typename T > |
void | setup_promise_flow (std::size_t task_id, promise< typename df_stored_type< T >::type > pr) |
|
int | hold_termination (void) const |
| Detects whether participation in global quiescence should be initiated, based on whether there are local conditions that would certainly cause it to fail (eg, all tasks in the local queue have not been retired). More...
|
|
std::pair< int, bool > | termination_value (void) const |
| Return the termination value of the PARAGRAPH on this location. More...
|
|
bool | query_factory (void) |
| Call back to the factory to allow for incremental construction of the task graph. More...
|
|
bool | local_empty (void) const |
|
bool | is_blocking (void) const |
|
runtime::location_md const & | get_location_md (void) const noexcept |
| Returns the location metadata of the location this object registered in.
|
|
runtime::location_md & | get_location_md (void) noexcept |
| Returns the location metadata of the location this object registered in. noexcept More...
|
|
void | reset (void) |
|
result_type | apply (task_graph &tg, bool one_sided) |
| Setup the result_view and underlying result_container storage for the PARAGRAPH, and register the appropriate callback with PARAGRAPH.
|
|
void | set_result_impl (std::size_t, task_graph::task_id_t task_id, task_graph &tg) |
| Signature for non-void return types. Redirect to the edge_container. More...
|
|
os_td_wait_t * | set_os_result_notifier (task_graph &tg, result_type &) |
| If the return type of the paragraph is non-void, initializes an instance of one_sided_wait_td_notifier to tie parent paragraph notification to both this paragraph's dataflow and termination detection. More...
|
|
result_type & | finalize_result (result_type &res) |
| For the primary class template, this method is an identity op. More...
|
|
|
rmi_handle::const_reference const & | get_rmi_handle (void) const noexcept |
| Returns the associated rmi_handle.
|
|
rmi_handle::reference const & | get_rmi_handle (void) noexcept |
| Returns the associated rmi_handle.
|
|
size_type | get_location_id (void) const noexcept |
| Returns the location id of the local sub-object.
|
|
size_type | get_num_locations (void) const noexcept |
| Returns the number of locations of the gang of this p_object.
|
|
void | advance_epoch (void) |
| Advances the epoch of the object. More...
|
|
void | unlock (void) |
| Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs. More...
|
|
void | lock (void) |
| Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs. More...
|
|
bool | try_lock (void) |
| Attempt to maintain atomicity with respect to incoming RMIs. More...
|
|
template<typename Scheduler, typename Factory, typename... Views>
class stapl::paragraph_impl::paragraph< Scheduler, Factory, Views >
The PARAGRAPH is the dependence graph representation of programs in STAPL. It's generally not advised for users to instantiate it directly, but rather use stapl::make_paragraph.
- Template Parameters
-
Scheduler | The scheduler this PARAGRAPH passes to the executor that is responsible for ordering runnable tasks for execution. It may also request migration of runnable tasks, to support policies such as dynamic, cross location task load balancing. |
Factory | The task factory for this PARAGRAPH which is responsible for populating the PARAGRAPH with tasks and edges. One instance of the factory will be inserted into the executor on each location of the PARAGRAPH during the first invocation (subsequent calls on a persistent PARAGRAPH avoid this operation). |
... | A list of views that the PARAGRAPH should provide to the factory when it is invoked. The factory may provide a data coarsening method to be applied prior to factory invocation. |
Most of the implementation is located in untyped (or less typed) base classes to avoid code bloat. This derived class exists mainly to hold data members needing the full PARAGRAPH type (i.e., views, factory, and scheduler) and to implement several virtual functions providing an interface to these members. The primary public operator is the function operator (to those creating a PARAGRAPH, it appears as function object). It also has interfaces for result specification by the factory.