Hedgehog  0.0.0
A library to generate hybrid pipeline workflow systems
core_node.h
1 // NIST-developed software is provided by NIST as a public service. You may use, copy and distribute copies of the
2 // software in any medium, provided that you keep intact this entire notice. You may improve, modify and create
3 // derivative works of the software or any portion of the software, and you may copy and distribute such modifications
4 // or works. Modified works should carry a notice stating that you changed the software and should note the date and
5 // nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the
6 // source of the software. NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND,
7 // EXPRESS, IMPLIED, IN FACT OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
8 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR
9 // WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE
10 // CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS
11 // THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE. You
12 // are solely responsible for determining the appropriateness of using and distributing the software and you assume
13 // all risks associated with its use, including but not limited to the risks and costs of program errors, compliance
14 // with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of
15 // operation. This software is not intended to be used in any situation where a failure could cause risk of injury or
16 // damage to property. The software developed by NIST employees is not subject to copyright protection within the
17 // United States.
18 
19 
20 #ifndef HEDGEHOG_CORE_NODE_H
21 #define HEDGEHOG_CORE_NODE_H
22 
23 #include <iostream>
24 #include <sstream>
25 #include <memory>
26 #include <map>
27 #include <set>
28 #include <chrono>
29 #include <cmath>
30 #include <vector>
31 
32 #include "../../api/printer/abstract_printer.h"
33 #include "../../behavior/node.h"
34 #include "../../tools/logger.h"
35 
37 namespace hh::core {
38 
40 enum struct NodeType { Graph, Task, StateManager, Sink, Source, ExecutionPipeline, Switch };
41 
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 class CoreSlot;
45 #endif //DOXYGEN_SHOULD_SKIP_THIS
46 
48 class CoreNode {
49  private:
50  bool
51  isInside_ = false,
52  hasBeenRegistered_ = false,
53  isCudaRelated_ = false,
54  isInCluster_ = false,
55  isActive_ = false;
56 
57  int threadId_ = 0;
58 
59  size_t numberThreads_ = 1;
60 
61  std::string_view name_ = "";
62 
63  NodeType const type_;
64 
65  CoreNode
66  *belongingNode_ = nullptr,
67  *coreClusterNode_ = nullptr;
68 
69  std::shared_ptr<std::multimap<CoreNode *, std::shared_ptr<CoreNode>>>
70  insideNodes_ = nullptr;
71 
72  std::chrono::duration<uint64_t, std::micro>
73  creationDuration_ = std::chrono::duration<uint64_t, std::micro>::zero(),
74  executionDuration_ = std::chrono::duration<uint64_t, std::micro>::zero(),
75  waitDuration_ = std::chrono::duration<uint64_t, std::micro>::zero(),
76  memoryWaitDuration_ = std::chrono::duration<uint64_t, std::micro>::zero();
77 
78  std::chrono::time_point<std::chrono::high_resolution_clock> const
79  creationTimeStamp_ = std::chrono::high_resolution_clock::now();
80 
81  std::chrono::time_point<std::chrono::high_resolution_clock>
82  startExecutionTimeStamp_ = std::chrono::high_resolution_clock::now();
83 
84  public:
86  CoreNode() = delete;
87 
92  CoreNode(std::string_view const &name, NodeType const type, size_t numberThreads)
93  : isActive_(false), name_(name), type_(type), coreClusterNode_(this) {
94  numberThreads_ = numberThreads == 0 ? 1 : numberThreads;
95  HLOG_SELF(0,
96  "Creating CoreNode with type: " << (int) type << ", name: " << name << " and number of Threads: "
97  << this->numberThreads_)
98  this->insideNodes_ = std::make_shared<std::multimap<CoreNode *, std::shared_ptr<CoreNode>>>();
99  }
100 
102  virtual ~CoreNode() {
103  HLOG_SELF(0, "Destructing CoreNode")
104  }
105 
108  virtual std::shared_ptr<CoreNode> clone() = 0; // Virtual constructor (copying)
109 
110  // Accessor
111 
114  [[nodiscard]] virtual std::string id() const {
115  std::stringstream ss{};
116  ss << "x" << this;
117  return ss.str();
118  }
119 
122  [[nodiscard]] virtual std::vector<std::pair<std::string, std::string>> ids() const {
123  return {{this->id(), this->coreClusterNode()->id()}};
124  }
125 
128  [[nodiscard]] std::string_view const &name() const { return name_; }
129 
132  [[nodiscard]] NodeType type() const { return type_; }
133 
136  [[nodiscard]] bool isInside() const { return isInside_; }
137 
140  [[nodiscard]] bool hasBeenRegistered() const { return hasBeenRegistered_; }
141 
144  [[nodiscard]] CoreNode *coreClusterNode() const { return coreClusterNode_; }
145 
148  [[nodiscard]] int threadId() const { return threadId_; }
149 
152  [[nodiscard]] size_t numberThreads() const { return numberThreads_; }
153 
156  [[nodiscard]] CoreNode *belongingNode() const { return belongingNode_; }
157 
160  [[nodiscard]] std::shared_ptr<std::multimap<CoreNode *,
161  std::shared_ptr<CoreNode>>> const &insideNodes() const {
162  return insideNodes_;
163  }
164 
167  [[nodiscard]] std::shared_ptr<std::multimap<CoreNode *, std::shared_ptr<CoreNode>>> &insideNodes() {
168  return insideNodes_;
169  }
170 
173  [[nodiscard]] std::chrono::duration<uint64_t, std::micro> const &executionTime() const { return executionDuration_; }
174 
177  [[nodiscard]] std::chrono::duration<uint64_t, std::micro> const &waitTime() const { return waitDuration_; }
178 
181  [[nodiscard]] std::chrono::duration<uint64_t, std::micro> const &memoryWaitTime() const {
182  return memoryWaitDuration_;
183  }
184 
187  [[nodiscard]] bool isInCluster() const { return this->isInCluster_; }
188 
191  [[nodiscard]] bool isActive() const { return isActive_; }
192 
195  [[nodiscard]] bool isCudaRelated() const { return isCudaRelated_; }
196 
199  [[nodiscard]] virtual int graphId() { return this->belongingNode()->graphId(); }
200 
203  [[nodiscard]] virtual int deviceId() { return this->belongingNode()->deviceId(); }
204 
207  [[nodiscard]] virtual std::chrono::duration<uint64_t, std::micro> maxExecutionTime() const {
208  return this->executionDuration_;
209  }
210 
213  [[nodiscard]] virtual std::chrono::duration<uint64_t, std::micro> minExecutionTime() const {
214  return this->executionDuration_;
215  }
216 
219  [[nodiscard]] virtual std::chrono::duration<uint64_t, std::micro> maxWaitTime() const { return this->waitDuration_; }
220 
223  [[nodiscard]] virtual std::chrono::duration<uint64_t, std::micro> minWaitTime() const { return this->waitDuration_; }
224 
227  [[nodiscard]] std::chrono::time_point<std::chrono::high_resolution_clock> const &creationTimeStamp() const {
228  return creationTimeStamp_;
229  }
230 
233  [[nodiscard]] std::chrono::time_point<std::chrono::high_resolution_clock> const &startExecutionTimeStamp() const {
234  return startExecutionTimeStamp_;
235  }
236 
239  [[nodiscard]] std::chrono::duration<uint64_t,
240  std::micro> const &creationDuration() const { return creationDuration_; }
241 
244  [[nodiscard]] std::chrono::duration<uint64_t, std::micro> const &executionDuration() const {
245  return executionDuration_;
246  }
247 
250  [[nodiscard]] std::chrono::duration<uint64_t, std::micro> meanExecTimeCluster() const {
251  auto ret = this->executionTime();
252  if (this->isInCluster()) {
253  std::chrono::duration<uint64_t, std::micro> sum = std::chrono::duration<uint64_t, std::micro>::zero();
254  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
255  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
256  sum += it->second->executionTime();
257  }
258  ret = sum / this->numberThreads();
259  }
260  return ret;
261  }
262 
265  [[nodiscard]] std::chrono::duration<uint64_t, std::micro> meanWaitTimeCluster() const {
266  auto ret = this->waitTime();
267  if (this->isInCluster()) {
268  std::chrono::duration<uint64_t, std::micro> sum = std::chrono::duration<uint64_t, std::micro>::zero();
269  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
270  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
271  sum += it->second->waitTime();
272  }
273  ret = sum / this->numberThreads();
274  }
275  return ret;
276  }
277 
280  [[nodiscard]] std::chrono::duration<uint64_t, std::micro> meanMemoryWaitTimeCluster() const {
281  auto ret = this->memoryWaitTime();
282  if (this->isInCluster()) {
283  std::chrono::duration<uint64_t, std::micro> sum = std::chrono::duration<uint64_t, std::micro>::zero();
284  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
285  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
286  sum += it->second->memoryWaitTime();
287  }
288  ret = sum / this->numberThreads();
289  }
290  return ret;
291  }
292 
295  [[nodiscard]] uint64_t stdvExecTimeCluster() const {
296  auto ret = 0;
297  if (this->isInCluster()) {
298  auto mean = this->meanExecTimeCluster().count(), meanSquare = mean * mean;
299  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
300  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
301  ret += (uint64_t) std::pow(it->second->executionTime().count(), 2) - meanSquare;
302  }
303  ret /= this->numberThreads();
304  ret = (uint64_t) std::sqrt(ret);
305  }
306  return ret;
307  }
308 
311  [[nodiscard]] uint64_t stdvWaitTimeCluster() const {
312  auto ret = 0;
313  if (this->isInCluster()) {
314  auto mean = this->meanWaitTimeCluster().count(), meanSquare = mean * mean;
315  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
316  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
317  ret += (uint64_t) std::pow(it->second->waitTime().count(), 2) - meanSquare;
318  }
319  ret /= this->numberThreads();
320  ret = (uint64_t) std::sqrt(ret);
321  }
322  return ret;
323  }
324 
327  [[nodiscard]] uint64_t stdvMemoryWaitTimeCluster() const {
328  auto ret = 0;
329  if (this->isInCluster()) {
330  auto mean = this->meanMemoryWaitTimeCluster().count(), meanSquare = mean * mean;
331  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
332  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
333  ret += (uint64_t) std::pow(it->second->memoryWaitTime().count(), 2) - meanSquare;
334  }
335  ret /= this->numberThreads();
336  ret = (uint64_t) std::sqrt(ret);
337  }
338  return ret;
339  }
340 
343  [[nodiscard]] std::pair<uint64_t, uint64_t> minmaxWaitTimeCluster() const {
344  uint64_t min = std::numeric_limits<uint64_t>::max();
345  uint64_t max = 0;
346  uint64_t val = 0;
347  if (this->isInCluster()) {
348  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
349  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
350  val = it->second->waitTime().count();
351  if (val < min) { min = val; }
352  if (val > max) { max = val; }
353  }
354  } else {
355  min = this->meanWaitTimeCluster().count();
356  max = min;
357  }
358  return {min, max};
359  }
360 
363  [[nodiscard]] std::pair<uint64_t, uint64_t> minmaxMemoryWaitTimeCluster() const {
364  uint64_t min = std::numeric_limits<uint64_t>::max();
365  uint64_t max = 0;
366  uint64_t val = 0;
367  if (this->isInCluster()) {
368  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
369  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
370  val = it->second->memoryWaitTime().count();
371  if (val < min) { min = val; }
372  if (val > max) { max = val; }
373  }
374  } else {
375  min = this->meanMemoryWaitTimeCluster().count();
376  max = min;
377  }
378  return {min, max};
379  }
380 
383  [[nodiscard]] std::pair<uint64_t, uint64_t> minmaxExecTimeCluster() const {
384  uint64_t min = std::numeric_limits<uint64_t>::max();
385  uint64_t max = 0;
386  uint64_t val = 0;
387  if (this->isInCluster()) {
388  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
389  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
390  val = it->second->executionTime().count();
391  if (val < min) { min = val; }
392  if (val > max) { max = val; }
393  }
394  } else {
395  min = this->meanExecTimeCluster().count();
396  max = min;
397  }
398 
399  return {min, max};
400  }
401 
404  [[nodiscard]] size_t numberActiveThreadInCluster() const {
405  size_t ret = 0;
406  if (this->isInCluster()) {
407  for (auto it = this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).first;
408  it != this->belongingNode()->insideNodes()->equal_range(this->coreClusterNode()).second; ++it) {
409  ret += it->second->isActive() ? 1 : 0;
410  }
411  } else {
412  ret = this->isActive() ? 1 : 0;
413  }
414  return ret;
415  }
416 
419  [[nodiscard]] virtual std::string extraPrintingInformation() { return node()->extraPrintingInformation(); }
420 
421  // Setter
425  std::chrono::time_point<std::chrono::high_resolution_clock> const &startExecutionTimeStamp) {
426  startExecutionTimeStamp_ = startExecutionTimeStamp;
427  }
430  virtual void deviceId(int deviceId) { this->belongingNode()->deviceId(deviceId); }
431 
433  virtual void setInside() { this->isInside_ = true; }
434 
436  void setInCluster() { this->isInCluster_ = true; }
437 
440  void threadId(uint8_t threadId) { threadId_ = threadId; }
441 
444  void coreClusterNode(CoreNode *coreClusterNode) { coreClusterNode_ = coreClusterNode; }
445 
448  void name(std::string_view const &name) { name_ = name; }
449 
452  void numberThreads(size_t numberThreads) { numberThreads_ = numberThreads; }
453 
456  void belongingNode(CoreNode *belongingNode) { belongingNode_ = belongingNode; }
457 
460  void hasBeenRegistered(bool hasBeenRegistered) { hasBeenRegistered_ = hasBeenRegistered; }
461 
464  void isActive(bool isActive) { isActive_ = isActive; }
465 
468  void isCudaRelated(bool isCudaRelated) { isCudaRelated_ = isCudaRelated; }
469 
472  void isInside(bool isInside) { isInside_ = isInside; }
473 
476  void creationDuration(std::chrono::duration<uint64_t, std::micro> const &creationDuration) {
477  creationDuration_ = creationDuration;
478  }
479 
482  void executionDuration(std::chrono::duration<uint64_t, std::micro> const &executionDuration) {
483  executionDuration_ = executionDuration;
484  }
485 
488  void incrementWaitForMemoryDuration(std::chrono::duration<uint64_t, std::micro> const &memoryWait) {
489  this->memoryWaitDuration_ += memoryWait;
490  }
491 
492  // Virtual
494  virtual void preRun() {}
495 
497  virtual void run() {}
498 
500  virtual void postRun() {}
501 
503  virtual void createCluster(std::shared_ptr<std::multimap<CoreNode *, std::shared_ptr<CoreNode>>> &) {};
504 
506  virtual void joinThreads() {}
507 
511  virtual void duplicateEdge(
512  CoreNode *duplicateNode, std::map<CoreNode *, std::shared_ptr<CoreNode>> &correspondenceMap) = 0;
513 
516  virtual behavior::Node *node() = 0;
517 
520  virtual void visit(AbstractPrinter *printer) = 0;
521 
524  virtual std::set<CoreSlot *> getSlots() = 0;
525 
526  // Public method
529  void removeInsideNode(CoreNode *coreNode) {
530  HLOG_SELF(0, "Remove inside node " << coreNode->id() << ")")
531  this->insideNodes()->erase(coreNode);
532  }
533 
534 
537  void copyInnerStructure(CoreNode *rhs) {
538  this->isInside_ = rhs->isInside();
539  this->belongingNode_ = rhs->belongingNode();
540  this->hasBeenRegistered_ = rhs->hasBeenRegistered();
541  this->isInCluster_ = rhs->isInCluster();
542  this->isCudaRelated_ = rhs->isCudaRelated();
543  this->numberThreads_ = rhs->numberThreads();
544  this->coreClusterNode(rhs->coreClusterNode());
545  }
546 
547  protected:
550  void addUniqueInsideNode(const std::shared_ptr<CoreNode> &coreNode) {
551  HLOG_SELF(0, "Add InsideNode " << coreNode->name() << "(" << coreNode->id() << ")")
552  if (insideNodes_->find(coreNode.get()) == insideNodes_->end()) {
553  coreNode->belongingNode(this);
554  coreNode->hasBeenRegistered(true);
555  insideNodes_->insert({coreNode.get(), coreNode});
556  }
557  }
558 
561  void incrementWaitDuration(std::chrono::duration<uint64_t, std::micro> const &wait) { this->waitDuration_ += wait; }
562 
565  void incrementExecutionDuration(std::chrono::duration<uint64_t, std::micro> const &exec) {
566  this->executionDuration_ += exec;
567  }
568 };
569 
570 }
571 #endif //HEDGEHOG_CORE_NODE_H
NodeType type() const
Node type accessor.
Definition: core_node.h:132
void incrementExecutionDuration(std::chrono::duration< uint64_t, std::micro > const &exec)
Increment execution duration.
Definition: core_node.h:565
std::pair< uint64_t, uint64_t > minmaxWaitTimeCluster() const
Compute and return the min and max wait time for all tasks in the node cluster.
Definition: core_node.h:343
void startExecutionTimeStamp(std::chrono::time_point< std::chrono::high_resolution_clock > const &startExecutionTimeStamp)
Execution timestamp setter.
Definition: core_node.h:424
virtual std::chrono::duration< uint64_t, std::micro > minWaitTime() const
Minimum waiting time accessor.
Definition: core_node.h:223
std::chrono::duration< uint64_t, std::micro > meanMemoryWaitTimeCluster() const
Compute and return the mean memory wait time for all tasks in the node cluster.
Definition: core_node.h:280
void isInside(bool isInside)
Set the node as being inside another one.
Definition: core_node.h:472
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.
Definition: core_node.h:363
std::shared_ptr< std::multimap< CoreNode *, std::shared_ptr< CoreNode > > > const & insideNodes() const
Inside node accessor.
Definition: core_node.h:161
virtual std::string extraPrintingInformation()
Extra printing information accessor.
Definition: core_node.h:419
void coreClusterNode(CoreNode *coreClusterNode)
Set the main cluster node to associate to this node.
Definition: core_node.h:444
std::shared_ptr< std::multimap< CoreNode *, std::shared_ptr< CoreNode > > > & insideNodes()
Inside nodes accessor.
Definition: core_node.h:167
bool isCudaRelated() const
Is related to CUDA, used to have a green background on the dot file.
Definition: core_node.h:195
virtual std::chrono::duration< uint64_t, std::micro > minExecutionTime() const
Minimum execution time accessor.
Definition: core_node.h:213
virtual void deviceId(int deviceId)
Device id setter.
Definition: core_node.h:430
std::chrono::duration< uint64_t, std::micro > meanExecTimeCluster() const
Compute and return the mean execution time for all tasks in the node cluster.
Definition: core_node.h:250
virtual void setInside()
Set the node as inside, (inside a graph)
Definition: core_node.h:433
void setInCluster()
Set the task as part of a cluster.
Definition: core_node.h:436
bool isActive() const
Is active property accessor.
Definition: core_node.h:191
void removeInsideNode(CoreNode *coreNode)
Remove a node from the registered inside nodes.
Definition: core_node.h:529
size_t numberActiveThreadInCluster() const
Compute and return the number of active nodes in a cluster.
Definition: core_node.h:404
void isActive(bool isActive)
Is active property setter.
Definition: core_node.h:464
void threadId(uint8_t threadId)
Set the thread id.
Definition: core_node.h:440
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.
Definition: core_node.h:503
void name(std::string_view const &name)
Name node setter.
Definition: core_node.h:448
std::chrono::time_point< std::chrono::high_resolution_clock > const & creationTimeStamp() const
Creation timestamp accessor.
Definition: core_node.h:227
uint64_t stdvMemoryWaitTimeCluster() const
Compute and return the standard deviation memory wait time for all tasks in the node cluster...
Definition: core_node.h:327
Printer interface.
Node Behavior definition.
Definition: node.h:39
Slot interface, receive notification from CoreNotifier.
Definition: core_slot.h:34
void numberThreads(size_t numberThreads)
Number of threads setter.
Definition: core_node.h:452
virtual void joinThreads()
Define what is done when the thread is joined.
Definition: core_node.h:506
Main Hedgehog object that does computation.
Definition: graph.h:85
int threadId() const
Thread id accessor.
Definition: core_node.h:148
virtual int graphId()
Graph id accessor.
Definition: core_node.h:199
uint64_t stdvWaitTimeCluster() const
Compute and return the standard deviation wait time for all tasks in the node cluster.
Definition: core_node.h:311
std::pair< uint64_t, uint64_t > minmaxExecTimeCluster() const
Compute and return the min and max execution time for all tasks in the node cluster.
Definition: core_node.h:383
void copyInnerStructure(CoreNode *rhs)
Copy inner structure from rhs nodes to this.
Definition: core_node.h:537
CoreNode * coreClusterNode() const
Main cluster core node link to this node accessor.
Definition: core_node.h:144
NodeType
Hedgehog node&#39;s type.
Definition: core_node.h:40
void addUniqueInsideNode(const std::shared_ptr< CoreNode > &coreNode)
Add a node to the inside nodes.
Definition: core_node.h:550
virtual void run()
Run method, main execution.
Definition: core_node.h:497
virtual void preRun()
Method defining what to do before the run.
Definition: core_node.h:494
Main Hedgehog core abstraction.
Definition: core_node.h:48
CoreNode(std::string_view const &name, NodeType const type, size_t numberThreads)
Core node only constructor.
Definition: core_node.h:92
uint64_t stdvExecTimeCluster() const
Compute and return the standard deviation execution time for all tasks in the node cluster...
Definition: core_node.h:295
Hedgehog graph&#39;s node, used to manage an AbstractState.
virtual void postRun()
Method defining what to do after the run.
Definition: core_node.h:500
std::chrono::time_point< std::chrono::high_resolution_clock > const & startExecutionTimeStamp() const
Execution start timestamp accessor.
Definition: core_node.h:233
std::chrono::duration< uint64_t, std::micro > const & executionDuration() const
Execution duration accessor.
Definition: core_node.h:244
std::chrono::duration< uint64_t, std::micro > meanWaitTimeCluster() const
Compute and return the mean wait time for all tasks in the node cluster.
Definition: core_node.h:265
Hedgehog core namespace.
Definition: core_execute.h:25
bool isInCluster() const
In cluster property accessor.
Definition: core_node.h:187
std::string_view const & name() const
Node name accessor.
Definition: core_node.h:128
void isCudaRelated(bool isCudaRelated)
Is CUDA related property setter.
Definition: core_node.h:468
virtual std::chrono::duration< uint64_t, std::micro > maxWaitTime() const
Maximum waiting time accessor.
Definition: core_node.h:219
std::chrono::duration< uint64_t, std::micro > const & memoryWaitTime() const
Memory wait time accessor.
Definition: core_node.h:181
size_t numberThreads() const
Number of threads associated accessor.
Definition: core_node.h:152
CoreNode * belongingNode() const
Belonging node accessor.
Definition: core_node.h:156
bool hasBeenRegistered() const
Node registration property accessor.
Definition: core_node.h:140
virtual int deviceId()
Device id accessor.
Definition: core_node.h:203
void incrementWaitDuration(std::chrono::duration< uint64_t, std::micro > const &wait)
Increment wait duration.
Definition: core_node.h:561
void belongingNode(CoreNode *belongingNode)
Belonging node setter.
Definition: core_node.h:456
NodeType const type_
Node type.
Definition: core_node.h:63
std::chrono::duration< uint64_t, std::micro > const & executionTime() const
Execution time accessor.
Definition: core_node.h:173
virtual ~CoreNode()
Default virtual destructor.
Definition: core_node.h:102
std::chrono::duration< uint64_t, std::micro > const & creationDuration() const
Creation duration accessor.
Definition: core_node.h:240
void hasBeenRegistered(bool hasBeenRegistered)
Has been registered property setter.
Definition: core_node.h:460
virtual std::chrono::duration< uint64_t, std::micro > maxExecutionTime() const
Maximum execution time accessor.
Definition: core_node.h:207
void executionDuration(std::chrono::duration< uint64_t, std::micro > const &executionDuration)
Execution duration setter.
Definition: core_node.h:482
bool isInside() const
Node inside property accessor.
Definition: core_node.h:136
virtual std::vector< std::pair< std::string, std::string > > ids() const
Input node ids [nodeId, nodeIdCluster] accessor.
Definition: core_node.h:122
virtual std::string id() const
Unique Id accessor.
Definition: core_node.h:114
std::chrono::duration< uint64_t, std::micro > const & waitTime() const
Wait time accessor.
Definition: core_node.h:177
void incrementWaitForMemoryDuration(std::chrono::duration< uint64_t, std::micro > const &memoryWait)
Add wait for memory duration to total duration.
Definition: core_node.h:488
void creationDuration(std::chrono::duration< uint64_t, std::micro > const &creationDuration)
Creation duration setter.
Definition: core_node.h:476