2#ifndef STORMM_NML_RANDOM_H
3#define STORMM_NML_RANDOM_H
6#include "Parsing/textfile.h"
8#include "namelist_emulator.h"
13using parse::WrapTextSearch;
17constexpr int default_random_seed = 30965871;
19constexpr int default_random_streams = 1048576;
21constexpr int default_random_streams = 1;
23constexpr int default_random_stride = 64;
24constexpr int default_random_warmup = 96;
46 RandomControls(ExceptionResponse policy_in = ExceptionResponse::DIE,
47 WrapTextSearch wrap = WrapTextSearch::NO);
49 ExceptionResponse policy_in = ExceptionResponse::DIE,
50 WrapTextSearch wrap = WrapTextSearch::NO);
100 ExceptionResponse policy;
109 int production_stride;
120 void validateRandomSeed();
123 void validateStreamCount();
126 void validateProductionStride();
143 ExceptionResponse policy = ExceptionResponse::DIE,
144 WrapTextSearch wrap = WrapTextSearch::NO);
151void validateRandomSeed(
int igseed,
int *warmup_cycles);
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
int getWarmupCycleCount() const
Get the number of warmup cycles for the prime stream generator.
Definition nml_random.cpp:55
void setStreamCount(const int streams_in)
Set the quantity of random number streams.
Definition nml_random.cpp:71
int getRandomSeed() const
Get the random seed supplied (and possibly, as corrected) from user input.
Definition nml_random.cpp:40
int getStreamCount() const
Get the number of random streams.
Definition nml_random.cpp:45
const NamelistEmulator & getTranscript() const
Get the original namelist emulator object as a transcript of the user input.
Definition nml_random.cpp:60
RandomControls(const RandomControls &original)=default
As with other control objects, copy and move constructors, plus copy and move assignment operators,...
void setProductionStride(const int stride_in)
Set the random number production batch size, the quantity of random numbers that each stream will pro...
Definition nml_random.cpp:77
int getProductionStride() const
Get the quantity of random numbers produced, per stream, each time a cache is filled.
Definition nml_random.cpp:50
void setRandomSeed(const int igseed_in)
Set the random seed.
Definition nml_random.cpp:65
void setWarmupCycles(const int cycles_in)
Set the number of warmup cycles through which to process the prime stream's random generator state pr...
Definition nml_random.cpp:83
RandomControls(ExceptionResponse policy_in=ExceptionResponse::DIE, WrapTextSearch wrap=WrapTextSearch::NO)
The constructor can prepare an object with default settings or read the corresponding namelist to acc...
Definition nml_random.cpp:12
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45