|
Hedgehog
0.0.0
A library to generate hybrid pipeline workflow systems
|
Main Hedgehog core abstraction. More...
#include "core_node.h"


Public Member Functions | |
| CoreNode ()=delete | |
| Deleted default constructor. | |
| CoreNode (std::string_view const &name, NodeType const type, size_t numberThreads) | |
| Core node only constructor. More... | |
| virtual | ~CoreNode () |
| Default virtual destructor. | |
| virtual std::shared_ptr< CoreNode > | clone ()=0 |
| Virtual constructor for copy. More... | |
| virtual std::string | id () const |
| Unique Id accessor. More... | |
| virtual std::vector< std::pair< std::string, std::string > > | ids () const |
| Input node ids [nodeId, nodeIdCluster] accessor. More... | |
| std::string_view const & | name () const |
| Node name accessor. More... | |
| NodeType | type () const |
| Node type accessor. More... | |
| bool | isInside () const |
| Node inside property accessor. More... | |
| bool | hasBeenRegistered () const |
| Node registration property accessor. More... | |
| CoreNode * | coreClusterNode () const |
| Main cluster core node link to this node accessor. More... | |
| int | threadId () const |
| Thread id accessor. More... | |
| size_t | numberThreads () const |
| Number of threads associated accessor. More... | |
| CoreNode * | belongingNode () const |
| Belonging node accessor. More... | |
| std::shared_ptr< std::multimap< CoreNode *, std::shared_ptr< CoreNode > > > const & | insideNodes () const |
| Inside node accessor. More... | |
| std::shared_ptr< std::multimap< CoreNode *, std::shared_ptr< CoreNode > > > & | insideNodes () |
| Inside nodes accessor. More... | |
| std::chrono::duration< uint64_t, std::micro > const & | executionTime () const |
| Execution time accessor. More... | |
| std::chrono::duration< uint64_t, std::micro > const & | waitTime () const |
| Wait time accessor. More... | |
| std::chrono::duration< uint64_t, std::micro > const & | memoryWaitTime () const |
| Memory wait time accessor. More... | |
| bool | isInCluster () const |
| In cluster property accessor. More... | |
| bool | isActive () const |
| Is active property accessor. More... | |
| bool | isCudaRelated () const |
| Is related to CUDA, used to have a green background on the dot file. More... | |
| virtual int | graphId () |
| Graph id accessor. More... | |
| virtual int | deviceId () |
| Device id accessor. More... | |
| virtual std::chrono::duration< uint64_t, std::micro > | maxExecutionTime () const |
| Maximum execution time accessor. More... | |
| virtual std::chrono::duration< uint64_t, std::micro > | minExecutionTime () const |
| Minimum execution time accessor. More... | |
| virtual std::chrono::duration< uint64_t, std::micro > | maxWaitTime () const |
| Maximum waiting time accessor. More... | |
| virtual std::chrono::duration< uint64_t, std::micro > | minWaitTime () const |
| Minimum waiting time accessor. More... | |
| std::chrono::time_point< std::chrono::high_resolution_clock > const & | creationTimeStamp () const |
| Creation timestamp accessor. More... | |
| std::chrono::time_point< std::chrono::high_resolution_clock > const & | startExecutionTimeStamp () const |
| Execution start timestamp accessor. More... | |
| std::chrono::duration< uint64_t, std::micro > const & | creationDuration () const |
| Creation duration accessor. More... | |
| std::chrono::duration< uint64_t, std::micro > const & | executionDuration () const |
| Execution duration accessor. More... | |
| std::chrono::duration< uint64_t, std::micro > | meanExecTimeCluster () const |
| Compute and return the mean execution time for all tasks in the node cluster. More... | |
| std::chrono::duration< uint64_t, std::micro > | meanWaitTimeCluster () const |
| Compute and return the mean wait time for all tasks in the node cluster. More... | |
| std::chrono::duration< uint64_t, std::micro > | meanMemoryWaitTimeCluster () const |
| Compute and return the mean memory wait time for all tasks in the node cluster. More... | |
| uint64_t | stdvExecTimeCluster () const |
| Compute and return the standard deviation execution time for all tasks in the node cluster. More... | |
| uint64_t | stdvWaitTimeCluster () const |
| Compute and return the standard deviation wait time for all tasks in the node cluster. More... | |
| uint64_t | stdvMemoryWaitTimeCluster () const |
| Compute and return the standard deviation memory wait time for all tasks in the node cluster. More... | |
| std::pair< uint64_t, uint64_t > | minmaxWaitTimeCluster () const |
| Compute and return the min and max wait time for all tasks in the node cluster. More... | |
| std::pair< uint64_t, uint64_t > | minmaxMemoryWaitTimeCluster () const |
| Compute and return the min and max memory wait time for all tasks in the node cluster. More... | |
| std::pair< uint64_t, uint64_t > | minmaxExecTimeCluster () const |
| Compute and return the min and max execution time for all tasks in the node cluster. More... | |
| size_t | numberActiveThreadInCluster () const |
| Compute and return the number of active nodes in a cluster. More... | |
| virtual std::string | extraPrintingInformation () |
| Extra printing information accessor. More... | |
| void | startExecutionTimeStamp (std::chrono::time_point< std::chrono::high_resolution_clock > const &startExecutionTimeStamp) |
| Execution timestamp setter. More... | |
| virtual void | deviceId (int deviceId) |
| Device id setter. More... | |
| virtual void | setInside () |
| Set the node as inside, (inside a graph) | |
| void | setInCluster () |
| Set the task as part of a cluster. | |
| void | threadId (uint8_t threadId) |
| Set the thread id. More... | |
| void | coreClusterNode (CoreNode *coreClusterNode) |
| Set the main cluster node to associate to this node. More... | |
| void | name (std::string_view const &name) |
| Name node setter. More... | |
| void | numberThreads (size_t numberThreads) |
| Number of threads setter. More... | |
| void | belongingNode (CoreNode *belongingNode) |
| Belonging node setter. More... | |
| void | hasBeenRegistered (bool hasBeenRegistered) |
| Has been registered property setter. More... | |
| void | isActive (bool isActive) |
| Is active property setter. More... | |
| void | isCudaRelated (bool isCudaRelated) |
| Is CUDA related property setter. More... | |
| void | isInside (bool isInside) |
| Set the node as being inside another one. More... | |
| void | creationDuration (std::chrono::duration< uint64_t, std::micro > const &creationDuration) |
| Creation duration setter. More... | |
| void | executionDuration (std::chrono::duration< uint64_t, std::micro > const &executionDuration) |
| Execution duration setter. More... | |
| void | incrementWaitForMemoryDuration (std::chrono::duration< uint64_t, std::micro > const &memoryWait) |
| Add wait for memory duration to total duration. More... | |
| virtual void | preRun () |
| Method defining what to do before the run. | |
| virtual void | run () |
| Run method, main execution. | |
| virtual void | postRun () |
| Method defining what to do after the run. | |
| virtual void | createCluster (std::shared_ptr< std::multimap< CoreNode *, std::shared_ptr< CoreNode >>> &) |
| Define how to create a cluster for the node, by default do nothing. | |
| virtual void | joinThreads () |
| Define what is done when the thread is joined. | |
| virtual void | duplicateEdge (CoreNode *duplicateNode, std::map< CoreNode *, std::shared_ptr< CoreNode >> &correspondenceMap)=0 |
| Duplicate all of the edges from this to its copy duplicateNode. More... | |
| virtual behavior::Node * | node ()=0 |
| User's node accessor. More... | |
| virtual void | visit (AbstractPrinter *printer)=0 |
| Abstract visit method for printing mechanism. More... | |
| virtual std::set< CoreSlot * > | getSlots ()=0 |
| Slots accessor for the node. More... | |
| void | removeInsideNode (CoreNode *coreNode) |
| Remove a node from the registered inside nodes. More... | |
| void | copyInnerStructure (CoreNode *rhs) |
| Copy inner structure from rhs nodes to this. More... | |
Protected Member Functions | |
| void | addUniqueInsideNode (const std::shared_ptr< CoreNode > &coreNode) |
| Add a node to the inside nodes. More... | |
| void | incrementWaitDuration (std::chrono::duration< uint64_t, std::micro > const &wait) |
| Increment wait duration. More... | |
| void | incrementExecutionDuration (std::chrono::duration< uint64_t, std::micro > const &exec) |
| Increment execution duration. More... | |
Private Attributes | |
| bool | isInside_ = false |
| True if the node is inside a graph, else False. | |
| bool | hasBeenRegistered_ = false |
| True if the node has been registered into a graph, else False. | |
| bool | isCudaRelated_ = false |
| True if the node is related with CUDA, else False. | |
| bool | isInCluster_ = false |
| True if the node is in cluster, else False. | |
| bool | isActive_ = false |
| True if the node is active, else False. | |
| int | threadId_ = 0 |
| Thread id, used to debug only. | |
| size_t | numberThreads_ = 1 |
| Number of threads associated to the node. | |
| std::string_view | name_ = "" |
| Node name. | |
| NodeType const | type_ |
| Node type. | |
| CoreNode * | belongingNode_ = nullptr |
| Pointer to the belonging node, a graph, does not store memory, just for reference. | |
| CoreNode * | coreClusterNode_ = nullptr |
| Pointer to the main cluster node, does not store memory, just for reference. | |
| std::shared_ptr< std::multimap< CoreNode *, std::shared_ptr< CoreNode > > > | insideNodes_ = nullptr |
| Map of inside nodes [Main Cluster Node -> Node]. | |
| std::chrono::duration< uint64_t, std::micro > | creationDuration_ = std::chrono::duration<uint64_t, std::micro>::zero() |
| Node creation duration. | |
| std::chrono::duration< uint64_t, std::micro > | executionDuration_ = std::chrono::duration<uint64_t, std::micro>::zero() |
| Node execution duration. | |
| std::chrono::duration< uint64_t, std::micro > | waitDuration_ = std::chrono::duration<uint64_t, std::micro>::zero() |
| Node wait duration. | |
| std::chrono::duration< uint64_t, std::micro > | memoryWaitDuration_ = std::chrono::duration<uint64_t, std::micro>::zero() |
| Node memory wait duration. | |
| std::chrono::time_point< std::chrono::high_resolution_clock > const | creationTimeStamp_ = std::chrono::high_resolution_clock::now() |
| Node creation timestamp. | |
| std::chrono::time_point< std::chrono::high_resolution_clock > | startExecutionTimeStamp_ = std::chrono::high_resolution_clock::now() |
| Node begin execution timestamp. | |
Main Hedgehog core abstraction.
Definition at line 48 of file core_node.h.
|
inline |
Core node only constructor.
| name | Node name |
| type | Node type |
| numberThreads | Node number of threads |
Definition at line 92 of file core_node.h.
|
inlineprotected |
Add a node to the inside nodes.
| coreNode | Node to add to the inside nodes |
Definition at line 550 of file core_node.h.

