SST  15.1.0
StructuralSimulationToolkit
coreTest_RNGComponent.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_RNGCOMPONENT_H
13 #define SST_CORE_CORETEST_RNGCOMPONENT_H
14 
15 #include "sst/core/component.h"
16 #include "sst/core/rng/rng.h"
17 
18 #include <string>
19 
20 using namespace SST;
21 using namespace SST::RNG;
22 
23 namespace SST::CoreTestRNGComponent {
24 
26 {
27 public:
28  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
29  SST_ELI_REGISTER_COMPONENT(
31  "coreTestElement",
32  "coreTestRNGComponent",
33  SST_ELI_ELEMENT_VERSION(1,0,0),
34  "Random number generation component",
35  COMPONENT_CATEGORY_UNCATEGORIZED
36  )
37 
38  SST_ELI_DOCUMENT_PARAMS(
39  { "seed_w", "The seed to use for the random number generator", "7" },
40  { "seed_z", "The seed to use for the random number generator", "5" },
41  { "seed", "The seed to use for the random number generator.", "11" },
42  { "rng", "The random number generator to use (Marsaglia or Mersenne), default is Mersenne", "Mersenne"},
43  { "count", "The number of random numbers to generate, default is 1000", "1000" },
44  { "verbose", "Sets the output verbosity of the component", "0" }
45  )
46 
47  // Optional since there is nothing to document
48  SST_ELI_DOCUMENT_STATISTICS(
49  )
50 
51  // Optional since there is nothing to document
52  SST_ELI_DOCUMENT_PORTS(
53  )
54 
55  // Optional since there is nothing to document
56  SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
57  )
58 
59  coreTestRNGComponent(SST::ComponentId_t id, SST::Params& params);
61  void setup() override {}
62  void finish() override {}
63 
64 private:
65  coreTestRNGComponent(); // for serialization only
66  coreTestRNGComponent(const coreTestRNGComponent&) = delete; // do not implement
67  coreTestRNGComponent& operator=(const coreTestRNGComponent&) = delete; // do not implement
68 
69  virtual bool tick(SST::Cycle_t);
70 
71  Output* output;
72  Random* rng;
73  std::string rng_type;
74  int rng_max_count;
75  int rng_count;
76 };
77 
78 } // namespace SST::CoreTestRNGComponent
79 
80 #endif // SST_CORE_CORETEST_RNGCOMPONENT_H
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:57
Implements the base class for random number generators for the SST core.
Definition: rng.h:29
Definition: constant.h:18
Definition: coreTest_RNGComponent.h:23
Main component object for the simulation.
Definition: component.h:30
Definition: action.cc:18
void setup() override
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Definition: coreTest_RNGComponent.h:61
void finish() override
Called after complete phase, but before objects are destroyed.
Definition: coreTest_RNGComponent.h:62
Parameter store.
Definition: params.h:63
Definition: coreTest_RNGComponent.h:25