Commit ba0bc95b authored by Lukas Weber's avatar Lukas Weber

fix and formatting

parent 46e64651
#include "jobinfo.h"
#include "merger.h"
#include <ctime>
#include <dirent.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <regex>
#include <dirent.h>
#include "merger.h"
namespace loadl {
......
#pragma once
#include <vector>
#include <string>
#include "parser.h"
#include "iodump.h"
#include "evalable.h"
#include "iodump.h"
#include "parser.h"
#include <string>
#include <vector>
namespace loadl {
......
......@@ -28,13 +28,13 @@ void mc::_init() {
measure.add_observable("_ll_pt_rank", 1);
}
}
if(param.defined("seed")) {
rng.reset(new random_number_generator(param.get<uint64_t>("seed")));
} else {
rng.reset(new random_number_generator());
}
init();
}
......@@ -78,7 +78,12 @@ void mc::_pt_update_param(double new_param, const std::string &new_dir) {
auto unclean = measure.is_unclean();
if(unclean) {
throw std::runtime_error(fmt::format("Unclean observable: {}\nIn parallel tempering mode you have to choose the binsize for all observables so that it is commensurate with pt_sweeps_per_global_update (so that all bins are empty once it happens). If you don’t like this limitation, implement it properly.", *unclean));
throw std::runtime_error(
fmt::format("Unclean observable: {}\nIn parallel tempering mode you have to choose the "
"binsize for all observables so that it is commensurate with "
"pt_sweeps_per_global_update (so that all bins are empty once it happens). "
"If you don’t like this limitation, implement it properly.",
*unclean));
}
pt_update_param(new_param);
......@@ -143,7 +148,6 @@ double mc::safe_exit_interval() {
return 2 * (max_checkpoint_write_time_ + max_sweep_time_ + max_meas_time_) + 2;
}
bool mc::_read(const std::string &dir) {
if(!file_exists(dir + ".dump.h5")) {
return false;
......@@ -181,7 +185,7 @@ bool mc::is_thermalized() {
if(pt_mode_ && pt_sweeps_per_global_update_ > 0) {
sweep /= pt_sweeps_per_global_update_;
}
return sweep >= therm_;
}
}
......@@ -27,7 +27,7 @@ public:
void samples_write(const iodump::group &meas_file);
// returns nullopt if all observables are clean,
// otherwise the name of a non-empty observable
// otherwise the name of a non-empty observable
std::optional<std::string> is_unclean() const;
private:
......
#include "merger.h"
#include "iodump.h"
#include "evalable.h"
#include "iodump.h"
#include "mc.h"
#include "measurements.h"
......@@ -107,7 +107,7 @@ results merge(const std::vector<std::string> &filenames, const std::vector<evala
for(auto &filename : filenames) {
iodump meas_file = iodump::open_readonly(filename);
auto g = meas_file.get_root();
for(auto & [obs_name, obs] : res.observables) {
for(auto &[obs_name, obs] : res.observables) {
std::vector<double> samples;
obs.name = obs_name;
......@@ -143,7 +143,7 @@ results merge(const std::vector<std::string> &filenames, const std::vector<evala
for(auto &filename : filenames) {
iodump meas_file = iodump::open_readonly(filename);
auto g = meas_file.get_root();
for(auto & [obs_name, obs] : res.observables) {
for(auto &[obs_name, obs] : res.observables) {
std::vector<double> samples;
auto &obs_meta = metadata.at(obs_name);
......
......@@ -13,7 +13,7 @@ void results::write_yaml(const std::string &filename, const std::string &taskdir
out << YAML::Key << "task" << YAML::Value << taskdir;
out << YAML::Key << "parameters" << YAML::Value << params;
out << YAML::Key << "results" << YAML::Value << YAML::BeginMap;
for(auto & [obs_name, obs] : observables) {
for(auto &[obs_name, obs] : observables) {
out << YAML::Key << obs_name;
if(obs.internal_bin_length == 0) {
out << YAML::Comment("evalable");
......
#include "runner.h"
#include "merger.h"
#include "iodump.h"
#include "merger.h"
#include "runner_pt.h"
#include <fmt/format.h>
namespace loadl {
......
......@@ -5,11 +5,11 @@
#include <ostream>
#include <vector>
#include "jobinfo.h"
#include "mc.h"
#include "measurements.h"
#include "parser.h"
#include "runner_task.h"
#include "jobinfo.h"
namespace loadl {
......
This diff is collapsed.
......@@ -26,7 +26,7 @@ struct pt_chain {
void checkpoint_write(const iodump::group &g);
void clear_histograms();
void optimize_params();
void optimize_params(int linreg_len);
};
struct pt_chain_run {
......
#pragma once
#include "mc.h"
#include "jobinfo.h"
#include "mc.h"
#include "runner_task.h"
#include <functional>
#include <ostream>
......
#include "iodump.h"
#include "runner_task.h"
#include "iodump.h"
namespace loadl {
......
#include "runner.cpp"
#include "jobinfo.cpp"
int main() {
using namespace loadl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment