Commit 5651eb93 authored by Lukas Weber's avatar Lukas Weber
Browse files

nicer merge output

parent b0bbba73
#include "evalable.h"
#include "measurements.h"
#include <fmt/format.h>
#include <iostream>
#include <map>
namespace loadl {
......@@ -43,10 +42,7 @@ observable_result evaluator::jackknife(const std::string &name,
size_t bin_count = -1; // maximal value
for(const auto &obs_name : used_observables) {
if(res_.observables.count(obs_name) <= 0) {
std::cerr << fmt::format(
"Warning: evalable '{}': used observable '{}' not found in Monte Carlo results. "
"Skipping...\n",
name, obs_name);
// skip evalable if ingredients are missing from the measurements
return obs_res;
}
const auto &obs = res_.observables.at(obs_name);
......
......@@ -4,15 +4,23 @@
#include "merger.h"
#include "runner.h"
#include "runner_single.h"
namespace loadl {
inline int merge_only(jobinfo job, const mc_factory &, int, char **) {
int ntasks = job.task_names.size();
int len = log(ntasks)/log(10)+1;
size_t max_tasklen = 0;
for(size_t task_id = 0; task_id < job.task_names.size(); task_id++) {
job.merge_task(task_id);
std::string taskdir = job.taskdir(task_id);
max_tasklen = std::max(max_tasklen, taskdir.size());
std::cout << fmt::format("-- {} merged\n", job.taskdir(task_id).string());
std::cout << fmt::format("\rMerging task {0: >{3}}/{1: >{3}}... {2: <{4}}", task_id+1, job.task_names.size(), taskdir, len, max_tasklen);
std::cout.flush();
job.merge_task(task_id);
}
std::cout << fmt::format("\rMerged {0} tasks.{1: >{2}}\n", job.task_names.size(), "", 2*len+5+max_tasklen);
return 0;
}
......
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