#!/bin/bash
#PBS -S /bin/bash
#PBS -N m6_unst_rans
#PBS -q normal
#PBS -l select=2:ncpus=512:mpiprocs=4:model=tur_ath
#PBS -W group_list=<your project group ID>
#PBS -l walltime=01:00:00
#PBS -j oe
#PBS -r n

#BENCH reference onera_M6_unst.data.iter
#BENCH tolerance_abs 5.0e-3
#BENCH tolerance_rel 5.0e-3
#BENCH compare last_step
#BENCH exclude_vars cfl*, lambda*, linresturb, linits, linitsturb linres, l0*, l2dq*


log_file="run.log"


# Load LAVA module
module purge
module use /swbuild/LAVA/LAVA_modules
module load LAVA

# Set environment
export OMP_NUM_THREADS=128

# Change to working directory
cd $PBS_O_WORKDIR

# Run LAVA (4 MPI ranks per node, 128 threads each)
mpiexec -ppn 4 --cpu-bind none mbind.x -cs -t $OMP_NUM_THREADS \
    lavaunst.3D.NS1.AVX512 unst_onera_m6.inputs 2>&1 |& tee -a ${log_file}


