Skip to content

Commit 4d2af25

Browse files
authored
Merge pull request #11786 from jsquyres/pr/do-not-support-hwloc-v3
Fail configure if external hwloc >= v3.0.0 is found
2 parents fcd03ef + bcc199e commit 4d2af25

File tree

2 files changed

+56
-2
lines changed

2 files changed

+56
-2
lines changed

config/opal_config_hwloc.m4

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ dnl
9696
dnl only safe to call from OPAL_CONFIG_HWLOC, assumes variables from
9797
dnl there are set.
9898
AC_DEFUN([_OPAL_CONFIG_HWLOC_EXTERNAL], [
99-
OPAL_VAR_SCOPE_PUSH([opal_hwloc_min_num_version opal_hwloc_min_version opal_hwloc_CPPFLAGS_save opal_hwloc_LDFLAGS_save opal_hwloc_LIBS_save opal_hwloc_external_support])
99+
OPAL_VAR_SCOPE_PUSH([opal_hwloc_min_num_version opal_hwloc_min_version opal_hwlox_max_num_version opal_hwloc_CPPFLAGS_save opal_hwloc_LDFLAGS_save opal_hwloc_LIBS_save opal_hwloc_external_support])
100100
101101
OAC_CHECK_PACKAGE([hwloc],
102102
[opal_hwloc],
@@ -118,7 +118,7 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_EXTERNAL], [
118118
opal_hwloc_min_num_version=OMPI_HWLOC_NUMERIC_MIN_VERSION
119119
opal_hwloc_min_version=OMPI_HWLOC_NUMERIC_MIN_VERSION
120120
AS_IF([test "$opal_hwloc_external_support" = "yes"],
121-
[AC_MSG_CHECKING([if external hwloc version is OMPI_HWLOC_MIN_VERSION or greater])
121+
[AC_MSG_CHECKING([if external hwloc version is version OMPI_HWLOC_MIN_VERSION or greater])
122122
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hwloc.h>
123123
]], [[
124124
#if HWLOC_API_VERSION < $opal_hwloc_min_num_version
@@ -130,6 +130,31 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_EXTERNAL], [
130130
AC_MSG_WARN([external hwloc version is too old (OMPI_HWLOC_MIN_VERSION or later required)])
131131
opal_hwloc_external_support="no"])])
132132
133+
# Ensure that we are not using Hwloc >= v3.x. Open MPI does not
134+
# (yet) support Hwloc >= v3.x (which will potentially have ABI and
135+
# API breakage compared to <= v2.x), and using it would lead to
136+
# complicated failure cases. Hence, we just abort outright if we
137+
# find an external Hwloc >= v3.x.
138+
AS_IF([test "$opal_hwloc_external_support" = "yes"],
139+
[AC_MSG_CHECKING([if external hwloc version is less than version 3.0.0])
140+
opal_hwloc_max_num_version=0x00030000
141+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <hwloc.h>
142+
]], [[
143+
#if HWLOC_API_VERSION >= $opal_hwloc_max_num_version
144+
#error "hwloc API version is >= $opal_hwloc_max_num_version"
145+
#endif
146+
]])],
147+
[AC_MSG_RESULT([yes])],
148+
[AC_MSG_RESULT([no])
149+
AC_MSG_WARN([External hwloc version is too new (less than v3.0.0 is required)])
150+
dnl Yes, the URL below will be wrong for master
151+
dnl builds. But this is "good enough" -- we're
152+
dnl more concerned about getting the URL correct
153+
dnl for end-user builds of official release Open
154+
dnl MPI distribution tarballs.
155+
AC_MSG_WARN([See https://docs.open-mpi.org/en/v$OMPI_MAJOR_VERSION.$OMPI_MINOR_VERSION.x/installing-open-mpi/required-support-libraries.html for more details])
156+
AC_MSG_ERROR([Cannot continue])])])
157+
133158
AS_IF([test "$opal_hwloc_external_support" = "yes"],
134159
[AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include <hwloc.h>
135160
])

docs/installing-open-mpi/required-support-libraries.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,35 @@ process. More on this below.
4747
.. note:: The versions listed in this table are the *minimum* versions needed. In general, the Open MPI community recommends using more recent versions of both the :ref:`required support libraries <label-install-required-support-libraries>` and any other optional support libraries. This is because more recent versions typically tend to include bug fixes, sometimes affecting Open MPI functionality. As a specific example, there is a known issue with `Hardware Locality <https://www.open-mpi.org/projects/hwloc/>`_ releases older than v2.8.0 on systems with Intel Ponte Vecchio accelerators. If you run Open MPI on such systems, you need to use Hwloc v2.8.0 or newer, or you will experience undefined behavior.
4848
This effect is not unique to the Hardware Locality library; this is why the Open MPI community recommends using as recent as possible versions of all support libraries.
4949

50+
.. danger:: As of |ompi_ver|, Open MPI does not yet support the
51+
Hwloc v3.x series (which may not even be available at
52+
the time of Open MPI |ompi_ver|'s release). Hwloc v3.x
53+
is anticipated to break API and/or ABI compared to the
54+
Hwloc v2.x series.
55+
56+
Open MPI will refuse to build if it finds an external
57+
Hwloc installation that is >= v3.0.0 on the assumption
58+
that other HPC applications and/or libraries may be
59+
using it. Such a configuration could lead to obscure
60+
and potentially confusing run-time failures of Open MPI
61+
applications.
62+
63+
If Open MPI's ``configure`` script aborts because it
64+
finds an Hwloc installation that is >= v3.0.0, you can
65+
either ensure that Open MPI finds a < v3.0.0 Hwloc
66+
installation (e.g., by changing the order of paths in
67+
``LD_LIBRARY_PATH``), or force the use of Open MPI's
68+
bundled Hwloc via:
69+
70+
.. code::
71+
72+
shell$ ./configure --with-hwloc=internal ...
73+
74+
Regardless, *it is critically important* that if an MPI
75+
application |mdash| or any of its dependencies |mdash|
76+
uses Hwloc, it uses the *same* Hwloc with which Open MPI
77+
was compiled.
78+
5079
Library dependencies
5180
--------------------
5281

0 commit comments

Comments
 (0)