|
Hedgehog
0.0.0
A library to generate hybrid pipeline workflow systems
|
Core switch, determine where to divert data to the graphs. More...
#include "core_switch.h"


Public Member Functions | |
| CoreSwitch () | |
| Default core switch. | |
| std::shared_ptr< CoreNode > | clone () override |
| Clone a default core switch. More... | |
| behavior::Node * | node () override |
| Send a user node, not possible for a switch, should only be managed by an execution pipeline, throw an error in every case. More... | |
| void | visit ([[maybe_unused]]AbstractPrinter *) override |
| Visit a switch, do nothing. | |
| void | addSlot (CoreSlot *slot) override |
| Add a slot for every input types. More... | |
| void | removeSlot (CoreSlot *slot) override |
| Remove a slot from every input types. More... | |
| void | notifyAllTerminated () override |
| Notify terminated for all input types. | |
| std::string | extraPrintingInformation () override |
| Print extra information for the switch. More... | |
Public Member Functions inherited from hh::core::CoreQueueSender< GraphInputs > | |
| CoreQueueSender (std::string_view const &name, NodeType const type, size_t const numberThreads) | |
| CoreQueueSender constructor. More... | |
| ~CoreQueueSender () override | |
| CoreQueueSender destructor. | |
| virtual std::shared_ptr< std::set< CoreQueueReceiver< GraphInputs > *> > const & | destinations () const |
| Destination accessor. More... | |
| void | addReceiver (CoreReceiver< GraphInputs > *receiver) override |
| Add a receiver to the set of receivers. More... | |
| void | removeReceiver (CoreReceiver< GraphInputs > *receiver) override |
| Remove a receiver from the set of receivers. More... | |
| void | sendAndNotify (std::shared_ptr< GraphInputs > ptr) final |
| Send a data to the list of destinations, and notify them. More... | |
| void | visit (AbstractPrinter *printer) override |
| Special visit method for a CoreQueueSender, printing an edge. More... | |
| std::set< CoreSender< GraphInputs > *> | getSenders () override |
| Get inner CoreSender i.e. this. More... | |
| void | copyInnerStructure (CoreQueueSender< GraphInputs > *rhs) |
| Copy the inner structure of a CoreQueueSender (destinations, and notifier) More... | |
Public Member Functions inherited from hh::core::CoreSender< GraphInputs > | |
| CoreSender (std::string_view const &name, NodeType const type, size_t const numberThreads) | |
| CoreSender constructor. More... | |
| ~CoreSender () override | |
| CoreSender destructor. | |
Public Member Functions inherited from hh::core::CoreNotifier | |
| CoreNotifier ()=delete | |
| Deleted default constructor. | |
| CoreNotifier (std::string_view const &name, NodeType const type, size_t const numberThreads) | |
| Notifier constructor. More... | |
| ~CoreNotifier () override | |
| Notifier destructor. | |
Public Member Functions inherited from hh::core::CoreNode | |
| 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::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... | |
| 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. | |
| 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... | |
Public Member Functions inherited from hh::core::CoreQueueNotifier | |
| CoreQueueNotifier (std::string_view const &name, NodeType const type, size_t const numberThreads) | |
| CoreQueueNotifier constructor. More... | |
| ~CoreQueueNotifier () override | |
| CoreQueueNotifier destructor. | |
| std::shared_ptr< std::set< CoreSlot * > > const & | slots () const |
| Connected slots accessor. More... | |
| void | copyInnerStructure (CoreQueueNotifier *rhs) |
| Copy the inner structure of the notifier (set of slots and connections) More... | |
Protected Member Functions | |
| void | duplicateEdge (CoreNode *duplicateNode, std::map< CoreNode *, std::shared_ptr< CoreNode >> &correspondenceMap) override |
| Duplicate all the edges from this to its copy duplicateNode. More... | |
Protected Member Functions inherited from hh::core::CoreQueueSender< GraphInputs > | |
| void | duplicateEdge (CoreNode *duplicateNode, std::map< CoreNode *, std::shared_ptr< CoreNode >> &correspondenceMap) override |
| Duplicate all the edges from this to it's copy duplicateNode. More... | |
Protected Member Functions inherited from hh::core::CoreNode | |
| 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 Member Functions | |
| template<class GraphInput > | |
| void | printSenderInfo (std::ostringstream &oss) |
| Stream all sender information into oss. More... | |
| std::set< CoreSlot * > | getSlots () override |
| Slots accessors, throw an error, a switch does not have any slots. More... | |
Core switch, determine where to divert data to the graphs.
| GraphInputs | Graph input types |
Definition at line 32 of file core_switch.h.
|
inlineoverridevirtual |
Add a slot for every input types.
| slot | slot to add |
Reimplemented from hh::core::CoreQueueNotifier.
Definition at line 61 of file core_switch.h.

|
inlineoverridevirtual |
Clone a default core switch.
Implements hh::core::CoreNode.
Definition at line 43 of file core_switch.h.
|
inlineoverrideprotectedvirtual |
Duplicate all the edges from this to its copy duplicateNode.
| duplicateNode | Node to connect |
| correspondenceMap | Correspondence map from base node to copy |
Implements hh::core::CoreNode.
Definition at line 83 of file core_switch.h.

|
inlineoverridevirtual |
Print extra information for the switch.
Reimplemented from hh::core::CoreNode.
Definition at line 72 of file core_switch.h.
|
inlineoverrideprivatevirtual |
Slots accessors, throw an error, a switch does not have any slots.
| std::runtime_error | A switch does not have any slots |
Implements hh::core::CoreNode.
Definition at line 103 of file core_switch.h.
|
inlineoverridevirtual |
Send a user node, not possible for a switch, should only be managed by an execution pipeline, throw an error in every case.
| std::runtime_error | A switch has not nodes |
Implements hh::core::CoreNode.
Definition at line 49 of file core_switch.h.
|
inlineprivate |
Stream all sender information into oss.
| GraphInput | Type of Sender to stream |
| oss | std::ostringstream to stream into |
Definition at line 93 of file core_switch.h.

|
inlineoverridevirtual |
Remove a slot from every input types.
| slot | CoreSlot to remove |
Reimplemented from hh::core::CoreQueueNotifier.
Definition at line 65 of file core_switch.h.
