Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
Base graph node abstraction. More...
#include "graph_node_abstraction.h"
Public Types | |
enum | Status { INIT , EXEC , TERM , INS } |
Graph status (INITialisation, EXECution, TERMination, INSide) More... | |
Public Member Functions | |
GraphNodeAbstraction (std::string const &name) | |
Base graph abstraction. | |
~GraphNodeAbstraction () override=default | |
Default destructor. | |
int | deviceId () const override |
Device id accessor. | |
size_t | graphId () const override |
Graph id accessor. | |
Status | graphStatus () const |
Graph status accessor. | |
std::chrono::time_point< std::chrono::system_clock > const & | graphStartCreation () const |
Graph start creation timestamp accessor. | |
std::chrono::nanoseconds const & | graphConstructionDuration () const |
Graph construction duration accessor. | |
void | deviceId (int deviceId) |
Setter to the device id. | |
void | graphId (size_t graphId) |
Setter to the graph id. | |
void | graphConstructionDuration (std::chrono::nanoseconds const &graphConstructionDuration) |
Setter to the graph construction duration. | |
void | registerNode (GraphNodeAbstraction *belongingGraph) override |
Register a graph inside a graph. | |
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > | minMaxExecutionDuration () const |
Accessor to the min / max execution duration of the nodes in the graph. | |
std::pair< std::chrono::nanoseconds, std::chrono::nanoseconds > | minMaxWaitDuration () const |
Accessor to the min / max wait duration of the nodes in the graph. | |
virtual void | joinThreads ()=0 |
Interface to join the threads inside of a graph, called by the Default scheduler. | |
virtual void | setInside ()=0 |
Set a graph inside another one. | |
virtual void | createInnerGroupsAndLaunchThreads (bool waitForInitialization)=0 |
Create the groups and launch the threads of the inside nodes. | |
virtual void | registerNodeInsideGraph (NodeAbstraction *core)=0 |
Register a core inside a graph. | |
![]() | |
NodeAbstraction (std::string name) | |
Core node constructor using the core's name. | |
virtual | ~NodeAbstraction ()=default |
DEfault destructor. | |
std::string const & | name () const |
Accessor to the core's name. | |
virtual std::string | id () const |
Core's id ('x' + address of abstraction) as string. | |
bool | isRegistered () const |
Accessor to registration flag. | |
GraphNodeAbstraction * | belongingGraph () const |
Belonging graph accessor. | |
virtual int | deviceId () const |
Get the device identifier (got from belonging graph) | |
virtual size_t | graphId () const |
Get the graph identifier (got from belonging graph) | |
std::chrono::nanoseconds const & | executionDuration () const |
Execution duration. | |
std::chrono::time_point< std::chrono::system_clock > const & | startExecutionTimeStamp () const |
Accessor to the starting execution timestamp. | |
void | startExecutionTimeStamp (std::chrono::time_point< std::chrono::system_clock > const &startExecutionTimeStamp) |
Setter to the starting execution timestamp. | |
void | incrementExecutionDuration (std::chrono::nanoseconds const &exec) |
Increment execution duration. | |
virtual void | registerNode (GraphNodeAbstraction *belongingGraph) |
Register node to the given graph. | |
virtual std::vector< std::pair< std::string const, std::string const > > | ids () const =0 |
Node ids [nodeId, nodeGroupId] accessor. | |
virtual behavior::Node * | node () const =0 |
Node accessor. | |
![]() | |
tool::PrintOptions const & | printOptions () const |
Print options const accessor. | |
tool::PrintOptions & | printOptions () |
Print options accessor. | |
virtual void | visit (Printer *printer)=0 |
Visitor method, used by the printer to visit all nodes in the graph. | |
Protected Attributes | |
std::unique_ptr< std::map< NodeAbstraction *, std::vector< NodeAbstraction * > > > const | insideNodesAndGroups_ = nullptr |
All nodes of the graph, mapped to their group nodes. | |
Status | graphStatus_ = Status::INIT |
Group status. | |
Private Attributes | |
std::chrono::time_point< std::chrono::system_clock > const | graphStartCreation_ = std::chrono::system_clock::now() |
graph creation timestamp | |
std::chrono::nanoseconds | graphConstructionDuration_ = std::chrono::nanoseconds::zero() |
Node creation duration. | |
int | deviceId_ = 0 |
Device Id used for computation on devices. | |
size_t | graphId_ = 0 |
Graph Id used to identify a graph in an execution pipeline. | |
Base graph node abstraction.
Definition at line 36 of file graph_node_abstraction.h.
Graph status (INITialisation, EXECution, TERMination, INSide)
Enumerator | |
---|---|
INIT | |
EXEC | |
TERM | |
INS |
Definition at line 39 of file graph_node_abstraction.h.
|
inlineexplicit |
Base graph abstraction.
name | Graph's name |
Definition at line 58 of file graph_node_abstraction.h.
|
overridedefault |
Default destructor.
|
pure virtual |
Create the groups and launch the threads of the inside nodes.
waitForInitialization | Wait for internal nodes to be initialized flags |
Implemented in hh::core::CoreGraph< Separator, AllTypes >, and hh::core::CoreGraph< Separator, AllTypes... >.
|
inlineoverridevirtual |
Device id accessor.
Reimplemented from hh::core::abstraction::NodeAbstraction.
Definition at line 67 of file graph_node_abstraction.h.
|
inline |
Setter to the device id.
deviceId | Device id to set |
Definition at line 89 of file graph_node_abstraction.h.
|
inline |
Graph construction duration accessor.
Definition at line 85 of file graph_node_abstraction.h.
|
inline |
Setter to the graph construction duration.
graphConstructionDuration | Graph construction duration |
Definition at line 97 of file graph_node_abstraction.h.
|
inlineoverridevirtual |
Graph id accessor.
Reimplemented from hh::core::abstraction::NodeAbstraction.
Definition at line 71 of file graph_node_abstraction.h.
|
inline |
Setter to the graph id.
graphId | Graph id to set |
Definition at line 93 of file graph_node_abstraction.h.
|
inline |
Graph start creation timestamp accessor.
Definition at line 79 of file graph_node_abstraction.h.
|
inline |
|
pure virtual |
Interface to join the threads inside of a graph, called by the Default scheduler.
Implemented in hh::core::CoreGraph< Separator, AllTypes >, and hh::core::CoreGraph< Separator, AllTypes... >.
|
inline |
Accessor to the min / max execution duration of the nodes in the graph.
Definition at line 110 of file graph_node_abstraction.h.
|
inline |
Accessor to the min / max wait duration of the nodes in the graph.
std::runtime_error | All the nodes in a group are not of the same types |
Definition at line 156 of file graph_node_abstraction.h.
|
inlineoverridevirtual |
Register a graph inside a graph.
belongingGraph | Belonging graph used to register this graph |
Reimplemented from hh::core::abstraction::NodeAbstraction.
Definition at line 103 of file graph_node_abstraction.h.
|
pure virtual |
Register a core inside a graph.
core | Core to add to the graph |
|
pure virtual |
Set a graph inside another one.
Implemented in hh::core::CoreGraph< Separator, AllTypes >, and hh::core::CoreGraph< Separator, AllTypes... >.
|
private |
Device Id used for computation on devices.
Definition at line 46 of file graph_node_abstraction.h.
|
private |
Node creation duration.
Definition at line 44 of file graph_node_abstraction.h.
|
private |
Graph Id used to identify a graph in an execution pipeline.
Definition at line 47 of file graph_node_abstraction.h.
|
private |
graph creation timestamp
Definition at line 42 of file graph_node_abstraction.h.
|
protected |
Group status.
Definition at line 53 of file graph_node_abstraction.h.
|
protected |
All nodes of the graph, mapped to their group nodes.
Definition at line 51 of file graph_node_abstraction.h.