12#ifndef SST_CORE_CORETEST_CHECKPOINT_H
13#define SST_CORE_CORETEST_CHECKPOINT_H
15#include "sst/core/component.h"
16#include "sst/core/event.h"
17#include "sst/core/link.h"
18#include "sst/core/rng/distrib.h"
19#include "sst/core/rng/rng.h"
20#include "sst/core/shared/sharedArray.h"
21#include "sst/core/shared/sharedMap.h"
22#include "sst/core/shared/sharedSet.h"
27namespace SST::CoreTestCheckpoint {
36 coreTestCheckpointEvent() :
41 explicit coreTestCheckpointEvent(uint32_t c) :
46 ~coreTestCheckpointEvent() {}
50 if ( counter != 0 ) counter--;
54 uint32_t getCount() {
return counter; }
61 Event::serialize_order(ser);
72 SST_ELI_REGISTER_COMPONENT(
76 SST_ELI_ELEMENT_VERSION(1,0,0),
77 "CoreTest Test Checkpoint",
78 COMPONENT_CATEGORY_UNCATEGORIZED
81 SST_ELI_DOCUMENT_PARAMS(
82 {
"starter",
"Whether this component initiates the ping-pong",
"T"},
83 {
"count",
"Number of times to bounce the message back and forth",
"1000" },
84 {
"test_string",
"A test string",
""},
85 {
"clock_frequency",
"Frequency for clock",
"100kHz"},
86 {
"clock_duty_cycle",
"Number of cycles to keep clock on and off",
"10"},
88 {
"output_prefix",
"Prefix for output",
""},
89 {
"output_verbose",
"Verbosity for output",
"0"},
90 {
"output_frequency",
"How often, in terms of clock cycles, to generate output",
"1"},
92 {
"rng_seed_w",
"The first seed for marsaglia",
"7" },
93 {
"rng_seed_z",
"The second seed for marsaglia",
"5" },
94 {
"rng_seed",
"The seed for mersenne and xorshift",
"11" },
95 {
"dist_const",
"Constant for ConstantDistribution",
"1.5" },
96 {
"dist_discrete_probs",
"Probabilities in discrete distribution",
"[1.0]"},
97 {
"dist_exp_lambda",
"Lambda for exponentional distribution",
"1.0"},
98 {
"dist_gauss_mean",
"Mean for Gaussian distribution",
"1.0"},
99 {
"dist_gauss_stddev",
"Standard deviation for Gaussian distribution",
"0.2"},
100 {
"dist_poisson_lambda",
"Lambda for Poisson distribution",
"1.0"},
101 {
"dist_uni_bins",
"Number of proability bins for the uniform distribution",
"4"}
104 SST_ELI_DOCUMENT_PORTS(
105 {
"port_left",
"Link to another coreTestCheckpoint", {
"coreTestElement.coreTestCheckpointEvent",
"" } },
106 {
"port_right",
"Link to another coreTestCheckpoint", {
"coreTestElement.coreTestCheckpointEvent",
"" } }
109 SST_ELI_DOCUMENT_STATISTICS(
110 {
"eventcount",
"Total number of events received",
"events", 1},
111 {
"rngvals",
"Numbers from RNG",
"number", 2},
112 {
"distvals",
"Numbers from distribution",
"number", 3},
113 {
"nullstat",
"Test that non-enabled stats are checkpointed correctly",
"number", 5}
116 SST_ELI_IS_CHECKPOINTABLE()
118 coreTestCheckpoint(ComponentId_t
id,
SST::Params& params);
119 ~coreTestCheckpoint();
121 void init(
unsigned phase)
override;
123 void setup()
override;
125 void complete(
unsigned phase)
override;
129 void printStatus(
Output& out)
override;
134 coreTestCheckpoint() :
142 bool handleClock(Cycle_t cycle);
151 int duty_cycle_count;
153 std::string test_string;
155 int output_frequency;
SSTHandlerBase< bool, Cycle_t > HandlerBase
Base handler for clock functions.
Definition clock.h:44
Main component object for the simulation.
Definition component.h:32
Definition coreTest_Checkpoint.h:34
Definition coreTest_Checkpoint.h:70
void setup() override
Called after all components have been constructed and initialization has completed,...
Definition coreTest_Checkpoint.cc:144
void finish() override
Called after complete phase, but before objects are destroyed.
Definition coreTest_Checkpoint.cc:161
void emergencyShutdown() override
Called when SIGINT or SIGTERM has been seen.
Definition coreTest_Checkpoint.cc:270
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43
Base class for Events - Items sent across links to communicate between components.
Definition event.h:41
Link between two components.
Definition link.h:57
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition output.h:58
Parameter store.
Definition params.h:65
Base class of statistical distributions in SST.
Definition distrib.h:24
Implements the base class for random number generators for the SST core.
Definition rng.h:30
SharedArray class.
Definition sharedArray.h:34
SharedMap class.
Definition sharedMap.h:32
SharedSet class.
Definition sharedSet.h:31
Forms the template defined base class for statistics gathering within SST.
Definition statbase.h:369
A class to convert between a component's view of time and the core's view of time.
Definition timeConverter.h:31