|
inline |
Belonging node accessor.
Definition at line 156 of file core_node.h.

|
inline |
Belonging node setter.
| belongingNode | Belonging node |
Definition at line 456 of file core_node.h.


|
pure virtual |
Virtual constructor for copy.
Implemented in hh::core::CoreDefaultExecutionPipeline< GraphOutput, GraphInputs >, hh::core::CoreGraph< GraphOutput, GraphInputs >, hh::core::CoreDefaultTask< TaskOutput, TaskInputs >, hh::core::CoreGraphSource< GraphInputs >, hh::core::CoreGraphSink< GraphOutput >, and hh::core::CoreSwitch< GraphInputs >.
|
inline |
Copy inner structure from rhs nodes to this.
| rhs | Node to copy to this |
Definition at line 537 of file core_node.h.


|
inline |
Main cluster core node link to this node accessor.
Definition at line 144 of file core_node.h.

|
inline |
Set the main cluster node to associate to this node.
| coreClusterNode | Main cluster node to associate to this node |
Definition at line 444 of file core_node.h.


|
inline |
Creation duration accessor.
Definition at line 240 of file core_node.h.

|
inline |
Creation duration setter.
| creationDuration | Creation duration to set |
Definition at line 476 of file core_node.h.
|
inline |
Creation timestamp accessor.
Definition at line 227 of file core_node.h.

