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