Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gpfs-policy
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
gpfs-policy
Commits
7b1880de
Commit
7b1880de
authored
9 months ago
by
Matthew K Defenderfer
Browse files
Options
Downloads
Patches
Plain Diff
change ntasks to cores
parent
bd36fe86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Add submit pol wrapper
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/run-submit-pol-job.py
+9
-7
9 additions, 7 deletions
src/run-submit-pol-job.py
src/submit-pol-job
+7
-7
7 additions, 7 deletions
src/submit-pol-job
with
16 additions
and
14 deletions
src/run-submit-pol-job.py
+
9
−
7
View file @
7b1880de
...
@@ -29,7 +29,7 @@ def parse_args():
...
@@ -29,7 +29,7 @@ def parse_args():
sbatch
=
parser
.
add_argument_group
(
'
sbatch parameters
'
)
sbatch
=
parser
.
add_argument_group
(
'
sbatch parameters
'
)
sbatch
.
add_argument
(
'
-N
'
,
'
--nodes
'
,
type
=
int
,
default
=
1
,
sbatch
.
add_argument
(
'
-N
'
,
'
--nodes
'
,
type
=
int
,
default
=
1
,
help
=
'
Number of nodes to run job across
'
)
help
=
'
Number of nodes to run job across
'
)
sbatch
.
add_argument
(
'
-
n
'
,
'
--
ntask
s
'
,
type
=
int
,
default
=
16
,
sbatch
.
add_argument
(
'
-
c
'
,
'
--
core
s
'
,
type
=
int
,
default
=
16
,
help
=
'
Number of cores to request
'
)
help
=
'
Number of cores to request
'
)
sbatch
.
add_argument
(
'
-p
'
,
'
--partition
'
,
type
=
str
,
default
=
'
amd-hdr100,medium
'
,
sbatch
.
add_argument
(
'
-p
'
,
'
--partition
'
,
type
=
str
,
default
=
'
amd-hdr100,medium
'
,
help
=
'
Partition to submit job to. Can be a comma-separated list of multiple partitions
'
)
help
=
'
Partition to submit job to. Can be a comma-separated list of multiple partitions
'
)
...
@@ -94,9 +94,9 @@ def validate_nodes(n):
...
@@ -94,9 +94,9 @@ def validate_nodes(n):
if
not
isinstance
(
n
,
int
)
and
n
>=
1
and
n
<=
4
:
if
not
isinstance
(
n
,
int
)
and
n
>=
1
and
n
<=
4
:
raise
ValueError
(
'
Nodes must be an integer between 1 and 4
'
)
raise
ValueError
(
'
Nodes must be an integer between 1 and 4
'
)
def
validate_
ntask
s
(
n
):
def
validate_
core
s
(
n
):
if
not
isinstance
(
n
,
int
)
and
n
>=
1
and
n
<=
48
:
if
not
isinstance
(
n
,
int
)
and
n
>=
1
and
n
<=
48
:
raise
ValueError
(
'
Ntask
s must be an integer between 1 and 48
'
)
raise
ValueError
(
'
Core
s must be an integer between 1 and 48
'
)
# Need to validate that the output directory exists. This will not create a directory that does not already exist.
# Need to validate that the output directory exists. This will not create a directory that does not already exist.
def
validate_output_directory
(
outdir
):
def
validate_output_directory
(
outdir
):
...
@@ -118,7 +118,7 @@ def main():
...
@@ -118,7 +118,7 @@ def main():
args
[
'
device
'
]
=
validate_device
(
args
[
'
device
'
])
args
[
'
device
'
]
=
validate_device
(
args
[
'
device
'
])
validate_nodes
(
args
[
'
nodes
'
])
validate_nodes
(
args
[
'
nodes
'
])
validate_
ntask
s
(
args
[
'
ntask
s
'
])
validate_
core
s
(
args
[
'
core
s
'
])
validate_mem
(
args
[
'
mem_per_cpu
'
])
validate_mem
(
args
[
'
mem_per_cpu
'
])
validate_time
(
args
[
'
time
'
])
validate_time
(
args
[
'
time
'
])
args
[
'
partition
'
]
=
validate_partition
(
args
[
'
partition
'
])
args
[
'
partition
'
]
=
validate_partition
(
args
[
'
partition
'
])
...
@@ -128,11 +128,13 @@ def main():
...
@@ -128,11 +128,13 @@ def main():
if
args
[
'
outfile
'
]
is
None
:
if
args
[
'
outfile
'
]
is
None
:
args
[
'
outfile
'
]
=
create_default_outfile
(
args
[
'
device
'
])
args
[
'
outfile
'
]
=
create_default_outfile
(
args
[
'
device
'
])
cmd
=
"
./submit-pol-job -o {outdir} -f {outfile} -N {nodes} -
n
{
ntask
s} -p {partition} -t {time} -m {mem_per_cpu} {device}
"
.
format
(
**
args
)
cmd
=
"
./submit-pol-job -o {outdir} -f {outfile} -N {nodes} -
c
{
core
s} -p {partition} -t {time} -m {mem_per_cpu} {device}
"
.
format
(
**
args
)
if
args
[
'
with_dirs
'
]:
if
args
[
'
with_dirs
'
]:
cmd
=
f
'
{
cmd
}
--with-dirs
'
cmd
=
f
'
{
cmd
}
--with-dirs
'
print
(
cmd
)
print
(
f
"
Command:
{
cmd
}
"
)
proc
=
subprocess
.
run
(
cmd
,
shell
=
True
)
proc
.
communicate
()
exit
()
exit
()
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
src/submit-pol-job
+
7
−
7
View file @
7b1880de
...
@@ -7,7 +7,7 @@ set -euxo pipefail
...
@@ -7,7 +7,7 @@ set -euxo pipefail
############################################################
############################################################
nodes
=
1
nodes
=
1
ntask
s
=
16
core
s
=
16
mem_per_cpu
=
"8G"
mem_per_cpu
=
"8G"
time
=
"24:00:00"
time
=
"24:00:00"
partition
=
"amd-hdr100,medium"
partition
=
"amd-hdr100,medium"
...
@@ -22,7 +22,7 @@ usage()
...
@@ -22,7 +22,7 @@ usage()
{
{
>
&2
cat
<<
EOF
>
&2
cat
<<
EOF
Usage:
$0
[ -h ] [ -o | --outdir ] [ -f | --outfile ] [ --with-dirs ]
Usage:
$0
[ -h ] [ -o | --outdir ] [ -f | --outfile ] [ --with-dirs ]
[ -N | --nodes ] [ -
n
| --
ntask
s ] [ -p | --partition]
[ -N | --nodes ] [ -
c
| --
core
s ] [ -p | --partition]
[ -t | --time ] [ -m | --mem-per-cpu ]
[ -t | --time ] [ -m | --mem-per-cpu ]
device
device
EOF
EOF
...
@@ -37,7 +37,7 @@ as root or via the run-submit-pol-job.py script. The default policy file is
...
@@ -37,7 +37,7 @@ as root or via the run-submit-pol-job.py script. The default policy file is
./policy/list-path-external
./policy/list-path-external
Usage:
$0
[ -h ] [ -o | --outdir ] [ -f | --outfile ] [ --with-dirs ]
Usage:
$0
[ -h ] [ -o | --outdir ] [ -f | --outfile ] [ --with-dirs ]
[ -N | --nodes ] [ -
n
| --
ntask
s ] [ -p | --partition ]
[ -N | --nodes ] [ -
c
| --
core
s ] [ -p | --partition ]
[ -t | --time ] [ -m | --mem ]
[ -t | --time ] [ -m | --mem ]
device
device
...
@@ -60,7 +60,7 @@ Policy Options:
...
@@ -60,7 +60,7 @@ Policy Options:
sbatch options:
sbatch options:
-N|--nodes Number of nodes to run the job on (default: 1)
-N|--nodes Number of nodes to run the job on (default: 1)
-
n
|--
ntask
s Number of
task
s (default: 16)
-
c
|--
core
s Number of
core
s (default: 16)
-p|--partition Partition to submit tasks to
-p|--partition Partition to submit tasks to
(default: amd-hdr100,medium)
(default: amd-hdr100,medium)
-t|--time Max walltime (default: 24:00:00)
-t|--time Max walltime (default: 24:00:00)
...
@@ -69,7 +69,7 @@ EOF
...
@@ -69,7 +69,7 @@ EOF
exit
0
exit
0
}
}
args
=
$(
getopt
-a
-o
ho:f:N:
n
:p:t:m:
--long
help
,outdir:,outfile:,with-dirs,nodes:,
ntask
s:,partition:,time:,mem:
--
"
$@
"
)
args
=
$(
getopt
-a
-o
ho:f:N:
c
:p:t:m:
--long
help
,outdir:,outfile:,with-dirs,nodes:,
core
s:,partition:,time:,mem:
--
"
$@
"
)
if
[[
$?
-gt
0
]]
;
then
if
[[
$?
-gt
0
]]
;
then
usage
usage
...
@@ -85,7 +85,7 @@ do
...
@@ -85,7 +85,7 @@ do
-f
|
--outfile
)
outfile
=
$2
;
shift
2
;;
-f
|
--outfile
)
outfile
=
$2
;
shift
2
;;
--with-dirs
)
policy
=
"./policy/list-path-dirplus"
;
shift
1
;;
--with-dirs
)
policy
=
"./policy/list-path-dirplus"
;
shift
1
;;
-N
|
--nodes
)
nodes
=
$2
;
shift
2
;;
-N
|
--nodes
)
nodes
=
$2
;
shift
2
;;
-
n
|
--
ntask
s
)
ntask
s
=
$2
;
shift
2
;;
-
c
|
--
core
s
)
core
s
=
$2
;
shift
2
;;
-p
|
--partition
)
partition
=
$2
;
shift
2
;;
-p
|
--partition
)
partition
=
$2
;
shift
2
;;
-t
|
--time
)
time
=
$2
;
shift
2
;;
-t
|
--time
)
time
=
$2
;
shift
2
;;
-m
|
--mem-per-cpu
)
mem_per_cpu
=
$2
;
shift
2
;;
-m
|
--mem-per-cpu
)
mem_per_cpu
=
$2
;
shift
2
;;
...
@@ -111,7 +111,7 @@ DIR=$outdir POLICYFILE=$policy FILESYSTEM=${device} OUTFILE=${outfile} && \
...
@@ -111,7 +111,7 @@ DIR=$outdir POLICYFILE=$policy FILESYSTEM=${device} OUTFILE=${outfile} && \
DIR
=
$DIR
POLICYFILE
=
$POLICYFILE
FILESYSTEM
=
${
FILESYSTEM
}
OUTFILE
=
${
OUTFILE
}
\
DIR
=
$DIR
POLICYFILE
=
$POLICYFILE
FILESYSTEM
=
${
FILESYSTEM
}
OUTFILE
=
${
OUTFILE
}
\
sbatch
\
sbatch
\
-N
$nodes
\
-N
$nodes
\
-
n
$
ntask
s
\
-
c
$
core
s
\
-t
$time
\
-t
$time
\
--mem-per-cpu
=
$mem_per_cpu
\
--mem-per-cpu
=
$mem_per_cpu
\
-p
$partition
\
-p
$partition
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment