Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ProfiT-HPC
aggregator
Commits
7e776208
Commit
7e776208
authored
Feb 27, 2020
by
Azat Khuziyakhmetov
Browse files
added array JOBID transformation for Slurm
parent
071e8c8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
conf/config.py.sample
View file @
7e776208
...
...
@@ -22,9 +22,10 @@ measurements = {
"gpu_proc"
:
'nvidia_proc'
,
}
SLURM_BIN
=
""
# FULL path to Slurm binaries
# Security
#############################
SLURM_BIN
=
""
# FULL path to Slurm binaries
LSF_BIN
=
""
SECUSER
=
True
# use setuid binary and check users before fetching data
job_uid_comm
=
{
...
...
@@ -32,6 +33,14 @@ job_uid_comm = {
"slurm"
:
SLURM_BIN
+
"sacct -j {jobid:s} -X -P -n -o
\"
uid
\"
"
,
}
# Array JOBID transformation
#############################
JOBID_ARRAY_TRANSFORM
=
True
jobid_array_trans_comm
=
{
"slurm"
:
SLURM_BIN
+
"sacct -j {jobid:s} -X -P -n -o
\"
JobIDRaw
\"
"
,
"lsf"
:
"NOT SUPPORTED"
}
# DB
#############################
CACHEJSON
=
False
# cache aggregated results as json file
...
...
data.py
View file @
7e776208
...
...
@@ -95,6 +95,31 @@ def check_user(jobid):
return
def
job_id_transform
(
jobid
):
if
"_"
not
in
jobid
:
return
jobid
if
conf
.
BATCH_SYSTEM
==
"SLURM"
:
jobid_comm
=
conf
.
jobid_array_trans_comm
[
"slurm"
].
format
(
jobid
=
jobid
)
elif
conf
.
BATCH_SYSTEM
==
"LSF"
:
return
jobid
else
:
print
(
"Cannot transform JOBID, no batch system specified"
)
exit
(
1
)
result
=
subprocess
.
run
(
jobid_comm
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
,
executable
=
'/bin/bash'
)
out
=
result
.
stdout
.
decode
(
"utf-8"
)
m
=
re
.
search
(
"[0-9]+"
,
out
)
if
m
is
None
or
m
.
group
(
0
)
is
None
:
print
(
"Cannot parse JOBID. {:s}"
.
format
(
out
))
exit
(
1
)
raw_job_id
=
m
.
group
(
0
)
return
raw_job_id
def
check_cache_file
(
jobid
,
filename
):
if
conf
.
CACHEJSON
is
False
or
conf
.
CACHEDIR
==
""
:
return
False
...
...
@@ -155,6 +180,9 @@ def main():
exit
()
# End of errors in arguments
if
conf
.
JOBID_ARRAY_TRANSFORM
:
job_id
=
job_id_transform
(
job_id
)
# initial values
need_to_aggregate
=
True
cache
=
{
"text"
:
False
,
"pdf"
:
False
}
...
...
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