Skip to content
Snippets Groups Projects

Update main to rel_v0.1.1-1

Merged Matthew K Defenderfer requested to merge rel_v0.1.1-1 into main
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -14,6 +14,7 @@ partition="amd-hdr100,medium"
outdir="/data/rc/gpfs-policy/data"
policy="./policy-def/list-path-external"
outfile=""
dry_run=""
############################################################
# Help #
@@ -23,7 +24,7 @@ usage()
>&2 cat << EOF
Usage: $0 [ -h ] [ -o | --outdir ] [ -f | --outfile ] [ --with-dirs ]
[ -N | --nodes ] [ -c | --cores ] [ -p | --partition]
[ -t | --time ] [ -m | --mem-per-cpu ]
[ -t | --time ] [ -m | --mem-per-cpu ] [ --dry_run ]
device
EOF
exit 1
@@ -38,11 +39,13 @@ as root or via the run-submit-pol-job.py script. The default policy file is
Usage: $0 [ -h ] [ -o | --outdir ] [ -f | --outfile ] [ -P | --policy ]
[ -N | --nodes ] [ -c | --cores ] [ -p | --partition ]
[ -t | --time ] [ -m | --mem ]
[ -t | --time ] [ -m | --mem ] [ --dry-run ]
device
options:
-h|--help Print this Help.
-h|--help Print this Help.
--dry-run Do not submit a Slurm job running the policy. Instead, pass --dry-run to run-mmpol.sh and call
it normally to just print the output to STDOUT
Required:
device GPFS fileset/directory apply the policy to. Can be
@@ -69,7 +72,8 @@ EOF
exit 0
}
args=$(getopt -a -o ho:f:P:N:c:p:t:m: --long help,outdir:,outfile:,policy:,nodes:,cores:,partition:,time:,mem: -- "$@")
args=$(getopt -a -o ho:f:P:N:c:p:t:m: \
--long help,outdir:,outfile:,policy:,nodes:,cores:,partition:,time:,mem:,dry-run -- "$@")
if [[ $? -gt 0 ]]; then
usage
@@ -89,6 +93,7 @@ do
-p | --partition) partition=$2 ; shift 2 ;;
-t | --time) time=$2 ; shift 2 ;;
-m | --mem-per-cpu) mem_per_cpu=$2 ; shift 2 ;;
--dry-run) dry_run=true ; shift 1 ;;
--) shift; break ;;
*) >&2 echo Unsupported option: $1
usage ;;
@@ -108,15 +113,23 @@ if [[ -z "$device" ]]; then
fi
slurm_out="out/pol-%A-$(basename ${policy})-$(basename ${device}).out"
mkdir -p out
DIR=$outdir POLICYFILE=$policy FILESYSTEM=${device} OUTFILE=${outfile} && \
DIR=$DIR POLICYFILE=$POLICYFILE FILESYSTEM=${FILESYSTEM} OUTFILE=${OUTFILE} \
sbatch \
-N $nodes \
-c $cores \
-t $time \
--mem-per-cpu=$mem_per_cpu \
-p $partition \
-o ${slurm_out} \
./run-mmpol.sh
run_mmpol_cmd_base="./run-mmpol.sh -o ${outdir} -f ${outfile} -P ${policy}"
if [[ -z "${dry_run}" ]]; then
mkdir -p out
run_mmpol_cmd="${run_mmpol_cmd_base} ${device}"
sbatch \
-N $nodes \
-c $cores \
-t $time \
--mem-per-cpu=$mem_per_cpu \
-p $partition \
-o ${slurm_out} \
--wrap "${run_mmpol_cmd}"
else
run_mmpol_cmd="${run_mmpol_cmd_base} --dry-run ${device}"
${run_mmpol_cmd}
fi
Loading