Commit c0ee1918 authored by Lukas Weber's avatar Lukas Weber

some cli improvements

parent b766f0ca
import yaml
import os
import subprocess
import errno
'''Helpers for handling loadleveller jobfiles/scripts. For lack of a better idea, the job description files of loadleveller are actually executables that output a more verbose yaml parameter file to stdout. Use the taskmaker module to write the input scripts.'''
......
......@@ -83,16 +83,16 @@ def print_status(jobfile, args):
if args.need_restart:
if job_prog.needs_restart():
print('Needs restart!')
return True
return 0
print('Job completed.')
return False
return 1
if args.need_merge:
if job_prog.needs_merge():
print('Needs merge!')
return True
return 0
print('Job already merged.')
return False
return 1
for task, tp in zip(job_prog.tasks, job_prog.progress):
therm_per_run = tp.therm_sweeps/tp.num_runs if tp.num_runs > 0 else 0
......
......@@ -33,7 +33,7 @@ void observable::checkpoint_write(const iodump::group &dump_file) const {
void observable::measurement_write(const iodump::group &meas_file) {
if(samples_.size() > vector_length_) {
std::vector<double> current_bin_value(samples_.end() - vector_length_, samples_.end());
samples_.resize(current_bin_ * vector_length_);
meas_file.insert_back("samples", samples_);
samples_ = current_bin_value;
......
......@@ -48,9 +48,10 @@ void observable::add(T val) {
template<class T>
void observable::add(const std::vector<T> &val) {
if(vector_length_ != val.size()) {
throw std::runtime_error{fmt::format(
"observable::add: added vector has unexpected size ({}). Observable was initialized with vector length ({})",
val.size(), vector_length_)};
throw std::runtime_error{
fmt::format("observable::add: added vector has unexpected size ({}). Observable was "
"initialized with vector length ({})",
val.size(), vector_length_)};
}
for(size_t j = 0; j < vector_length_; ++j)
......
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