STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions
stapl::skeletons::taskgraph_env< TGV > Class Template Reference

The main environment for spawning skeletons in STAPL and evaluating them as taskgraphs is taskgraph_env. It gets the workfunction, unwraps the inputs which are given as producer_info (indexed_producer, view_element_producer, etc.) and calls add_task or set_num_succs from the given PARAGRAPH via the given taskgraph view (TGV) More...

Public Member Functions

 taskgraph_env (TGV tgv)
 
template<bool isResult, typename WF , typename Mapper , typename... In>
std::enable_if< !skeletons::is_nested_skeleton< typename std::decay< WF >::type >::value, void >::type spawn_element (std::size_t tid, std::size_t result_id, WF &&wf, Mapper &&mapper, std::size_t num_succs, In &&... in)
 Spawns an element in a given taskgraph. It first unwraps the input given as various types of producer_info and converts them to acceptable arguments to PARAGRAPH's input arguments for add_task requests. More...
 
template<bool isResult, typename S , bool Reducer, typename ExecutionParams , bool B, typename Mapper , typename... In>
void spawn_element (std::size_t tid, std::size_t result_id, wrapped_skeleton< S, tags::nested_execution< Reducer >, ExecutionParams, B > const &wf, Mapper &&mapper, std::size_t num_succs, In &&... in)
 A specialization of spawn_element for the case that the given workfunction is a skeleton itself and the skeleton is not reducing to a single element. Examples of such are zip(zip(op)), map(butterfly(op)). More...
 
template<bool isResult, typename WF , typename Mapper , typename ... In>
void spawn_element (std::size_t tid, std::size_t result_id, std::vector< std::size_t > const &notifications, WF &&wf, Mapper &&mapper, std::size_t num_succs, In &&... in)
 A specialization of spawn_element where the notification dependencies are also specified (notifications). More...
 
template<typename WF , typename Farm , typename ... In>
void spawn_farm_element (WF &&wf, Farm &&farm, In &&... in)
 Spawn a task generated by a farm. More...
 
template<typename... Args>
void pre_spawn (Args &&...) const
 
template<typename... Args>
void post_spawn (Args &&...) const
 
void set_num_succs (std::size_t tid, std::size_t num_succs) const
 
void init_location_info (std::size_t num_PEs, runtime::location_id loc_id)
 
std::size_t get_num_PEs () const
 
runtime::location_id get_PE_id () const
 

Detailed Description

template<typename TGV>
class stapl::skeletons::taskgraph_env< TGV >

The main environment for spawning skeletons in STAPL and evaluating them as taskgraphs is taskgraph_env. It gets the workfunction, unwraps the inputs which are given as producer_info (indexed_producer, view_element_producer, etc.) and calls add_task or set_num_succs from the given PARAGRAPH via the given taskgraph view (TGV)

Template Parameters
TGVtaskgraph view that can be used to create tasks and modify their metadata in STAPL

Member Function Documentation

◆ spawn_element() [1/3]

template<typename TGV >
template<bool isResult, typename WF , typename Mapper , typename... In>
std::enable_if< !skeletons::is_nested_skeleton<typename std::decay<WF>::type>::value, void>::type stapl::skeletons::taskgraph_env< TGV >::spawn_element ( std::size_t  tid,
std::size_t  result_id,
WF &&  wf,
Mapper &&  mapper,
std::size_t  num_succs,
In &&...  in 
)

Spawns an element in a given taskgraph. It first unwraps the input given as various types of producer_info and converts them to acceptable arguments to PARAGRAPH's input arguments for add_task requests.

Parameters
tidthe unique task id assigned for this element
result_idresult_id of this task if it has one
wfthe workfunction to be executed by the task
mapperthe output to output mapper for mapping the results of the child paragraph to current paragraph
num_succsthe exact number of successors for this task. Remember that in some cases this value is set to stapl::defer_specs (when the spawner is in SET_HOLD mode)
ininputs
Note
The enable_if in here is required only by gcc 4.8.2 and older versions.

◆ spawn_element() [2/3]

template<typename TGV >
template<bool isResult, typename S , bool Reducer, typename ExecutionParams , bool B, typename Mapper , typename... In>
void stapl::skeletons::taskgraph_env< TGV >::spawn_element ( std::size_t  tid,
std::size_t  result_id,
wrapped_skeleton< S, tags::nested_execution< Reducer >, ExecutionParams, B > const &  wf,
Mapper &&  mapper,
std::size_t  num_succs,
In &&...  in 
)

A specialization of spawn_element for the case that the given workfunction is a skeleton itself and the skeleton is not reducing to a single element. Examples of such are zip(zip(op)), map(butterfly(op)).

Internally, nested skeletons are wrapped inside the adapter class called wrapped_skeleton, which contains the preference for execution.

Parameters
tidthe unique task id assigned for this element
result_idresult_id of this task if it has one
wfa wrapped_skeleton with a nested_execution execution tag
mapperthe output to output mapper for mapping the results of the child paragraph to current paragraph
num_succsthe exact number of successors for this task. Remember that in some cases this value is set to stapl::defer_specs (when the spawner is in SET_HOLD mode)
ininputs

◆ spawn_element() [3/3]

template<typename TGV >
template<bool isResult, typename WF , typename Mapper , typename ... In>
void stapl::skeletons::taskgraph_env< TGV >::spawn_element ( std::size_t  tid,
std::size_t  result_id,
std::vector< std::size_t > const &  notifications,
WF &&  wf,
Mapper &&  mapper,
std::size_t  num_succs,
In &&...  in 
)

A specialization of spawn_element where the notification dependencies are also specified (notifications).

Parameters
tidthe unique task id assigned for this element
result_idresult_id of this task if it has one
notificationsthe list of task ids which this task depends on
wfthe workfunction to be executed by the task
mapperthe output to output mapper for mapping the results of the child paragraph to current paragraph
num_succsthe exact number of successors for this task. Remember that in some cases this value is set to stapl::defer_specs (when the spawner is in SET_HOLD mode)
ininputs

◆ spawn_farm_element()

template<typename TGV >
template<typename WF , typename Farm , typename ... In>
void stapl::skeletons::taskgraph_env< TGV >::spawn_farm_element ( WF &&  wf,
Farm &&  farm,
In &&...  in 
)

Spawn a task generated by a farm.

Parameters
wfthe workfunction to be executed by the task
ininputs

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