Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
Task core abstraction used to define some method for task-like behaving cores like CoreExecutionPipeline, CoreStateManager, CoreTask. More...
#include "task_node_abstraction.h"
Public Member Functions | |
TaskNodeAbstraction (std::string const &name, behavior::Node *node) | |
Create the abstraction with the node's name. | |
~TaskNodeAbstraction () override=default | |
Default destructor. | |
bool | isActive () const |
Accessor to task status. | |
bool | isInitialized () const |
Accessor to initialized flag. | |
size_t | numberReceivedElements () const |
Accessor to the number of received elements. | |
std::chrono::nanoseconds const & | waitDuration () const |
Accessor to the duration the node was in a wait state. | |
std::chrono::nanoseconds const & | memoryWaitDuration () const |
Accessor to the duration the node was in a memory wait state. | |
std::shared_ptr< NvtxProfiler > const & | nvtxProfiler () const |
Accessor to the NVTX profiler attached to the node. | |
std::chrono::nanoseconds | perElementExecutionDuration () const |
Accessor to the duration the average duration of processing an input data. | |
void | isActive (bool isActive) |
Setter to the task status. | |
void | incrementNumberReceivedElements () |
Increment the number of elements received. | |
void | incrementWaitDuration (std::chrono::nanoseconds const &wait) |
Increment the wait duration. | |
void | incrementMemoryWaitDuration (std::chrono::nanoseconds const &wait) |
Increase the memory wait duration. | |
void | incrementPerElementExecutionDuration (std::chrono::nanoseconds const &exec) |
Increase the execution time per elements. | |
virtual void | preRun ()=0 |
Pre run method, called only once. | |
virtual void | run ()=0 |
Run method, called when thread is attached. | |
virtual void | postRun ()=0 |
Post run method, called only once. | |
virtual std::string | extraPrintingInformation () const =0 |
Abstraction to add user-defined message for the printers. | |
virtual bool | hasMemoryManagerAttached () const =0 |
Flag accessor to the presence of memory manager attached. | |
virtual std::shared_ptr< AbstractMemoryManager > | memoryManager () const =0 |
Accessor to the attached memory manager. | |
behavior::Node * | node () const override |
Node accessor. | |
![]() | |
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 Member Functions | |
void | setInitialized () |
Set the task as initialized. | |
Private Attributes | |
size_t | numberReceivedElements_ = 0 |
Number of elements received. | |
bool | isActive_ = false |
Active flag. | |
bool | isInitialized_ = false |
Is initialized flag. | |
std::chrono::nanoseconds | perElementExecutionDuration_ = std::chrono::nanoseconds::zero() |
Node per element duration. | |
std::chrono::nanoseconds | waitDuration_ = std::chrono::nanoseconds::zero() |
Node wait duration. | |
std::chrono::nanoseconds | memoryWaitDuration_ = std::chrono::nanoseconds::zero() |
Node memory wait duration. | |
std::shared_ptr< NvtxProfiler > | nvtxProfiler_ = nullptr |
Store hedgehog nvtx profiler for the task. | |
behavior::Node * | node_ = nullptr |
Node attache to this task-like core. | |
Task core abstraction used to define some method for task-like behaving cores like CoreExecutionPipeline, CoreStateManager, CoreTask.
Definition at line 39 of file task_node_abstraction.h.
|
inlineexplicit |
Create the abstraction with the node's name.
name | Name of the node |
node | Node attached to this core |
Definition at line 61 of file task_node_abstraction.h.
|
overridedefault |
Default destructor.
|
pure virtual |
Abstraction to add user-defined message for the printers.
Implemented in hh::core::CoreExecutionPipeline< Separator, AllTypes >, hh::core::CoreExecutionPipeline< Separator, AllTypes... >, hh::core::CoreStateManager< Separator, AllTypes >, hh::core::CoreStateManager< Separator, AllTypes... >, hh::core::CoreTask< Separator, AllTypes >, and hh::core::CoreTask< Separator, AllTypes... >.
|
pure virtual |
Flag accessor to the presence of memory manager attached.
Implemented in hh::core::abstraction::ExecutionPipelineNodeAbstraction, hh::core::CoreStateManager< Separator, AllTypes >, hh::core::CoreStateManager< Separator, AllTypes... >, hh::core::CoreTask< Separator, AllTypes >, and hh::core::CoreTask< Separator, AllTypes... >.
|
inline |
Increase the memory wait duration.
wait | Duration in nanoseconds |
Definition at line 116 of file task_node_abstraction.h.
|
inline |
Increment the number of elements received.
Definition at line 108 of file task_node_abstraction.h.
|
inline |
Increase the execution time per elements.
exec | Duration in nanoseconds |
Definition at line 120 of file task_node_abstraction.h.
|
inline |
Increment the wait duration.
wait | Duration in nanoseconds |
Definition at line 112 of file task_node_abstraction.h.
|
inline |
Accessor to task status.
Definition at line 70 of file task_node_abstraction.h.
|
inline |
Setter to the task status.
isActive | Status to set |
Definition at line 105 of file task_node_abstraction.h.
|
inline |
Accessor to initialized flag.
Definition at line 74 of file task_node_abstraction.h.
|
pure virtual |
Accessor to the attached memory manager.
Implemented in hh::core::abstraction::ExecutionPipelineNodeAbstraction, hh::core::CoreStateManager< Separator, AllTypes >, hh::core::CoreStateManager< Separator, AllTypes... >, hh::core::CoreTask< Separator, AllTypes >, and hh::core::CoreTask< Separator, AllTypes... >.
|
inline |
Accessor to the duration the node was in a memory wait state.
Definition at line 88 of file task_node_abstraction.h.
|
inlineoverridevirtual |
Node accessor.
Implements hh::core::abstraction::NodeAbstraction.
Definition at line 147 of file task_node_abstraction.h.
|
inline |
Accessor to the number of received elements.
Definition at line 80 of file task_node_abstraction.h.
|
inline |
Accessor to the NVTX profiler attached to the node.
Definition at line 92 of file task_node_abstraction.h.
|
inline |
Accessor to the duration the average duration of processing an input data.
Definition at line 96 of file task_node_abstraction.h.
|
pure virtual |
Post run method, called only once.
Implemented in hh::core::CoreExecutionPipeline< Separator, AllTypes >, hh::core::CoreExecutionPipeline< Separator, AllTypes... >, hh::core::CoreStateManager< Separator, AllTypes >, hh::core::CoreStateManager< Separator, AllTypes... >, hh::core::CoreTask< Separator, AllTypes >, and hh::core::CoreTask< Separator, AllTypes... >.
|
pure virtual |
Pre run method, called only once.
Implemented in hh::core::CoreExecutionPipeline< Separator, AllTypes >, hh::core::CoreExecutionPipeline< Separator, AllTypes... >, hh::core::CoreStateManager< Separator, AllTypes >, hh::core::CoreStateManager< Separator, AllTypes... >, hh::core::CoreTask< Separator, AllTypes >, and hh::core::CoreTask< Separator, AllTypes... >.
|
pure virtual |
Run method, called when thread is attached.
Implemented in hh::core::CoreExecutionPipeline< Separator, AllTypes >, hh::core::CoreExecutionPipeline< Separator, AllTypes... >, hh::core::CoreStateManager< Separator, AllTypes >, hh::core::CoreStateManager< Separator, AllTypes... >, hh::core::CoreTask< Separator, AllTypes >, and hh::core::CoreTask< Separator, AllTypes... >.
|
inlineprotected |
Set the task as initialized.
Definition at line 151 of file task_node_abstraction.h.
|
inline |
Accessor to the duration the node was in a wait state.
Definition at line 84 of file task_node_abstraction.h.
|
private |
Active flag.
Definition at line 43 of file task_node_abstraction.h.
|
private |
Is initialized flag.
Definition at line 44 of file task_node_abstraction.h.
|
private |
Node memory wait duration.
Definition at line 49 of file task_node_abstraction.h.
|
private |
Node attache to this task-like core.
Definition at line 55 of file task_node_abstraction.h.
|
private |
Number of elements received.
Definition at line 41 of file task_node_abstraction.h.
|
private |
Store hedgehog nvtx profiler for the task.
Definition at line 52 of file task_node_abstraction.h.
|
private |
Node per element duration.
Definition at line 47 of file task_node_abstraction.h.
|
private |
Node wait duration.
Definition at line 48 of file task_node_abstraction.h.