![]() |
HTGS
v2.0
The Hybrid Task Graph Scheduler
|
Implements the rule edge that is added to the graph. More...
#include <htgs/core/graph/edge/RuleEdge.hpp>
Public Member Functions | |
RuleEdge (Bookkeeper< T > *bookkeeper, std::shared_ptr< IRule< T, U >> rule, ITask< U, W > *consumer) | |
Creates a rule edge. More... | |
void | applyEdge (AnyTaskGraphConf *graph) override |
Applies an edge to a task graph. More... | |
EdgeDescriptor * | copy (AnyTaskGraphConf *graph) override |
Creates a copy of the edge descriptor to be added to other graphs, such as those within execution pipelines. More... | |
![]() | |
virtual | ~EdgeDescriptor () |
Destructor. | |
Private Attributes | |
Bookkeeper< T > * | bookkeeper |
The bookkeeper task. | |
std::shared_ptr< IRule< T, U > > | rule |
the rule | |
ITask< U, W > * | consumer |
the consumer task | |
Implements the rule edge that is added to the graph.
This edge connects a bookkeeper with some consumer task via a rule. The rule is used to decide when to produce data, often based on the state of the computation.
When applying the edge, the bookkeeper and consumer tasks are created. A new rule manager is created to manage the rule. This rule manager is added to the bookkeeper and uses the input connector from the consumer task to produce data.
During edge copying the bookkeeper and consumer tasks are copied. The rule is reused. This mechanism shares the rule among multiple bookkeepers, but is acceptable as the rule defines a mutex to ensure no race conditions.
T | the input type of the Bookkeeper and IRule |
U | the output type of the IRule and the input type of the consumer ITask |
W | the output type of the consumer ITask |
|
inline |
Creates a rule edge.
bookkeeper | the bookkeeper task |
rule | the rule |
consumer | the consumer task |
|
inlineoverridevirtual |
Applies an edge to a task graph.
An edge is added to the supplied task graph. Each ITask is obtains a task manager that is to be used to manage the ITask. The graph has helper function AnyTaskGraphConf::getTaskManager. This is used to get the correct task manager that is to be used for a given ITask.
graph | the task graph configuration that the edge is applied to. |
Implements htgs::EdgeDescriptor.
|
inlineoverridevirtual |
Creates a copy of the edge descriptor to be added to other graphs, such as those within execution pipelines.
The edge descriptor typically has ITasks that are added to a TaskManager, which is then added to the task graph. The copy function is used to copy the ITasks and any other meta data that is needed for applying the edge. The implementation should use the AnyTaskGraphConf::getCopy function to get copies of the ITask.
graph | the graph you are getting ITask copies from. |
Implements htgs::EdgeDescriptor.