Commit 5e271ed5 authored by Lukas Weber's avatar Lukas Weber

add lljobcat to the loadleveller module

parent e60edfd1
#!/usr/bin/env python3
from loadleveller import jobstatus, jobfile
import argparse
import subprocess
import json
parser = argparse.ArgumentParser(description='Concatenate job results and merge them if needed')
parser.add_argument('jobfiles', nargs='+', help='jobs to concatenate')
parser.add_argument('-o', '--output', required=True, help='output file for the concatenated result.')
parser.add_argument('-n', '--no-merge', action='store_true', help='skip the merging step')
args = parser.parse_args()
tasks = []
for jobname in args.jobfiles:
try:
j = jobfile.JobFile(jobname)
if not args.no_merge:
if jobstatus.job_need_merge(j):
subprocess.run(['loadl', 'm', jobname])
with open(j.jobname+'.results.json', 'r') as infile:
res = json.load(infile)
tasks += res
except FileNotFoundError:
print('File not found for "{}". Skipping...'.format(jobname))
with open(args.output, 'w') as outfile:
json.dump(tasks, outfile, indent=0)
print('{} -> {}'.format(' '.join(args.jobfiles), args.output))
......@@ -9,6 +9,6 @@ setuptools.setup(
url="https://git.rwth-aachen.de/lukas.weber2/load_leveller",
packages=setuptools.find_packages(),
license="MIT",
scripts=["loadl"],
scripts=["loadl", "lljobcat"],
install_requires=["pyyaml","h5py","numpy"],
)
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