|
inlinevirtual |
Device id accessor.
Reimplemented in hh::core::CoreGraph< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, and hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >.
Definition at line 203 of file core_node.h.

|
inlinevirtual |
Device id setter.
| deviceId | Device id |
Reimplemented in hh::core::CoreGraph< GraphOutput, GraphInputs >.
Definition at line 430 of file core_node.h.
|
pure virtual |
Duplicate all of the edges from this to its copy duplicateNode.
| duplicateNode | Node to connect |
| correspondenceMap | Correspondence map from base node to copy |
Implemented in hh::core::CoreQueueSender< NodeOutput >, hh::core::CoreQueueSender< GraphOutput >, hh::core::CoreQueueSender< GraphInputs >, hh::core::CoreQueueSender< TaskOutput >, hh::core::CoreSwitch< GraphInputs >, hh::core::CoreSender< Output >, hh::core::CoreSender< GraphOutput >, hh::core::CoreSender< NodeOutput >, hh::core::CoreSender< GraphInputs >, and hh::core::CoreSender< TaskOutput >.

|
inline |
Execution duration accessor.
Definition at line 244 of file core_node.h.

|
inline |
Execution duration setter.
| executionDuration | Execution duration |
Definition at line 482 of file core_node.h.
|
inline |
|
inlinevirtual |
Extra printing information accessor.
Reimplemented in hh::core::CoreSwitch< GraphInputs >.
Definition at line 419 of file core_node.h.
|
pure virtual |
Slots accessor for the node.
Implemented in hh::core::CoreGraph< GraphOutput, GraphInputs >, hh::core::CoreSwitch< GraphInputs >, hh::core::CoreQueueMultiReceivers< NodeInputs >, hh::core::CoreQueueMultiReceivers< GraphOutput >, hh::core::CoreQueueMultiReceivers< TaskInputs... >, and hh::core::CoreGraphSource< GraphInputs >.

