Skip to content
Snippets Groups Projects
Commit c59e637d authored by John-Paul Robinson's avatar John-Paul Robinson
Browse files

Fix ambigous policy output renaming

The mmpolicyapply list output file naming is not well documented.
Add job-specific subdir for global and scratch paths to isolate
expected files from a job.
Rename final tagged result and move it to the provided global
output dir and clean up the temporary dir after file completes.
Include potential for no output if there are zero matches.
parent e145fb8f
No related branches found
No related tags found
No related merge requests found
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
filesystem=${FILESYSTEM:-scratch} filesystem=${FILESYSTEM:-scratch}
policyfile=$POLICYFILE policyfile=$POLICYFILE
tmpglobal=$DIR tmpglobal=$DIR/slurm-tmp-${SLURM_JOBID}
tmpscratch=$DIR tmpscratch=$DIR/slurm-tmp-${SLURM_JOBID}
mkdir -p $tmpglobal
nodes=`scontrol show hostnames "${SLURM_JOB_NODELIST}" | tr '\n' ',' | sed -e 's/,$//'` nodes=`scontrol show hostnames "${SLURM_JOB_NODELIST}" | tr '\n' ',' | sed -e 's/,$//'`
cores="${SLURM_CPUS_PER_TASK}" cores="${SLURM_CPUS_PER_TASK}"
...@@ -41,4 +42,8 @@ fi ...@@ -41,4 +42,8 @@ fi
# tag output file with run metadata # tag output file with run metadata
outfile=`ls -t $tmpglobal | head -1` outfile=`ls -t $tmpglobal | head -1`
mv -n $tmpglobal/$outfile $tmpglobal/${outfile}_$filetag if [[ "$outfile" != "" ]]
then
mv -n $tmpglobal/$outfile $tmpglobal/../${outfile}_$filetag
fi
rmdir $tmpglobal
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment