#!/bin/bash
#PBS -N KAIJU
#PBS -A UJHB0019
#PBS -l walltime=02:00:00
#PBS -q main
#PBS -l select=1:ncpus=128:ompthreads=128
#PBS -j oe
#PBS -m abe

#source ~/.bashrc
#module restore kaiju

# if [[ ! -z "$KAIJUROOTDIR" ]]; then
#     #If the root folder of a kaiju repo was passed in, souce the environment setup script
#     source $KAIJUROOTDIR/scripts/setupEnvironment.sh
# fi

echo "Job $PBS_JOBID started at `date` on `hostname` in directory `pwd`."

echo 'Setting up MAGE environment.'
source $KAIJUROOTDIR/scripts/setupEnvironment.sh

echo 'Loading modules.'
module --force purge
module load $MODULE_LIST
echo 'The following modules are loaded:'
module list

echo 'Setting environment variables.'
MPICOMMAND="mpiexec $KAIJUHOME/scripts/preproc/pinCpuCores.sh"
export OMP_NUM_THREADS=128
export MPI_TYPE_DEPTH=32
export KMP_STACKSIZE=128M
echo 'The active environment variables are:'
printenv

python ./intelChecksReport.py

echo "Job $PBS_JOBID ended at `date` on `hostname` in directory `pwd`."

