SST  15.1.0
StructuralSimulationToolkit
coreTest_OverheadMeasure.h
1 // Copyright 2009-2025 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2025, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_CORETEST_OVERHEADMEASURE_H
13 #define SST_CORE_CORETEST_OVERHEADMEASURE_H
14 
15 #include "sst/core/component.h"
16 #include "sst/core/link.h"
17 #include "sst/core/rng/marsaglia.h"
18 
19 #include <vector>
20 
21 namespace SST::CoreTestOverhead {
22 
24 {
25 public:
26  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
27  SST_ELI_REGISTER_COMPONENT(
29  "coreTestElement",
30  "overhead_measure",
31  SST_ELI_ELEMENT_VERSION(1,0,0),
32  "Element to measure overheads in the ConfigGraph and BaseComponent base class",
33  COMPONENT_CATEGORY_UNCATEGORIZED
34  )
35 
36  SST_ELI_DOCUMENT_PARAMS(
37  { "id", "ID of component", "" }
38  )
39 
40  // Optional since there is nothing to document
41  SST_ELI_DOCUMENT_STATISTICS()
42 
43  SST_ELI_DOCUMENT_PORTS(
44  {"left_%d", "dth left port ", { "NullEvent", "" } },
45  {"right_%d", "dth right port ", { "NullEvent", "" } }
46  )
47 
48  // Optional since there is nothing to document
49  SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
50  )
51 
52  OverheadMeasure(SST::ComponentId_t id, SST::Params& params);
53  OverheadMeasure() = default;
54  ~OverheadMeasure() = default;
55 
56  void init(unsigned int UNUSED(phase)) override {}
57  void setup() override {}
58  void complete(unsigned int UNUSED(phase)) override {}
59  void finish() override {}
60 
61 private:
62  int id_;
63  int ports_;
64 
65  void handleEvent(SST::Event* ev, int port);
66  bool clockTic(Cycle_t cycle);
67 
68  std::vector<Link*> links_;
69 };
70 
71 } // namespace SST::CoreTestOverhead
72 
73 #endif // SST_CORE_CORETEST_OVERHEADMEASURE_H
void init(unsigned int UNUSED(phase)) override
Used during the init phase.
Definition: coreTest_OverheadMeasure.h:56
Main component object for the simulation.
Definition: component.h:30
Definition: coreTest_OverheadMeasure.h:21
void setup() override
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Definition: coreTest_OverheadMeasure.h:57
Definition: coreTest_OverheadMeasure.h:23
void finish() override
Called after complete phase, but before objects are destroyed.
Definition: coreTest_OverheadMeasure.h:59
Parameter store.
Definition: params.h:63
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:40
void complete(unsigned int UNUSED(phase)) override
Used during the complete phase after the end of simulation.
Definition: coreTest_OverheadMeasure.h:58