#!/bin/sh
### Nom du job
#PBS -N jorek
###  4 noeuds, 12  procs par node
#PBS -l nodes=4:ppn=12
#PBS -W x=NACCESSPOLICY:SINGLEJOB

#PBS -l walltime=01:30:00
##P#B#S -l mem=40gb

# modules cleaning
module purge
module load torque
module load mpiexec mvapich2/intel/64/1.8
module load intel/compiler+mkl
module load hwloc
 
# Pour ne pas confiner (no binding) les threads sur les coeurs de calcul
export IPATH_NO_CPUAFFINITY=1

export OMP_NUM_THREADS=12
export KMP_NUM_THREADS=12
export KMP_AFFINITY="verbose,norespect,compact"
export KMP_STACKSIZE=128m

MODEL=199
PREFIX=res
TG=${PREFIX}${MODEL}
JOREK_HOME=/home/pramet/jorek/trunk

cd $JOREK_HOME
export PRERUN='export OMP_NUM_THREADS=12;export KMP_NUM_THREADS=12;export MKL_NUM_THREADS=1;export KMP_AFFINITY="verbose,norespect,compact"'
export MPIRUN="mpiexec -comm pmi -npernode 1"
#export MPIRUN="mpirun -np 4 -ppn 1"
export BASEDIR=${JOREK_HOME}
$PRERUN
util/launch_tests.sh ${TG}
