Skip to content

Remove hwloc framework. #3029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions config/opal_check_hwloc.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# -*- shell-script -*-
#
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014-2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
#
# Copyright (c) 2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# --------------------------------------------------------------------
AC_DEFUN([OPAL_CHECK_HWLOC],[

OPAL_VAR_SCOPE_PUSH([opal_hwloc_CPPFLAGS_save opal_hwloc_CFLAGS_save opal_hwloc_LDFLAGS_save opal_hwloc_LIBS_save opal_hwloc_support opal_hwloc_tmp opal_hwloc_lstopo])

AC_ARG_WITH([hwloc],
[AC_HELP_STRING([--with-hwloc=DIR],
[Where to find hwloc, if not in the standard location])])

AC_ARG_WITH([hwloc-libdir],
[AC_HELP_STRING([--with-hwloc-libdir=DIR],
[Search for hwloc libraries in DIR])])

# look for support unless expressly told not to
AC_MSG_CHECKING([if have hwloc support])
AS_IF([test "$with_hwloc" = "no"],
[AC_MSG_RESULT([no])
AC_MSG_WARN([HWLOC support is required])
AC_MSG_WARN([Please install a recent version (at least 1.5)])
AC_MSG_ERROR([Cannot continue])],
[AC_MSG_RESULT([yes])
OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir],
[libhwloc.*])

AC_MSG_CHECKING([looking for hwloc in])
AS_IF([test ! -z "$with_hwloc" && \
test "$with_hwloc" != "yes"],
[opal_hwloc_dir=$with_hwloc
AC_MSG_RESULT([($opal_hwloc_dir)])],
[AC_MSG_RESULT([(default search paths)])])
AS_IF([test ! -z "$with_hwloc_libdir" && \
test "$with_hwloc_libdir" != "yes"],
[opal_hwloc_libdir=$with_hwloc_libdir])

opal_hwloc_CPPFLAGS_save=$CPPFLAGS
opal_hwloc_CFLAGS_save=$CFLAGS
opal_hwloc_LDFLAGS_save=$LDFLAGS
opal_hwloc_LIBS_save=$LIBS

OPAL_CHECK_PACKAGE([opal_hwloc],
[hwloc.h],
[hwloc],
[hwloc_topology_init],
[],
[$opal_hwloc_dir],
[$opal_hwloc_libdir],
[opal_hwloc_support=yes],
[opal_hwloc_support=no])

CPPFLAGS=$opal_hwloc_CPPFLAGS_save
CFLAGS=$opal_hwloc_CFLAGS_save
LDFLAGS=$opal_hwloc_LDFLAGS_save
LIBS=$opal_hwloc_LIBS_save
])

# Done!
AC_MSG_CHECKING([was hwloc support found])
AS_IF([test "$opal_hwloc_support" != "yes"],
[AC_MSG_RESULT([no])
AC_MSG_WARN([HWLOC support was not found, but is required])
AC_MSG_WARN([Please install a recent version (at least 1.5)])
AC_MSG_ERROR([Cannot continue])],
[AC_MSG_RESULT([yes])
# See if hwloc supports XML
AC_MSG_CHECKING([if hwloc supports XML])
AS_IF([test "$opal_hwloc_dir" != ""],
[opal_hwloc_lstopo="$opal_hwloc_dir/bin/lstopo"],
[OPAL_WHICH(lstopo, opal_hwloc_lstopo)])
opal_hwloc_tmp=`$opal_hwloc_lstopo --help | $GREP "Supported output file formats" | grep xml`
AS_IF([test "$opal_hwloc_tmp" = ""],
[opal_hwloc_enable_xml=0
AC_MSG_RESULT([no])],
[opal_hwloc_enable_xml=1
AC_MSG_RESULT([yes])])

AC_CHECK_HEADERS([infiniband/verbs.h])

AC_MSG_CHECKING([if hwloc version is 1.5 or greater])
AS_IF([test "$opal_hwloc_dir" != ""],
[opal_hwloc_external_CFLAGS_save=$CFLAGS
CFLAGS="-I$opal_hwloc_dir/include $opal_hwloc_CFLAGS_save"])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <hwloc.h>]],
[[
#if HWLOC_API_VERSION < 0x00010500
#error "hwloc API version is less than 0x00010500"
#endif
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Cannot continue])])
AC_MSG_CHECKING([if hwloc version is lower than 2.0])
AS_IF([test "$opal_hwloc_dir" != ""],
[opal_hwloc_CFLAGS_save=$CFLAGS
CFLAGS="-I$opal_hwloc_dir/include $opal_hwloc_CFLAGS_save"])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <hwloc.h>]],
[[
#if HWLOC_API_VERSION >= 0x00020000
#error "hwloc API version is greater or equal than 0x00020000"
#endif
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([OMPI does not currently support hwloc v2 API
Cannot continue])])
AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC])
AS_IF([test "$opal_hwloc_dir" != ""],
[CFLAGS=$opal_hwloc_CFLAGS_save])

