24 montecarlo::progression(1.0, 20, 20000,
25 "./data/hp/burn_in_time/unordered_1_0.txt");
26 montecarlo::progression(1.0, 20, 20000, 1,
27 "./data/hp/burn_in_time/ordered_1_0.txt");
28 montecarlo::progression(2.4, 20, 20000,
29 "./data/hp/burn_in_time/unordered_2_4.txt");
30 montecarlo::progression(2.4, 20, 20000, 1,
31 "./data/hp/burn_in_time/ordered_2_4.txt");
40 montecarlo::pd_estimate(1.0, 20, 1000000,
41 "./data/hp/pd_estimate/estimate_1_0.txt");
42 montecarlo::pd_estimate(2.4, 20, 1000000,
43 "./data/hp/pd_estimate/estimate_2_4.txt");
51 montecarlo::phase_transition(
52 100, 2.1, 2.4, 40, 1e5, montecarlo::mcmc_serial,
53 "./data/hp/test_burn_in_time/burn_in.txt", 5000);
54 montecarlo::phase_transition(
55 100, 2.1, 2.4, 40, 1e5, montecarlo::mcmc_serial,
56 "./data/hp/test_burn_in_time/no_burn_in.txt", 0);
67 for (
size_t i = 0; i < tries; i++)
68 montecarlo::mcmc_serial(20, 1.0, 10000);
70 for (
size_t i = 0; i < tries; i++)
71 montecarlo::mcmc_parallel(20, 1.0, 10000);
74 std::cout <<
"Time serial : " << (t1 - t0) / tries <<
" seconds"
76 std::cout <<
"Time parallel : " << (t2 - t1) / tries <<
" seconds"
78 std::cout <<
"Speedup parallel: " << (t1 - t0) / (t2 - t1) <<
'\n';
89 montecarlo::phase_transition(20, 2.1, 2.4, 40, 1e4,
90 montecarlo::mcmc_parallel,
91 "./data/hp/phase_transition/size_20.txt");
92 montecarlo::phase_transition(40, 2.1, 2.4, 40, 1e4,
93 montecarlo::mcmc_parallel,
94 "./data/hp/phase_transition/size_40.txt");
95 montecarlo::phase_transition(60, 2.1, 2.4, 40, 1e4,
96 montecarlo::mcmc_parallel,
97 "./data/hp/phase_transition/size_60.txt");
98 montecarlo::phase_transition(80, 2.1, 2.4, 40, 1e4,
99 montecarlo::mcmc_parallel,
100 "./data/hp/phase_transition/size_80.txt");
101 montecarlo::phase_transition(100, 2.1, 2.4, 40, 1e4,
102 montecarlo::mcmc_parallel,
103 "./data/hp/phase_transition/size_100.txt");
104 t1 = omp_get_wtime();
106 std::cout <<
"Time: " << t1 - t0 << std::endl;
112 std::cout <<
"Usage: " << filename <<
" OPTION ...\n"
113 <<
"At least one option should be used.\n\n"
114 <<
"\t[ -h | --help ]\n"
116 <<
"\t[ --create-burn-in-data ]\n"
117 <<
"\t[ --create-pd-estimate-data ]\n"
118 <<
"\t[ --create-phase-transition-data ]\n"
119 <<
"\t[ --test-parallel-speedup ]\n"
120 <<
"\t[ --test-burn-in-time ]\n";
127 static struct option long_options[] = {
128 {
"all", no_argument, 0, 0},
129 {
"create-burn-in-data", no_argument, 0, 0},
130 {
"create-pd-estimate-data", no_argument, 0, 0},
131 {
"test-parallel-speedup", no_argument, 0, 0},
132 {
"create-phase-transition-data", no_argument, 0, 0},
133 {
"test-burn-in-time", no_argument, 0, 0},
134 {
"help", no_argument, 0, 0}};
136 int option_index = -1;
140 c = getopt_long(argc, argv,
"h", long_options, &option_index);
147 switch (option_index) {
Type to use with the IsingModel class and montecarlo module.
Header for the data_t type.
void test_parallel_speedup()
Test how much Openmp speeds up.
void create_pd_estimate_data()
Create the data used to estimate the probability distribution for tempratures 1.0 and 2....
void create_burn_in_time_data()
Create the data for the burn-in time for temperatures 1.0 and 2.4 for both unordered and ordered init...
void test_burn_in_time()
Create data using the same parameters except one uses burn-in time, while the other doesn't.
void create_phase_transition_data()
Create data for studying phase transition.
void usage(std::string filename)
A function that displays how to use the program and quits.
Functions for Monte Carlo simulations.
int main()
The main function.
Function prototypes and macros that are useful.