Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
a984d75e
Commit
a984d75e
authored
Jul 09, 2020
by
Michael Ott
Browse files
Add parameter -m to specify maximum job length to be used for end_ts in start
parent
5da108d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/dcdbslurmjob/dcdbslurmjob.cpp
View file @
a984d75e
...
...
@@ -72,6 +72,7 @@ void usage() {
std
::
cout
<<
" -j<jobid> Numerical job id [default: SLURM_JOB_ID var]"
<<
std
::
endl
;
std
::
cout
<<
" -i<userid> Numerical user id [default: SLURM_JOB_USER var]"
<<
std
::
endl
;
std
::
cout
<<
" -s<pattern> Nodelist substitution pattern [default: none]"
<<
std
::
endl
;
std
::
cout
<<
" -m<pattern> Maximum job length in h [default: none]"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
" -h This help page"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
...
...
@@ -172,11 +173,12 @@ int main(int argc, char** argv) {
int
port
;
std
::
string
nodelist
=
""
,
jobId
=
""
,
userId
=
""
;
std
::
string
substitution
=
""
;
int
maxJobLength
=
-
1
;
int
qos
=
0
;
uint64_t
ts
=
0
;
// Defining options
const
char
*
opts
=
"b:q:c:u:p:n:t:j:i:s:h"
;
const
char
*
opts
=
"b:q:c:u:p:n:t:j:i:s:
m:
h"
;
char
ret
;
while
((
ret
=
getopt
(
argc
,
argv
,
opts
))
!=-
1
)
{
...
...
@@ -244,8 +246,12 @@ int main(int argc, char** argv) {
substitution
=
optarg
;
if
(
substitution
==
"SNG"
)
{
substitution
=
"s%([fi][0-9]{2})(r[0-9]{2})(c[0-9]{2})(s[0-9]{2})%/sng/
\\
1/
\\
2/
\\
3/
\\
4%"
;
maxJobLength
=
48
;
}
break
;
case
'm'
:
maxJobLength
=
std
::
stoull
(
optarg
);
break
;
case
'h'
:
default:
usage
();
...
...
@@ -332,6 +338,9 @@ int main(int argc, char** argv) {
std
::
cout
<<
"START = "
<<
ts
<<
std
::
endl
;
std
::
cout
<<
"NODELIST = "
<<
nodelist
<<
std
::
endl
;
std
::
cout
<<
"SUBST = "
<<
substitution
<<
std
::
endl
;
if
(
maxJobLength
>=
0
)
{
std
::
cout
<<
"JOBLEN = "
<<
maxJobLength
<<
std
::
endl
;
}
std
::
cout
<<
"NODES ="
;
for
(
auto
&
n
:
nl
)
{
std
::
cout
<<
" "
<<
n
;
...
...
@@ -344,7 +353,7 @@ int main(int argc, char** argv) {
jd
.
jobId
=
jobId
;
jd
.
userId
=
userId
;
jd
.
startTime
=
DCDB
::
TimeStamp
(
ts
);
jd
.
endTime
=
DCDB
::
TimeStamp
((
uint64_t
)
0
);
jd
.
endTime
=
(
maxJobLength
>=
0
)
?
DCDB
::
TimeStamp
(
ts
+
S_TO_NS
(
maxJobLength
*
3600
)
+
1
)
:
DCDB
::
TimeStamp
((
uint64_t
)
0
);
jd
.
nodes
=
nl
;
}
catch
(
const
std
::
invalid_argument
&
e
)
{
std
::
cerr
<<
"Invalid input format!"
<<
std
::
endl
;
...
...
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