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
696bdc91
Commit
696bdc91
authored
8 months ago
by
Matthew K Defenderfer
Browse files
Options
Downloads
Patches
Plain Diff
add help, usage, default values, and more robust option handling
parent
668670d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Add submit pol wrapper
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/submit-pol-job
+110
-15
110 additions, 15 deletions
src/submit-pol-job
with
110 additions
and
15 deletions
src/submit-pol-job
+
110
−
15
View file @
696bdc91
#!/bin/bash
# schedule a policy run on gpfs
outdir
=
$1
policy
=
$2
nodes
=
$3
cores
=
$4
ram
=
$5
partition
=
$6
filesystem
=
${
7
:-
scratch
}
time
=
${
8
:-
60
}
outfile
=
${
9
}
DIR
=
$outdir
POLICYFILE
=
$policy
FILESYSTEM
=
${
filesystem
}
OUTFILE
=
${
outfile
}
&&
\
set
-euxo
pipefail
############################################################
# Default Values #
############################################################
nodes
=
1
ntasks
=
16
mem_per_cpu
=
"8G"
time
=
"24:00:00"
partition
=
"amd-hdr100,medium"
outdir
=
"/data/rc/gpfs-policy/data"
policy
=
"./policy/list-path-external"
############################################################
# Help #
############################################################
usage
()
{
>
&2
cat
<<
EOF
Usage:
$0
[ -h ] [ -o | --outdir ] [ -f | --outfile ] [ --with-dirs ]
[ -N | --nodes ] [ -n | --ntasks ] [ -p | --partition]
[ -t | --time ] [ -m | --mem-per-cpu ]
device
EOF
exit
1
}
help
()
{
>
&2
cat
<<
EOF
Wraps the run-mmpol.sh script for applying a policy file. Must be run directly
as root or via the run-submit-pol-job.py script. The default policy file is
./policy/list-path-external
Usage:
$0
[ -h ] [ -o | --outdir ] [ -f | --outfile ] [ --with-dirs ]
[ -N | --nodes ] [ -n | --ntasks ] [ -p | --partition ]
[ -t | --time ] [ -m | --mem ]
device
options:
-h|--help Print this Help.
Required:
device GPFS fileset/directory apply the policy to. Can be
specified as either the name of the fileset or the
full path to the directory
(Examples: scratch, /data/user/[username])
Path:
-o|--outdir Parent directory to save policy output to
(default: /data/rc/gpfs-policy/data)
-f|--outfile Name of the policy output file
(default: "")
Policy Options:
--with-dirs Change to ./policy/list-path-dirplus (default: False)
sbatch options:
-N|--nodes Number of nodes to run the job on (default: 1)
-n|--ntasks Number of tasks (default: 16)
-p|--partition Partition to submit tasks to
(default: amd-hdr100,medium)
-t|--time Max walltime (default: 24:00:00)
-m|--mem-per-cpu RAM per task (default: 8G)
EOF
exit
0
}
args
=
$(
getopt
-a
-o
ho:f:N:n:p:t:m:
--long
help
,outdir:,outfile:,with-dirs,nodes:,ntasks:,partition:,time:,mem:
--
"
$@
"
)
if
[[
$?
-gt
0
]]
;
then
usage
fi
eval set
--
${
args
}
while
:
do
case
$1
in
-h
|
--help
)
help
;;
-o
|
--outdir
)
outdir
=
$2
;
shift
2
;;
-f
|
--outfile
)
outfile
=
$2
;
shift
2
;;
--with-dirs
)
policy
=
"./policy/list-path-dirplus"
;
shift
1
;;
-N
|
--nodes
)
nodes
=
$2
;
shift
2
;;
-n
|
--ntasks
)
ntasks
=
$2
;
shift
2
;;
-p
|
--partition
)
partition
=
$2
;
shift
2
;;
-t
|
--time
)
time
=
$2
;
shift
2
;;
-m
|
--mem-per-cpu
)
mem_per_cpu
=
$2
;
shift
2
;;
--
)
shift
;
break
;;
*
)
>
&2
echo
Unsupported option:
$1
usage
;;
esac
done
if
[[
$#
-eq
0
]]
;
then
usage
fi
device
=
"
$1
"
# Ensure gpfs_logdir is set
if
[[
-z
"
$device
"
]]
;
then
echo
"Error: Specify either the name of a fileset or a directory path"
usage
fi
DIR
=
$outdir
POLICYFILE
=
$policy
FILESYSTEM
=
${
device
}
OUTFILE
=
${
outfile
}
&&
\
DIR
=
$DIR
POLICYFILE
=
$POLICYFILE
FILESYSTEM
=
${
FILESYSTEM
}
OUTFILE
=
${
OUTFILE
}
\
sbatch
\
-N
$nodes
\
-
c
$
core
s
\
-
n
$
ntask
s
\
-t
$time
\
--mem-per-cpu
=
$
ram
\
--mem-per-cpu
=
$
mem_per_cpu
\
-p
$partition
\
./run-mmpol.sh
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