Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Weber
load_leveller
Commits
5e271ed5
Commit
5e271ed5
authored
Nov 12, 2019
by
Lukas Weber
Browse files
add lljobcat to the loadleveller module
parent
e60edfd1
Changes
2
Hide whitespace changes
Inline
Side-by-side
python/lljobcat
0 → 100755
View file @
5e271ed5
#!/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
))
python/setup.py
View file @
5e271ed5
...
...
@@ -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"
],
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment