From 2ec135a6a7714a99e20d9a5cf361293dcc57295a Mon Sep 17 00:00:00 2001 From: Henrik Rusche Date: Mon, 10 Aug 2015 17:11:10 +0200 Subject: [PATCH] FEATURE: Backport of Intel and SGI MPI support --- etc/settings.csh | 60 ++++++++++++++++++++++++++ etc/settings.sh | 57 ++++++++++++++++++++++++ wmake/rules/General/mplibSGIMPI | 3 ++ wmake/rules/linux64Gcc/mplibINTELMPI | 3 ++ wmake/rules/linux64Gcc45/mplibINTELMPI | 3 ++ wmake/rules/linux64Gcc46/mplibINTELMPI | 3 ++ wmake/rules/linux64Gcc49/mplibINTELMPI | 3 ++ wmake/rules/linux64Icc/mplibINTELMPI | 3 ++ wmake/rules/linuxIA64Icc/mplibINTELMPI | 3 ++ 9 files changed, 138 insertions(+) create mode 100644 wmake/rules/General/mplibSGIMPI create mode 100755 wmake/rules/linux64Gcc/mplibINTELMPI create mode 100755 wmake/rules/linux64Gcc45/mplibINTELMPI create mode 100755 wmake/rules/linux64Gcc46/mplibINTELMPI create mode 100644 wmake/rules/linux64Gcc49/mplibINTELMPI create mode 100644 wmake/rules/linux64Icc/mplibINTELMPI create mode 100644 wmake/rules/linuxIA64Icc/mplibINTELMPI diff --git a/etc/settings.csh b/etc/settings.csh index 11997857d..45cd45cdc 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -391,6 +391,66 @@ case QSMPI: breaksw +case SGIMPI: + if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy + + if ( ! -d "$MPI_ROOT" ) then + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:" + echo " MPI_ROOT not a valid mpt installation directory." + echo " Please set MPI_ROOT to the mpt installation directory." + echo " (usually done by loading the mpt module)" + echo " MPI_ROOT currently set to '$MPI_ROOT'" + endif + + if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then + setenv MPI_ROOT ${MPI_ROOT:h} + endif + + setenv FOAM_MPI ${MPI_ROOT:t} + setenv MPI_ARCH_PATH $MPI_ROOT + + + if ($?FOAM_VERBOSE && $?prompt) then + echo "Using SGI MPT:" + echo " MPI_ROOT : $MPI_ROOT" + echo " FOAM_MPI : $FOAM_MPI" + endif + + + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib + breaksw + +case INTELMPI: + if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy + + if ( ! -d "$MPI_ROOT" ) then + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:" + echo " MPI_ROOT not a valid mpt installation directory." + echo " Please set MPI_ROOT to the mpt installation directory." + echo " (usually done by loading the mpt module)" + echo " MPI_ROOT currently set to '$MPI_ROOT'" + endif + + if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then + setenv MPI_ROOT ${MPI_ROOT:h} + endif + + setenv FOAM_MPI ${MPI_ROOT:t} + setenv MPI_ARCH_PATH $MPI_ROOT + + + if ($?FOAM_VERBOSE && $?prompt) then + echo "Using INTEL MPT:" + echo " MPI_ROOT : $MPI_ROOT" + echo " FOAM_MPI : $FOAM_MPI" + endif + + + _foamAddPath $MPI_ARCH_PATH/bin64 + _foamAddLib $MPI_ARCH_PATH/lib64 + breaksw + default: breaksw endsw diff --git a/etc/settings.sh b/etc/settings.sh index da7e95590..7149d05c4 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -479,7 +479,64 @@ QSMPI) _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib + ;; +SGIMPI) + # no trailing slash + [ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}" + + export FOAM_MPI="${MPI_ROOT##*/}" + export MPI_ARCH_PATH=$MPI_ROOT + + if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ] + then + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2 + echo " MPI_ROOT not a valid mpt installation directory or ending" \ + " in a '/'." 1>&2 + echo " Please set MPI_ROOT to the mpt installation directory." 1>&2 + echo " MPI_ROOT currently set to '$MPI_ROOT'" 1>&2 + fi + + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using SGI MPT:" 1>&2 + echo " MPI_ROOT : $MPI_ROOT" 1>&2 + echo " FOAM_MPI : $FOAM_MPI" 1>&2 + fi + + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib + + export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/sgimpi + ;; + +INTELMPI) + # no trailing slash + [ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}" + + export FOAM_MPI="${MPI_ROOT##*/}" + export MPI_ARCH_PATH=$MPI_ROOT + + if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ] + then + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2 + echo " MPI_ROOT not a valid mpt installation directory or ending" \ + " in a '/'." 1>&2 + echo " Please set MPI_ROOT to the mpt installation directory." 1>&2 + echo " MPI_ROOT currently set to '$MPI_ROOT'" 1>&2 + fi + + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using INTEL MPI:" 1>&2 + echo " MPI_ROOT : $MPI_ROOT" 1>&2 + echo " FOAM_MPI : $FOAM_MPI" 1>&2 + fi + + _foamAddPath $MPI_ARCH_PATH/intel64/bin + _foamAddLib $MPI_ARCH_PATH/intel64/lib + + export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/intelmpi ;; *) diff --git a/wmake/rules/General/mplibSGIMPI b/wmake/rules/General/mplibSGIMPI new file mode 100644 index 000000000..859526466 --- /dev/null +++ b/wmake/rules/General/mplibSGIMPI @@ -0,0 +1,3 @@ +PFLAGS = -DSGIMPI -DMPI_NO_CPPBIND +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi diff --git a/wmake/rules/linux64Gcc/mplibINTELMPI b/wmake/rules/linux64Gcc/mplibINTELMPI new file mode 100755 index 000000000..cf80ec2ea --- /dev/null +++ b/wmake/rules/linux64Gcc/mplibINTELMPI @@ -0,0 +1,3 @@ +PFLAGS = -DMPICH_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include64 +PLIBS = -L$(MPI_ARCH_PATH)/lib64 -lmpi diff --git a/wmake/rules/linux64Gcc45/mplibINTELMPI b/wmake/rules/linux64Gcc45/mplibINTELMPI new file mode 100755 index 000000000..cf80ec2ea --- /dev/null +++ b/wmake/rules/linux64Gcc45/mplibINTELMPI @@ -0,0 +1,3 @@ +PFLAGS = -DMPICH_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include64 +PLIBS = -L$(MPI_ARCH_PATH)/lib64 -lmpi diff --git a/wmake/rules/linux64Gcc46/mplibINTELMPI b/wmake/rules/linux64Gcc46/mplibINTELMPI new file mode 100755 index 000000000..cf80ec2ea --- /dev/null +++ b/wmake/rules/linux64Gcc46/mplibINTELMPI @@ -0,0 +1,3 @@ +PFLAGS = -DMPICH_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include64 +PLIBS = -L$(MPI_ARCH_PATH)/lib64 -lmpi diff --git a/wmake/rules/linux64Gcc49/mplibINTELMPI b/wmake/rules/linux64Gcc49/mplibINTELMPI new file mode 100644 index 000000000..cf80ec2ea --- /dev/null +++ b/wmake/rules/linux64Gcc49/mplibINTELMPI @@ -0,0 +1,3 @@ +PFLAGS = -DMPICH_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include64 +PLIBS = -L$(MPI_ARCH_PATH)/lib64 -lmpi diff --git a/wmake/rules/linux64Icc/mplibINTELMPI b/wmake/rules/linux64Icc/mplibINTELMPI new file mode 100644 index 000000000..cf80ec2ea --- /dev/null +++ b/wmake/rules/linux64Icc/mplibINTELMPI @@ -0,0 +1,3 @@ +PFLAGS = -DMPICH_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include64 +PLIBS = -L$(MPI_ARCH_PATH)/lib64 -lmpi diff --git a/wmake/rules/linuxIA64Icc/mplibINTELMPI b/wmake/rules/linuxIA64Icc/mplibINTELMPI new file mode 100644 index 000000000..cf80ec2ea --- /dev/null +++ b/wmake/rules/linuxIA64Icc/mplibINTELMPI @@ -0,0 +1,3 @@ +PFLAGS = -DMPICH_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include64 +PLIBS = -L$(MPI_ARCH_PATH)/lib64 -lmpi