[Dune-devel] [Dune-Commit] [Commit] dune-common - ac6885f: [Release][MPI] Add check for MPI standard version and warn if installed version is < 2.1
Markus Blatt
markus at dr-blatt.de
Wed Dec 11 18:14:41 CET 2013
Is this standard conforming? There is a function MPI_Get_version that
looks intriguing to me for this kind purpose. Not sure when that was
introduced, though.
On Wed, Dec 11, 2013 at 02:22:38PM +0100, Steffen Müthing wrote:
> New commit, appeared at Wed Dec 11 14:22:38 2013 +0100
> as part of the following ref changes:
>
> branch refs/heads/master updated from 3e9a414 -> ac6885f
>
> Browsable version: http://cgit.dune-project.org/repositories/dune-common/commit/?id=ac6885f8af7c6b63e99f3285ef2a98d2c5523637
>
> ======================================================================
>
> commit ac6885f8af7c6b63e99f3285ef2a98d2c5523637
> Author: Steffen Müthing <muething at dune-project.org>
> Date: Wed Dec 11 14:16:02 2013 +0100
>
> [Release][MPI] Add check for MPI standard version and warn if installed version is < 2.1
>
> As decided in the doodle for FS#1395, really old MPI versions will be
> deprecated in the 2.3 release.
>
> This patch adds an additional check to the MPI tests for autotools and
> cmake that makes sure the user has an MPI which is at least compliant
> with MPI-2.1. If the user's version is older, a warning is generated.
>
> The test uses version macros instead of the more standard runtime
> MPI version query interface to avoid problems when cross-compiling.
>
> cmake/modules/DuneMPI.cmake | 22 ++++++++++++++++++++++
> m4/dune_mpi.m4 | 28 +++++++++++++++++++++++++++-
> 2 files changed, 49 insertions(+), 1 deletion(-)
>
>
>
> diff --git a/cmake/modules/DuneMPI.cmake b/cmake/modules/DuneMPI.cmake
> index b5e2cf5..991ce5a 100644
> --- a/cmake/modules/DuneMPI.cmake
> +++ b/cmake/modules/DuneMPI.cmake
> @@ -42,12 +42,34 @@ if(MPI_CXX_FOUND)
> # Check whether the MPI-2 standard is supported
> include(CMakePushCheckState)
> include(CheckFunctionExists)
> + include(CheckCXXSourceCompiles)
> cmake_push_check_state()
> set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES};${MPI_DUNE_LIBRARIES})
> set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} "-DENABLE_MPI=1 -DMPICH_SKIP_MPICXX -DMPIPP_H")
> set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${MPI_DUNE_INCLUDE_PATH})
> check_function_exists(MPI_Finalized MPI_2)
> +
> + # proper version check
> + check_cxx_source_compiles("
> + #include <mpi.h>
> +
> + #if !((MPI_VERSION > 2) || (MPI_VERSION == 2 && MPI_SUBVERSION >= 1))
> + fail with a horribe compilation error due to old MPI version
> + #endif
> +
> + int main(int argc, char** argv)
> + {
> + MPI_Init(&argc,&argv);
> + MPI_Finalize();
> + }
> +" MPI_VERSION_SUPPORTED)
> +
> cmake_pop_check_state()
> +
> + # TODO: Turn into an error after 2.3 release
> + if(NOT MPI_VERSION_SUPPORTED)
> + MESSAGE(WARNING "Support for your MPI implementation is DEPRECATED and will be removed after the next release. Please upgrade to an MPI-2.1 compliant version.")
> + endif()
> endif(MPI_CXX_FOUND)
>
> # adds MPI flags to the targets
> diff --git a/m4/dune_mpi.m4 b/m4/dune_mpi.m4
> index f2f401b..aeac3fa 100644
> --- a/m4/dune_mpi.m4
> +++ b/m4/dune_mpi.m4
> @@ -157,6 +157,28 @@ AC_DEFUN([DUNE_MPI],[
> with_mpi=no]
> )
>
> + AC_MSG_CHECKING([whether MPI is recent enough (MPI-2.1)])
> + # check MPI version and issue a deprecation warning if MPI is older than 2.1
> + # TODO: Replace with error after 2.3 release
> + AC_LANG_PUSH([C++])
> + AC_COMPILE_IFELSE(
> + [AC_LANG_SOURCE(
> + [ #include <mpi.h>
> + #if !((MPI_VERSION > 2) || (MPI_VERSION == 2 && MPI_SUBVERSION >= 1))
> + fail with a horribe compilation error due to old MPI version
> + #endif
> + int main (int argc, char** argv) {
> + MPI_Init(&argc, &argv);
> + MPI_Finalize(); }])],
> + [ AC_MSG_RESULT([yes]) ],
> + [ AC_MSG_RESULT([no])
> + AC_MSG_WARN([You are using a very old version of MPI that
> + is not compatible with the MPI-2.1 standard. Support for your
> + version of MPI is deprecated and will be removed after the next
> + release!])
> + mpi_deprecated=yes]
> + )
> +
> AS_IF([test "x$mpiruntest" != "xyes"],[
> AC_MSG_WARN([Disabled test whether running with $dune_MPI_VERSION works.])
> ],[
> @@ -210,7 +232,11 @@ AC_DEFUN([DUNE_MPI],[
>
> AM_CONDITIONAL(MPI, [test "x$with_mpi" != "xno"])
>
> - DUNE_ADD_SUMMARY_ENTRY([MPI],[$with_mpi])
> + AS_IF([test "x$mpi_deprecated" == "xyes"],[
> + DUNE_ADD_SUMMARY_ENTRY([MPI],[$with_mpi (deprecated MPI version)])
> + ],[
> + DUNE_ADD_SUMMARY_ENTRY([MPI],[$with_mpi])
> + ])
>
> AC_LANG_POP
> ])
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
--
Do you need more support with DUNE or HPC in general?
Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858 Fax: +49 (0)322 1108991658
More information about the Dune-devel
mailing list