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

#BENCH reference jaxa_wing_body_unst.data.iter
#BENCH tolerance_abs 8.0e-3
#BENCH tolerance_rel 8.0e-3
#BENCH compare last_step
#BENCH exclude_vars cfl,cfltur,lambdatur, linresturb, linres, lambda*, l0*, l2dq*, l2res0, l2res1, l2res2, l2res3, l2res4, l2turbres0, linits, linitsturb

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_jaxa_wing_body.inputs 2>&1 |& tee -a ${log_file}


