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