SST  10.1.0
StructuralSimulationToolkit
coreTest_RNGComponent.h
1 // Copyright 2009-2020 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-2020, NTESS
6 // All rights reserved.
7 //
8 // Portions are copyright of other developers:
9 // See the file CONTRIBUTORS.TXT in the top level directory
10 // the distribution for more information.
11 //
12 // This file is part of the SST software package. For license
13 // information, see the LICENSE file in the top level directory of the
14 // distribution.
15 
16 #ifndef _CORETESTRNGCOMPONENT_H
17 #define _CORETESTRNGCOMPONENT_H
18 
19 #include "sst/core/component.h"
20 #include "sst/core/rng/sstrng.h"
21 
22 using namespace SST;
23 using namespace SST::RNG;
24 
25 namespace SST {
26 namespace CoreTestRNGComponent {
27 
29 {
30 public:
31 
32  // REGISTER THIS COMPONENT INTO THE ELEMENT LIBRARY
33  SST_ELI_REGISTER_COMPONENT(
35  "coreTestElement",
36  "coreTestRNGComponent",
37  SST_ELI_ELEMENT_VERSION(1,0,0),
38  "Random number generation component",
39  COMPONENT_CATEGORY_UNCATEGORIZED
40  )
41 
42  SST_ELI_DOCUMENT_PARAMS(
43  { "seed_w", "The seed to use for the random number generator", "7" },
44  { "seed_z", "The seed to use for the random number generator", "5" },
45  { "seed", "The seed to use for the random number generator.", "11" },
46  { "rng", "The random number generator to use (Marsaglia or Mersenne), default is Mersenne", "Mersenne"},
47  { "count", "The number of random numbers to generate, default is 1000", "1000" },
48  { "verbose", "Sets the output verbosity of the component", "0" }
49  )
50 
51  // Optional since there is nothing to document
52  SST_ELI_DOCUMENT_STATISTICS(
53  )
54 
55  // Optional since there is nothing to document
56  SST_ELI_DOCUMENT_PORTS(
57  )
58 
59  // Optional since there is nothing to document
60  SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
61  )
62 
63  coreTestRNGComponent(SST::ComponentId_t id, SST::Params& params);
65  void setup() { }
66  void finish() { }
67 
68 private:
69  coreTestRNGComponent(); // for serialization only
70  coreTestRNGComponent(const coreTestRNGComponent&); // do not implement
71  void operator=(const coreTestRNGComponent&); // do not implement
72 
73  virtual bool tick(SST::Cycle_t);
74 
75  Output* output;
76  SSTRandom* rng;
77  std::string rng_type;
78  int rng_max_count;
79  int rng_count;
80 
81 };
82 
83 } // namespace CoreTestRNGComponent
84 } // namespace SST
85 
86 #endif /* _CORETESTRNGCOMPONENT_H */
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
Main component object for the simulation.
Definition: component.h:31
void setup()
Called after all components have been constructed and initialization has completed, but before simulation time has begun.
Definition: coreTest_RNGComponent.h:65
Implements the base class for random number generators for the SST core.
Definition: sstrng.h:27
void finish()
Called after simulation completes, but before objects are destroyed.
Definition: coreTest_RNGComponent.h:66
Parameter store.
Definition: params.h:44
Definition: coreTest_RNGComponent.h:28