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

Add mmapplypolicy wrapper script to simplify policy call via slurm

The run-mmpol.sh job script makes it easier to call the policy command
in a job and the submit-pol-job makes it easier initial the slurm run.
parents
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# run an mmapply policy across the cluster via slurm
# gather info to map mmapplypolicy to runtime configuration
# arguments passed via job env and runtime context
policyfile=$POLICYFILE
tmpglobal=$DIR
tmpscratch=$DIR
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'`
$filetag=$policyfile_$DATESTR
cmd="mmapplypolicy scratch -I prepare \
-P $policyfile \
-g $tmpglobal \
-s $tmpscratch \
-M "FILETAG=$filetag"
-N ${nodes} -n ${cores}"
# report final command in job log
echo $cmd
# run policy command
$cmd
#!/bin/bash
# schedule a policy run on gpfs
$outdir=$1
$policy=$2
$nodes=$3
$cores=$4
$ram=$5
$partition=$6
DIR=$outdir POLICYFILE=$policy && \
DIR=$DIR POLICYFILE=$POLICYFILE \
sbatch \
-N $nodes \
-c $cores \
--mem-per-cpu=$ram \
-p $partition \
./run-mmpol.sh
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