#!/bin/bash
#SBATCH --job-name=QCDBENCHMARK
#SBATCH --workdir=#WRC#
#SBATCH --output=mpi_%j_#NODES#.out
#SBATCH --error=mpi_%j_#NODES#.err
#SBATCH --time=00:10:00
#SBATCH --constraint=highmem
#SBATCH --nodes=#NODES#
#SBATCH --ntasks-per-node=#NTASKPERNODE#
#SBATCH --cpus-per-task=#CPUSPERTASK#
#SBATCH --ntasks=#NTASK#
#SBATCH --exclusive

#set -e
export OMP_NUM_THREADS=#OPENMP#
export KMP_AFFINITY=compact,1,0,granularity=fine,verbose
export KMP_HW_SUBSET=1T


#export KMP_AFFINITY=balanced,granularity=fine
export I_MPI_PIN=1
export I_MPI_PIN_DOMAIN=#CPUSPERTASK#

module load intel/2018.4 impi/2018.4
module load hdf5
n=$1
m=$2
g=$3
v=$4
EXE=$5
name=$6
lx=$7
ly=$8
lz=$9
lt=${10}
prec=${11}

echo "mpirun -n #NTASK# $EXE -x $lx -y $ly -z $lz -t $lt -by 4 -bz 4 -pxy 1 -pxyz 0 -c #OPENMP# -sy 1 -sz 1 -minct 1 -compress12 -geom $v $g $m $n -prec  $prec -cg"
mpirun -n #NTASK# $EXE -x $lx -y $ly -z $lz -t $lt -by 4 -bz 4 -pxy 1 -pxyz 0 -c #OPENMP# -sy 1 -sz 1 -minct 1 -compress12 -geom $v $g $m $n -prec  $prec -cg > $name