# These flags need to get passed to the wrapper compilers

# Finally, add some flags to the wrapper compiler if we're
# building with developer headers so that our headers can
# be found.
hwloc_WRAPPER_EXTRA_CPPFLAGS=$opal_hwloc_CPPFLAGS
hwloc_WRAPPER_EXTRA_LDFLAGS=$opal_hwloc_LDFLAGS
hwloc_WRAPPER_EXTRA_LIBS=$opal_hwloc_LIBS

# Add some stuff to CPPFLAGS so that the rest of the source
# tree can be built
CPPFLAGS="$CPPFLAGS $opal_hwloc_CPPFLAGS"
LDFLAGS="$LDFLAGS $opal_hwloc_LDFLAGS"
LIBS="$LIBS $opal_hwloc_LIBS"
AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"],
[CPPFLAGS="$CPPFLAGS -I$OPAL_TOP_BUILDDIR/opal/hwloc"])

# We have to do some extra indirection to get the
# OPAL_HWLOC_WANT_VERBS_HELPER to work. First, the
# opal_hwloc_external_include file (set above), points to a
# file here in this component. That file will include the
# actual external hwloc.h file (via the
# MCA_hwloc_external_header define). And if
# OPAL_HWLOC_WANT_VERBS_HELPER is set, that file will
# include the external hwloc/openfabrics-verbs.h file (via
# the MCA_hwloc_external_openfabrics_helper define).
AS_IF([test "$opal_hwloc_dir" != ""],
[opal_hwloc_include="$opal_hwloc_dir/include/hwloc.h"
opal_hwloc_openfabrics_include="$opal_hwloc_dir/include/hwloc/openfabrics-verbs.h"],
[opal_hwloc_include="hwloc.h"
opal_hwloc_openfabrics_include="hwloc/openfabrics-verbs.h"])
AC_DEFINE_UNQUOTED(hwloc_external_header,
["$opal_hwloc_include"],
[Location of external hwloc header])
AC_DEFINE_UNQUOTED(hwloc_external_openfabrics_header,
["$opal_hwloc_openfabrics_include"],
[Location of external hwloc OpenFabrics header])])

OPAL_SUMMARY_ADD([[Miscellaneous]],[[HWLOC support]],[opal_hwloc], [$opal_hwloc_support])