|
inlinevirtual |
Graph id accessor.
Reimplemented in hh::core::CoreGraph< GraphOutput, GraphInputs >.
Definition at line 199 of file core_node.h.

|
inline |
Node registration property accessor.
Definition at line 140 of file core_node.h.

|
inline |
Has been registered property setter.
| hasBeenRegistered | Has been registered property |
Definition at line 460 of file core_node.h.


|
inlinevirtual |
Unique Id accessor.
Reimplemented in hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, and hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >.
Definition at line 114 of file core_node.h.

|
inlinevirtual |
Input node ids [nodeId, nodeIdCluster] accessor.
Reimplemented in hh::core::CoreGraph< GraphOutput, GraphInputs >.
Definition at line 122 of file core_node.h.

|
inlineprotected |
Increment execution duration.
| exec | Duration to add to the execution duration |
Definition at line 565 of file core_node.h.

|
inlineprotected |
Increment wait duration.
| wait | Duration to add to the wait duration |
Definition at line 561 of file core_node.h.

|
inline |
Add wait for memory duration to total duration.
| memoryWait | Duration to add to the memory duration |
Definition at line 488 of file core_node.h.
|
inline |
Inside node accessor.
Definition at line 161 of file core_node.h.

|
inline |
Is active property accessor.
Definition at line 191 of file core_node.h.

|
inline |
Is active property setter.
| isActive | Is active property |
Definition at line 464 of file core_node.h.


|
inline |
Is related to CUDA, used to have a green background on the dot file.
Definition at line 195 of file core_node.h.

|
inline |
Is CUDA related property setter.
| isCudaRelated | CUDA related property to set |
Definition at line 468 of file core_node.h.


|
inline |
In cluster property accessor.
Definition at line 187 of file core_node.h.

|
inline |
Node inside property accessor.
Definition at line 136 of file core_node.h.

|
inline |
Set the node as being inside another one.
| isInside | True if the node is inside another one, else False |
Definition at line 472 of file core_node.h.


