diff --git a/opal/mca/hwloc/hwloc1111/configure.m4 b/opal/mca/hwloc/hwloc1111/configure.m4 deleted file mode 100644 index 964904cdd0..0000000000 --- a/opal/mca/hwloc/hwloc1111/configure.m4 +++ /dev/null @@ -1,172 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2014-2015 Intel, Inc. All rights reserved. -# Copyright (c) 2015 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# -# Priority -# -AC_DEFUN([MCA_opal_hwloc_hwloc1111_PRIORITY], [90]) - -# -# Force this component to compile in static-only mode -# -AC_DEFUN([MCA_opal_hwloc_hwloc1111_COMPILE_MODE], [ - AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) - $4="static" - AC_MSG_RESULT([$$4]) -]) - -# Include hwloc m4 files -m4_include(opal/mca/hwloc/hwloc1111/hwloc/config/hwloc.m4) -m4_include(opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_pkg.m4) -m4_include(opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_attributes.m4) -m4_include(opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_visibility.m4) -m4_include(opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_vendor.m4) -m4_include(opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_components.m4) - -# MCA_hwloc_hwloc1111_POST_CONFIG() -# --------------------------------- -AC_DEFUN([MCA_opal_hwloc_hwloc1111_POST_CONFIG],[ - OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc1111_basedir]) - - # If we won, then do all the rest of the setup - AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc1111_support" = "yes"], - [ - # Set this variable so that the framework m4 knows what - # file to include in opal/mca/hwloc/hwloc.h - opal_hwloc_hwloc1111_basedir=opal/mca/hwloc/hwloc1111 - opal_hwloc_base_include="$opal_hwloc_hwloc1111_basedir/hwloc1111.h" - - # Add some stuff to CPPFLAGS so that the rest of the source - # tree can be built - file=$opal_hwloc_hwloc1111_basedir/hwloc - CPPFLAGS="$CPPFLAGS -I$OPAL_TOP_SRCDIR/$file/include" - AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"], - [CPPFLAGS="$CPPFLAGS -I$OPAL_TOP_BUILDDIR/$file/include"]) - unset file - ]) - OPAL_VAR_SCOPE_POP - - # This must be run unconditionally - HWLOC_DO_AM_CONDITIONALS -])dnl - - -# MCA_hwloc_hwloc1111_CONFIG([action-if-found], [action-if-not-found]) -# -------------------------------------------------------------------- -AC_DEFUN([MCA_opal_hwloc_hwloc1111_CONFIG],[ - # Hwloc needs to know if we have Verbs support - AC_REQUIRE([OPAL_CHECK_VERBS_DIR]) - - AC_CONFIG_FILES([opal/mca/hwloc/hwloc1111/Makefile]) - - OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc1111_save_CPPFLAGS opal_hwloc_hwloc1111_save_LDFLAGS opal_hwloc_hwloc1111_save_LIBS opal_hwloc_hwloc1111_save_cairo opal_hwloc_hwloc1111_save_xml opal_hwloc_hwloc1111_basedir opal_hwloc_hwloc1111_file opal_hwloc_hwloc1111_save_cflags CPPFLAGS_save LIBS_save]) - - # default to this component not providing support - opal_hwloc_hwloc1111_basedir=opal/mca/hwloc/hwloc1111 - opal_hwloc_hwloc1111_support=no - - if test "$with_hwloc" = "internal" || test -z "$with_hwloc" || test "$with_hwloc" = "yes"; then - opal_hwloc_hwloc1111_save_CPPFLAGS=$CPPFLAGS - opal_hwloc_hwloc1111_save_LDFLAGS=$LDFLAGS - opal_hwloc_hwloc1111_save_LIBS=$LIBS - - # Run the hwloc configuration - set the prefix to minimize - # the chance that someone will use the internal symbols - HWLOC_SET_SYMBOL_PREFIX([opal_hwloc1111_]) - - # save XML or graphical options - opal_hwloc_hwloc1111_save_cairo=$enable_cairo - opal_hwloc_hwloc1111_save_xml=$enable_xml - opal_hwloc_hwloc1111_save_static=$enable_static - opal_hwloc_hwloc1111_save_shared=$enable_shared - opal_hwloc_hwloc1111_save_plugins=$enable_plugins - - # never enable hwloc's graphical option - enable_cairo=no - - # never enable hwloc's plugin system - enable_plugins=no - enable_static=yes - enable_shared=no - - # Override -- disable hwloc's libxml2 support, but enable the - # native hwloc XML support - enable_libxml2=no - enable_xml=yes - - # hwloc checks for compiler visibility, and its needs to do - # this without "picky" flags. - opal_hwloc_hwloc1111_save_cflags=$CFLAGS - CFLAGS=$OPAL_CFLAGS_BEFORE_PICKY - HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc1111/hwloc], - [AC_MSG_CHECKING([whether hwloc configure succeeded]) - AC_MSG_RESULT([yes]) - HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc1111_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc1111_basedir/hwloc/VERSION`" - - # Build flags for our Makefile.am - opal_hwloc_hwloc1111_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)' - opal_hwloc_hwloc1111_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc1111_basedir"'/hwloc/src/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)' - opal_hwloc_hwloc1111_support=yes - - AC_DEFINE_UNQUOTED([HWLOC_HWLOC1111_HWLOC_VERSION], - ["$HWLOC_VERSION"], - [Version of hwloc]) - - # Do we have verbs support? - CPPFLAGS_save=$CPPFLAGS - AS_IF([test "$opal_want_verbs" = "yes"], - [CPPFLAGS="-I$opal_verbs_dir/include $CPPFLAGS"]) - AC_CHECK_HEADERS([infiniband/verbs.h]) - CPPFLAGS=$CPPFLAGS_save - ], - [AC_MSG_CHECKING([whether hwloc configure succeeded]) - AC_MSG_RESULT([no]) - opal_hwloc_hwloc1111_support=no]) - CFLAGS=$opal_hwloc_hwloc1111_save_cflags - - # Restore some env variables, if necessary - AS_IF([test -n "$opal_hwloc_hwloc1111_save_cairo"], - [enable_cairo=$opal_hwloc_hwloc1111_save_cairo]) - AS_IF([test -n "$opal_hwloc_hwloc1111_save_xml"], - [enable_xml=$opal_hwloc_hwloc1111_save_xml]) - AS_IF([test -n "$opal_hwloc_hwloc1111_save_static"], - [enable_static=$opal_hwloc_hwloc1111_save_static]) - AS_IF([test -n "$opal_hwloc_hwloc1111_save_shared"], - [enable_shared=$opal_hwloc_hwloc1111_save_shared]) - AS_IF([test -n "$opal_hwloc_hwloc1111_save_plugins"], - [enable_plugins=$opal_hwloc_hwloc1111_save_shared]) - - CPPFLAGS=$opal_hwloc_hwloc1111_save_CPPFLAGS - LDFLAGS=$opal_hwloc_hwloc1111_save_LDFLAGS - LIBS=$opal_hwloc_hwloc1111_save_LIBS - - AC_SUBST([opal_hwloc_hwloc1111_CFLAGS]) - AC_SUBST([opal_hwloc_hwloc1111_CPPFLAGS]) - AC_SUBST([opal_hwloc_hwloc1111_LDFLAGS]) - AC_SUBST([opal_hwloc_hwloc1111_LIBS]) - - # Finally, add some flags to the wrapper compiler so that our - # headers can be found. - hwloc_hwloc1111_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS" - hwloc_hwloc1111_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS" - hwloc_hwloc1111_WRAPPER_EXTRA_CPPFLAGS='-I${pkgincludedir}/'"$opal_hwloc_hwloc1111_basedir/hwloc/include" - fi - - # Done! - AS_IF([test "$opal_hwloc_hwloc1111_support" = "yes"], - [$1], - [$2]) - - OPAL_VAR_SCOPE_POP -])dnl diff --git a/opal/mca/hwloc/hwloc1111/Makefile.am b/opal/mca/hwloc/hwloc1112/Makefile.am similarity index 82% rename from opal/mca/hwloc/hwloc1111/Makefile.am rename to opal/mca/hwloc/hwloc1112/Makefile.am index c070422512..5ab0b36f50 100644 --- a/opal/mca/hwloc/hwloc1111/Makefile.am +++ b/opal/mca/hwloc/hwloc1112/Makefile.am @@ -1,6 +1,8 @@ # # Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2014-2015 Intel, Inc. All right reserved. +# Copyright (c) 2016 Los Alamos National Security, LLC. All rights +# reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -25,16 +27,16 @@ EXTRA_DIST = \ SUBDIRS = hwloc # Headers and sources -headers = hwloc1111.h -sources = hwloc1111_component.c +headers = hwloc1112.h +sources = hwloc1112_component.c # We only ever build this component statically -noinst_LTLIBRARIES = libmca_hwloc_hwloc1111.la -libmca_hwloc_hwloc1111_la_SOURCES = $(headers) $(sources) -nodist_libmca_hwloc_hwloc1111_la_SOURCES = $(nodist_headers) -libmca_hwloc_hwloc1111_la_LDFLAGS = -module -avoid-version $(opal_hwloc_hwloc1111_LDFLAGS) -libmca_hwloc_hwloc1111_la_LIBADD = $(opal_hwloc_hwloc1111_LIBS) -libmca_hwloc_hwloc1111_la_DEPENDENCIES = \ +noinst_LTLIBRARIES = libmca_hwloc_hwloc1112.la +libmca_hwloc_hwloc1112_la_SOURCES = $(headers) $(sources) +nodist_libmca_hwloc_hwloc1112_la_SOURCES = $(nodist_headers) +libmca_hwloc_hwloc1112_la_LDFLAGS = -module -avoid-version $(opal_hwloc_hwloc1112_LDFLAGS) +libmca_hwloc_hwloc1112_la_LIBADD = $(opal_hwloc_hwloc1112_LIBS) +libmca_hwloc_hwloc1112_la_DEPENDENCIES = \ $(HWLOC_top_builddir)/src/libhwloc_embedded.la # Since the rest of the code base includes the underlying hwloc.h, we diff --git a/opal/mca/hwloc/hwloc1111/README-ompi.txt b/opal/mca/hwloc/hwloc1112/README-ompi.txt similarity index 100% rename from opal/mca/hwloc/hwloc1111/README-ompi.txt rename to opal/mca/hwloc/hwloc1112/README-ompi.txt diff --git a/opal/mca/hwloc/hwloc1112/configure.m4 b/opal/mca/hwloc/hwloc1112/configure.m4 new file mode 100644 index 0000000000..28f40a6d95 --- /dev/null +++ b/opal/mca/hwloc/hwloc1112/configure.m4 @@ -0,0 +1,174 @@ +# -*- shell-script -*- +# +# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2014-2015 Intel, Inc. All rights reserved. +# Copyright (c) 2015 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# Copyright (c) 2016 Los Alamos National Security, LLC. All rights +# reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# +# Priority +# +AC_DEFUN([MCA_opal_hwloc_hwloc1112_PRIORITY], [90]) + +# +# Force this component to compile in static-only mode +# +AC_DEFUN([MCA_opal_hwloc_hwloc1112_COMPILE_MODE], [ + AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) + $4="static" + AC_MSG_RESULT([$$4]) +]) + +# Include hwloc m4 files +m4_include(opal/mca/hwloc/hwloc1112/hwloc/config/hwloc.m4) +m4_include(opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_pkg.m4) +m4_include(opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_attributes.m4) +m4_include(opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_visibility.m4) +m4_include(opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_vendor.m4) +m4_include(opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_components.m4) + +# MCA_hwloc_hwloc1112_POST_CONFIG() +# --------------------------------- +AC_DEFUN([MCA_opal_hwloc_hwloc1112_POST_CONFIG],[ + OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc1112_basedir]) + + # If we won, then do all the rest of the setup + AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc1112_support" = "yes"], + [ + # Set this variable so that the framework m4 knows what + # file to include in opal/mca/hwloc/hwloc.h + opal_hwloc_hwloc1112_basedir=opal/mca/hwloc/hwloc1112 + opal_hwloc_base_include="$opal_hwloc_hwloc1112_basedir/hwloc1112.h" + + # Add some stuff to CPPFLAGS so that the rest of the source + # tree can be built + file=$opal_hwloc_hwloc1112_basedir/hwloc + CPPFLAGS="$CPPFLAGS -I$OPAL_TOP_SRCDIR/$file/include" + AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"], + [CPPFLAGS="$CPPFLAGS -I$OPAL_TOP_BUILDDIR/$file/include"]) + unset file + ]) + OPAL_VAR_SCOPE_POP + + # This must be run unconditionally + HWLOC_DO_AM_CONDITIONALS +])dnl + + +# MCA_hwloc_hwloc1112_CONFIG([action-if-found], [action-if-not-found]) +# -------------------------------------------------------------------- +AC_DEFUN([MCA_opal_hwloc_hwloc1112_CONFIG],[ + # Hwloc needs to know if we have Verbs support + AC_REQUIRE([OPAL_CHECK_VERBS_DIR]) + + AC_CONFIG_FILES([opal/mca/hwloc/hwloc1112/Makefile]) + + OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc1112_save_CPPFLAGS opal_hwloc_hwloc1112_save_LDFLAGS opal_hwloc_hwloc1112_save_LIBS opal_hwloc_hwloc1112_save_cairo opal_hwloc_hwloc1112_save_xml opal_hwloc_hwloc1112_basedir opal_hwloc_hwloc1112_file opal_hwloc_hwloc1112_save_cflags CPPFLAGS_save LIBS_save]) + + # default to this component not providing support + opal_hwloc_hwloc1112_basedir=opal/mca/hwloc/hwloc1112 + opal_hwloc_hwloc1112_support=no + + if test "$with_hwloc" = "internal" || test -z "$with_hwloc" || test "$with_hwloc" = "yes"; then + opal_hwloc_hwloc1112_save_CPPFLAGS=$CPPFLAGS + opal_hwloc_hwloc1112_save_LDFLAGS=$LDFLAGS + opal_hwloc_hwloc1112_save_LIBS=$LIBS + + # Run the hwloc configuration - set the prefix to minimize + # the chance that someone will use the internal symbols + HWLOC_SET_SYMBOL_PREFIX([opal_hwloc1112_]) + + # save XML or graphical options + opal_hwloc_hwloc1112_save_cairo=$enable_cairo + opal_hwloc_hwloc1112_save_xml=$enable_xml + opal_hwloc_hwloc1112_save_static=$enable_static + opal_hwloc_hwloc1112_save_shared=$enable_shared + opal_hwloc_hwloc1112_save_plugins=$enable_plugins + + # never enable hwloc's graphical option + enable_cairo=no + + # never enable hwloc's plugin system + enable_plugins=no + enable_static=yes + enable_shared=no + + # Override -- disable hwloc's libxml2 support, but enable the + # native hwloc XML support + enable_libxml2=no + enable_xml=yes + + # hwloc checks for compiler visibility, and its needs to do + # this without "picky" flags. + opal_hwloc_hwloc1112_save_cflags=$CFLAGS + CFLAGS=$OPAL_CFLAGS_BEFORE_PICKY + HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc1112/hwloc], + [AC_MSG_CHECKING([whether hwloc configure succeeded]) + AC_MSG_RESULT([yes]) + HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc1112_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc1112_basedir/hwloc/VERSION`" + + # Build flags for our Makefile.am + opal_hwloc_hwloc1112_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)' + opal_hwloc_hwloc1112_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc1112_basedir"'/hwloc/src/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)' + opal_hwloc_hwloc1112_support=yes + + AC_DEFINE_UNQUOTED([HWLOC_HWLOC1112_HWLOC_VERSION], + ["$HWLOC_VERSION"], + [Version of hwloc]) + + # Do we have verbs support? + CPPFLAGS_save=$CPPFLAGS + AS_IF([test "$opal_want_verbs" = "yes"], + [CPPFLAGS="-I$opal_verbs_dir/include $CPPFLAGS"]) + AC_CHECK_HEADERS([infiniband/verbs.h]) + CPPFLAGS=$CPPFLAGS_save + ], + [AC_MSG_CHECKING([whether hwloc configure succeeded]) + AC_MSG_RESULT([no]) + opal_hwloc_hwloc1112_support=no]) + CFLAGS=$opal_hwloc_hwloc1112_save_cflags + + # Restore some env variables, if necessary + AS_IF([test -n "$opal_hwloc_hwloc1112_save_cairo"], + [enable_cairo=$opal_hwloc_hwloc1112_save_cairo]) + AS_IF([test -n "$opal_hwloc_hwloc1112_save_xml"], + [enable_xml=$opal_hwloc_hwloc1112_save_xml]) + AS_IF([test -n "$opal_hwloc_hwloc1112_save_static"], + [enable_static=$opal_hwloc_hwloc1112_save_static]) + AS_IF([test -n "$opal_hwloc_hwloc1112_save_shared"], + [enable_shared=$opal_hwloc_hwloc1112_save_shared]) + AS_IF([test -n "$opal_hwloc_hwloc1112_save_plugins"], + [enable_plugins=$opal_hwloc_hwloc1112_save_shared]) + + CPPFLAGS=$opal_hwloc_hwloc1112_save_CPPFLAGS + LDFLAGS=$opal_hwloc_hwloc1112_save_LDFLAGS + LIBS=$opal_hwloc_hwloc1112_save_LIBS + + AC_SUBST([opal_hwloc_hwloc1112_CFLAGS]) + AC_SUBST([opal_hwloc_hwloc1112_CPPFLAGS]) + AC_SUBST([opal_hwloc_hwloc1112_LDFLAGS]) + AC_SUBST([opal_hwloc_hwloc1112_LIBS]) + + # Finally, add some flags to the wrapper compiler so that our + # headers can be found. + hwloc_hwloc1112_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS" + hwloc_hwloc1112_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS" + hwloc_hwloc1112_WRAPPER_EXTRA_CPPFLAGS='-I${pkgincludedir}/'"$opal_hwloc_hwloc1112_basedir/hwloc/include" + fi + + # Done! + AS_IF([test "$opal_hwloc_hwloc1112_support" = "yes"], + [$1], + [$2]) + + OPAL_VAR_SCOPE_POP +])dnl diff --git a/opal/mca/hwloc/hwloc1111/hwloc/AUTHORS b/opal/mca/hwloc/hwloc1112/hwloc/AUTHORS similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/AUTHORS rename to opal/mca/hwloc/hwloc1112/hwloc/AUTHORS diff --git a/opal/mca/hwloc/hwloc1111/hwloc/COPYING b/opal/mca/hwloc/hwloc1112/hwloc/COPYING similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/COPYING rename to opal/mca/hwloc/hwloc1112/hwloc/COPYING diff --git a/opal/mca/hwloc/hwloc1111/hwloc/Makefile.am b/opal/mca/hwloc/hwloc1112/hwloc/Makefile.am similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/Makefile.am rename to opal/mca/hwloc/hwloc1112/hwloc/Makefile.am diff --git a/opal/mca/hwloc/hwloc1111/hwloc/NEWS b/opal/mca/hwloc/hwloc1112/hwloc/NEWS similarity index 95% rename from opal/mca/hwloc/hwloc1111/hwloc/NEWS rename to opal/mca/hwloc/hwloc1112/hwloc/NEWS index 9638d63f0c..28db716278 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/NEWS +++ b/opal/mca/hwloc/hwloc1112/hwloc/NEWS @@ -1,5 +1,5 @@ Copyright © 2009 CNRS -Copyright © 2009-2015 Inria. All rights reserved. +Copyright © 2009-2016 Inria. All rights reserved. Copyright © 2009-2013 Université Bordeaux Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. @@ -17,6 +17,54 @@ bug fixes (and other actions) for each version of hwloc since version in v0.9.1). +Version 1.11.3 +-------------- +* Fix /proc/mounts parsing on Linux by using mntent.h. + Thanks to Nathan Hjelm for reporting the issue. + + +Version 1.11.2 +-------------- +* Improve support for Intel Knights Landing Xeon Phi on Linux: + + Group local NUMA nodes of normal memory (DDR) and high-bandwidth memory + (MCDRAM) together through "Cluster" groups so that the local MCDRAM is + easy to find. + - See "How do I find the local MCDRAM NUMA node on Intel Knights + Landing Xeon Phi?" in the documentation. + - For uniformity across all KNL configurations, always have a NUMA node + object even if the host is UMA. + + Fix the detection of the memory-side cache: + - Add the hwloc-dump-hwdata superuser utility to dump SMBIOS information + into /var/run/hwloc/ as root during boot, and load this dumped + information from the hwloc library at runtime. + - See "Why do I need hwloc-dump-hwdata for caches on Intel Knights + Landing Xeon Phi?" in the documentation. + Thanks to Grzegorz Andrejczuk for the patches and for the help. +* The x86 and linux backends may now be combined for discovering CPUs + through x86 CPUID and memory from the Linux kernel. + This is useful for working around buggy CPU information reported by Linux + (for instance the AMD Bulldozer/Piledriver bug below). + Combination is enabled by passing HWLOC_COMPONENTS=x86 in the environment. +* Fix L3 cache sharing on AMD Opteron 63xx (Piledriver) and 62xx (Bulldozer) + in the x86 backend. Thanks to many users who helped. +* Fix the overzealous L3 cache sharing fix added to the x86 backend in 1.11.1 + for AMD Opteron 61xx (Magny-Cours) processors. +* The x86 backend may now add the info attribute Inclusive=0 or 1 to caches + it discovers, or to caches discovered by other backends earlier. + Thanks to Guillaume Beauchamp for the patch. +* Fix the management on alloc_membind() allocation failures on AIX, HP-UX + and OSF/Tru64. +* Fix spurious failures to load with ENOMEM on AIX in case of Misc objects + below PUs. +* lstopo improvements in X11 and Windows graphical mode: + + Add + - f 1 shortcuts to manually zoom-in, zoom-out, reset the scale, + or fit the entire window. + + Display all keyboard shortcuts in the console. +* Debug messages may be disabled at runtime by passing HWLOC_DEBUG_VERBOSE=0 + in the environment when --enable-debug was passed to configure. +* Add a FAQ entry "What are these Group objects in my topology?". + + Version 1.11.1 -------------- * Detection fixes diff --git a/opal/mca/hwloc/hwloc1111/hwloc/README b/opal/mca/hwloc/hwloc1112/hwloc/README similarity index 99% rename from opal/mca/hwloc/hwloc1111/hwloc/README rename to opal/mca/hwloc/hwloc1112/hwloc/README index 6332fbce93..592d459f84 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/README +++ b/opal/mca/hwloc/hwloc1112/hwloc/README @@ -25,9 +25,9 @@ using PLPA has already switched to hwloc. hwloc supports the following operating systems: * Linux (including old kernels not having sysfs topology information, with - knowledge of cpusets, offline CPUs, ScaleMP vSMP, NumaScale NumaConnect, - and Kerrighed support) on all supported hardware, including Intel Xeon Phi - (either standalone or as a coprocessor). + knowledge of cpusets, offline CPUs, ScaleMP vSMP and Kerrighed support) on + all supported hardware, including Intel Xeon Phi (KNL and KNC, either + standalone or as a coprocessor) and NumaScale NumaConnect. * Solaris * AIX * Darwin / OS X diff --git a/opal/mca/hwloc/hwloc1112/hwloc/README-ompi.txt b/opal/mca/hwloc/hwloc1112/hwloc/README-ompi.txt new file mode 100644 index 0000000000..78bf7af6f0 --- /dev/null +++ b/opal/mca/hwloc/hwloc1112/hwloc/README-ompi.txt @@ -0,0 +1,3 @@ +Cherry-picked commits after 1.11.2: + +open-mpi/hwloc@d2d07b9a2268699e13e1644b4f2ef7a53ef7396c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/VERSION b/opal/mca/hwloc/hwloc1112/hwloc/VERSION similarity index 96% rename from opal/mca/hwloc/hwloc1111/hwloc/VERSION rename to opal/mca/hwloc/hwloc1112/hwloc/VERSION index b1361597cf..c809f10a05 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/VERSION +++ b/opal/mca/hwloc/hwloc1112/hwloc/VERSION @@ -7,7 +7,7 @@ major=1 minor=11 -release=1 +release=2 # greek is used for alpha or beta release tags. If it is non-empty, # it will be appended to the version number. It does not have to be @@ -20,7 +20,7 @@ greek= # The date when this release was created -date="Oct 15, 2015" +date="Dec 17, 2015" # If snapshot=1, then use the value from snapshot_version as the # entire hwloc version (i.e., ignore major, minor, release, and @@ -39,4 +39,4 @@ snapshot_version=${major}.${minor}.${release}${greek}-git # 2. Version numbers are described in the Libtool current:revision:age # format. -libhwloc_so_version=11:7:6 +libhwloc_so_version=11:8:6 diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/distscript.sh b/opal/mca/hwloc/hwloc1112/hwloc/config/distscript.sh similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/distscript.sh rename to opal/mca/hwloc/hwloc1112/hwloc/config/distscript.sh diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc.m4 b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc.m4 similarity index 99% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc.m4 rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc.m4 index e364e6c0e9..1b4f490591 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc.m4 +++ b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc.m4 @@ -1213,6 +1213,7 @@ AC_DEFUN([HWLOC_DO_AM_CONDITIONALS],[ AM_CONDITIONAL([HWLOC_HAVE_WINDOWS], [test "x$hwloc_windows" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_MINGW32], [test "x$target_os" = "xmingw32"]) + AM_CONDITIONAL([HWLOC_HAVE_X86], [test "x$hwloc_x86_32" = "xyes" -o "x$hwloc_x86_64" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_X86_32], [test "x$hwloc_x86_32" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_X86_64], [test "x$hwloc_x86_64" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_X86_CPUID], [test "x$hwloc_have_x86_cpuid" = "xyes"]) diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_attributes.m4 b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_attributes.m4 similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_attributes.m4 rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_attributes.m4 diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_vendor.m4 b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_vendor.m4 similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_vendor.m4 rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_vendor.m4 diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_visibility.m4 b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_visibility.m4 similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_check_visibility.m4 rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_check_visibility.m4 diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_components.m4 b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_components.m4 similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_components.m4 rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_components.m4 diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_get_version.sh b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_get_version.sh similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_get_version.sh rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_get_version.sh diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_internal.m4 b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_internal.m4 similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_internal.m4 rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_internal.m4 diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_pkg.m4 b/opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_pkg.m4 similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/hwloc_pkg.m4 rename to opal/mca/hwloc/hwloc1112/hwloc/config/hwloc_pkg.m4 diff --git a/opal/mca/hwloc/hwloc1111/hwloc/config/test-driver b/opal/mca/hwloc/hwloc1112/hwloc/config/test-driver similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/config/test-driver rename to opal/mca/hwloc/hwloc1112/hwloc/config/test-driver diff --git a/opal/mca/hwloc/hwloc1111/hwloc/configure.ac b/opal/mca/hwloc/hwloc1112/hwloc/configure.ac similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/configure.ac rename to opal/mca/hwloc/hwloc1112/hwloc/configure.ac diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/hwloc-valgrind.supp b/opal/mca/hwloc/hwloc1112/hwloc/contrib/hwloc-valgrind.supp similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/hwloc-valgrind.supp rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/hwloc-valgrind.supp diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/README b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/README similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/README rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/README diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-annotate.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-annotate.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-annotate.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-annotate.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-annotate.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-annotate.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-annotate.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-annotate.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-assembler.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-assembler.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-assembler.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-assembler.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-assembler.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-assembler.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-assembler.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-assembler.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-bind.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-bind.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-bind.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-bind.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-bind.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-bind.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-bind.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-bind.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-calc.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-calc.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-calc.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-calc.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-calc.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-calc.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-calc.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-calc.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-diff.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-diff.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-diff.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-diff.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-diff.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-diff.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-diff.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-diff.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distances.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distances.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distances.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distances.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distances.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distances.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distances.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distances.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distrib.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distrib.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distrib.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distrib.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distrib.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distrib.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-distrib.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-distrib.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-info.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-info.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-info.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-info.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-info.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-info.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-info.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-info.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-patch.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-patch.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-patch.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-patch.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-patch.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-patch.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc-patch.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc-patch.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc.sln b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc.sln similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc.sln rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc.sln diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc_config.h b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc_config.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/hwloc_config.h rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/hwloc_config.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/libhwloc.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/libhwloc.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/libhwloc.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/libhwloc.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/libhwloc.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/libhwloc.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/libhwloc.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/libhwloc.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-no-graphics.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-no-graphics.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-no-graphics.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-no-graphics.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-no-graphics.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-no-graphics.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-no-graphics.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-no-graphics.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-win.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-win.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-win.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-win.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-win.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-win.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo-win.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo-win.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo.vcxproj b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo.vcxproj similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo.vcxproj rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo.vcxproj diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo.vcxproj.filters b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo.vcxproj.filters similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/lstopo.vcxproj.filters rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/lstopo.vcxproj.filters diff --git a/opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/private_config.h b/opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/private_config.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/contrib/windows/private_config.h rename to opal/mca/hwloc/hwloc1112/hwloc/contrib/windows/private_config.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/doc/README.txt b/opal/mca/hwloc/hwloc1112/hwloc/doc/README.txt similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/doc/README.txt rename to opal/mca/hwloc/hwloc1112/hwloc/doc/README.txt diff --git a/opal/mca/hwloc/hwloc1111/hwloc/hwloc.pc.in b/opal/mca/hwloc/hwloc1112/hwloc/hwloc.pc.in similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/hwloc.pc.in rename to opal/mca/hwloc/hwloc1112/hwloc/hwloc.pc.in diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/Makefile.am b/opal/mca/hwloc/hwloc1112/hwloc/include/Makefile.am similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/Makefile.am rename to opal/mca/hwloc/hwloc1112/hwloc/include/Makefile.am diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc.h similarity index 99% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc.h index 6220dcb743..deb5141fc7 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc.h +++ b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc.h @@ -211,6 +211,7 @@ typedef enum { * expose their arbitrary processors aggregation this * way. And hwloc may insert such objects to group * NUMA nodes according to their distances. + * See also \ref faq_groups. * * These objects are ignored when they do not bring * any structure. diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/autogen/config.h.in b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/autogen/config.h.in similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/autogen/config.h.in rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/autogen/config.h.in diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/bitmap.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/bitmap.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/bitmap.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/bitmap.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/cuda.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/cuda.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/cuda.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/cuda.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/cudart.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/cudart.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/cudart.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/cudart.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/deprecated.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/deprecated.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/deprecated.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/deprecated.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/diff.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/diff.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/diff.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/diff.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/gl.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/gl.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/gl.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/gl.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/glibc-sched.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/glibc-sched.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/glibc-sched.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/glibc-sched.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/helper.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/helper.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/helper.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/helper.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/inlines.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/inlines.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/inlines.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/inlines.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/intel-mic.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/intel-mic.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/intel-mic.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/intel-mic.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/linux-libnuma.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/linux-libnuma.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/linux-libnuma.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/linux-libnuma.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/linux.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/linux.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/linux.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/linux.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/myriexpress.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/myriexpress.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/myriexpress.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/myriexpress.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/nvml.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/nvml.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/nvml.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/nvml.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/opencl.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/opencl.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/opencl.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/opencl.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/openfabrics-verbs.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/openfabrics-verbs.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/openfabrics-verbs.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/openfabrics-verbs.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/plugins.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/plugins.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/plugins.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/plugins.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/rename.h b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/rename.h similarity index 99% rename from opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/rename.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/rename.h index 496504a9f0..27a6f9d12c 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/include/hwloc/rename.h +++ b/opal/mca/hwloc/hwloc1112/hwloc/include/hwloc/rename.h @@ -1,6 +1,6 @@ /* * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. - * Copyright © 2010-2014 Inria. All rights reserved. + * Copyright © 2010-2015 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -510,6 +510,7 @@ extern "C" { /* private/debug.h */ +#define hwloc_debug_enabled HWLOC_NAME(debug_enabled) #define hwloc_debug HWLOC_NAME(debug) /* private/misc.h */ diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/autogen/config.h.in b/opal/mca/hwloc/hwloc1112/hwloc/include/private/autogen/config.h.in similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/autogen/config.h.in rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/autogen/config.h.in diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/components.h b/opal/mca/hwloc/hwloc1112/hwloc/include/private/components.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/components.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/components.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/cpuid-x86.h b/opal/mca/hwloc/hwloc1112/hwloc/include/private/cpuid-x86.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/cpuid-x86.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/cpuid-x86.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/debug.h b/opal/mca/hwloc/hwloc1112/hwloc/include/private/debug.h similarity index 66% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/debug.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/debug.h index 4de91bf8ae..2038a4cfe5 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/include/private/debug.h +++ b/opal/mca/hwloc/hwloc1112/hwloc/include/private/debug.h @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2012 Inria. All rights reserved. + * Copyright © 2009-2015 Inria. All rights reserved. * Copyright © 2009, 2011 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -18,36 +18,57 @@ #include #endif +#ifdef HWLOC_DEBUG +static __hwloc_inline int hwloc_debug_enabled(void) +{ + static int checked = 0; + static int enabled = 1; + if (!checked) { + const char *env = getenv("HWLOC_DEBUG_VERBOSE"); + if (env) + enabled = atoi(env); + if (enabled) + fprintf(stderr, "hwloc verbose debug enabled, may be disabled with HWLOC_DEBUG_VERBOSE=0 in the environment.\n"); + checked = 1; + } + return enabled; +} +#endif + static __hwloc_inline void hwloc_debug(const char *s __hwloc_attribute_unused, ...) { #ifdef HWLOC_DEBUG + if (hwloc_debug_enabled()) { va_list ap; - va_start(ap, s); vfprintf(stderr, s, ap); va_end(ap); + } #endif } #ifdef HWLOC_DEBUG #define hwloc_debug_bitmap(fmt, bitmap) do { \ +if (hwloc_debug_enabled()) { \ char *s; \ hwloc_bitmap_asprintf(&s, bitmap); \ fprintf(stderr, fmt, s); \ free(s); \ -} while (0) +} } while (0) #define hwloc_debug_1arg_bitmap(fmt, arg1, bitmap) do { \ +if (hwloc_debug_enabled()) { \ char *s; \ hwloc_bitmap_asprintf(&s, bitmap); \ fprintf(stderr, fmt, arg1, s); \ free(s); \ -} while (0) +} } while (0) #define hwloc_debug_2args_bitmap(fmt, arg1, arg2, bitmap) do { \ +if (hwloc_debug_enabled()) { \ char *s; \ hwloc_bitmap_asprintf(&s, bitmap); \ fprintf(stderr, fmt, arg1, arg2, s); \ free(s); \ -} while (0) +} } while (0) #else #define hwloc_debug_bitmap(s, bitmap) do { } while(0) #define hwloc_debug_1arg_bitmap(s, arg1, bitmap) do { } while(0) diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/misc.h b/opal/mca/hwloc/hwloc1112/hwloc/include/private/misc.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/misc.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/misc.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/private.h b/opal/mca/hwloc/hwloc1112/hwloc/include/private/private.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/private.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/private.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/solaris-chiptype.h b/opal/mca/hwloc/hwloc1112/hwloc/include/private/solaris-chiptype.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/solaris-chiptype.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/solaris-chiptype.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/include/private/xml.h b/opal/mca/hwloc/hwloc1112/hwloc/include/private/xml.h similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/include/private/xml.h rename to opal/mca/hwloc/hwloc1112/hwloc/include/private/xml.h diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/Makefile.am b/opal/mca/hwloc/hwloc1112/hwloc/src/Makefile.am similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/Makefile.am rename to opal/mca/hwloc/hwloc1112/hwloc/src/Makefile.am diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/base64.c b/opal/mca/hwloc/hwloc1112/hwloc/src/base64.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/base64.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/base64.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/bind.c b/opal/mca/hwloc/hwloc1112/hwloc/src/bind.c similarity index 94% rename from opal/mca/hwloc/hwloc1111/hwloc/src/bind.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/bind.c index a0cbfd8a3a..afef5e8f0d 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/bind.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/bind.c @@ -74,9 +74,13 @@ hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_bitmap_t set, int flags if (topology->binding_hooks.set_thisthread_cpubind) return topology->binding_hooks.set_thisthread_cpubind(topology, set, flags); } else { - if (topology->binding_hooks.set_thisproc_cpubind) - return topology->binding_hooks.set_thisproc_cpubind(topology, set, flags); - else if (topology->binding_hooks.set_thisthread_cpubind) + if (topology->binding_hooks.set_thisproc_cpubind) { + int err = topology->binding_hooks.set_thisproc_cpubind(topology, set, flags); + if (err >= 0 || errno != ENOSYS) + return err; + /* ENOSYS, fallback */ + } + if (topology->binding_hooks.set_thisthread_cpubind) return topology->binding_hooks.set_thisthread_cpubind(topology, set, flags); } @@ -94,9 +98,13 @@ hwloc_get_cpubind(hwloc_topology_t topology, hwloc_bitmap_t set, int flags) if (topology->binding_hooks.get_thisthread_cpubind) return topology->binding_hooks.get_thisthread_cpubind(topology, set, flags); } else { - if (topology->binding_hooks.get_thisproc_cpubind) - return topology->binding_hooks.get_thisproc_cpubind(topology, set, flags); - else if (topology->binding_hooks.get_thisthread_cpubind) + if (topology->binding_hooks.get_thisproc_cpubind) { + int err = topology->binding_hooks.get_thisproc_cpubind(topology, set, flags); + if (err >= 0 || errno != ENOSYS) + return err; + /* ENOSYS, fallback */ + } + if (topology->binding_hooks.get_thisthread_cpubind) return topology->binding_hooks.get_thisthread_cpubind(topology, set, flags); } @@ -164,9 +172,13 @@ hwloc_get_last_cpu_location(hwloc_topology_t topology, hwloc_bitmap_t set, int f if (topology->binding_hooks.get_thisthread_last_cpu_location) return topology->binding_hooks.get_thisthread_last_cpu_location(topology, set, flags); } else { - if (topology->binding_hooks.get_thisproc_last_cpu_location) - return topology->binding_hooks.get_thisproc_last_cpu_location(topology, set, flags); - else if (topology->binding_hooks.get_thisthread_last_cpu_location) + if (topology->binding_hooks.get_thisproc_last_cpu_location) { + int err = topology->binding_hooks.get_thisproc_last_cpu_location(topology, set, flags); + if (err >= 0 || errno != ENOSYS) + return err; + /* ENOSYS, fallback */ + } + if (topology->binding_hooks.get_thisthread_last_cpu_location) return topology->binding_hooks.get_thisthread_last_cpu_location(topology, set, flags); } @@ -272,9 +284,13 @@ hwloc_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodes if (topology->binding_hooks.set_thisthread_membind) return topology->binding_hooks.set_thisthread_membind(topology, nodeset, policy, flags); } else { - if (topology->binding_hooks.set_thisproc_membind) - return topology->binding_hooks.set_thisproc_membind(topology, nodeset, policy, flags); - else if (topology->binding_hooks.set_thisthread_membind) + if (topology->binding_hooks.set_thisproc_membind) { + int err = topology->binding_hooks.set_thisproc_membind(topology, nodeset, policy, flags); + if (err >= 0 || errno != ENOSYS) + return err; + /* ENOSYS, fallback */ + } + if (topology->binding_hooks.set_thisthread_membind) return topology->binding_hooks.set_thisthread_membind(topology, nodeset, policy, flags); } @@ -307,9 +323,13 @@ hwloc_get_membind_nodeset(hwloc_topology_t topology, hwloc_nodeset_t nodeset, hw if (topology->binding_hooks.get_thisthread_membind) return topology->binding_hooks.get_thisthread_membind(topology, nodeset, policy, flags); } else { - if (topology->binding_hooks.get_thisproc_membind) - return topology->binding_hooks.get_thisproc_membind(topology, nodeset, policy, flags); - else if (topology->binding_hooks.get_thisthread_membind) + if (topology->binding_hooks.get_thisproc_membind) { + int err = topology->binding_hooks.get_thisproc_membind(topology, nodeset, policy, flags); + if (err >= 0 || errno != ENOSYS) + return err; + /* ENOSYS, fallback */ + } + if (topology->binding_hooks.get_thisthread_membind) return topology->binding_hooks.get_thisthread_membind(topology, nodeset, policy, flags); } diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/bitmap.c b/opal/mca/hwloc/hwloc1112/hwloc/src/bitmap.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/bitmap.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/bitmap.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/components.c b/opal/mca/hwloc/hwloc1112/hwloc/src/components.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/components.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/components.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/diff.c b/opal/mca/hwloc/hwloc1112/hwloc/src/diff.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/diff.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/diff.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/distances.c b/opal/mca/hwloc/hwloc1112/hwloc/src/distances.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/distances.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/distances.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/dolib.c b/opal/mca/hwloc/hwloc1112/hwloc/src/dolib.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/dolib.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/dolib.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/hwloc.dtd b/opal/mca/hwloc/hwloc1112/hwloc/src/hwloc.dtd similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/hwloc.dtd rename to opal/mca/hwloc/hwloc1112/hwloc/src/hwloc.dtd diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/misc.c b/opal/mca/hwloc/hwloc1112/hwloc/src/misc.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/misc.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/misc.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/pci-common.c b/opal/mca/hwloc/hwloc1112/hwloc/src/pci-common.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/pci-common.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/pci-common.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-aix.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-aix.c similarity index 99% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-aix.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-aix.c index 1b98ba6b92..37812f3ab8 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-aix.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-aix.c @@ -585,7 +585,7 @@ hwloc_aix_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_nodes ret = ra_mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0, R_RSET, rsid, aix_policy); rs_free(rsid.at_rset); - return ret; + return ret == (void*)-1 ? NULL : ret; } #endif /* P_DEFAULT */ diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-bgq.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-bgq.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-bgq.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-bgq.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-cuda.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-cuda.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-cuda.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-cuda.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-custom.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-custom.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-custom.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-custom.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-darwin.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-darwin.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-darwin.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-darwin.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-fake.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-fake.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-fake.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-fake.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-freebsd.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-freebsd.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-freebsd.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-freebsd.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-gl.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-gl.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-gl.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-gl.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-hardwired.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-hardwired.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-hardwired.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-hardwired.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-hpux.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-hpux.c similarity index 98% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-hpux.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-hpux.c index 44a4a4c41a..44258cc2a2 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-hpux.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-hpux.c @@ -142,6 +142,7 @@ static void* hwloc_hpux_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) { int mmap_flags; + void *p; /* Can not give a set of nodes. */ if (!hwloc_bitmap_isequal(nodeset, hwloc_topology_get_complete_nodeset(topology))) { @@ -165,7 +166,8 @@ hwloc_hpux_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_node return NULL; } - return mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | mmap_flags, -1, 0); + p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | mmap_flags, -1, 0); + return p == MAP_FAILED ? NULL : p; } #endif /* MAP_MEM_FIRST_TOUCH */ diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-linux.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-linux.c similarity index 93% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-linux.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-linux.c index b1199d3519..c76f97c250 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-linux.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-linux.c @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2015 Inria. All rights reserved. + * Copyright © 2009-2016 Inria. All rights reserved. * Copyright © 2009-2013, 2015 Université Bordeaux * Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. * Copyright © 2015 Intel, Inc. All rights reserved. @@ -36,18 +36,21 @@ #include #include #include +#include #if defined HWLOC_HAVE_SET_MEMPOLICY || defined HWLOC_HAVE_MBIND #define migratepages migrate_pages /* workaround broken migratepages prototype in numaif.h before libnuma 2.0.2 */ #include #endif struct hwloc_linux_backend_data_s { + char *root_path; /* NULL if unused */ int root_fd; /* The file descriptor for the file system root, used when browsing, e.g., Linux' sysfs and procfs. */ int is_real_fsroot; /* Boolean saying whether root_fd points to the real filesystem root of the system */ #ifdef HAVE_LIBUDEV_H struct udev *udev; /* Global udev context */ #endif - + char *dumped_hwdata_dirname; + int is_knl; struct utsname utsname; /* fields contain \0 when unknown */ int deprecated_classlinks_model; /* -2 if never tried, -1 if unknown, 0 if new (device contains class/name), 1 if old (device contains class:name) */ @@ -1651,96 +1654,40 @@ hwloc_parse_cpumap(const char *mappath, int fsroot_fd) return set; } -static char * -hwloc_strdup_mntpath(const char *escapedpath, size_t length) -{ - char *path = malloc(length+1); - const char *src = escapedpath, *tmp; - char *dst = path; - - while ((tmp = strchr(src, '\\')) != NULL) { - strncpy(dst, src, tmp-src); - dst += tmp-src; - if (!strncmp(tmp+1, "040", 3)) - *dst = ' '; - else if (!strncmp(tmp+1, "011", 3)) - *dst = ' '; - else if (!strncmp(tmp+1, "012", 3)) - *dst = '\n'; - else - *dst = '\\'; - dst++; - src = tmp+4; - } - - strcpy(dst, src); - - return path; -} - static void -hwloc_find_linux_cpuset_mntpnt(char **cgroup_mntpnt, char **cpuset_mntpnt, int fsroot_fd) +hwloc_find_linux_cpuset_mntpnt(char **cgroup_mntpnt, char **cpuset_mntpnt, const char *root_path) { -#define PROC_MOUNT_LINE_LEN 512 - char line[PROC_MOUNT_LINE_LEN]; + char *mount_path; + struct mntent *mntent; FILE *fd; + int err; *cgroup_mntpnt = NULL; *cpuset_mntpnt = NULL; - /* ideally we should use setmntent, getmntent, hasmntopt and endmntent, - * but they do not support fsroot_fd. - */ - - fd = hwloc_fopen("/proc/mounts", "r", fsroot_fd); + if (root_path) { + /* setmntent() doesn't support openat(), so use the root_path directly */ + err = asprintf(&mount_path, "%s/proc/mounts", root_path); + if (err < 0) + return; + fd = setmntent(mount_path, "r"); + free(mount_path); + } else { + fd = setmntent("/proc/mounts", "r"); + } if (!fd) return; - while (fgets(line, sizeof(line), fd)) { - char *path; - char *type; - char *tmp; - - /* remove the ending " 0 0\n" that the kernel always adds */ - tmp = line + strlen(line) - 5; - if (tmp < line || strcmp(tmp, " 0 0\n")) - fprintf(stderr, "Unexpected end of /proc/mounts line `%s'\n", line); - else - *tmp = '\0'; - - /* path is after first field and a space */ - tmp = strchr(line, ' '); - if (!tmp) - continue; - path = tmp+1; - - /* type is after path, which may not contain spaces since the kernel escaped them to \040 - * (see the manpage of getmntent) */ - tmp = strchr(path, ' '); - if (!tmp) - continue; - type = tmp+1; - /* mark the end of path to ease upcoming strdup */ - *tmp = '\0'; - - if (!strncmp(type, "cpuset ", 7)) { - /* found a cpuset mntpnt */ - hwloc_debug("Found cpuset mount point on %s\n", path); - *cpuset_mntpnt = hwloc_strdup_mntpath(path, type-path); + while ((mntent = getmntent(fd)) != NULL) { + if (!strcmp(mntent->mnt_type, "cpuset")) { + hwloc_debug("Found cpuset mount point on %s\n", mntent->mnt_dir); + *cpuset_mntpnt = strdup(mntent->mnt_dir); break; - - } else if (!strncmp(type, "cgroup ", 7)) { + } else if (!strcmp(mntent->mnt_type, "cgroup")) { /* found a cgroup mntpnt */ - char *opt, *opts; + char *opt, *opts = mntent->mnt_opts; int cpuset_opt = 0; int noprefix_opt = 0; - - /* find options */ - tmp = strchr(type, ' '); - if (!tmp) - continue; - opts = tmp+1; - /* look at options */ while ((opt = strsep(&opts, ",")) != NULL) { if (!strcmp(opt, "cpuset")) @@ -1750,19 +1697,18 @@ hwloc_find_linux_cpuset_mntpnt(char **cgroup_mntpnt, char **cpuset_mntpnt, int f } if (!cpuset_opt) continue; - if (noprefix_opt) { - hwloc_debug("Found cgroup emulating a cpuset mount point on %s\n", path); - *cpuset_mntpnt = hwloc_strdup_mntpath(path, type-path); + hwloc_debug("Found cgroup emulating a cpuset mount point on %s\n", mntent->mnt_dir); + *cpuset_mntpnt = strdup(mntent->mnt_dir); } else { - hwloc_debug("Found cgroup/cpuset mount point on %s\n", path); - *cgroup_mntpnt = hwloc_strdup_mntpath(path, type-path); + hwloc_debug("Found cgroup/cpuset mount point on %s\n", mntent->mnt_dir); + *cgroup_mntpnt = strdup(mntent->mnt_dir); } break; } } - fclose(fd); + endmntent(fd); } /* @@ -2801,6 +2747,96 @@ look_powerpc_device_tree(struct hwloc_topology *topology, free(cpus.p); } +/* Try to add memory-side caches for KNL. + * Returns 0 on success and -1 otherwise */ +static int hwloc_linux_try_add_knl_mcdram_caches(hwloc_topology_t topology, struct hwloc_linux_backend_data_s *data, hwloc_obj_t *nodes, unsigned nbnodes) +{ + char *knl_cache_file; + long long int cache_size = -1; + int associativity = -1; + int inclusiveness = -1; + int line_size = -1; + unsigned i; + FILE *f; + char buffer[512] = {0}; + char *data_beg = NULL; + char *data_end = NULL; + + if (asprintf(&knl_cache_file, "%s/knl_memoryside_cache", data->dumped_hwdata_dirname) < 0) + return -1; + + hwloc_debug("Reading knl cache data from: %s\n", knl_cache_file); + f = hwloc_fopen(knl_cache_file, "r", data->root_fd); + if (!f) { + hwloc_debug("Unable to open KNL data file `%s' (%s)\n", knl_cache_file, strerror(errno)); + free(knl_cache_file); + return -1; + } + free(knl_cache_file); + + data_beg = &buffer[0]; + data_end = data_beg + fread(buffer, 1, sizeof(buffer), f); + + /* file must start with version information, only 1 accepted for now */ + if (strncmp("version: 1\n", data_beg, strlen("version: 1\n"))) { + fprintf(stderr, "Invalid knl_memoryside_cache header, expected \"version: 1\".\n"); + fclose(f); + return -1; + } + data_beg += strlen("version: 1\n"); + + while (data_beg < data_end) { + char *line_end = strstr(data_beg, "\n"); + if (!line_end) + break; + if (!strncmp("cache_size:", data_beg, strlen("cache_size"))) { + sscanf(data_beg, "cache_size: %lld", &cache_size); + hwloc_debug("read cache_size=%lld\n", cache_size); + } else if (!strncmp("line_size:", data_beg, strlen("line_size:"))) { + sscanf(data_beg, "line_size: %d", &line_size); + hwloc_debug("read line_size=%d\n", line_size); + } else if (!strncmp("inclusiveness:", data_beg, strlen("inclusiveness:"))) { + sscanf(data_beg, "inclusiveness: %d", &inclusiveness); + hwloc_debug("read inclusiveness=%d\n", inclusiveness); + } else if (!strncmp("associativity:", data_beg, strlen("associativity:"))) { + sscanf(data_beg, "associativity: %d\n", &associativity); + hwloc_debug("read associativity=%d\n", associativity); + } + data_beg += line_end - data_beg +1; + } + + fclose(f); + + if (line_size == -1 || cache_size == -1 || associativity == -1 || inclusiveness == -1) { + hwloc_debug("Incorrect file format line_size=%d cache_size=%lld associativity=%d inclusiveness=%d\n", + line_size, cache_size, associativity, inclusiveness); + return -1; + } + + for(i=0; icpuset)) + /* one L3 per DDR, none for MCDRAM nodes */ + continue; + + cache = hwloc_alloc_setup_object(HWLOC_OBJ_CACHE, -1); + if (!cache) + return -1; + + cache->attr->cache.depth = 3; + cache->attr->cache.type = HWLOC_OBJ_CACHE_UNIFIED; + cache->attr->cache.associativity = associativity; + hwloc_obj_add_info(cache, "Inclusive", inclusiveness ? "1" : "0"); + cache->attr->cache.size = cache_size; + cache->attr->cache.linesize = line_size; + cache->cpuset = hwloc_bitmap_dup(nodes[i]->cpuset); + hwloc_obj_add_info(cache, "Type", "MemorySideCache"); + hwloc_insert_object_by_cpuset(topology, cache); + } + return 0; +} + /************************************** @@ -2838,18 +2874,17 @@ look_sysfsnode(struct hwloc_topology *topology, else return -1; - if (nbnodes <= 1) - { - hwloc_bitmap_free(nodeset); - return 0; - } + if (!nbnodes || (nbnodes == 1 && !data->is_knl)) { /* always keep NUMA for KNL, or configs might look too different */ + hwloc_bitmap_free(nodeset); + return 0; + } /* For convenience, put these declarations inside a block. */ { hwloc_obj_t * nodes = calloc(nbnodes, sizeof(hwloc_obj_t)); unsigned *indexes = calloc(nbnodes, sizeof(unsigned)); - float * distances; + float * distances = NULL; int failednodes = 0; unsigned index_; @@ -2886,6 +2921,7 @@ look_sysfsnode(struct hwloc_topology *topology, char nodepath[SYSFS_NUMA_NODE_PATH_LEN]; hwloc_bitmap_t cpuset; hwloc_obj_t node, res_obj; + int annotate; osnode = indexes[index_]; @@ -2897,32 +2933,43 @@ look_sysfsnode(struct hwloc_topology *topology, continue; } - node = hwloc_alloc_setup_object(HWLOC_OBJ_NUMANODE, osnode); - node->cpuset = cpuset; - node->nodeset = hwloc_bitmap_alloc(); - hwloc_bitmap_set(node->nodeset, osnode); - + node = hwloc_get_numanode_obj_by_os_index(topology, osnode); + annotate = (node != NULL); + if (!annotate) { + /* create a new node */ + node = hwloc_alloc_setup_object(HWLOC_OBJ_NUMANODE, osnode); + node->cpuset = cpuset; + node->nodeset = hwloc_bitmap_alloc(); + hwloc_bitmap_set(node->nodeset, osnode); + } hwloc_sysfs_node_meminfo_info(topology, data, path, osnode, &node->memory); hwloc_debug_1arg_bitmap("os node %u has cpuset %s\n", osnode, node->cpuset); - res_obj = hwloc_insert_object_by_cpuset(topology, node); - if (node == res_obj) { + + if (annotate) { nodes[index_] = node; } else { - /* We got merged somehow, could be a buggy BIOS reporting wrong NUMA node cpuset. - * This object disappeared, we'll ignore distances */ - failednodes++; + res_obj = hwloc_insert_object_by_cpuset(topology, node); + if (node == res_obj) { + nodes[index_] = node; + } else { + /* We got merged somehow, could be a buggy BIOS reporting wrong NUMA node cpuset. + * This object disappeared, we'll ignore distances */ + failednodes++; + } } } + if (!failednodes && data->is_knl) + hwloc_linux_try_add_knl_mcdram_caches(topology, data, nodes, nbnodes); + if (failednodes) { /* failed to read/create some nodes, don't bother reading/fixing * a distance matrix that would likely be wrong anyway. */ nbnodes -= failednodes; - distances = NULL; - } else { + } else if (nbnodes > 1) { distances = calloc(nbnodes*nbnodes, sizeof(float)); } @@ -2944,6 +2991,46 @@ look_sysfsnode(struct hwloc_topology *topology, hwloc_parse_node_distance(nodepath, nbnodes, distances+index_*nbnodes, data->root_fd); } + if (data->is_knl) { + char *env = getenv("HWLOC_KNL_NUMA_QUIRK"); + if (!(env && !atoi(env)) && nbnodes>=2) { /* SNC2 or SNC4, with 0 or 2/4 MCDRAM, and 0-4 DDR nodes */ + unsigned i, j, closest; + for(i=0; icpuset)) + /* nodes with CPU, that's DDR, skip it */ + continue; + hwloc_obj_add_info(nodes[i], "Type", "MCDRAM"); + + /* DDR is the closest node with CPUs */ + closest = (unsigned)-1; + for(j=0; jcpuset)) + /* nodes without CPU, that's another MCDRAM, skip it */ + continue; + if (closest == (unsigned)-1 || distances[i*nbnodes+j]cpuset = hwloc_bitmap_dup(nodes[i]->cpuset); + cluster->nodeset = hwloc_bitmap_dup(nodes[i]->nodeset); + hwloc_bitmap_or(cluster->cpuset, cluster->cpuset, nodes[closest]->cpuset); + hwloc_bitmap_or(cluster->nodeset, cluster->nodeset, nodes[closest]->nodeset); + hwloc_obj_add_info(cluster, "Type", "Cluster"); + hwloc_insert_object_by_cpuset(topology, cluster); + } + } + /* drop the distance matrix, it contradicts the above NUMA layout groups */ + free(distances); + free(nodes); + free(indexes); + goto out; + } + } + hwloc_distances_set(topology, HWLOC_OBJ_NUMANODE, nbnodes, indexes, nodes, distances, 0 /* OS cannot force */); } @@ -3224,6 +3311,11 @@ package_done: kB = atol(str2); /* in kB */ fclose(fd); } + /* KNL reports L3 with size=0 and full cpuset in cpuid. + * Let hwloc_linux_try_add_knl_mcdram_cache() detect it better. + */ + if (!kB && depth == 2 && data->is_knl) + continue; /* get the line size */ sprintf(mappath, "%s/cpu%d/cache/index%d/coherency_line_size", path, i, j); @@ -3459,6 +3551,7 @@ hwloc_linux_parse_cpuinfo_generic(const char *prefix, const char *value, return 0; } +/* Lprocs_p set to NULL unless returns > 0 */ static int hwloc_linux_parse_cpuinfo(struct hwloc_linux_backend_data_s *data, const char *path, @@ -3606,6 +3699,7 @@ hwloc_linux_parse_cpuinfo(struct hwloc_linux_backend_data_s *data, fclose(fd); free(str); free(Lprocs); + *Lprocs_p = NULL; return -1; } @@ -3625,18 +3719,13 @@ hwloc_linux_free_cpuinfo(struct hwloc_linux_cpuinfo_proc * Lprocs, unsigned nump static int look_cpuinfo(struct hwloc_topology *topology, - struct hwloc_linux_backend_data_s *data, - const char *path, hwloc_bitmap_t online_cpuset) + struct hwloc_linux_cpuinfo_proc * Lprocs, + unsigned numprocs, hwloc_bitmap_t online_cpuset) { - struct hwloc_linux_cpuinfo_proc * Lprocs = NULL; - struct hwloc_obj_info_s *global_infos = NULL; - unsigned global_infos_count = 0; /* P for physical/OS index, L for logical (e.g. in we order we get them, not in the final hwloc logical order) */ unsigned *Lcore_to_Pcore; unsigned *Lcore_to_Ppkg; /* needed because Lcore is equivalent to Pcore+Ppkg, not to Pcore alone */ unsigned *Lpkg_to_Ppkg; - int _numprocs; - unsigned numprocs; unsigned numpkgs=0; unsigned numcores=0; unsigned long Lproc; @@ -3645,20 +3734,6 @@ look_cpuinfo(struct hwloc_topology *topology, unsigned i,j; hwloc_bitmap_t cpuset; - /* parse the entire cpuinfo first, fill the Lprocs array and numprocs */ - _numprocs = hwloc_linux_parse_cpuinfo(data, path, &Lprocs, &global_infos, &global_infos_count); - - - /* setup root info */ - hwloc__move_infos(&hwloc_get_root_obj(topology)->infos, &hwloc_get_root_obj(topology)->infos_count, - &global_infos, &global_infos_count); - - - if (_numprocs <= 0) - /* found no processor */ - return -1; - numprocs = _numprocs; - /* initialize misc arrays, there can be at most numprocs entries */ Lcore_to_Pcore = malloc(numprocs * sizeof(*Lcore_to_Pcore)); Lcore_to_Ppkg = malloc(numprocs * sizeof(*Lcore_to_Ppkg)); @@ -3713,7 +3788,7 @@ look_cpuinfo(struct hwloc_topology *topology, * provide bogus information. We should rather drop it. */ missingpkg=0; for(j=0; jlevels[0][0]->cpuset) - /* somebody discovered things */ - return 0; - - hwloc_gather_system_info(topology, data); + already_pus = (topology->levels[0][0]->complete_cpuset != NULL + && !hwloc_bitmap_iszero(topology->levels[0][0]->complete_cpuset)); + /* if there are PUs, still look at memory information + * since x86 misses NUMA node information (unless the processor supports topoext) + * memory size. + */ + /* allocate root sets in case not done yet */ hwloc_alloc_obj_cpusets(topology->levels[0][0]); - /* Gather the list of admin-disabled cpus and mems */ - hwloc_find_linux_cpuset_mntpnt(&cgroup_mntpnt, &cpuset_mntpnt, data->root_fd); + /********************************* + * Platform information for later + */ + hwloc_gather_system_info(topology, data); + + /********************** + * /proc/cpuinfo + */ + numprocs = hwloc_linux_parse_cpuinfo(data, "/proc/cpuinfo", &Lprocs, &global_infos, &global_infos_count); + + /* detect models for quirks */ + if (numprocs > 0) { + /* KNL */ + if (!strncmp(data->utsname.machine, "x86", 3)) { /* supports 32bits? */ + unsigned i; + const char *cpuvendor = NULL, *cpufamilynumber = NULL, *cpumodelnumber = NULL; + for(i=0; iis_knl = 1; + } + } + + /********************** + * Gather the list of admin-disabled cpus and mems + */ + hwloc_find_linux_cpuset_mntpnt(&cgroup_mntpnt, &cpuset_mntpnt, data->root_path); if (cgroup_mntpnt || cpuset_mntpnt) { cpuset_name = hwloc_read_linux_cpuset_name(data->root_fd, topology->pid); if (cpuset_name) { @@ -3982,6 +4094,10 @@ hwloc_look_linuxfs(struct hwloc_backend *backend) hwloc_obj_t machine; hwloc_bitmap_t machine_online_set; + if (already_pus) + /* we don't support extending kerrighed topologies */ + return 0; + /* replace top-level object type with SYSTEM and add some MACHINE underneath */ topology->levels[0][0]->type = HWLOC_OBJ_SYSTEM; @@ -3990,13 +4106,19 @@ hwloc_look_linuxfs(struct hwloc_backend *backend) /* No cpuset support for now. */ /* No sys support for now. */ while ((dirent = readdir(nodes_dir)) != NULL) { + struct hwloc_linux_cpuinfo_proc * machine_Lprocs = NULL; + struct hwloc_obj_info_s *machine_global_infos = NULL; + unsigned machine_global_infos_count = 0; + int machine_numprocs = 0; unsigned long node; if (strncmp(dirent->d_name, "node", 4)) continue; machine_online_set = hwloc_bitmap_alloc(); node = strtoul(dirent->d_name+4, NULL, 0); snprintf(path, sizeof(path), "/proc/nodes/node%lu/cpuinfo", node); - err = look_cpuinfo(topology, data, path, machine_online_set); + machine_numprocs = hwloc_linux_parse_cpuinfo(data, path, &machine_Lprocs, &machine_global_infos, &machine_global_infos_count); + err = look_cpuinfo(topology, machine_Lprocs, machine_numprocs, machine_online_set); + hwloc_linux_free_cpuinfo(machine_Lprocs, machine_numprocs, machine_global_infos, machine_global_infos_count); if (err < 0) { hwloc_bitmap_free(machine_online_set); continue; @@ -4018,6 +4140,10 @@ hwloc_look_linuxfs(struct hwloc_backend *backend) } closedir(nodes_dir); } else { + /********************* + * Memory information + */ + /* Get the machine memory attributes */ hwloc_get_procfs_meminfo_info(topology, data, &topology->levels[0][0]->memory); @@ -4034,11 +4160,23 @@ hwloc_look_linuxfs(struct hwloc_backend *backend) topology->levels[0][0]->memory.page_types[i].count = 0; } + /********************** + * CPU information + */ + + /* Don't rediscover CPU resources if already done */ + if (already_pus) + goto done; + /* Gather the list of cpus now */ err = hwloc_linux_try_hardwired_cpuinfo(backend); if (!err) goto done; + /* setup root info */ + hwloc__move_infos(&hwloc_get_root_obj(topology)->infos, &hwloc_get_root_obj(topology)->infos_count, + &global_infos, &global_infos_count); + if (getenv("HWLOC_LINUX_USE_CPUINFO") || (hwloc_access("/sys/devices/system/cpu/cpu0/topology/core_siblings", R_OK, data->root_fd) < 0 && hwloc_access("/sys/devices/system/cpu/cpu0/topology/thread_siblings", R_OK, data->root_fd) < 0 @@ -4046,27 +4184,28 @@ hwloc_look_linuxfs(struct hwloc_backend *backend) && hwloc_access("/sys/bus/cpu/devices/cpu0/topology/core_siblings", R_OK, data->root_fd) < 0)) { /* revert to reading cpuinfo only if /sys/.../topology unavailable (before 2.6.16) * or not containing anything interesting */ - err = look_cpuinfo(topology, data, "/proc/cpuinfo", topology->levels[0][0]->online_cpuset); + if (numprocs > 0) + err = look_cpuinfo(topology, Lprocs, numprocs, topology->levels[0][0]->online_cpuset); + else + err = -1; if (err < 0) hwloc_linux_fallback_pu_level(topology); + look_powerpc_device_tree(topology, data); } else { - struct hwloc_linux_cpuinfo_proc * Lprocs = NULL; - struct hwloc_obj_info_s *global_infos = NULL; - unsigned global_infos_count = 0; - int numprocs = hwloc_linux_parse_cpuinfo(data, "/proc/cpuinfo", &Lprocs, &global_infos, &global_infos_count); - if (numprocs <= 0) - Lprocs = NULL; + /* sysfs */ if (look_sysfscpu(topology, data, "/sys/bus/cpu/devices", Lprocs, numprocs) < 0) if (look_sysfscpu(topology, data, "/sys/devices/system/cpu", Lprocs, numprocs) < 0) /* sysfs but we failed to read cpu topology, fallback */ hwloc_linux_fallback_pu_level(topology); - hwloc__move_infos(&hwloc_get_root_obj(topology)->infos, &hwloc_get_root_obj(topology)->infos_count, - &global_infos, &global_infos_count); - hwloc_linux_free_cpuinfo(Lprocs, numprocs, global_infos, global_infos_count); } done: + + /********************** + * Misc + */ + /* Gather DMI info */ hwloc__get_dmi_id_info(data, topology->levels[0][0]); if (hwloc_topology_get_flags(topology) & (HWLOC_TOPOLOGY_FLAG_IO_DEVICES|HWLOC_TOPOLOGY_FLAG_WHOLE_IO)) @@ -4084,6 +4223,7 @@ hwloc_look_linuxfs(struct hwloc_backend *backend) /* data->utsname was filled with real uname or \0, we can safely pass it */ hwloc_add_uname_info(topology, &data->utsname); + hwloc_linux_free_cpuinfo(Lprocs, numprocs, global_infos, global_infos_count); return 1; } @@ -4464,20 +4604,30 @@ hwloc_linux_block_class_fillinfos(struct hwloc_backend *backend, if (!dev) return; prop = udev_device_get_property_value(dev, "ID_VENDOR"); - if (prop) - strcpy(vendor, prop); + if (prop) { + strncpy(vendor, prop, sizeof(vendor)); + vendor[sizeof(vendor)-1] = '\0'; + } prop = udev_device_get_property_value(dev, "ID_MODEL"); - if (prop) - strcpy(model, prop); + if (prop) { + strncpy(model, prop, sizeof(model)); + model[sizeof(model)-1] = '\0'; + } prop = udev_device_get_property_value(dev, "ID_REVISION"); - if (prop) - strcpy(revision, prop); + if (prop) { + strncpy(revision, prop, sizeof(revision)); + revision[sizeof(revision)-1] = '\0'; + } prop = udev_device_get_property_value(dev, "ID_SERIAL_SHORT"); - if (prop) - strcpy(serial, prop); + if (prop) { + strncpy(serial, prop, sizeof(serial)); + serial[sizeof(serial)-1] = '\0'; + } prop = udev_device_get_property_value(dev, "ID_TYPE"); - if (prop) - strcpy(blocktype, prop); + if (prop) { + strncpy(blocktype, prop, sizeof(blocktype)); + blocktype[sizeof(blocktype)-1] = '\0'; + } udev_device_unref(dev); } else @@ -4952,6 +5102,8 @@ hwloc_linux_backend_disable(struct hwloc_backend *backend) { struct hwloc_linux_backend_data_s *data = backend->private_data; #ifdef HAVE_OPENAT + if (data->root_path) + free(data->root_path); close(data->root_fd); #endif #ifdef HAVE_LIBUDEV_H @@ -4983,13 +5135,16 @@ hwloc_linux_component_instantiate(struct hwloc_disc_component *component, } backend->private_data = data; + backend->flags = HWLOC_BACKEND_FLAG_NEED_LEVELS; backend->discover = hwloc_look_linuxfs; backend->get_obj_cpuset = hwloc_linux_backend_get_obj_cpuset; backend->notify_new_object = hwloc_linux_backend_notify_new_object; backend->disable = hwloc_linux_backend_disable; /* default values */ + data->is_knl = 0; data->is_real_fsroot = 1; + data->root_path = NULL; if (!fsroot_path) fsroot_path = "/"; @@ -5001,6 +5156,7 @@ hwloc_linux_component_instantiate(struct hwloc_disc_component *component, if (strcmp(fsroot_path, "/")) { backend->is_thissystem = 0; data->is_real_fsroot = 0; + data->root_path = strdup(fsroot_path); } /* Since this fd stays open after hwloc returns, mark it as @@ -5028,6 +5184,10 @@ hwloc_linux_component_instantiate(struct hwloc_disc_component *component, } #endif + data->dumped_hwdata_dirname = getenv("HWLOC_DUMPED_HWDATA_DIR"); + if (!data->dumped_hwdata_dirname) + data->dumped_hwdata_dirname = "/var/run/hwloc/"; + data->deprecated_classlinks_model = -2; /* never tried */ data->mic_need_directlookup = -1; /* not initialized */ data->mic_directlookup_id_max = -1; /* not initialized */ @@ -5035,6 +5195,10 @@ hwloc_linux_component_instantiate(struct hwloc_disc_component *component, return backend; out_with_data: +#ifdef HAVE_OPENAT + if (data->root_path) + free(data->root_path); +#endif free(data); out_with_backend: free(backend); diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-netbsd.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-netbsd.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-netbsd.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-netbsd.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-noos.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-noos.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-noos.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-noos.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-nvml.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-nvml.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-nvml.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-nvml.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-opencl.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-opencl.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-opencl.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-opencl.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-osf.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-osf.c similarity index 99% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-osf.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-osf.c index 57158883d6..b403d1343f 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-osf.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-osf.c @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2014 Inria. All rights reserved. + * Copyright © 2009-2015 Inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -234,7 +234,7 @@ hwloc_osf_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_nodes ptr = nmmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0, &mattr); radsetdestroy(&mattr.mattr_radset); - return ptr; + return ptr == MAP_FAILED ? NULL : ptr; } static int diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-pci.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-pci.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-pci.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-pci.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-solaris-chiptype.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-solaris-chiptype.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-solaris-chiptype.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-solaris-chiptype.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-solaris.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-solaris.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-solaris.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-solaris.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-synthetic.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-synthetic.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-synthetic.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-synthetic.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-windows.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-windows.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-windows.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-windows.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-x86.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-x86.c similarity index 88% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-x86.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-x86.c index 624b7bf50f..ab6de7c934 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-x86.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-x86.c @@ -26,6 +26,7 @@ struct hwloc_x86_backend_data_s { unsigned nbprocs; hwloc_bitmap_t apicid_set; int apicid_unique; + int is_knl; }; #define has_topoext(features) ((features)[6] & (1 << 22)) @@ -35,9 +36,11 @@ struct cacheinfo { unsigned type; unsigned level; unsigned nbthreads_sharing; + unsigned cacheid; unsigned linesize; unsigned linepart; + int inclusive; int ways; unsigned sets; unsigned long size; @@ -99,6 +102,8 @@ static void fill_amd_cache(struct procinfo *infos, unsigned level, int type, uns cache->nbthreads_sharing = infos->max_log_proc; cache->linesize = cpuid & 0xff; cache->linepart = 0; + cache->inclusive = 0; /* old AMD (K8-K10) supposed to have exclusive caches */ + if (level == 1) { cache->ways = (cpuid >> 16) & 0xff; if (cache->ways == 0xff) @@ -112,20 +117,6 @@ static void fill_amd_cache(struct procinfo *infos, unsigned level, int type, uns cache->size = size; cache->sets = 0; - if (infos->cpufamilynumber== 0x10 && infos->cpumodelnumber == 0x9 - && level == 3 - && (cache->ways == -1 || (cache->ways % 2 == 0)) && cache->nbthreads_sharing >= 8) { - /* Fix AMD family 0x10 model 0x9 (Magny-Cours) with 8 or 12 cores. - * The L3 (and its associativity) is actually split into two halves). - */ - if (cache->nbthreads_sharing == 16) - cache->nbthreads_sharing = 12; /* nbthreads_sharing is a power of 2 but the processor actually has 8 or 12 cores */ - cache->nbthreads_sharing /= 2; - cache->size /= 2; - if (cache->ways != -1) - cache->ways /= 2; - } - hwloc_debug("cache L%u t%u linesize %u ways %u size %luKB\n", cache->level, cache->nbthreads_sharing, cache->linesize, cache->ways, cache->size >> 10); } @@ -183,6 +174,9 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns } infos->cpustepping = eax & 0xf; + if (cpuid_type == intel && infos->cpufamilynumber == 0x6 && infos->cpumodelnumber == 0x57) + data->is_knl = 1; + /* Get cpu vendor string from cpuid 0x00 */ memset(regs, 0, sizeof(regs)); regs[0] = 0; @@ -297,6 +291,7 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns cache->ways = ways; cache->sets = sets = ecx + 1; cache->size = linesize * linepart * ways * sets; + cache->inclusive = edx & 0x2; hwloc_debug("cache %u type %u L%u t%u c%u linesize %lu linepart %lu ways %lu sets %lu, size %uKB\n", cachenum, cache->type, cache->level, cache->nbthreads_sharing, infos->max_nbcores, linesize, linepart, ways, sets, cache->size >> 10); @@ -331,6 +326,7 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns * (not supported on AMD) */ if (cpuid_type != amd && highest_cpuid >= 0x04) { + unsigned level; for (cachenum = 0; ; cachenum++) { unsigned type; eax = 0x04; @@ -343,6 +339,10 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns if (type == 0) break; + level = (eax >> 5) & 0x7; + if (data->is_knl && level == 3) + /* KNL reports wrong L3 information (size always 0, cpuset always the entire machine, ignore it */ + break; infos->numcaches++; if (!cachenum) { @@ -369,9 +369,13 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns if (type == 0) break; + level = (eax >> 5) & 0x7; + if (data->is_knl && level == 3) + /* KNL reports wrong L3 information (size always 0, cpuset always the entire machine, ignore it */ + break; cache->type = type; - cache->level = (eax >> 5) & 0x7; + cache->level = level; cache->nbthreads_sharing = ((eax >> 14) & 0xfff) + 1; cache->linesize = linesize = (ebx & 0xfff) + 1; @@ -384,6 +388,7 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns cache->ways = ways; cache->sets = sets = ecx + 1; cache->size = linesize * linepart * ways * sets; + cache->inclusive = edx & 0x2; hwloc_debug("cache %u type %u L%u t%u c%u linesize %lu linepart %lu ways %lu sets %lu, size %uKB\n", cachenum, cache->type, cache->level, cache->nbthreads_sharing, infos->max_nbcores, linesize, linepart, ways, sets, cache->size >> 10); @@ -441,6 +446,48 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns } } + /* Now that we have all info, compute cacheids and apply quirks */ + for (cachenum = 0; cachenum < infos->numcaches; cachenum++) { + struct cacheinfo *cache = &infos->cache[cachenum]; + + /* default cacheid value */ + cache->cacheid = infos->apicid / cache->nbthreads_sharing; + + /* AMD quirk */ + if (cpuid_type == amd + && infos->cpufamilynumber== 0x10 && infos->cpumodelnumber == 0x9 + && cache->level == 3 + && (cache->ways == -1 || (cache->ways % 2 == 0)) && cache->nbthreads_sharing >= 8) { + /* Fix AMD family 0x10 model 0x9 (Magny-Cours) with 8 or 12 cores. + * The L3 (and its associativity) is actually split into two halves). + */ + if (cache->nbthreads_sharing == 16) + cache->nbthreads_sharing = 12; /* nbthreads_sharing is a power of 2 but the processor actually has 8 or 12 cores */ + cache->nbthreads_sharing /= 2; + cache->size /= 2; + if (cache->ways != -1) + cache->ways /= 2; + /* AMD Magny-Cours 12-cores processor reserve APIC ids as AAAAAABBBBBB.... + * among first L3 (A), second L3 (B), and unexisting cores (.). + * On multi-socket servers, L3 in non-first sockets may have APIC id ranges + * such as [16-21] that are not aligned on multiple of nbthreads_sharing (6). + * That means, we can't just compare apicid/nbthreads_sharing to identify siblings. + */ + cache->cacheid = (infos->apicid % infos->max_log_proc) / cache->nbthreads_sharing /* cacheid within the package */ + + 2 * (infos->apicid / infos->max_log_proc); /* add 2 caches per previous package */ + + } else if (cpuid_type == amd + && infos->cpufamilynumber == 0x15 + && (infos->cpumodelnumber == 0x1 /* Bulldozer */ || infos->cpumodelnumber == 0x2 /* Piledriver */) + && cache->level == 3 && cache->nbthreads_sharing == 6) { + /* AMD Bulldozer and Piledriver 12-core processors have same APIC ids as Magny-Cours above, + * but we can't merge the checks because the original nbthreads_sharing must be exactly 6 here. + */ + cache->cacheid = (infos->apicid % infos->max_log_proc) / cache->nbthreads_sharing /* cacheid within the package */ + + 2 * (infos->apicid / infos->max_log_proc); /* add 2 cache per previous package */ + } + } + if (hwloc_bitmap_isset(data->apicid_set, infos->apicid)) data->apicid_unique = 0; else @@ -631,6 +678,7 @@ static void summarize(struct hwloc_backend *backend, struct procinfo *infos, int } unit = hwloc_alloc_setup_object(HWLOC_OBJ_GROUP, unitid); unit->cpuset = unit_cpuset; + hwloc_obj_add_info(unit, "Type", "ComputeUnit"); hwloc_debug_1arg_bitmap("os unit %u has cpuset %s\n", unitid, unit_cpuset); hwloc_insert_object_by_cpuset(topology, unit); @@ -728,18 +776,14 @@ static void summarize(struct hwloc_backend *backend, struct procinfo *infos, int for (j = 0; j < infos[i].numcaches; j++) if (infos[i].cache[j].level > level) level = infos[i].cache[j].level; - - /* Look for known types */ - if (fulldiscovery) while (level > 0) { + while (level > 0) { for (type = 1; type <= 3; type++) { /* Look for caches of that type at level level */ { hwloc_bitmap_t caches_cpuset = hwloc_bitmap_dup(complete_cpuset); - hwloc_bitmap_t cache_cpuset; hwloc_obj_t cache; while ((i = hwloc_bitmap_first(caches_cpuset)) != (unsigned) -1) { - unsigned packageid = infos[i].packageid; for (l = 0; l < infos[i].numcaches; l++) { if (infos[i].cache[l].level == level && infos[i].cache[l].type == type) @@ -751,17 +795,12 @@ static void summarize(struct hwloc_backend *backend, struct procinfo *infos, int continue; } - /* Found a matching cache, now look for others sharing it */ - { - /* AMD Magny-Cours 12-cores processor reserve APIC ids as AAAAAABBBBBB.... - * among first L3 (A), second L3 (B), and unexisting cores (.). - * On multi-socket servers, L3 in non-first sockets may have APIC id ranges - * such as [16-21] that are not aligned on multiple of nbthreads_sharing (6). - * That means, we can't just compare apicid/nbthreads_sharing to identify siblings. - * Hence we use apicid%max_log_proc instead of apicid to restore the alignment. - * Works because we also compare packageid to identify siblings. - */ - unsigned cacheid = (infos[i].apicid % infos[i].max_log_proc) / infos[i].cache[l].nbthreads_sharing; + if (fulldiscovery) { + /* Add caches */ + hwloc_bitmap_t cache_cpuset; + unsigned packageid = infos[i].packageid; + unsigned cacheid = infos[i].cache[l].cacheid; + /* Found a matching cache, now look for others sharing it */ cache_cpuset = hwloc_bitmap_alloc(); for (j = i; j < nbprocs; j++) { @@ -775,7 +814,7 @@ static void summarize(struct hwloc_backend *backend, struct procinfo *infos, int hwloc_bitmap_clr(caches_cpuset, j); continue; } - if (infos[j].packageid == packageid && (infos[j].apicid % infos[j].max_log_proc) / infos[j].cache[l2].nbthreads_sharing == cacheid) { + if (infos[j].packageid == packageid && infos[j].cache[l2].cacheid == cacheid) { hwloc_bitmap_set(cache_cpuset, j); hwloc_bitmap_clr(caches_cpuset, j); } @@ -797,9 +836,31 @@ static void summarize(struct hwloc_backend *backend, struct procinfo *infos, int break; } cache->cpuset = cache_cpuset; + hwloc_obj_add_info(cache, "Inclusive", infos[i].cache[l].inclusive ? "1" : "0"); hwloc_debug_2args_bitmap("os L%u cache %u has cpuset %s\n", level, cacheid, cache_cpuset); hwloc_insert_object_by_cpuset(topology, cache); + + } else { + /* Annotate existing caches */ + hwloc_bitmap_t set = hwloc_bitmap_alloc(); + hwloc_obj_t cache = NULL; + int depth; + hwloc_bitmap_set(set, i); + depth = hwloc_get_cache_type_depth(topology, level, + type == 1 ? HWLOC_OBJ_CACHE_DATA : type == 2 ? HWLOC_OBJ_CACHE_INSTRUCTION : HWLOC_OBJ_CACHE_UNIFIED); + if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) + cache = hwloc_get_next_obj_covering_cpuset_by_depth(topology, set, depth, NULL); + hwloc_bitmap_free(set); + if (cache) { + /* Found cache above that PU, annotate if no such attribute yet */ + if (!hwloc_obj_get_info_by_name(cache, "Inclusive")) + hwloc_obj_add_info(cache, "Inclusive", infos[i].cache[l].inclusive ? "1" : "0"); + hwloc_bitmap_andnot(caches_cpuset, caches_cpuset, cache->cpuset); + } else { + /* No cache above that PU?! */ + hwloc_bitmap_clr(caches_cpuset, i); + } } } hwloc_bitmap_free(caches_cpuset); @@ -981,6 +1042,7 @@ int hwloc_look_x86(struct hwloc_backend *backend, int fulldiscovery) if (highest_cpuid >= 0x7) { eax = 0x7; + ecx = 0; hwloc_x86_cpuid(&eax, &ebx, &ecx, &edx); features[9] = ebx; } @@ -1108,6 +1170,7 @@ hwloc_x86_component_instantiate(struct hwloc_disc_component *component, backend->disable = hwloc_x86_backend_disable; /* default values */ + data->is_knl = 0; data->apicid_set = hwloc_bitmap_alloc(); data->apicid_unique = 1; diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-xml-libxml.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-xml-libxml.c similarity index 99% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-xml-libxml.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-xml-libxml.c index ce3250c285..46fe4aec29 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-xml-libxml.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-xml-libxml.c @@ -257,7 +257,8 @@ hwloc_libxml_import_diff(struct hwloc__xml_import_state_s *state, const char *xm if (state->global->next_attr(state, &attrname, &attrvalue) < 0) break; if (!strcmp(attrname, "refname")) { - free(refname); + if (refname) + free(refname); refname = strdup(attrvalue); } else goto out_with_doc; @@ -266,13 +267,15 @@ hwloc_libxml_import_diff(struct hwloc__xml_import_state_s *state, const char *xm ret = hwloc__xml_import_diff(state, firstdiffp); if (refnamep && !ret) *refnamep = refname; - else + else if (refname) free(refname); xmlFreeDoc(doc); return ret; out_with_doc: + if (refname) + free(refname); xmlFreeDoc(doc); out: return -1; /* failed */ diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-xml-nolibxml.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-xml-nolibxml.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-xml-nolibxml.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-xml-nolibxml.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology-xml.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology-xml.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology-xml.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology-xml.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/topology.c b/opal/mca/hwloc/hwloc1112/hwloc/src/topology.c similarity index 96% rename from opal/mca/hwloc/hwloc1111/hwloc/src/topology.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/topology.c index b4e986a131..028c226bdb 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc/src/topology.c +++ b/opal/mca/hwloc/hwloc1112/hwloc/src/topology.c @@ -349,9 +349,8 @@ void hwloc_obj_add_info_nodup(hwloc_obj_t obj, const char *name, const char *val /* Get pointer to next childect. */ \ child = *pchild) -/* Free an object and all its content. */ -void -hwloc_free_unlinked_object(hwloc_obj_t obj) +static void +hwloc__free_object_contents(hwloc_obj_t obj) { switch (obj->type) { default: @@ -370,9 +369,34 @@ hwloc_free_unlinked_object(hwloc_obj_t obj) hwloc_bitmap_free(obj->nodeset); hwloc_bitmap_free(obj->complete_nodeset); hwloc_bitmap_free(obj->allowed_nodeset); +} + +/* Free an object and all its content. */ +void +hwloc_free_unlinked_object(hwloc_obj_t obj) +{ + hwloc__free_object_contents(obj); free(obj); } +/* Replace old with contents of new object, and make new freeable by the caller. + * Only updates next_sibling/first_child pointers, + * so may only be used during early discovery. + */ +static void +hwloc_replace_linked_object(hwloc_obj_t old, hwloc_obj_t new) +{ + /* drop old fields */ + hwloc__free_object_contents(old); + /* copy old tree pointers to new */ + new->next_sibling = old->next_sibling; + new->first_child = old->first_child; + /* copy new contents to old now that tree pointers are OK */ + memcpy(old, new, sizeof(*old)); + /* clear new to that we may free it */ + memset(new, 0,sizeof(*new)); +} + /* insert the (non-empty) list of sibling starting at firstnew as new children of newparent, * and return the address of the pointer to the next one */ @@ -499,9 +523,7 @@ hwloc_topology_dup(hwloc_topology_t *newp, return -1; } - if (0 != hwloc_topology_init(&new)) { - return -1; - } + hwloc_topology_init(&new); new->flags = old->flags; memcpy(new->ignored_types, old->ignored_types, sizeof(old->ignored_types)); @@ -755,21 +777,56 @@ static int hwloc_obj_cmp_sets(hwloc_obj_t obj1, hwloc_obj_t obj2) { hwloc_bitmap_t set1, set2; + int res = HWLOC_OBJ_DIFFERENT; - /* compare cpusets if possible, or fallback to nodeset, or return */ - if (obj1->cpuset && !hwloc_bitmap_iszero(obj1->cpuset) - && obj2->cpuset && !hwloc_bitmap_iszero(obj2->cpuset)) { + /* compare cpusets first */ + if (obj1->complete_cpuset && obj2->complete_cpuset) { + set1 = obj1->complete_cpuset; + set2 = obj2->complete_cpuset; + } else { set1 = obj1->cpuset; set2 = obj2->cpuset; - } else if (obj1->nodeset && !hwloc_bitmap_iszero(obj1->nodeset) - && obj2->nodeset && !hwloc_bitmap_iszero(obj2->nodeset)) { - set1 = obj1->nodeset; - set2 = obj2->nodeset; - } else { - return HWLOC_OBJ_DIFFERENT; + } + if (set1 && set2 && !hwloc_bitmap_iszero(set1) && !hwloc_bitmap_iszero(set2)) { + res = hwloc_bitmap_compare_inclusion(set1, set2); + if (res == HWLOC_OBJ_INTERSECTS) + return HWLOC_OBJ_INTERSECTS; } - return hwloc_bitmap_compare_inclusion(set1, set2); + /* then compare nodesets, and combine the results */ + if (obj1->complete_nodeset && obj2->complete_nodeset) { + set1 = obj1->complete_nodeset; + set2 = obj2->complete_nodeset; + } else { + set1 = obj1->nodeset; + set2 = obj2->nodeset; + } + if (set1 && set2 && !hwloc_bitmap_iszero(set1) && !hwloc_bitmap_iszero(set2)) { + int noderes = hwloc_bitmap_compare_inclusion(set1, set2); + /* deal with conflicting cpusets/nodesets inclusions */ + if (noderes == HWLOC_OBJ_INCLUDED) { + if (res == HWLOC_OBJ_CONTAINS) + /* contradicting order for cpusets and nodesets */ + return HWLOC_OBJ_INTERSECTS; + res = HWLOC_OBJ_INCLUDED; + + } else if (noderes == HWLOC_OBJ_CONTAINS) { + if (res == HWLOC_OBJ_INCLUDED) + /* contradicting order for cpusets and nodesets */ + return HWLOC_OBJ_INTERSECTS; + res = HWLOC_OBJ_CONTAINS; + + } else if (noderes == HWLOC_OBJ_INTERSECTS) { + return HWLOC_OBJ_INTERSECTS; + + } else { + /* nodesets are different, keep the cpuset order */ + /* FIXME: with upcoming multiple levels of NUMA, we may have to report INCLUDED or CONTAINED here */ + + } + } + + return res; } /* Compare object cpusets based on complete_cpuset if defined (always correctly ordered), @@ -849,9 +906,7 @@ merge_insert_equal(hwloc_obj_t new, hwloc_obj_t old) &new->infos, &new->infos_count); } - if (new->name) { - if (old->name) - free(old->name); + if (new->name && !old->name) { old->name = new->name; new->name = NULL; } @@ -860,21 +915,17 @@ merge_insert_equal(hwloc_obj_t new, hwloc_obj_t old) switch(new->type) { case HWLOC_OBJ_NUMANODE: - /* Do not check these, it may change between calls */ - merge_sizes(new, old, memory.local_memory); - merge_sizes(new, old, memory.total_memory); - /* if both newects have a page_types array, just keep the biggest one for now */ - if (new->memory.page_types_len && old->memory.page_types_len) - hwloc_debug("%s", "merging page_types by keeping the biggest one only\n"); - if (new->memory.page_types_len < old->memory.page_types_len) { - free(new->memory.page_types); - } else { - free(old->memory.page_types); + if (new->memory.local_memory && !old->memory.local_memory) { + /* no memory in old, use new memory */ + old->memory.local_memory = new->memory.local_memory; + if (old->memory.page_types) + free(old->memory.page_types); old->memory.page_types_len = new->memory.page_types_len; old->memory.page_types = new->memory.page_types; new->memory.page_types = NULL; new->memory.page_types_len = 0; } + /* old->memory.total_memory will be updated by propagate_total_memory() */ break; case HWLOC_OBJ_CACHE: merge_sizes(new, old, attr->cache.size); @@ -924,8 +975,18 @@ hwloc___insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t cur assert(topology->ignored_types[HWLOC_OBJ_GROUP] != HWLOC_IGNORE_TYPE_NEVER); /* Remove the Group now. The normal ignore code path wouldn't tell us whether the Group was removed or not. * - * Keep EQUAL so that the Group gets merged. + * The Group doesn't contain anything to keep, just let the caller free it. */ + return child; + + } else if (child->type == HWLOC_OBJ_GROUP) { + + /* Replace the Group with the new object contents + * and let the caller free the new object + */ + hwloc_replace_linked_object(child, obj); + return child; + } else { /* otherwise compare actual types to decide of the inclusion */ res = hwloc_type_cmp(obj, child); @@ -952,7 +1013,9 @@ hwloc___insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t cur } return NULL; } - /* Can be two objects with same type. Or one Group and anything else. */ + /* Two objects with same type. + * Groups are handled above. + */ if (obj->type == child->type && (obj->type == HWLOC_OBJ_PU || obj->type == HWLOC_OBJ_NUMANODE) && obj->os_index != child->os_index) { @@ -2131,6 +2194,12 @@ hwloc_level_filter_objects(hwloc_topology_t topology, /* count interesting objects and allocate the new array */ for(i=0, nnew=0; itype_depth[l] = HWLOC_TYPE_DEPTH_UNKNOWN; /* initialize root type depth */ topology->type_depth[topology->levels[0][0]->type] = 0; @@ -2207,17 +2276,14 @@ hwloc_connect_levels(hwloc_topology_t topology) topology->bridge_level = NULL; topology->bridge_nbobjects = 0; topology->first_bridge = topology->last_bridge = NULL; - topology->type_depth[HWLOC_OBJ_BRIDGE] = HWLOC_TYPE_DEPTH_BRIDGE; free(topology->pcidev_level); topology->pcidev_level = NULL; topology->pcidev_nbobjects = 0; topology->first_pcidev = topology->last_pcidev = NULL; - topology->type_depth[HWLOC_OBJ_PCI_DEVICE] = HWLOC_TYPE_DEPTH_PCI_DEVICE; free(topology->osdev_level); topology->osdev_level = NULL; topology->osdev_nbobjects = 0; topology->first_osdev = topology->last_osdev = NULL; - topology->type_depth[HWLOC_OBJ_OS_DEVICE] = HWLOC_TYPE_DEPTH_OS_DEVICE; /* Start with children of the whole system. */ n_objs = topology->levels[0][0]->arity; @@ -2345,13 +2411,20 @@ hwloc_connect_levels(hwloc_topology_t topology) void hwloc_alloc_obj_cpusets(hwloc_obj_t obj) { - obj->cpuset = hwloc_bitmap_alloc_full(); - obj->complete_cpuset = hwloc_bitmap_alloc(); - obj->online_cpuset = hwloc_bitmap_alloc_full(); - obj->allowed_cpuset = hwloc_bitmap_alloc_full(); - obj->nodeset = hwloc_bitmap_alloc(); - obj->complete_nodeset = hwloc_bitmap_alloc(); - obj->allowed_nodeset = hwloc_bitmap_alloc_full(); + if (!obj->cpuset) + obj->cpuset = hwloc_bitmap_alloc_full(); + if (!obj->complete_cpuset) + obj->complete_cpuset = hwloc_bitmap_alloc(); + if (!obj->online_cpuset) + obj->online_cpuset = hwloc_bitmap_alloc_full(); + if (!obj->allowed_cpuset) + obj->allowed_cpuset = hwloc_bitmap_alloc_full(); + if (!obj->nodeset) + obj->nodeset = hwloc_bitmap_alloc(); + if (!obj->complete_nodeset) + obj->complete_nodeset = hwloc_bitmap_alloc(); + if (!obj->allowed_nodeset) + obj->allowed_nodeset = hwloc_bitmap_alloc_full(); } /* Main discovery loop */ @@ -2597,6 +2670,7 @@ void hwloc_topology_setup_defaults(struct hwloc_topology *topology) { struct hwloc_obj *root_obj; + unsigned l; /* reset support */ memset(&topology->binding_hooks, 0, sizeof(topology->binding_hooks)); @@ -2617,6 +2691,12 @@ hwloc_topology_setup_defaults(struct hwloc_topology *topology) topology->first_bridge = topology->last_bridge = NULL; topology->first_pcidev = topology->last_pcidev = NULL; topology->first_osdev = topology->last_osdev = NULL; + /* sane values to type_depth */ + for (l = HWLOC_OBJ_SYSTEM; l < HWLOC_OBJ_MISC; l++) + topology->type_depth[l] = HWLOC_TYPE_DEPTH_UNKNOWN; + topology->type_depth[HWLOC_OBJ_BRIDGE] = HWLOC_TYPE_DEPTH_BRIDGE; + topology->type_depth[HWLOC_OBJ_PCI_DEVICE] = HWLOC_TYPE_DEPTH_PCI_DEVICE; + topology->type_depth[HWLOC_OBJ_OS_DEVICE] = HWLOC_TYPE_DEPTH_OS_DEVICE; /* Create the actual machine object, but don't touch its attributes yet * since the OS backend may still change the object into something else @@ -3048,7 +3128,6 @@ hwloc__check_children(struct hwloc_obj *parent) assert(prev_firstchild < firstchild); prev_firstchild = firstchild; } - (void)prev_firstchild; // silence compiler warning } /* checks for all children */ diff --git a/opal/mca/hwloc/hwloc1111/hwloc/src/traversal.c b/opal/mca/hwloc/hwloc1112/hwloc/src/traversal.c similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/src/traversal.c rename to opal/mca/hwloc/hwloc1112/hwloc/src/traversal.c diff --git a/opal/mca/hwloc/hwloc1111/hwloc/tests/README.txt b/opal/mca/hwloc/hwloc1112/hwloc/tests/README.txt similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/tests/README.txt rename to opal/mca/hwloc/hwloc1112/hwloc/tests/README.txt diff --git a/opal/mca/hwloc/hwloc1111/hwloc/utils/README.txt b/opal/mca/hwloc/hwloc1112/hwloc/utils/README.txt similarity index 100% rename from opal/mca/hwloc/hwloc1111/hwloc/utils/README.txt rename to opal/mca/hwloc/hwloc1112/hwloc/utils/README.txt diff --git a/opal/mca/hwloc/hwloc1111/hwloc1111.h b/opal/mca/hwloc/hwloc1112/hwloc1112.h similarity index 83% rename from opal/mca/hwloc/hwloc1111/hwloc1111.h rename to opal/mca/hwloc/hwloc1112/hwloc1112.h index 7b5c2f4124..8b20bf623b 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc1111.h +++ b/opal/mca/hwloc/hwloc1112/hwloc1112.h @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2016 Los Alamos National Security, LLC. All rights + * reserved. * * $COPYRIGHT$ * @@ -13,8 +16,8 @@ * this header represents the public interface to this static component. */ -#ifndef MCA_OPAL_HWLOC_HWLOC1111_H -#define MCA_OPAL_HWLOC_HWLOC1111_H +#ifndef MCA_OPAL_HWLOC_HWLOC1112_H +#define MCA_OPAL_HWLOC_HWLOC1112_H BEGIN_C_DECLS @@ -42,4 +45,4 @@ BEGIN_C_DECLS END_C_DECLS -#endif /* MCA_OPAL_HWLOC_HWLOC1111_H */ +#endif /* MCA_OPAL_HWLOC_HWLOC1112_H */ diff --git a/opal/mca/hwloc/hwloc1111/hwloc1111_component.c b/opal/mca/hwloc/hwloc1112/hwloc1112_component.c similarity index 81% rename from opal/mca/hwloc/hwloc1111/hwloc1111_component.c rename to opal/mca/hwloc/hwloc1112/hwloc1112_component.c index f40ff00258..8117766276 100644 --- a/opal/mca/hwloc/hwloc1111/hwloc1111_component.c +++ b/opal/mca/hwloc/hwloc1112/hwloc1112_component.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights * reserved. * * $COPYRIGHT$ @@ -22,20 +22,20 @@ #include "opal/constants.h" #include "opal/mca/hwloc/hwloc.h" -#include "hwloc1111.h" +#include "hwloc1112.h" /* * Public string showing the sysinfo ompi_linux component version number */ -const char *opal_hwloc_hwloc1111_component_version_string = - "OPAL hwloc1111 hwloc MCA component version " OPAL_VERSION; +const char *opal_hwloc_hwloc1112_component_version_string = + "OPAL hwloc1112 hwloc MCA component version " OPAL_VERSION; /* * Instantiate the public struct with all of our public information * and pointers to our public functions in it */ -const opal_hwloc_component_t mca_hwloc_hwloc1111_component = { +const opal_hwloc_component_t mca_hwloc_hwloc1112_component = { /* First, the mca_component_t struct containing meta information about the component itself */ @@ -44,7 +44,7 @@ const opal_hwloc_component_t mca_hwloc_hwloc1111_component = { OPAL_HWLOC_BASE_VERSION_2_0_0, /* Component name and version */ - .mca_component_name = "hwloc1111", + .mca_component_name = "hwloc1112", MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, OPAL_RELEASE_VERSION), }, diff --git a/opal/mca/hwloc/hwloc1111/owner.txt b/opal/mca/hwloc/hwloc1112/owner.txt similarity index 100% rename from opal/mca/hwloc/hwloc1111/owner.txt rename to opal/mca/hwloc/hwloc1112/owner.txt