OPAL_VAR_SCOPE_POP
])dnl
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ m4_ifdef([project_oshmem],
OPAL_CONFIGURE_OPTIONS
OPAL_CHECK_OS_FLAVORS
OPAL_CHECK_CUDA
OPAL_CHECK_HWLOC
OPAL_CHECK_PMIX
m4_ifdef([project_orte], [ORTE_CONFIGURE_OPTIONS])
m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
Expand Down
4 changes: 2 additions & 2 deletions ompi/communicator/comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* All rights reserved.
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Mellanox Technologies. All rights reserved.
* $COPYRIGHT$
*
Expand All @@ -34,7 +34,7 @@
#include <stdio.h>

#include "ompi/constants.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/hwloc/base.h"
#include "opal/dss/dss.h"
#include "opal/mca/pmix/pmix.h"

Expand Down
4 changes: 2 additions & 2 deletions ompi/dpm/dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
Expand All @@ -41,7 +41,7 @@
#include "opal/util/opal_getcwd.h"
#include "opal/util/proc.h"
#include "opal/dss/dss.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/hwloc/base.h"
#include "opal/mca/pmix/pmix.h"

#include "ompi/communicator/communicator.h"
Expand Down
20 changes: 10 additions & 10 deletions ompi/mca/coll/sm/coll_sm_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -49,7 +49,7 @@

#include "mpi.h"
#include "opal_stdint.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/hwloc/base.h"
#include "opal/util/os_path.h"

#include "ompi/communicator/communicator.h"
Expand Down Expand Up @@ -124,9 +124,9 @@ static int mca_coll_sm_module_disable(mca_coll_base_module_t *module, struct omp
{
mca_coll_sm_module_t *sm_module = (mca_coll_sm_module_t*) module;
if (NULL != sm_module->previous_reduce_module) {
sm_module->previous_reduce = NULL;
sm_module->previous_reduce = NULL;
OBJ_RELEASE(sm_module->previous_reduce_module);
sm_module->previous_reduce_module = NULL;
sm_module->previous_reduce_module = NULL;
}
return OMPI_SUCCESS;
}
Expand Down Expand Up @@ -174,7 +174,7 @@ mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority)
if (OMPI_COMM_IS_INTER(comm) || 1 == ompi_comm_size(comm) || ompi_group_have_remote_peers (comm->c_local_group)) {
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:comm_query (%d/%s): intercomm, comm is too small, or not all peers local; disqualifying myself", comm->c_contextid, comm->c_name);
return NULL;
return NULL;
}

/* Get the priority level attached to this module. If priority is less
Expand All @@ -183,7 +183,7 @@ mca_coll_sm_comm_query(struct ompi_communicator_t *comm, int *priority)
if (mca_coll_sm_component.sm_priority <= 0) {
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:sm:comm_query (%d/%s): priority too low; disqualifying myself", comm->c_contextid, comm->c_name);
return NULL;
return NULL;
}

sm_module = OBJ_NEW(mca_coll_sm_module_t);
Expand Down Expand Up @@ -246,7 +246,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,
mca_coll_sm_comm_t *data = NULL;
size_t control_size, frag_size;
mca_coll_sm_component_t *c = &mca_coll_sm_component;
opal_hwloc_base_memory_segment_t *maffinity;
opal_hwloc_memory_segment_t *maffinity;
int parent, min_child, num_children;
unsigned char *base = NULL;
const int num_barrier_buffers = 2;
Expand All @@ -259,8 +259,8 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,

/* Get some space to setup memory affinity (just easier to try to
alloc here to handle the error case) */
maffinity = (opal_hwloc_base_memory_segment_t*)
malloc(sizeof(opal_hwloc_base_memory_segment_t) *
maffinity = (opal_hwloc_memory_segment_t*)
malloc(sizeof(opal_hwloc_memory_segment_t) *
c->sm_comm_num_segments * 3);
if (NULL == maffinity) {
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
Expand Down Expand Up @@ -446,7 +446,7 @@ int ompi_coll_sm_lazy_enable(mca_coll_base_module_t *module,

/* Setup memory affinity so that the pages that belong to this
process are local to this process */
opal_hwloc_base_memory_set(maffinity, j);
opal_hwloc_memory_set(maffinity, j);
free(maffinity);

/* Zero out the control structures that belong to this process */
Expand Down
3 changes: 1 addition & 2 deletions ompi/mca/topo/treematch/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Copyright (c) 2011-2015 INRIA. All rights reserved.
# Copyright (c) 2011-2015 Universite Bordeaux 1
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -18,7 +18,6 @@
# [action-if-cant-compile])
# -------------------------------------------
AC_DEFUN([MCA_ompi_topo_treematch_CONFIG], [
AC_REQUIRE([MCA_opal_hwloc_CONFIG_REQUIRE])

AC_ARG_WITH([treematch],
[AC_HELP_STRING([--with-treematch(=DIR)],
Expand Down
8 changes: 4 additions & 4 deletions ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* reserved.
* Copyright (c) 2011-2015 INRIA. All rights reserved.
* Copyright (c) 2012-2015 Bordeaux Poytechnic Institute
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
Expand All @@ -20,7 +20,7 @@
#include "ompi_config.h"

#include "opal/constants.h"
#include "opal/mca/hwloc/hwloc.h"
#include "opal/hwloc/hwloc.h"

#include "ompi/mca/topo/treematch/topo_treematch.h"
#include "ompi/mca/topo/treematch/treematch/tm_mapping.h"
Expand Down Expand Up @@ -256,7 +256,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
/* Then, we need to know if the processes are bound */
/* We make the hypothesis that all processes are in */
/* the same state : all bound or none bound */
if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) {
if (OPAL_SUCCESS != opal_hwloc_get_topology()) {
goto fallback;
}
root_obj = hwloc_get_root_obj(opal_hwloc_topology);
Expand Down Expand Up @@ -890,7 +890,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
(void)opal_pmix.store_local((opal_process_name_t*)ORTE_PROC_MY_NAME, &kv);
OBJ_DESTRUCT(&kv);

locality = opal_hwloc_base_get_relative_locality(opal_hwloc_topology,
locality = opal_hwloc_get_relative_locality(opal_hwloc_topology,
orte_process_info.cpuset,set_as_string);
OBJ_CONSTRUCT(&kv, opal_value_t);
kv.key = strdup(OPAL_PMIX_LOCALITY);
Expand Down
Loading