9int main(
int argc,
char **argv) {
15 double beta = parameters.get(
"beta");
16 double mass = parameters.get(
"mass");
17 int seed = parameters.get(
"seed");
18 int n_trajectories = parameters.get(
"n_trajectories");
19 double hmc_steps = parameters.get(
"hmc_steps");
20 double traj_length = parameters.get(
"traj_length");
21 std::string configfile = parameters.get(
"configuration_file");
22 int log_level = parameters.get(
"log_level");
26 hila::log <<
"Example simulation with SU(" << N <<
") gauge and \n";
27 hila::log <<
"and a staggered fermion. \n";
28 hila::log <<
"Running " << n_trajectories <<
" HMC trajectories.\n";
32 hila::log <<
"Steps per HMC trajectory: " << hmc_steps <<
"\n";
33 hila::log <<
"writing output to " << configfile <<
"\n";
71 int config_found = (bool)std::ifstream(configfile);
74 hila::out0 <<
"Found configuration file, reading\n";
77 hila::out0 <<
"No config file " << configfile <<
", starting new run\n";
81 for (
int step = 0; step < n_trajectories; step++) {
82 update_hmc(integrator_level_2, hmc_steps, traj_length);
void set_unity()
Set the gauge field to unity.
void read_file(std::string filename)
Read the gauge field from a file.
double plaquette()
Calculate the plaquette.
void write_file(std::string filename)
Write the gauge field to a file.
void setup(const CoordinateVector &siz)
General lattice setup.
void set_verbosity(int level)
Set logging level.
logger_class log
Now declare the logger.
std::ostream out0
This writes output only from main process (node 0)
void initialize(int argc, char **argv)
Read in command line arguments. Initialise default stream and MPI communication.
void seed_random(uint64_t seed, bool device_rng=true)
Seed random generators with 64-bit unsigned value. On MPI shuffles the seed so that different MPI ran...
T broadcast(T &var, int rank=0)
Broadcast the value of var to all MPI ranks from rank (default=0).
void finishrun()
Normal, controlled exit - all nodes must call this. Prints timing information and information about c...