#!/bin/bash
######################
## CURIE   TGCC/CEA ##
######################
#MSUB -r XIOS
#MSUB -o client_output.out    # standard output
#MSUB -e client_error.err    #error output
#MSUB -eo
#MSUB -c 1
#MSUB -n 16  # Number of MPI tasks (SPMD case) or cores (MPMD case)
#MSUB -X 
#MSUB -x 
#MSUB -T 1800      # Wall clock limit (seconds)
#MSUB -q skylake           # thin nodes
#MSUB -A devcmip6
#MSUB -Q test
#MSUB -m work

cd $BRIDGE_MSUB_PWD
module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi gnu
module load gnu
module load mpi/intelmpi/2017.0.6.256
module load flavor/buildcompiler/intel/17
#module load flavor/buildmpi/intelmpi/2017
module load flavor/hdf5/parallel
module load netcdf-fortran/4.4.4
module load hdf5/1.8.20
module load boost
module load blitz
module load feature/bridge/heterogenous_mpmd
module load arm-forge
module load nco
module load cdo

export KMP_STACKSIZE=3g
export KMP_LIBRARY=turnaround
export MKL_SERIAL=YES
export OMP_NUM_THREADS=${BRIDGE_MSUB_NCORE}

set -x 

#export GMON_OUT_PREFIX='gmon.out'
export machine_name=irene

#export TAU_MAKEFILE=$TAU_MAKEFILEDIR/Makefile.tau-icpc-papi-mpi-pdt-openmp-opari-scorep
#ccc_mprun -E '--enable_perf' amplxe-cl -collect hotspots -r ${PWD}/1omp_vtune/vtune_results ../../bin/test_send.exe

#ccc_mprun ../build_prod/bin/test_omp.exe 4
#ccc_mprun tau_exec -io ../../bin/test_send.exe
#ddt -start -n 8 ../buile_intelmpi/bin/test_omp.exe

cmake .
make test
