Commit fcf08d9b authored by Lukas Weber's avatar Lukas Weber

safe sweep counts properly

parent 02a0d3ec
...@@ -86,8 +86,8 @@ void mc::_write(const std::string &dir) { ...@@ -86,8 +86,8 @@ void mc::_write(const std::string &dir) {
if(pt_mode_) { if(pt_mode_) {
therm *= pt_sweeps_per_global_update_; therm *= pt_sweeps_per_global_update_;
} }
g.write("thermalization_sweeps", std::min(sweep_,therm_)); g.write("thermalization_sweeps", std::min(sweep_,therm));
g.write("sweeps", std::max(0,sweep_-therm_)); g.write("sweeps", std::max(0,sweep_-therm));
} }
rename((dir + ".dump.h5.tmp").c_str(), (dir + ".dump.h5").c_str()); rename((dir + ".dump.h5.tmp").c_str(), (dir + ".dump.h5").c_str());
......
...@@ -188,7 +188,7 @@ void runner_pt_master::construct_pt_chains() { ...@@ -188,7 +188,7 @@ void runner_pt_master::construct_pt_chains() {
int target_sweeps = task.get<int>("sweeps"); int target_sweeps = task.get<int>("sweeps");
if(chain.target_sweeps >= 0 && target_sweeps != chain.target_sweeps) { if(chain.target_sweeps >= 0 && target_sweeps != chain.target_sweeps) {
throw std::runtime_error{ throw std::runtime_error{
fmt::format(pt_sweep_error, chain.id, "target_sweeps", i, chain.target_sweeps, target_sweeps)}; fmt::format(pt_sweep_error, chain.id, i, "target_sweeps", chain.target_sweeps, target_sweeps)};
} }
chain.target_sweeps = target_sweeps; chain.target_sweeps = target_sweeps;
......
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