#!/usr/bin/env bash
#PBS -N test_BGW
#PBS -q debug
#PBS -l mppwidth=24
#PBS -l walltime=00:30:00
#PBS -V

export TEMPDIRPATH=$SCRATCH/tmp

cd $PBS_O_WORKDIR 

# Non-threaded case:
export BGW_TEST_MPI_NPROCS=24
export OMP_NUM_THREADS=1
export MPIEXEC=`which aprun`

# Uncomment below to test threaded version
#export BGW_TEST_MPI_NPROCS=12
#export OMP_NUM_THREADS=2
#export MPIEXEC="`which aprun` -d 2"

export NO_STOP_MESSAGE=1
# do not write silly FORTRAN STOP messages from PGI
make check-parallel &> test.out

echo "Exit status = $?"
