#! /bin/bash
#MSUB -r Test1              # Request name
#MSUB -n #NTASK#            # Number of Task
#MSUB -c #OPENMP#           # Number of Threads per Task
#MSUB -N #NODES#            # Number of Nodes
#MSUB -T 1800               # Elapsed time limit in seconds
#MSUB -o bench_out_%I.o     # Standart output %I is the job ID
#MSUB -o bench_out_%I.e     # Error output %I is the job ID
#MSUB -q skylake            # see ccc_mpinfo:  skylake or
#MSUB -A pa4564             # Project ID
set -x
cd ${BRIDGE_MSUB_PWD}

export OMP_NUM_THEADS=#OPENMP#
export BRIDGE_MSUB_NCORE=#CPUPERTASK#  # number of requested cores per process

export I_MPI_PIN=1
export I_MPI_PIN_DOMAIN=#CPUSPERTASK#

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

module unload feature/openmpi/net/auto feature/openmpi/mpi_compiler/intel mpi/openmpi/2.0.4
module unload mpi/openmpi/2.0.4
module unload .tuning/openmpi/2.0.4
module unload feature/openmpi/net/auto feature/openmpi/mpi_compiler/intel mpi/openmpi/2.0.4
module load mpi/intelmpi/2018.0.3.222
module load python3


echo "ccc_mrun -E '--exclusive' -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 #PX# #PY# #PZ# #PT# -prec #PREC# > #NAME#"
ccc_mprun -E '--exclusive' -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 #PX# #PY# #PZ# #PT# -prec #PREC# -cg > #NAME#
