Commit 144739bd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Properly handle old MPI libraries

parent 07f818be
......@@ -92,15 +92,16 @@ if test "$enable_mpi" = "yes"; then
*"Open MPI"*)
MPI_THREAD_LIBS=""
AC_MSG_RESULT([Open MPI])
# OpenMPI should be 1.8.6 or later, if not complain.
# Version is last word on first line of -version output.
revision=`mpirun -version 2>&1 | grep "Open MPI" | awk '{print $NF}'`
AX_COMPARE_VERSION( $revision, [ge], [1.8.6],,[good_mpi="no"] )
if test "$good_mpi" = "no"; then
AC_MSG_WARN([
Open MPI version should be at least 1.8.6 (is $revision)])
enable_mpi="yes (but with warning)"
fi
# # OpenMPI should be 1.8.6 or later, if not complain.
# # Version is last word on first line of -version output.
# revision=`mpirun -version 2>&1 | grep "Open MPI" | awk '{print $NF}'`
# AX_COMPARE_VERSION( $revision, [ge], [1.8.6],,[good_mpi="no"] )
# if test "$good_mpi" = "no"; then
# AC_MSG_WARN([
# Open MPI version should be at least 1.8.6 (is $revision)])
# enable_mpi="yes (but with warning)"
# good_mpi="yes"
# fi
;;
*)
MPI_THREAD_LIBS=""
......
......@@ -134,11 +134,16 @@ const char *compiler_version(void) {
const char *mpi_version(void) {
static char version[256] = {0};
#ifdef WITH_MPI
static char lib_version[MPI_MAX_LIBRARY_VERSION_STRING] = {0};
int len, std_version, std_subversion;
MPI_Get_library_lib_version(version, &len);
#ifdef MPI_MAX_LIBRARY_VERSION_STRING
static char lib_version[MPI_MAX_LIBRARY_VERSION_STRING] = {0};
MPI_Get_library_version(lib_version, &len);
#else
static char lib_version[256] = {0};
sprintf(lib_version, "Unknow library");
#endif
MPI_Get_version(&std_version, &std_subversion);
sprintf("%s (standard v %i.%i)", lib_version, std_version, std_subversion);
sprintf(version, "%s (standard v %i.%i)", lib_version, std_version, std_subversion);
#else
sprintf(version, "Code was not compiled with MPI support");
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment