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
+ 14
17
Compare changes
  • Side-by-side
  • Inline
+ 14
17
@@ -10,9 +10,8 @@ set -euxo pipefail
outdir="/data/rc/gpfs-policy/data"
policy_file="./policy-def/list-path-external"
device="scratch"
output_log_prefix=""
dry_run=""
dry_run=false
############################################################
# Help #
@@ -103,7 +102,7 @@ tmpscratch=$outdir/slurm-tmp-${SLURM_JOBID}
nodes=`scontrol show hostnames "${SLURM_JOB_NODELIST}" | tr '\n' ',' | sed -e 's/,$//'`
cores="${SLURM_CPUS_PER_TASK}"
DATESTR=`date +'%Y-%m-%d-%H:%M:%S'`
DATESTR=`date +'%Y%m%dT%H%M%S'`
policy=`basename $policy_file`
filetag="${policy}_slurm-${SLURM_JOBID}_${DATESTR}"
@@ -118,25 +117,23 @@ cmd="mmapplypolicy ${device} -I defer \
-M LIST_OUTPUT_FILE=${output_log_prefix} \
-N ${nodes} -n ${cores} -m ${cores}"
# report final command in job log
echo $cmd
if [[ -z "${dry_run}" ]]; then
mkdir -p $tmpglobal
if [[ ! ${dry_run} ]]; then
mkdir -p ${tmpglobal}
# run policy command
$cmd
${cmd}
log_name="${output_log_prefix}_${filetag}"
log_dir="${outdir}/${log_name}.d"
mkdir ${log_dir}
# tag output file with run metadata
raw_log_file=$(find ${outdir} -name "list-${SLURM_JOBID}*" -type d | head -1)
if [[ "$raw_log_file" != "" ]]
then
mv -n ${raw_log_file} ${log_dir}/${log_name}
raw_log_file=$(find ${outdir} -maxdepth 1 -name "list-${SLURM_JOBID}*" -type f | head -1)
if [[ "$raw_log_file" != "" ]]; then
mv -n ${raw_log_file} ${log_dir}/${log_name}
fi
rmdir $tmpglobal
fi
\ No newline at end of file
rmdir ${tmpglobal}
fi
Loading