|
inlinevirtual |
Maximum execution time accessor.
Reimplemented in hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >, and hh::core::CoreGraph< GraphOutput, GraphInputs >.
Definition at line 207 of file core_node.h.
|
inlinevirtual |
Maximum waiting time accessor.
Reimplemented in hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >, and hh::core::CoreGraph< GraphOutput, GraphInputs >.
Definition at line 219 of file core_node.h.
|
inline |
Compute and return the mean execution time for all tasks in the node cluster.
Definition at line 250 of file core_node.h.
|
inline |
Compute and return the mean memory wait time for all tasks in the node cluster.
Definition at line 280 of file core_node.h.
|
inline |
Compute and return the mean wait time for all tasks in the node cluster.
Definition at line 265 of file core_node.h.
|
inline |
|
inlinevirtual |
Minimum execution time accessor.
Reimplemented in hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >, and hh::core::CoreGraph< GraphOutput, GraphInputs >.
Definition at line 213 of file core_node.h.
|
inline |
Compute and return the min and max execution time for all tasks in the node cluster.
Definition at line 383 of file core_node.h.
|
inline |
Compute and return the min and max memory wait time for all tasks in the node cluster.
Definition at line 363 of file core_node.h.
|
inline |
Compute and return the min and max wait time for all tasks in the node cluster.
Definition at line 343 of file core_node.h.
|
inlinevirtual |
Minimum waiting time accessor.
Reimplemented in hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >, and hh::core::CoreGraph< GraphOutput, GraphInputs >.
Definition at line 223 of file core_node.h.
|
inline |
Node name accessor.
Definition at line 128 of file core_node.h.

|
inline |
Name node setter.
| name | Name node to set |
Definition at line 448 of file core_node.h.


|
pure virtual |
User's node accessor.
Implemented in hh::core::CoreGraph< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >, hh::core::CoreGraphReceiver< GraphInput >, hh::core::CoreGraphReceiver< GraphInputs >, hh::core::CoreTask< TaskOutput, TaskInputs >, hh::core::CoreTask< GraphOutput, GraphInputs... >, hh::core::CoreTask< TaskOutput, TaskInputs... >, hh::core::CoreGraphSource< GraphInputs >, hh::core::CoreGraphMultiReceivers< GraphInputs >, hh::core::CoreGraphMultiReceivers< GraphInputs... >, hh::core::CoreGraphSink< GraphOutput >, and hh::core::CoreSwitch< GraphInputs >.
|
inline |
Compute and return the number of active nodes in a cluster.
Definition at line 404 of file core_node.h.
|
inline |
Number of threads associated accessor.
Definition at line 152 of file core_node.h.

|
inline |
Number of threads setter.
| numberThreads | Number of threads |
Definition at line 452 of file core_node.h.


|
inline |
Remove a node from the registered inside nodes.
| coreNode | Node to remove from the inside nodes |
Definition at line 529 of file core_node.h.


|
inline |
Execution start timestamp accessor.
Definition at line 233 of file core_node.h.

|
inline |
Execution timestamp setter.
| startExecutionTimeStamp | Execution timestamp to set |
Definition at line 424 of file core_node.h.
|
inline |
Compute and return the standard deviation execution time for all tasks in the node cluster.
Definition at line 295 of file core_node.h.
|
inline |
Compute and return the standard deviation memory wait time for all tasks in the node cluster.
Definition at line 327 of file core_node.h.
|
inline |
Compute and return the standard deviation wait time for all tasks in the node cluster.
Definition at line 311 of file core_node.h.
|
inline |
Thread id accessor.
Definition at line 148 of file core_node.h.

|
inline |
Set the thread id.
| threadId | Thread id to set |
Definition at line 440 of file core_node.h.


|
inline |
Node type accessor.
Definition at line 132 of file core_node.h.

|
pure virtual |
Abstract visit method for printing mechanism.
| printer | Printer visitor to print the node |
Implemented in hh::core::CoreGraph< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs >, hh::core::CoreExecutionPipeline< GraphOutput, GraphInputs... >, hh::core::CoreTask< TaskOutput, TaskInputs >, hh::core::CoreTask< GraphOutput, GraphInputs... >, hh::core::CoreTask< TaskOutput, TaskInputs... >, hh::core::CoreQueueSender< NodeOutput >, hh::core::CoreQueueSender< GraphOutput >, hh::core::CoreQueueSender< GraphInputs >, hh::core::CoreQueueSender< TaskOutput >, hh::core::CoreGraphSource< GraphInputs >, and hh::core::CoreGraphSink< GraphOutput >.
|
inline |