diff --git a/BuildIssues.txt b/BuildIssues.txt index 011b5dc0488e1c9d72869d4fc3b8832a134de13a..fbb6b6dcb5728c4d6d81c21479fa885a140326d6 100644 --- a/BuildIssues.txt +++ b/BuildIssues.txt @@ -3,6 +3,21 @@ OpenFOAM-1706 Known Build Issues ================== +--------------------- +Intel MPI (Gcc/Clang) +--------------------- + + Either I_MPI_ROOT or MPI_ROOT can be used to specify the Intel-MPI + installation directory path. + + The ThirdParty build of ptscotch uses `mpiicc` for Intel-MPI + instead of the usual `mpicc`. + When gcc or clang are used, it is highly likely that the + I_MPI_CC environment variable also needs to be set accordingly. + + See `mpiicc -help` for more information about environment variables. + + -------------- Intel Compiler -------------- diff --git a/etc/config.csh/mpi b/etc/config.csh/mpi index e1e7fba8e1ebea4079808fad70d8465a7f0cc297..e2ec875e4f2abac26f047d2a9d69f374f3995a90 100644 --- a/etc/config.csh/mpi +++ b/etc/config.csh/mpi @@ -33,13 +33,14 @@ # #------------------------------------------------------------------------------ unsetenv MPI_ARCH_PATH MPI_HOME +setenv FOAM_MPI dummy # Fallback value switch ("$WM_MPLIB") case SYSTEMOPENMPI: # Use the system installed openmpi, get library directory via mpicc setenv FOAM_MPI openmpi-system - # Bit of a hack: strip off 'lib' and hope this is the prefix for openmpi + # Bit of a hack: strip off 'lib' and assume it is the prefix for openmpi # include files and libraries. set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'` @@ -58,9 +59,9 @@ case OPENMPI: setenv OPAL_PREFIX $MPI_ARCH_PATH if ($?FOAM_VERBOSE && $?prompt) then - echo "Using OPENMPI:" - echo " OPAL_PREFIX : $OPAL_PREFIX" + echo "Using $WM_MPLIB" echo " FOAM_MPI : $FOAM_MPI" + echo " OPAL_PREFIX : $MPI_ARCH_PATH" endif _foamAddPath $MPI_ARCH_PATH/bin @@ -191,10 +192,9 @@ case SGIMPI: if ( ! -d "$MPI_ROOT" ) then echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:" - 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'" + echo " Not a valid $WM_MPLIB installation directory." + echo " Please set MPI_ROOT properly (usually via the mpt module)" + echo " Currently using '$MPI_ARCH_PATH'" endif if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then @@ -205,9 +205,9 @@ case SGIMPI: setenv MPI_ARCH_PATH $MPI_ROOT if ($?FOAM_VERBOSE && $?prompt) then - echo "Using SGI MPT:" - echo " MPI_ROOT : $MPI_ROOT" + echo "Using $WM_MPLIB" echo " FOAM_MPI : $FOAM_MPI" + echo " MPI_ROOT : $MPI_ARCH_PATH" endif _foamAddPath $MPI_ARCH_PATH/bin @@ -215,36 +215,65 @@ case SGIMPI: breaksw case INTELMPI: - if ( ! $?MPI_ROOT ) setenv MPI_ROOT /dummy + if ( $?I_MPI_ROOT ) then + # I_MPI_ROOT: The Intel MPI Library installation directory - if ( ! -d "$MPI_ROOT" ) then - echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:" - 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 + # Remove trailing slash + if ( "${I_MPI_ROOT:h}/" == $I_MPI_ROOT ) then + setenv I_MPI_ROOT ${I_MPI_ROOT:h} + endif + setenv MPI_ARCH_PATH $I_MPI_ROOT + setenv FOAM_MPI ${MPI_ARCH_PATH:t} + + # If subdirectory is version number only, prefix with 'impi-' + switch ("$FOAM_MPI") + case [0-9]*: + setenv FOAM_MPI "impi-$FOAM_MPI" + breaksw + endsw + + if ($?FOAM_VERBOSE && $?prompt) then + echo "Using $WM_MPLIB" + echo " FOAM_MPI : $FOAM_MPI" + echo " I_MPI_ROOT : $MPI_ARCH_PATH" + endif + else if ( $?MPI_ROOT ) then + # MPI_ROOT: General specification - if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then - setenv MPI_ROOT ${MPI_ROOT:h} - endif + # Remove trailing slash + 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 + setenv MPI_ARCH_PATH $MPI_ROOT + setenv FOAM_MPI ${MPI_ARCH_PATH:t} + + # If subdirectory is version number only, prefix with 'impi-' + switch ("$FOAM_MPI") + case [0-9]*: + setenv FOAM_MPI "impi-$FOAM_MPI" + breaksw + endsw + + if ($?FOAM_VERBOSE && $?prompt) then + echo "Using $WM_MPLIB" + echo " FOAM_MPI : $FOAM_MPI" + echo " MPI_ROOT : $MPI_ARCH_PATH" + endif + else + setenv MPI_ARCH_PATH /dummy + endif - if ($?FOAM_VERBOSE && $?prompt) then - echo "Using INTEL MPT:" - echo " MPI_ROOT : $MPI_ROOT" - echo " FOAM_MPI : $FOAM_MPI" + if ( ! -d "$MPI_ARCH_PATH" ) then + echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:" + echo " Not a valid $WM_MPLIB installation directory." + echo " Please set I_MPI_ROOT or MPI_ROOT properly." + echo " Currently using '$MPI_ARCH_PATH'" endif _foamAddPath $MPI_ARCH_PATH/bin64 _foamAddLib $MPI_ARCH_PATH/lib64 breaksw - -default: - setenv FOAM_MPI dummy - breaksw endsw diff --git a/etc/config.sh/mpi b/etc/config.sh/mpi index 9d22c3e700660c76c185abe48da83cacfeb675f9..a2d676d76b54c0fe4dc1ef4c74a2676754e7dea2 100644 --- a/etc/config.sh/mpi +++ b/etc/config.sh/mpi @@ -33,6 +33,7 @@ # #------------------------------------------------------------------------------ unset MPI_ARCH_PATH MPI_HOME +export FOAM_MPI=dummy # Fallback value case "$WM_MPLIB" in SYSTEMOPENMPI) @@ -45,7 +46,7 @@ SYSTEMOPENMPI) unset OPAL_PREFIX fi - # Bit of a hack: strip off 'lib' and hope this is the prefix for openmpi + # Bit of a hack: strip off 'lib' and assume it is the prefix for openmpi # include files and libraries. libDir=$(mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/') @@ -65,9 +66,9 @@ OPENMPI) if [ "$FOAM_VERBOSE" -a "$PS1" ] then - echo "Using OPENMPI:" 1>&2 - echo " OPAL_PREFIX : $OPAL_PREFIX" 1>&2 + echo "Using $WM_MPLIB" 1>&2 echo " FOAM_MPI : $FOAM_MPI" 1>&2 + echo " OPAL_PREFIX : $MPI_ARCH_PATH" 1>&2 fi # Could be sourced from ThirdParty with incomplete environment @@ -208,25 +209,23 @@ QSMPI) SGIMPI) # No trailing slash - [ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}" + MPI_ROOT="${MPI_ROOT%/}" # Remove trailing slash - export FOAM_MPI="${MPI_ROOT##*/}" - export MPI_ARCH_PATH=$MPI_ROOT + export MPI_ARCH_PATH="${MPI_ROOT%/}" # Remove trailing slash + export FOAM_MPI="${MPI_ARCH_PATH##*/}" - if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ] - then + [ -d "$MPI_ARCH_PATH" ] || { echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 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 + echo " Not a valid $WM_MPLIB installation directory." 1>&2 + echo " Please set MPI_ROOT properly (usually via the mpt module)" 1>&2 + echo " Currently using '$MPI_ARCH_PATH'" 1>&2 + } if [ "$FOAM_VERBOSE" -a "$PS1" ] then - echo "Using SGI MPT:" 1>&2 - echo " MPI_ROOT : $MPI_ROOT" 1>&2 + echo "Using $WM_MPLIB" 1>&2 echo " FOAM_MPI : $FOAM_MPI" 1>&2 + echo " MPI_ROOT : $MPI_ARCH_PATH" 1>&2 fi _foamAddPath $MPI_ARCH_PATH/bin @@ -234,35 +233,53 @@ SGIMPI) ;; INTELMPI) - MPI_ROOT="${MPI_ROOT%/}" # No trailing slash + if [ -n "$I_MPI_ROOT" ] + then + # I_MPI_ROOT: The Intel MPI Library installation directory - export FOAM_MPI="${MPI_ROOT##*/}" - export MPI_ARCH_PATH=$MPI_ROOT + MPI_ARCH_PATH="${I_MPI_ROOT%/}" # Remove trailing slash + FOAM_MPI="${MPI_ARCH_PATH##*/}" - if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ] - then - echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 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 subdirectory is version number only, prefix with 'impi-' + case "$FOAM_MPI" in ([0-9]*) FOAM_MPI="impi-$FOAM_MPI";; esac - 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 + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using $WM_MPLIB" 1>&2 + echo " FOAM_MPI : $FOAM_MPI" 1>&2 + echo " I_MPI_ROOT : $MPI_ARCH_PATH" 1>&2 + fi + else + # MPI_ROOT: General specification + MPI_ARCH_PATH="${MPI_ROOT%/}" # Remove trailing slash + FOAM_MPI="${MPI_ARCH_PATH##*/}" + + # If subdirectory is version number only, prefix with 'impi-' + case "$FOAM_MPI" in ([0-9]*) FOAM_MPI="impi-$FOAM_MPI";; esac + + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using $WM_MPLIB" 1>&2 + echo " FOAM_MPI : $FOAM_MPI" 1>&2 + echo " MPI_ROOT : $MPI_ARCH_PATH" 1>&2 + fi fi + [ -d "$MPI_ARCH_PATH" ] || { + echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2 + echo " Not a valid $WM_MPLIB installation directory." 1>&2 + echo " Please set I_MPI_ROOT or MPI_ROOT properly." 1>&2 + echo " Currently using '$MPI_ARCH_PATH'" 1>&2 + } + + export FOAM_MPI MPI_ARCH_PATH + _foamAddPath $MPI_ARCH_PATH/bin64 _foamAddLib $MPI_ARCH_PATH/lib64 ;; -*) - export FOAM_MPI=dummy - ;; esac + # Add (non-dummy) MPI implementation # - dummy MPI already added to LD_LIBRARY_PATH and has no external libraries if [ "$FOAM_MPI" != dummy ] && type _foamAddLib > /dev/null 2>&1