From 9069a8dc7637106c4973168b786d2c14805a9036 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Mon, 17 Jun 2013 08:36:57 +0000 Subject: [PATCH] Intel MPI module names do not depend on compiler (version). --- sit | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) 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