jobinfo.h 928 Bytes
Newer Older
1
2
3
#pragma once

#include "evalable.h"
Lukas Weber's avatar
Lukas Weber committed
4
5
6
7
#include "iodump.h"
#include "parser.h"
#include <string>
#include <vector>
8
9
10

namespace loadl {

11
12
13
14
15
16
using register_evalables_func = std::function<void (evaluator &, const parser &)>;

class jobinfo {
private:
	register_evalables_func evalable_func_;
public:
17
18
19
20
21
	parser jobfile;
	std::string jobname;

	std::vector<std::string> task_names;

Lukas Weber's avatar
Lukas Weber committed
22
23
	double checkpoint_time{};
	double runtime{};
24

25
	jobinfo(const std::string &jobfile_name, register_evalables_func evalable_func);
26
27
28
29
30
31
32
33

	std::string jobdir() const;
	std::string rundir(int task_id, int run_id) const;
	std::string taskdir(int task_id) const;

	static std::vector<std::string> list_run_files(const std::string &taskdir,
	                                               const std::string &file_ending);
	int read_dump_progress(int task_id) const;
34
	void merge_task(int task_id);
35
36
37
38
39
	void concatenate_results();
	void log(const std::string &message);
};

}