diff --git a/etc/bashrc b/etc/bashrc index 137daddc9..aa618df81 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -144,7 +144,7 @@ export WM_COMPILER_LIB_ARCH= # WM_COMPILE_OPTION = Opt | Debug | Prof : ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION -# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI +# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI | MVAPICH2 : ${WM_MPLIB:=OPENMPI}; export WM_MPLIB # WM_NCOMPPROCS = diff --git a/etc/cshrc b/etc/cshrc index c2a760d8b..b7644e2ac 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -128,7 +128,7 @@ if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt #setenv WM_COMPILE_OPTION Opt #setenv WM_COMPILE_OPTION Debug -# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI +# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI | MVAPICH2 if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI # WM_NCOMPPROCS = diff --git a/etc/settings.csh b/etc/settings.csh index 011d7858c..16612e1dd 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -282,6 +282,36 @@ case SYSTEMOPENMPI: unset mpi_version breaksw +case MVAPICH2: + set mpi_version=mvapich2 + + if ($?MVAPICH2_BIN_DIR != 0) then + if (-d "${MVAPICH2_BIN_DIR}" ) then + _foamAddPath $MVAPICH2_BIN_DIR + endif + else + set mpicc_cmd=`which mpicc` + setenv MVAPICH2_BIN_DIR `dirname $mpicc_cmd` + unset mpicc_cmd + endif + + setenv MPI_HOME `dirname $MVAPICH2_BIN_DIR` + setenv MPI_ARCH_PATH $MPI_HOME + + setenv PINC "`mpicc -show -cc= -nativelinking`" + setenv PLIBS "`mpicc -show -cc= | sed "s%$PINC%%"`" + + if ($?FOAM_VERBOSE && $?prompt) then + echo " Environment variables defined for MVAPICH2:" + echo " MPI_ARCH_PATH : $MPI_ARCH_PATH" + echo " PINC : $PINC" + echo " PLIBS : $PLIBS" + endif + + setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version + unset mpi_version + breaksw + case MPICH: set mpi_version=mpich-1.2.4 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version diff --git a/etc/settings.sh b/etc/settings.sh index 455bcb68b..4f800a456 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -334,6 +334,42 @@ SYSTEMOPENMPI) unset mpi_version ;; +MVAPICH2) + mpi_version=mvapich2 + + if [ -n "${MVAPICH2_BIN_DIR}" ] && [ -d "${MVAPICH2_BIN_DIR}" ] + then + _foamAddPath $MVAPICH2_BIN_DIR + else + MVAPICH2_BIN_DIR=$(dirname `which mpicc`) + fi + + if which mpicc >/dev/null + then + mpicc -v 2>/dev/null | grep -q "mpicc for MVAPICH2" || + echo "Warning: `which mpicc` does not appear to be for MVAPICH2" + else + echo "Warning: mpicc not available" + fi + + export MPI_HOME=`dirname $MVAPICH2_BIN_DIR` + export MPI_ARCH_PATH=$MPI_HOME + + export PINC="`mpicc -show -cc= -nativelinking`" + export PLIBS="`mpicc -show -cc= | sed "s%$PINC%%"`" + + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo " Environment variables defined for MVAPICH2:" + echo " MPI_ARCH_PATH : $MPI_ARCH_PATH" + echo " PINC : $PINC" + echo " PLIBS : $PLIBS" + fi + + export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version + unset mpi_version + ;; + MPICH) mpi_version=mpich-1.2.4 export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake index a01538cc3..6c4131068 100755 --- a/src/Pstream/Allwmake +++ b/src/Pstream/Allwmake @@ -5,7 +5,7 @@ set -x wmake libso dummy case "$WM_MPLIB" in -*MPI*) +*MPI* | MVAPICH*) set +x echo echo "Note: ignore spurious warnings about missing mpicxx.h headers" diff --git a/wmake/rules/linux64Gcc/mplibMVAPICH2 b/wmake/rules/linux64Gcc/mplibMVAPICH2 new file mode 100644 index 000000000..e69de29bb