Skip to content

Commit 7e01be6

Browse files
committed
hwloc: add support for hwloc v1.5
hwloc v1.5 does not support HWLOC_OBJ_OSDEV_COPROC nor hwloc_topology_dup(), so for this version : - do not search for coprocessors - do not try hwloc_topology_dup(), note this is not used anywhere in the code base Thanks Jeff for helping with the wording Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent 802deb6 commit 7e01be6

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

opal/mca/hwloc/base/hwloc_base_dt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
22
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2017 Research Organization for Information Science
4+
* and Technology (RIST). All rights reserved.
35
*
46
* $COPYRIGHT$
57
*
@@ -154,8 +156,14 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest,
154156

155157
int opal_hwloc_copy(hwloc_topology_t *dest, hwloc_topology_t src, opal_data_type_t type)
156158
{
159+
#ifdef HAVE_HWLOC_TOPOLOGY_DUP
157160
/* use the hwloc dup function */
158161
return hwloc_topology_dup(dest, src);
162+
#else
163+
/* hwloc_topology_dup() was introduced in hwloc v1.8.0.
164+
* Note that as of March 2017, opal_hwloc_copy() is not (yet?) used in the code base anywhere. */
165+
return OPAL_ERR_NOT_SUPPORTED;
166+
#endif
159167
}
160168

161169
int opal_hwloc_compare(const hwloc_topology_t topo1,

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2012-2015 Los Alamos National Security, LLC.
1515
* All rights reserved.
1616
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
17-
* Copyright (c) 2015-2016 Research Organization for Information Science
17+
* Copyright (c) 2015-2017 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
1919
* $COPYRIGHT$
2020
*
@@ -1526,6 +1526,7 @@ char* opal_hwloc_base_find_coprocessors(hwloc_topology_t topo)
15261526
"hwloc:base:find_coprocessors: NONE FOUND IN TOPO"));
15271527
return NULL;
15281528
}
1529+
#if HAVE_DECL_HWLOC_OBJ_OSDEV_COPROC
15291530
/* check the device objects for coprocessors */
15301531
osdev = hwloc_get_obj_by_depth(topo, depth, 0);
15311532
while (NULL != osdev) {
@@ -1549,6 +1550,11 @@ char* opal_hwloc_base_find_coprocessors(hwloc_topology_t topo)
15491550
OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
15501551
"hwloc:base:find_coprocessors: hosting coprocessors %s",
15511552
(NULL == cpstring) ? "NONE" : cpstring));
1553+
#else
1554+
OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
1555+
"hwloc:base:find_coprocessors: the version of hwloc that Open MPI was built against (v%d.%d.%d) does not support detecting coprocessors",
1556+
(HWLOC_API_VERSION>>16)&&0xFF, (HWLOC_API_VERSION>>8)&0xFF, HWLOC_API_VERSION&&0xFF));
1557+
#endif
15521558
return cpstring;
15531559
}
15541560

opal/mca/hwloc/external/configure.m4

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- shell-script -*-
22
#
33
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
4-
# Copyright (c) 2014-2016 Research Organization for Information Science
4+
# Copyright (c) 2014-2017 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
#
77
# $COPYRIGHT$
@@ -136,6 +136,13 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
136136
[opal_hwloc_external_support=yes],
137137
[opal_hwloc_external_support=no])
138138

139+
AS_IF([test "$opal_hwloc_external_support" = "yes"],
140+
[CPPFLAGS="$CPPFLAGS $opal_hwloc_external_CPPFLAGS"
141+
LDFLAGS="$LDFLAGS $opal_hwloc_external_LDFLAGS"
142+
LIBS="$LIBS $opal_hwloc_external_LIBS"
143+
AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include <hwloc.h>])
144+
AC_CHECK_FUNCS([hwloc_topology_dup])])
145+
139146
CPPFLAGS=$opal_hwloc_external_CPPFLAGS_save
140147
CFLAGS=$opal_hwloc_external_CFLAGS_save
141148
LDFLAGS=$opal_hwloc_external_LDFLAGS_save
@@ -162,15 +169,15 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
162169

163170
AC_CHECK_HEADERS([infiniband/verbs.h])
164171

165-
AC_MSG_CHECKING([if external hwloc version is 1.8 or greater])
172+
AC_MSG_CHECKING([if external hwloc version is 1.5 or greater])
166173
AS_IF([test "$opal_hwloc_dir" != ""],
167174
[opal_hwloc_external_CFLAGS_save=$CFLAGS
168175
CFLAGS="-I$opal_hwloc_dir/include $opal_hwloc_external_CFLAGS_save"])
169176
AC_COMPILE_IFELSE(
170177
[AC_LANG_PROGRAM([[#include <hwloc.h>]],
171178
[[
172-
#if HWLOC_API_VERSION < 0x00010800
173-
#error "hwloc API version is less than 0x00010800"
179+
#if HWLOC_API_VERSION < 0x00010500
180+
#error "hwloc API version is less than 0x00010500"
174181
#endif
175182
]])],
176183
[AC_MSG_RESULT([yes])],

opal/mca/hwloc/hwloc1113/configure.m4

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
5-
# Copyright (c) 2015-2016 Research Organization for Information Science
5+
# Copyright (c) 2015-2017 Research Organization for Information Science
66
# and Technology (RIST). All rights reserved.
77
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
88
# reserved.
@@ -176,7 +176,9 @@ AC_DEFUN([MCA_opal_hwloc_hwloc1113_CONFIG],[
176176
# distclean" infrastructure to work properly).
177177
AS_IF([test "$opal_hwloc_external" = "yes"],
178178
[AC_MSG_WARN([using an external hwloc; disqualifying this component])
179-
opal_hwloc_hwloc1113_support=no])
179+
opal_hwloc_hwloc1113_support=no],
180+
[AC_DEFINE([HAVE_DECL_HWLOC_OBJ_OSDEV_COPROC], [1])
181+
AC_DEFINE([HAVE_HWLOC_TOPOLOGY_DUP], [1])])
180182

181183
# Done!
182184
AS_IF([test "$opal_hwloc_hwloc1113_support" = "yes"],

0 commit comments

Comments
 (0)