GLAC  1.0
parameters.h
Go to the documentation of this file.
1 
13 #ifndef PARAMETERS_H
14 #define PARAMETERS_H
15 
16 #include <string>
17 #include <vector>
18 
20 {
21  friend class SysPrint;
22 private:
23  // Total lattice sizes
24  static unsigned int m_NSpatial;
25  static unsigned int m_NTemporal;
26  static unsigned int m_latticeSize;
27 
28  // Sub lattice / parallel related variables
29  static std::vector<unsigned int> m_N;
30  static unsigned int m_subLatticeSize;
31  static int m_processorsPerDimension[4];
32  static bool m_subLatticeSizePreset;
33 
34  // Action type
35  static std::string m_actionType;
36 
37  // Beta value constant
38  static double m_beta;
39 
40  // Lattice spacing
41  static double m_a;
42  static const double r0;
43 
44  // Program information output
45  static bool m_verbose;
46 
47  // Variable holding if we are to calculate and store the thermalization variables
48  static bool m_storeThermalizationObservables;
49 
50  // Variable storing gauge configurations
51  static bool m_storeConfigurations;
52 
53  // Variable storing if we are to start hot or cold
54  static bool m_hotStart;
55 
56  // Variable storing what kind if initial hot start we are to use
57  static bool m_RSTHotStart;
58 
59  // IO parameters
60  static std::string m_pwd;
61  static std::string m_batchName;
62  static std::string m_inputFolder;
63  static std::string m_outputFolder;
64 
65  // Run specific variables
66  static unsigned int m_NCf;
67  static unsigned int m_NCor;
68  static unsigned int m_NTherm;
69  static unsigned int m_NUpdates;
70  static unsigned int m_NFlows;
71  static unsigned int m_configSamplePoints;
72  static unsigned int m_flowSamplePoints;
73 
74  // Unit testing
75  static bool m_unitTesting;
76  static bool m_unitTestingVerbose;
77  static bool m_testLatticeGaugeInvariance;
78  static std::string m_latticeFileNameToCheck;
79 
80  // Performance testing
81  static bool m_performanceTesting;
82  static unsigned int m_NExpTests;
83  static unsigned int m_NRandTests;
84  static unsigned int m_NDerivativeTests;
85  static unsigned int m_NTaylorPolDegree;
86 
87  // Data generation related variables
88  static double m_SU3Eps;
89  static double m_flowEpsilon;
90  static double m_metropolisSeed;
91  static double m_randomMatrixSeed;
92 
93  // Name of samplers
94  static std::string m_expFuncName;
95  static std::vector<std::string> m_observablesList;
96  static std::vector<std::string> m_flowObservablesList;
97 
98  // Field configurations
99  static bool m_loadFieldConfigurations;
100  static bool m_loadChromaConfigurations;
101  static std::vector<std::string> m_fieldConfigurationFileNames;
102 
103  // Variable for storing if we are to load and run from a given configuration
104  static bool m_loadConfigAndRun;
105  static int m_configStartNumber;
106 
107  // Integer for storing the sampling frequency
108  static int m_samplingFrequency;
109 
110  // Debug parameter
111  static bool m_debug;
112 
113  static double calculateLatticeSpacing(double beta);
114 public:
115  Parameters();
116  ~Parameters();
117 
121  // Lattice related run setters
122  static void setNSpatial(unsigned int NSpatial);
123  static void setNTemporal(unsigned int NTemporal);
124  static void setBeta(double beta);
125  static void setNCf(unsigned int NCf) { m_NCf = NCf; }
126  static void setNCor(unsigned int NCor) { m_NCor = NCor; }
127  static void setNTherm(unsigned int NTherm) { m_NTherm = NTherm; }
128  static void setNFlows(unsigned int NFlows) { m_NFlows = NFlows; }
129  static void setNUpdates(unsigned int NUpdates) { m_NUpdates = NUpdates; }
130 
131  // Data storage related setters
132  static void setOutputFolder(std::string outputFolder) { m_outputFolder = outputFolder; }
133  static void setInputFolder(std::string inputFolder) { m_inputFolder = inputFolder; }
134  static void setStoreConfigurations(bool storeConfigurations) { m_storeConfigurations = storeConfigurations; }
135  static void setStoreThermalizationObservables(bool storeThermalizationObservables) { m_storeThermalizationObservables = storeThermalizationObservables; }
136 
137  // Human readable output related setters
138  static void setVerbose(bool verbose) { m_verbose = verbose; }
139 
140  // Setup related setters
141  static void setFilePath(std::string pwd) { m_pwd = pwd; }
142  static void setBatchName(std::string batchName) { m_batchName = batchName; }
143  static void setHotStart(bool hotStart) { m_hotStart = hotStart; }
144  static void setRSTHotStart(bool RSTHotStart) { m_RSTHotStart = RSTHotStart; }
145 
146  // Testing related setters
147  static void setUnitTesting(bool unitTesting) { m_unitTesting = unitTesting; }
148  static void setUnitTestingVerbose(bool unitTestingVerbose) { m_unitTestingVerbose = unitTestingVerbose; }
149  static void setCheckFieldGaugeInvariance(bool testLatticeGaugeInvariance) { m_testLatticeGaugeInvariance = testLatticeGaugeInvariance; }
150  static void setGaugeFieldToCheck(std::string latticeFileNameToCheck) { m_latticeFileNameToCheck = latticeFileNameToCheck; }
151 
152  // Performance testing related setters
153  static void setPerformanceTesting(bool performanceTesting) { m_performanceTesting = performanceTesting; }
154  static void setNExpTests(unsigned int NExpTests) { m_NExpTests = NExpTests; }
155  static void setNRandTests(unsigned int NRandTests) { m_NRandTests = NRandTests; }
156  static void setNDerivaitveTests(unsigned int NDerivativeTests) { m_NDerivativeTests = NDerivativeTests; }
157  static void setTaylorPolDegree(unsigned int NTaylorPolDegree) { m_NTaylorPolDegree = NTaylorPolDegree; }
158 
159  // Data generation related setters
160  static void setFlowEpsilon(double flowEpsilon) { m_flowEpsilon = flowEpsilon; }
161  static void setSU3Eps(double SU3Eps) { m_SU3Eps = SU3Eps; }
162  static void setMetropolisSeed(double metropolisSeed);
163  static void setRandomMatrixSeed(double randomMatrixSeed);
164 
165  // Lattice related setters, initiated after config input
166  static void setLatticeSize(unsigned int latticeSize) { m_latticeSize = latticeSize; }
167 
168  // Sub lattice / parallel related setters
169  static void setN(std::vector<unsigned int> N) { m_N = N; }
170  static void setSubLatticePreset(bool subLatticeSizePreset) { m_subLatticeSizePreset = subLatticeSizePreset; }
171  static void setSubLatticeSize(unsigned int subLatticeSize) { m_subLatticeSize = subLatticeSize; }
172  static void setProcessorsPerDimension(int *processorsPerDimension) { for (unsigned int i = 0; i < 4; i++) m_processorsPerDimension[i] = processorsPerDimension[i]; }
173 
174  // Action type
175  static void setActionType(std::string actionType) { m_actionType = actionType; }
176 
177  // Name of samplers setters
178  static void setExpFuncName(std::string expFuncName) { m_expFuncName = expFuncName;}
179  static void setObservableList(std::vector<std::string> observablesList) { m_observablesList = observablesList; }
180  static void setFlowObservablesList(std::vector<std::string> flowObservablesList) { m_flowObservablesList = flowObservablesList; }
181 
182  // Field configurations setters
183  static void setLoadFieldConfigurations(bool loadFieldConfigurations) { m_loadFieldConfigurations = loadFieldConfigurations; }
184  static void setLoadChromaConfigurations(bool loadChromaConfigurations) { m_loadChromaConfigurations = loadChromaConfigurations; }
185  static void setFieldConfigurationFileNames(std::vector<std::string> fieldConfigurationFileNames) { m_fieldConfigurationFileNames = fieldConfigurationFileNames; }
186 
187  // Setters for storing if we are to load and run from a given configuration
188  static void setLoadConfigAndRun(bool loadConfigAndRun) { m_loadConfigAndRun = loadConfigAndRun; }
189  static void setConfigStartNumber(int configStartNumber) { m_configStartNumber = configStartNumber; }
190 
191  // Setter for the sampling frequency
192  static void setSamplingFrequency(int samplingFrequency) { m_samplingFrequency = samplingFrequency; }
193 
194  // Getter for debug parameter
195  static void setDebug(bool debug) { m_debug = debug; }
196 
200  // Lattice related run getters
201  static unsigned int getNSpatial() { return m_NSpatial; }
202  static unsigned int getNTemporal() { return m_NTemporal; }
203  static double getBeta() { return m_beta; }
204  static unsigned int getNCf() { return m_NCf; }
205  static unsigned int getNCor() { return m_NCor; }
206  static unsigned int getNTherm() { return m_NTherm; }
207  static unsigned int getNUpdates() { return m_NUpdates; }
208  static unsigned int getNFlows() { return m_NFlows; }
209 
210  // Data storage related getters
211  static std::string getOutputFolder() { return m_outputFolder; }
212  static std::string getInputFolder() { return m_inputFolder; }
213  static bool getStoreConfigurations() { return m_storeConfigurations; }
214  static bool getStoreThermalizationObservables() { return m_storeThermalizationObservables; }
215 
216  // Human readable output related getters
217  static bool getVerbose() { return m_verbose; }
218 
219  // Setup related getters
220  static std::string getFilePath() { return m_pwd; }
221  static std::string getBatchName() { return m_batchName; }
222  static bool getHotStart() { return m_hotStart; }
223  static bool getRSTHotStart() { return m_RSTHotStart; }
224 
225  // Testing related getters
226  static bool getUnitTesting() { return m_unitTesting; }
227  static bool getUnitTestingVerbose() { return m_unitTestingVerbose; }
228  static bool getCheckFieldGaugeInvariance() { return m_testLatticeGaugeInvariance; }
229  static std::string getGaugeFieldToCheck() { return m_latticeFileNameToCheck; }
230 
231  // Performance testing related getters
232  static bool getPerformanceTesting() { return m_performanceTesting; }
233  static unsigned int getNExpTests() { return m_NExpTests; }
234  static unsigned int getNRandTests() { return m_NRandTests; }
235  static unsigned int getNDerivativeTests() { return m_NDerivativeTests; }
236  static unsigned int getTaylorPolDegree() { return m_NTaylorPolDegree; }
237 
238  // Data generation related getters
239  static double getFlowEpsilon() { return m_flowEpsilon; }
240  static double getSU3Eps() { return m_SU3Eps; }
241  static double getMetropolisSeed() { return m_metropolisSeed; }
242  static double getRandomMatrixSeed() { return m_randomMatrixSeed; }
243 
244  // Lattice related getters, initiated after config input
245  static double getLatticeSpacing() { return m_a; }
246  static unsigned int getLatticeSize() { return m_latticeSize; }
247 
248  // Sub lattice / parallel related getters
249  static std::vector<unsigned int> getN() { return m_N; }
250  static bool getSubLatticePreset() { return m_subLatticeSizePreset; }
251  static unsigned int getSubLatticeSize() { return m_subLatticeSize; }
252  static void getProcessorsPerDimension(int *processorsPerDimension) { for (unsigned int i = 0; i < 4; i++) m_processorsPerDimension[i] = processorsPerDimension[i]; }
253 
254  // Action type
255  static std::string getActionType() { return m_actionType; }
256 
257  // Exponential getters
258  static std::string getExpFuncName() { return m_expFuncName; }
259  static std::vector<std::string> getObservablesList() { return m_observablesList; }
260  static std::vector<std::string> getFlowObservablesList() { return m_flowObservablesList; }
261 
262  // Field configurations getters
263  static bool getLoadFieldConfigurations() { return m_loadFieldConfigurations; }
264  static bool getLoadChromaConfigurations() { return m_loadChromaConfigurations; }
265  static std::vector<std::string> getFieldConfigurationFileNames() { return m_fieldConfigurationFileNames; }
266 
267  // Getters for storing if we are to load and run from a given configuration
268  static bool getLoadConfigAndRun() { return m_loadConfigAndRun; }
269  static int getConfigStartNumber() { return m_configStartNumber; }
270 
271  // Getter for field density sampling frequency
272  static int getSamplingFrequency() { return m_samplingFrequency; }
273 
274  // Getter for debug parameter
275  static bool getDebug() { return m_debug; }
276 };
277 
278 #endif // PARAMETERS_H
static int getConfigStartNumber()
Definition: parameters.h:269
static unsigned int getNUpdates()
Definition: parameters.h:207
static void setNFlows(unsigned int NFlows)
Definition: parameters.h:128
static void setLoadFieldConfigurations(bool loadFieldConfigurations)
Definition: parameters.h:183
static void setGaugeFieldToCheck(std::string latticeFileNameToCheck)
Definition: parameters.h:150
static double getSU3Eps()
Definition: parameters.h:240
static double getLatticeSpacing()
Definition: parameters.h:245
static unsigned int getNDerivativeTests()
Definition: parameters.h:235
static bool getDebug()
Definition: parameters.h:275
static void setLoadConfigAndRun(bool loadConfigAndRun)
Definition: parameters.h:188
static void setObservableList(std::vector< std::string > observablesList)
Definition: parameters.h:179
static unsigned int getTaylorPolDegree()
Definition: parameters.h:236
static bool getLoadConfigAndRun()
Definition: parameters.h:268
static void setOutputFolder(std::string outputFolder)
Definition: parameters.h:132
static void getProcessorsPerDimension(int *processorsPerDimension)
Definition: parameters.h:252
static unsigned int getNRandTests()
Definition: parameters.h:234
static void setPerformanceTesting(bool performanceTesting)
Definition: parameters.h:153
static void setNDerivaitveTests(unsigned int NDerivativeTests)
Definition: parameters.h:156
static void setLatticeSize(unsigned int latticeSize)
Definition: parameters.h:166
static void setLoadChromaConfigurations(bool loadChromaConfigurations)
Definition: parameters.h:184
Parameters()
Definition: parameters.cpp:95
static unsigned int getNExpTests()
Definition: parameters.h:233
static double getFlowEpsilon()
Definition: parameters.h:239
static void setFieldConfigurationFileNames(std::vector< std::string > fieldConfigurationFileNames)
Definition: parameters.h:185
static void setStoreConfigurations(bool storeConfigurations)
Definition: parameters.h:134
static void setN(std::vector< unsigned int > N)
Definition: parameters.h:169
Parameter holding class.
Definition: parameters.h:19
static void setUnitTesting(bool unitTesting)
Definition: parameters.h:147
static void setExpFuncName(std::string expFuncName)
Definition: parameters.h:178
static bool getPerformanceTesting()
Definition: parameters.h:232
static void setFlowEpsilon(double flowEpsilon)
Definition: parameters.h:160
static void setDebug(bool debug)
Definition: parameters.h:195
static unsigned int getNSpatial()
Definition: parameters.h:201
static std::string getGaugeFieldToCheck()
Definition: parameters.h:229
static void setNUpdates(unsigned int NUpdates)
Definition: parameters.h:129
static void setNTemporal(unsigned int NTemporal)
Definition: parameters.cpp:131
static void setNSpatial(unsigned int NSpatial)
Definition: parameters.cpp:125
Class for printing run information.
Definition: sysprint.h:21
static std::string getOutputFolder()
Definition: parameters.h:211
~Parameters()
Definition: parameters.cpp:100
static void setCheckFieldGaugeInvariance(bool testLatticeGaugeInvariance)
Definition: parameters.h:149
static double getRandomMatrixSeed()
Definition: parameters.h:242
static void setMetropolisSeed(double metropolisSeed)
Parameters::setMetropolisSeed set a seed for the Metropolis algorithm.
Definition: parameters.cpp:143
static unsigned int getNTherm()
Definition: parameters.h:206
static bool getLoadChromaConfigurations()
Definition: parameters.h:264
static void setNRandTests(unsigned int NRandTests)
Definition: parameters.h:155
static void setBatchName(std::string batchName)
Definition: parameters.h:142
static void setFilePath(std::string pwd)
Definition: parameters.h:141
static void setSubLatticePreset(bool subLatticeSizePreset)
Definition: parameters.h:170
static unsigned int getNCf()
Definition: parameters.h:204
static std::string getActionType()
Definition: parameters.h:255
static void setRandomMatrixSeed(double randomMatrixSeed)
Parameters::setRandomMatrixSeed set a seed for the random matrix generation(both RST and random metho...
Definition: parameters.cpp:155
static bool getVerbose()
Definition: parameters.h:217
static bool getUnitTestingVerbose()
Definition: parameters.h:227
static bool getStoreThermalizationObservables()
Definition: parameters.h:214
static void setNTherm(unsigned int NTherm)
Definition: parameters.h:127
static void setConfigStartNumber(int configStartNumber)
Definition: parameters.h:189
static bool getCheckFieldGaugeInvariance()
Definition: parameters.h:228
static int getSamplingFrequency()
Definition: parameters.h:272
static unsigned int getLatticeSize()
Definition: parameters.h:246
static void setUnitTestingVerbose(bool unitTestingVerbose)
Definition: parameters.h:148
static unsigned int getNCor()
Definition: parameters.h:205
static void setNExpTests(unsigned int NExpTests)
Definition: parameters.h:154
static unsigned int getNFlows()
Definition: parameters.h:208
static void setSU3Eps(double SU3Eps)
Definition: parameters.h:161
static void setStoreThermalizationObservables(bool storeThermalizationObservables)
Definition: parameters.h:135
static void setSamplingFrequency(int samplingFrequency)
Definition: parameters.h:192
static void setNCf(unsigned int NCf)
Definition: parameters.h:125
static std::vector< std::string > getObservablesList()
Definition: parameters.h:259
static std::vector< unsigned int > getN()
Definition: parameters.h:249
static void setBeta(double beta)
Definition: parameters.cpp:105
static unsigned int getSubLatticeSize()
Definition: parameters.h:251
static void setVerbose(bool verbose)
Definition: parameters.h:138
static void setInputFolder(std::string inputFolder)
Definition: parameters.h:133
static unsigned int getNTemporal()
Definition: parameters.h:202
static void setHotStart(bool hotStart)
Definition: parameters.h:143
static double getMetropolisSeed()
Definition: parameters.h:241
static bool getRSTHotStart()
Definition: parameters.h:223
static std::string getFilePath()
Definition: parameters.h:220
static void setProcessorsPerDimension(int *processorsPerDimension)
Definition: parameters.h:172
static bool getLoadFieldConfigurations()
Definition: parameters.h:263
static std::vector< std::string > getFieldConfigurationFileNames()
Definition: parameters.h:265
static void setSubLatticeSize(unsigned int subLatticeSize)
Definition: parameters.h:171
static void setRSTHotStart(bool RSTHotStart)
Definition: parameters.h:144
static bool getStoreConfigurations()
Definition: parameters.h:213
static bool getHotStart()
Definition: parameters.h:222
static bool getUnitTesting()
Definition: parameters.h:226
static std::string getExpFuncName()
Definition: parameters.h:258
static void setNCor(unsigned int NCor)
Definition: parameters.h:126
static bool getSubLatticePreset()
Definition: parameters.h:250
static std::string getInputFolder()
Definition: parameters.h:212
static void setTaylorPolDegree(unsigned int NTaylorPolDegree)
Definition: parameters.h:157
static std::vector< std::string > getFlowObservablesList()
Definition: parameters.h:260
static void setFlowObservablesList(std::vector< std::string > flowObservablesList)
Definition: parameters.h:180
static std::string getBatchName()
Definition: parameters.h:221
static double getBeta()
Definition: parameters.h:203
static void setActionType(std::string actionType)
Definition: parameters.h:175