#!/bin/bash
#PBS -A P28100045
#PBS -N KAIJU
#PBS -j oe
#PBS -q regular
#PBS -l walltime=12:00:00
#PBS -l select=1:ncpus=72:ompthreads=72

#Example usage
#qsub -v KAIJUEXE="pusher.x" -J 1-5 -N RC_ep RunK.pbs
#Module savelist "kaiju"
#Currently Loaded Modules:
#  1) git/2.9.5    (H)   4) impi/2018.4.274       7) python/2.7.16
#  2) intel/18.0.5       5) ncarenv/1.3           8) cmake/3.14.4
#  3) hdf5/1.10.5        6) ncarcompilers/0.5.0

export EXE=${KAIJUEXE:-"pusher.x"}
export RUNID=${PBS_JOBNAME}

source ~/.bashrc
module restore kaiju

module list
hostname
date
export OMP_NUM_THREADS=72
export KMP_STACKSIZE=128M
export JNUM=${PBS_ARRAY_INDEX:-0}
echo "Running $EXE"
${EXE} ${RUNID}.xml ${JNUM} > ${RUNID}.${JNUM}.out
date