# Arbitrary name of the LoadLeveler job
# @ job_name = Generic_testcase
# Standard job output file
# @ output   = $(job_name).out
# Error job output file
# @ error    = $(job_name).err
# Type of job
# @ job_type = mpich
# Number of MPI processes requested
# @ total_tasks = 16
# Number of OpenMP/pthreads tasks per MPI process
# @ nb_threads  = 1
# @ resources = ConsumableCpus($(nb_threads))
# Permits passing total_tasks to mpirun via NB_TASKS
# as well as the number of threads/processes
# @ environment = OMP_NUM_THREADS=$(nb_threads); NB_TASKS=$(total_tasks)
# Job time hh:mm:ss (1h30mn here)
# @ wall_clock_limit = 0:30:00
# @ queue

# Recommendation : Compile and execute your codes under the same Intel environment.  
# If necessary, therefore, use the module command to load the appropriate environment.
# For example, if your code is compiled with Intel/2016.2, uncomment the following line:
#module load intel/2016.2

# To have the command echoes
set -x

module load intel/2018.2
module load gcc/6.4.0
module load cdo
module load cmake

# The LOADL_STEP_INITDIR vaiable is automatically set by
# LoadLeveler at the directory where the llsubmit is typed
#cp $LOADL_STEP_INITDIR/a.out .
# The max. STACK memory used (default 4MB) (here 16 MB) per
# the private variables of each thread.
export KMP_STACKSIZE=16m
# It is also possible to use OMP_STACKSIZE
# export OMP_STACKSIZE=16M

# Execution of a parallel hybrid program (MPI + threads).
# mpirun -np $NB_TASKS ../../build_prod/bin/generic_testcase.exe
export machine_name=ada

cmake .
ctest -V
