|
Hedgehog
0.0.0
A library to generate hybrid pipeline workflow systems
|
Node interface made for duplicating a graph, for example in the case of multi-GPU computation. More...
#include "abstract_execution_pipeline.h"


Public Member Functions | |
| AbstractExecutionPipeline ()=delete | |
| Deleted default constructor, an execution pipeline need to be constructed with a compatible graph. | |
| AbstractExecutionPipeline (std::shared_ptr< Graph< GraphOutput, GraphInputs... >> graph, size_t const &numberGraphDuplications, bool iota=false) | |
| Constructor to set an execution pipeline with a graph and the total number of graphs. More... | |
| AbstractExecutionPipeline (std::shared_ptr< Graph< GraphOutput, GraphInputs... >> graph, size_t const &numberGraphDuplications, std::vector< int > const deviceIds, bool automaticStart=false) | |
| Constructor to set an execution pipeline with a graph, the total number of graphs, the device Ids, and set the execution to automatically start. More... | |
| AbstractExecutionPipeline (std::string_view const &name, std::shared_ptr< Graph< GraphOutput, GraphInputs... >> const &graph, size_t const &numberGraphDuplications, std::vector< int > const &deviceIds, bool automaticStart=false) | |
| Constructor to set an execution pipeline with a graph, the total number of graphs, the device Ids and set the execution to automatically start. More... | |
| virtual | ~AbstractExecutionPipeline ()=default |
| Default destructor. | |
| std::shared_ptr< core::CoreNode > | core () override |
| Execution Pipeline accessor core. More... | |
| std::shared_ptr< Graph< GraphOutput, GraphInputs... > > const & | graph () const |
| Inner graph accessor. More... | |
Public Member Functions inherited from hh::behavior::Node | |
| virtual std::string | extraPrintingInformation () const |
| Adds node information to print in the dot file. More... | |
| virtual bool | canTerminate () |
| Determine if the node can terminate. More... | |
Public Member Functions inherited from hh::behavior::SwitchRule< GraphInputs > | |
| virtual bool | sendToGraph (std::shared_ptr< GraphInputs > &data, size_t const &graphId)=0 |
| Switch rule to determine if data should be sent to the graph graphId managed by an AbstractExecutionPipeline. More... | |
Private Attributes | |
| std::shared_ptr< Graph< GraphOutput, GraphInputs... > > | graph_ = nullptr |
| Original Graph that will be duplicated. | |
| std::shared_ptr< core::CoreDefaultExecutionPipeline< GraphOutput, GraphInputs... > > | coreExecutionPipeline_ = nullptr |
| Execution Pipeline core. | |
Additional Inherited Members | |
Public Types inherited from hh::behavior::MultiReceivers< GraphInputs... > | |
| using | inputs_t = std::tuple< Inputs... > |
| Tuple with the list of input types. | |
Public Types inherited from hh::behavior::Sender< GraphOutput > | |
| using | output_t = GraphOutput |
| Output Type. | |
Node interface made for duplicating a graph, for example in the case of multi-GPU computation.
The duplicated graph will run concurrently, and their inside nodes is also duplicated. Each graph will be distinguished thanks to a device ID (deviceId), from 0, the original to n the number of duplications minus one.
Also, it is used as tool to enable multi-GPU computation, each graph will be bounded to a specific device id accessible from the graph's inside nodes.
The code below is from Hedgehog tutorial 5.
A data send to a specialized AbstractExecutionPipeline, before reaching a graph will first go through SwitchRule::sendToGraph that will send it to the graph's copy or not.
Definition at line 97 of file abstract_execution_pipeline.h.
|
inline |
Constructor to set an execution pipeline with a graph and the total number of graphs.
If iota is set to true, the device ids are initialized from 0 to numberGraphDuplications - 1, if iota is set to false, the device Ids are all set to 0.
| graph | Inside Base Graph |
| numberGraphDuplications | Total number of graphs inside the execution pipeline (numberGraphDuplications - 1 duplications) |
| iota | If true the device Id are set from 0 to numberGraphDuplications - 1 (using std::iota), else all device Ids are set to 0. |
Definition at line 123 of file abstract_execution_pipeline.h.
|
inline |
Constructor to set an execution pipeline with a graph, the total number of graphs, the device Ids, and set the execution to automatically start.
| graph | Inside Base Graph |
| numberGraphDuplications | Total number of graphs inside the execution pipeline (numberGraphDuplications - 1 duplications) |
| deviceIds | Vector of Ids, corresponding to device Ids for each inside graphs |
| automaticStart | If True, the execution pipeline will be automatically started by sending nullptr to the SwitchRule::sendToGraph, else not |
Definition at line 143 of file abstract_execution_pipeline.h.
|
inline |
Constructor to set an execution pipeline with a graph, the total number of graphs, the device Ids and set the execution to automatically start.
| name | Execution pipeline's name |
| graph | Inside Base Graph |
| numberGraphDuplications | Total number of graphs inside the execution pipeline (numberGraphDuplications - 1 duplications) |
| deviceIds | Vector of Ids, corresponding to device Ids for each inside graphs |
| automaticStart | If True, the execution pipeline will be automatically started by sending nullptr to the SwitchRule::sendToGraph, else not |
Definition at line 163 of file abstract_execution_pipeline.h.
|
inlineoverridevirtual |
Execution Pipeline accessor core.
Implements hh::behavior::Node.
Definition at line 183 of file abstract_execution_pipeline.h.
|
inline |
Inner graph accessor.
Definition at line 187 of file abstract_execution_pipeline.h.
