Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
machinejobfeatures
mjf-scripts
Commits
ca2fb9a3
Commit
ca2fb9a3
authored
May 04, 2016
by
Andrew McNab
Browse files
Full set of key/values
parent
666d716e
Changes
1
Hide whitespace changes
Inline
Side-by-side
htcondor-jobfeatures
View file @
ca2fb9a3
...
...
@@ -65,6 +65,12 @@ import time
os
.
umask
(
0022
)
try
:
fromMachineAd
=
open
(
os
.
environ
[
'_CONDOR_MACHINE_AD'
],
'r'
).
read
()
except
:
sys
.
stderr
.
write
(
'Could not read $_CONDOR_MACHINE_AD file - exiting htcondor-jobfeatures'
)
sys
.
exit
(
10
)
try
:
fromJobAd
=
open
(
os
.
environ
[
'_CONDOR_JOB_AD'
],
'r'
).
read
()
except
:
...
...
@@ -151,26 +157,25 @@ for key in ['allocated_cpu', 'wall_limit_secs', 'cpu_limit_secs',
# Examine the Job Ad, for resource limits
try
:
cpusMatchObject
=
re
.
search
(
'CpusProvisioned *= *([0-9]*)'
,
fromJobAd
)
jobfeatures
[
'allocated_cpu'
]
=
int
(
cpusMatchObject
.
group
(
1
))
cpusMatchObject
=
re
.
search
(
'CpusProvisioned *= *([0-9
+*/()-
]*)'
,
fromJobAd
)
jobfeatures
[
'allocated_cpu'
]
=
int
(
eval
(
cpusMatchObject
.
group
(
1
))
)
except
:
pass
#try:
# wallMatchObject = re.search('walltime=([0-9]*):([0-9]*):([0-9]*)', sys.argv[5])
# jobfeatures['wall_limit_secs'] = int(wallMatchObject.group(1)) * 3600 + int(wallMatchObject.group(2)) * 60 + int(wallMatchObject.group(3))
#except:
# pass
#
#try:
# cputimeMatchObject = re.search('cput=([0-9]*):([0-9]*):([0-9]*)', sys.argv[5])
# jobfeatures['cpu_limit_secs'] = int(cputimeMatchObject.group(1)) * 3600 + int(cputimeMatchObject.group(2)) * 60 + int(cputimeMatchObject.group(3))
#except:
# pass
try
:
wallMatchObject
=
re
.
search
(
'^MaxJobRetirementTime *= *([0-9 +*/()-]*)'
,
fromMachineAd
)
jobfeatures
[
'wall_limit_secs'
]
=
int
(
eval
(
wallMatchObject
.
group
(
1
)))
except
:
pass
if
not
'cpu_limit_secs'
in
jobfeatures
and
'wall_limit_secs'
in
jobfeatures
:
# If not given in mjf files, we create a CPU seconds limit from wallclock
# and allocated CPUs/processors
jobfeatures
[
'cpu_limit_secs'
]
=
jobfeatures
[
'wall_limit_secs'
]
*
jobfeatures
[
'allocated_cpu'
]
try
:
rssMatchObject
=
re
.
search
(
'^MemoryProvisioned *= *([0-9]*)'
,
fromJobAd
)
rssInt
=
int
(
rssMatchObject
.
group
(
1
))
rssMatchObject
=
re
.
search
(
'^MemoryProvisioned *= *([0-9
+*/()-
]*)'
,
fromJobAd
)
rssInt
=
int
(
eval
(
rssMatchObject
.
group
(
1
))
)
except
:
pass
else
:
...
...
@@ -178,8 +183,8 @@ else:
jobfeatures
[
'max_rss_bytes'
]
=
rssInt
*
1000000
try
:
scratchMatchObject
=
re
.
search
(
'^DiskProvisioned *= *([0-9]*)'
,
fromJobAd
)
scratchInt
=
int
(
rssMatchObject
.
group
(
1
))
scratchMatchObject
=
re
.
search
(
'^DiskProvisioned *= *([0-9
+*/()-
]*)'
,
fromJobAd
)
scratchInt
=
int
(
eval
(
rssMatchObject
.
group
(
1
))
)
except
:
pass
else
:
...
...
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