diff --git a/sit b/sit index 3f0319e..ff3b6f1 100755 --- a/sit +++ b/sit @@ -97,23 +97,37 @@ if [ ! -z "$MPI" ] ; then MPI_MODULE="mpi/$MPI" if [ ! -z "$MPI_VERSION" ] ; then MPI_VERSION_NUM=${MPI_VERSION%%-*} - MPI_MODULE=${MPI_MODULE}${MPI_VERSION_NUM:+"/${MPI_VERSION_NUM}-$COMPILER-$COMPILER_VERSION"} + case $MPI in + impi) + MPI_MODULE=${MPI_MODULE}${MPI_VERSION_NUM:+"/${MPI_VERSION_NUM}"} + ;; + *) + MPI_MODULE=${MPI_MODULE}${MPI_VERSION_NUM:+"/${MPI_VERSION_NUM}-$COMPILER-$COMPILER_VERSION"} + ;; + esac fi echo "Loading MPI module ${MPI_MODULE}" module load $MPI_MODULE - case $COMPILER in - gnu) - MPICC="mpicc" - MPICXX="mpicxx" - MPIFC="mpif90" - ;; - intel) - MPICC="mpiicc" - MPICXX="mpiicpc" - MPIFC="mpiifort" - ;; - esac + case $COMPILER in + intel) + if [[ $mpi == "impi" ]] ; then + MPICC="mpiicc" + MPICXX="mpiicpc" + MPIFC="mpiifort" + else + MPICC="mpicc" + MPICXX="mpicxx" + MPIFC="mpif90" + fi + ;; + gnu|*) + MPICC="mpicc" + MPICXX="mpicxx" + MPIFC="mpif90" + ;; + esac + echo "MPI compiler env: MPICC=$MPICC, MPICXX=$MPICXX, MPIFC=$MPIFC" MPI_DIR=${MPI_DIR:=$(dirname $(dirname $(which $MPICC)))} fi