-
Notifications
You must be signed in to change notification settings - Fork 3
/
detqmcparams.h
95 lines (75 loc) · 3.85 KB
/
detqmcparams.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. See the enclosed file LICENSE for a copy or if
* that was not distributed with this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*
* Copyright 2017 Max H. Gerlach
*
* */
#ifndef DETQMCPARAMS_H_
#define DETQMCPARAMS_H_
#include <string>
#include <set>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wshadow"
#include "boost/serialization/string.hpp"
#include "boost/serialization/set.hpp"
#pragma GCC diagnostic pop
#include "metadata.h"
// Collect various structs defining various parameters. [more structs
// in the other ...params.h headers]
// The set specified included in each struct contains string representations
// of all parameters actually specified. This allows throwing an exception
// at the appropriate point in the program if a parameter is missing.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
typedef double num; //possibility to switch to single precision if ever desired
#pragma GCC diagnostic pop
// Representation of Monte Carlo simulation parameters for DetQMC
struct DetQMCParams {
//public data members, call check() after setting these
uint32_t simindex; // an index to discriminate between multiple simulation instances for the same set of parameters
uint32_t sweeps; // number of sweeps used for measurements
uint32_t thermalization; // number of warm-up sweeps allowed before equilibrium is assumed
uint32_t jkBlocks; // number of jackknife blocks for error estimation
bool timeseries; // if true, write time series of individual measurements to disk
uint32_t measureInterval; // take measurements every measureInterval sweeps
uint32_t saveInterval; // write measurements to disk every saveInterval sweeps
uint32_t saveConfigurationStreamInterval; // interval in sweeps where full system configurations are buffered and saved to disk. Must be an integer multiple of measureInterval. This is only effective if one of the boolean flags for saving configurations is set to true.
uint32_t rngSeed; // seed for random number generator
std::string greenUpdateType_string; //"simple" or "stabilized"
enum GreenUpdateType {GreenUpdateTypeSimple, GreenUpdateTypeStabilized};
GreenUpdateType greenUpdateType;
bool saveConfigurationStreamText;
bool saveConfigurationStreamBinary;
std::string stateFileName; //for serialization dumps
bool sweepsHasChanged; //true, if the number of target sweeps has changed after resuming
std::set<std::string> specified; // used to record names of specified parameters
DetQMCParams() :
simindex(0), sweeps(), thermalization(), jkBlocks(), timeseries(false), measureInterval(), saveInterval(),
saveConfigurationStreamInterval(0),
rngSeed(), greenUpdateType_string(), saveConfigurationStreamText(false), saveConfigurationStreamBinary(false),
stateFileName(), sweepsHasChanged(false), specified()
{ }
// check consistency, convert strings to enums
void check();
// to export human readable form of parameters
MetadataMap prepareMetadataMap() const;
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive& ar, const uint32_t version) {
(void)version;
ar & simindex
& sweeps & thermalization & jkBlocks & timeseries
& measureInterval & saveInterval & saveConfigurationStreamInterval
& rngSeed
& greenUpdateType_string & greenUpdateType
& saveConfigurationStreamText & saveConfigurationStreamBinary
& stateFileName
& sweepsHasChanged
& specified;
}
};
#endif /* DETQMCPARAMS_H_ */