diff -Nru hwloc-contrib-2.1.0+dfsg/config/hwloc_check_vendor.m4 hwloc-contrib-2.2.0+dfsg/config/hwloc_check_vendor.m4 --- hwloc-contrib-2.1.0+dfsg/config/hwloc_check_vendor.m4 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/config/hwloc_check_vendor.m4 2020-03-30 18:07:31.000000000 +0000 @@ -11,7 +11,7 @@ dnl Copyright © 2004-2005 The Regents of the University of California. dnl All rights reserved. dnl Copyright © 2011 Cisco Systems, Inc. All rights reserved. -dnl Copyright © 2015 Inria. All rights reserved. +dnl Copyright © 2015-2020 Inria. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -244,3 +244,18 @@ $1="$hwloc_check_compiler_vendor_result" unset hwloc_check_compiler_vendor_result ]) + +# _HWLOC_CHECK_GCC_OPTION([option], [variable to append the option to], [action if supported]) +# ---------------------------------------------- +# Run gcc to determine if option is supported. +AC_DEFUN([_HWLOC_CHECK_GCC_OPTION], [ + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="$1" + AC_MSG_CHECKING([if gcc supports $1]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int i;]])], + [AC_MSG_RESULT(yes) + $2="$$2 $1" + $3], + [AC_MSG_RESULT(no)]) + CFLAGS="$tmp_save_CFLAGS" +]) diff -Nru hwloc-contrib-2.1.0+dfsg/config/hwloc_components.m4 hwloc-contrib-2.2.0+dfsg/config/hwloc_components.m4 --- hwloc-contrib-2.1.0+dfsg/config/hwloc_components.m4 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/config/hwloc_components.m4 2020-03-30 18:07:31.000000000 +0000 @@ -1,15 +1,15 @@ -# Copyright © 2012-2018 Inria. All rights reserved. +# Copyright © 2012-2020 Inria. All rights reserved. # See COPYING in top-level directory. # HWLOC_PREPARE_FILTER_COMPONENTS # -# Given a comma-separated list of names, define hwloc__component_maybeplugin=1. +# Given a list of names, define hwloc__component_maybeplugin=1. # -# $1 = command-line given list of components to build as plugins +# $1 = space-separated list of components to build as plugins # AC_DEFUN([HWLOC_PREPARE_FILTER_COMPONENTS], [ - for name in `echo [$1] | sed -e 's/,/ /g'` ; do + for name in [$1] ; do str="hwloc_${name}_component_wantplugin=1" eval $str done @@ -19,7 +19,7 @@ # HWLOC_FILTER_COMPONENTS # # For each component in hwloc_components, -# check if hwloc__component_wantplugin=1 or enable_plugin=yes, +# check if hwloc__component_wantplugin=1, # and check if hwloc__component_maybeplugin=1. # Add to hwloc_[static|plugin]_components accordingly. # And set hwloc__component=[static|plugin] accordingly. @@ -30,7 +30,7 @@ eval $str str="wantplugin=\$hwloc_${name}_component_wantplugin" eval $str - if test x$hwloc_have_plugins = xyes && test x$maybeplugin = x1 && test x$wantplugin = x1 -o x$enable_plugins = xyes; then + if test x$hwloc_have_plugins = xyes -a x$maybeplugin = x1 -a x$wantplugin = x1; then hwloc_plugin_components="$hwloc_plugin_components $name" str="hwloc_${name}_component=plugin" else diff -Nru hwloc-contrib-2.1.0+dfsg/config/hwloc_internal.m4 hwloc-contrib-2.2.0+dfsg/config/hwloc_internal.m4 --- hwloc-contrib-2.1.0+dfsg/config/hwloc_internal.m4 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/config/hwloc_internal.m4 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ dnl -*- Autoconf -*- dnl -dnl Copyright © 2010-2019 Inria. All rights reserved. +dnl Copyright © 2010-2020 Inria. All rights reserved. dnl Copyright © 2009, 2011 Université Bordeaux dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana dnl University Research and Technology @@ -89,6 +89,11 @@ AS_HELP_STRING([--disable-nvml], [Disable the NVML device discovery])) + # 32bits_pci_domain? + AC_ARG_ENABLE([32bits-pci-domain], + AS_HELP_STRING([--enable-32bits-pci-domain], + [Enable 32 bits PCI domains (domains > 16bits are ignored by default). WARNING: This breaks the library ABI, don't enable unless really needed.])) + # GL/Display AC_ARG_ENABLE([gl], AS_HELP_STRING([--disable-gl], @@ -104,6 +109,17 @@ AS_HELP_STRING([--enable-plugins=name,...], [Build the given components as dynamically-loaded plugins])) + # Look for dlopen + # Not --disable-dlopen because $enable_dlopen is already used/set + AC_ARG_ENABLE([plugin-dlopen], + AC_HELP_STRING([--disable-plugin-dlopen], + [Do not use dlopen for loading plugins.])) + # Look for ltdl + # Not --disable-ltdl for consistency wrt dlopen above + AC_ARG_ENABLE([plugin-ltdl], + AC_HELP_STRING([--disable-plugin-ltdl], + [Do not use ltdl for loading plugins.])) + ])dnl #----------------------------------------------------------------------- @@ -155,6 +171,8 @@ AC_MSG_RESULT([$hwloc_generate_doxs]) AS_IF([test "x$hwloc_generate_doxs" = xyes -a "x$HWLOC_DOXYGEN_VERSION" = x1.6.2], [hwloc_generate_doxs="no"; AC_MSG_WARN([doxygen 1.6.2 has broken short name support, disabling])]) + AS_IF([test "x$hwloc_generate_doxs" = xyes -a "x$HWLOC_DOXYGEN_VERSION" = x1.8.16 -a "$HWLOC_top_builddir" = "$HWLOC_top_srcdir"], + [hwloc_generate_doxs="no"; AC_MSG_WARN([doxygen 1.8.16 fails when building inside the source-tree, disabling])]) AC_REQUIRE([AC_PROG_SED]) @@ -191,41 +209,6 @@ [hwloc_install_doxs=no]) AC_MSG_RESULT([$hwloc_install_doxs]) - # For the common developer case, if we're in a developer checkout and - # using the GNU compilers, turn on maximum warnings unless - # specifically disabled by the user. - AC_MSG_CHECKING([whether to enable "picky" compiler mode]) - hwloc_want_picky=0 - AS_IF([test "$hwloc_c_vendor" = "gnu"], - [AS_IF([test -e "$srcdir/.git"], - [hwloc_want_picky=1])]) - if test "$enable_picky" = "yes"; then - if test "$GCC" = "yes"; then - AC_MSG_RESULT([yes]) - hwloc_want_picky=1 - else - AC_MSG_RESULT([no]) - AC_MSG_WARN([Warning: --enable-picky used, but is currently only defined for the GCC compiler set -- automatically disabled]) - hwloc_want_picky=0 - fi - elif test "$enable_picky" = "no"; then - AC_MSG_RESULT([no]) - hwloc_want_picky=0 - else - if test "$hwloc_want_picky" = 1; then - AC_MSG_RESULT([yes (default)]) - else - AC_MSG_RESULT([no (default)]) - fi - fi - if test "$hwloc_want_picky" = 1; then - add="-Wall -Wunused-parameter -Wundef -Wno-long-long -Wsign-compare" - add="$add -Wmissing-prototypes -Wstrict-prototypes" - add="$add -Wcomment -pedantic -Wshadow" - - HWLOC_CFLAGS="$HWLOC_CFLAGS $add" - fi - # Generate some files for the docs AC_CONFIG_FILES( hwloc_config_prefix[doc/Makefile] @@ -465,6 +448,7 @@ hwloc_config_prefix[utils/netloc/infiniband/netloc_ib_gather_raw] hwloc_config_prefix[contrib/hwloc-ps.www/Makefile] hwloc_config_prefix[contrib/systemd/Makefile] + hwloc_config_prefix[contrib/completion/Makefile] hwloc_config_prefix[contrib/misc/Makefile] hwloc_config_prefix[contrib/windows/Makefile] hwloc_config_prefix[contrib/windows/test-windows-version.sh] diff -Nru hwloc-contrib-2.1.0+dfsg/config/hwloc.m4 hwloc-contrib-2.2.0+dfsg/config/hwloc.m4 --- hwloc-contrib-2.1.0+dfsg/config/hwloc.m4 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/config/hwloc.m4 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ dnl -*- Autoconf -*- dnl -dnl Copyright © 2009-2019 Inria. All rights reserved. -dnl Copyright © 2009-2012, 2015-2017 Université Bordeaux +dnl Copyright © 2009-2020 Inria. All rights reserved. +dnl Copyright © 2009-2012, 2015-2017, 2020 Université Bordeaux dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana dnl University Research and Technology dnl Corporation. All rights reserved. @@ -81,7 +81,7 @@ # Get the version of hwloc that we are installing AC_MSG_CHECKING([for hwloc version]) - HWLOC_VERSION="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION`" + HWLOC_VERSION="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION`" if test "$?" != "0"; then AC_MSG_ERROR([Cannot continue]) fi @@ -90,16 +90,16 @@ AC_DEFINE_UNQUOTED([HWLOC_VERSION], ["$HWLOC_VERSION"], [The library version, always available, even in embedded mode, contrary to VERSION]) - HWLOC_VERSION_MAJOR="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --major`" + HWLOC_VERSION_MAJOR="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --major`" AC_DEFINE_UNQUOTED([HWLOC_VERSION_MAJOR], [$HWLOC_VERSION_MAJOR], [The library version major number]) - HWLOC_VERSION_MINOR="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --minor`" + HWLOC_VERSION_MINOR="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --minor`" AC_DEFINE_UNQUOTED([HWLOC_VERSION_MINOR], [$HWLOC_VERSION_MINOR], [The library version minor number]) - HWLOC_VERSION_RELEASE="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release`" + HWLOC_VERSION_RELEASE="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release`" AC_DEFINE_UNQUOTED([HWLOC_VERSION_RELEASE], [$HWLOC_VERSION_RELEASE], [The library version release number]) - HWLOC_VERSION_GREEK="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --greek`" + HWLOC_VERSION_GREEK="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --greek`" AC_DEFINE_UNQUOTED([HWLOC_VERSION_GREEK], ["$HWLOC_VERSION_GREEK"], [The library version optional greek suffix string]) - HWLOC_RELEASE_DATE="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release-date`" + HWLOC_RELEASE_DATE="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release-date`" AC_SUBST(HWLOC_RELEASE_DATE) # Debug mode? @@ -376,6 +376,54 @@ ]) ]) + AS_IF([test "$hwloc_mode" = "standalone"],[ + # For the common developer case, if we're in a developer checkout and + # using the GNU compilers, turn on maximum warnings unless + # specifically disabled by the user. + AC_MSG_CHECKING([whether to enable "picky" compiler mode]) + hwloc_want_picky=0 + AS_IF([test "$hwloc_c_vendor" = "gnu"], + [AS_IF([test -e "$srcdir/.git"], + [hwloc_want_picky=1])]) + if test "$enable_picky" = "yes"; then + if test "$GCC" = "yes"; then + AC_MSG_RESULT([yes]) + hwloc_want_picky=1 + else + AC_MSG_RESULT([no]) + AC_MSG_WARN([Warning: --enable-picky used, but is currently only defined for the GCC compiler set -- automatically disabled]) + hwloc_want_picky=0 + fi + elif test "$enable_picky" = "no"; then + AC_MSG_RESULT([no]) + hwloc_want_picky=0 + else + if test "$hwloc_want_picky" = 1; then + AC_MSG_RESULT([yes (default)]) + else + AC_MSG_RESULT([no (default)]) + fi + fi + if test "$hwloc_want_picky" = 1; then + add="-Wall -Wextra -Wunused-parameter -Wundef -Wno-long-long -Wsign-compare" + add="$add -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes" + add="$add -Wcomment -pedantic -Wshadow -Wwrite-strings -Wnested-externs" + add="$add -Wpointer-arith -Wbad-function-cast -Wold-style-definition" + add="$add -Werror-implicit-function-declaration" + + _HWLOC_CHECK_GCC_OPTION([-Wdiscarded-qualifiers], [add]) + _HWLOC_CHECK_GCC_OPTION([-Wvariadic-macros], [add]) + _HWLOC_CHECK_GCC_OPTION([-Wtype-limits], [add]) + _HWLOC_CHECK_GCC_OPTION([-Wstack-usage=262144], [add]) + + # -Wextra enables some -Wfoo that we want to disable it at some place + _HWLOC_CHECK_GCC_OPTION([-Wmissing-field-initializers], [add], [AC_DEFINE(HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS, 1, [Define to 1 if gcc -Wmissing-field-initializers is supported and enabled])]) + _HWLOC_CHECK_GCC_OPTION([-Wcast-function-type], [add], [AC_DEFINE(HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE, 1, [Define to 1 if gcc -Wcast-function-type is supported and enabled])]) + + HWLOC_CFLAGS="$HWLOC_CFLAGS $add" + fi + ]) + # # Now detect support # @@ -385,6 +433,13 @@ AC_CHECK_HEADERS([strings.h]) AC_CHECK_HEADERS([ctype.h]) + if test x$hwloc_freebsd = xyes; then + + AC_CHECK_HEADERS([sys/domainset.h]) + + fi + + AC_CHECK_FUNCS([strcasecmp], [ _HWLOC_CHECK_DECL([strcasecmp], [ AC_DEFINE([HWLOC_HAVE_DECL_STRCASECMP], [1], [Define to 1 if function `strcasecmp' is declared by system headers]) @@ -470,26 +525,12 @@ _SC_PAGE_SIZE, _SC_LARGE_PAGESIZE],,[:],[[#include ]]) - AC_HAVE_HEADERS([mach/mach_host.h]) - AC_HAVE_HEADERS([mach/mach_init.h], [ + AC_HAVE_HEADERS([mach/mach_init.h]) + AC_HAVE_HEADERS([mach_init.h]) + AC_HAVE_HEADERS([mach/mach_host.h], [ AC_CHECK_FUNCS([host_info]) ]) - AC_CHECK_HEADERS([sys/param.h]) - AC_CHECK_HEADERS([sys/sysctl.h], [ - AC_CHECK_DECLS([CTL_HW, HW_NCPU],,,[[ - #if HAVE_SYS_PARAM_H - #include - #endif - #include - ]]) - ],,[ - AC_INCLUDES_DEFAULT - #if HAVE_SYS_PARAM_H - #include - #endif - ]) - AC_CHECK_DECLS([strtoull], [], [AC_CHECK_FUNCS([strtoull])], [AC_INCLUDES_DEFAULT]) # Needed for Windows in private/misc.h @@ -530,6 +571,23 @@ fi if test "x$hwloc_linux" != "xyes" ; then + # Don't look for sys/sysctl.h on Linux because it's deprecated and + # generates a warning in GCC10. Also it's unneeded. + AC_CHECK_HEADERS([sys/param.h]) + AC_CHECK_HEADERS([sys/sysctl.h], [ + AC_CHECK_DECLS([CTL_HW, HW_NCPU, HW_REALMEM64, HW_MEMSIZE64, HW_PHYSMEM64, HW_USERMEM64, HW_REALMEM, HW_MEMSIZE, HW_PHYSMEM, HW_USERMEM],,,[[ + #if HAVE_SYS_PARAM_H + #include + #endif + #include + ]]) + ],,[ + AC_INCLUDES_DEFAULT + #if HAVE_SYS_PARAM_H + #include + #endif + ]) + # Don't detect sysctl* on Linux because its sysctl() syscall is # long deprecated and unneeded. Some libc still expose the symbol # and raise a big warning at link time. @@ -789,6 +847,11 @@ ]) fi + AS_IF([test "x$enable_32bits_pci_domain" = "xyes"], [ + AC_DEFINE([HWLOC_HAVE_32BITS_PCI_DOMAIN], 1, + [Define to 1 if --enable-32bits-pci-domain is called.]) + ]) + # PCI support via libpciaccess. NOTE: we do not support # libpci/pciutils because that library is GPL and is incompatible # with our BSD license. @@ -1112,34 +1175,74 @@ # Plugin support AC_MSG_CHECKING([if plugin support is enabled]) - # Plugins (even core support) are totally disabled by default - AS_IF([test "x$enable_plugins" = "x"], [enable_plugins=no]) - AS_IF([test "x$enable_plugins" != "xno"], [hwloc_have_plugins=yes], [hwloc_have_plugins=no]) - AC_MSG_RESULT([$hwloc_have_plugins]) - AS_IF([test "x$hwloc_have_plugins" = "xyes"], - [AC_DEFINE([HWLOC_HAVE_PLUGINS], 1, [Define to 1 if the hwloc library should support dynamically-loaded plugins])]) - - # Some sanity checks about plugins - # libltdl doesn't work on AIX as of 2.4.2 - AS_IF([test "x$enable_plugins" = "xyes" -a "x$hwloc_aix" = "xyes"], - [AC_MSG_WARN([libltdl does not work on AIX, plugins support cannot be enabled.]) - AC_MSG_ERROR([Cannot continue])]) - # posix linkers don't work well with plugins and windows dll constraints - AS_IF([test "x$enable_plugins" = "xyes" -a "x$hwloc_windows" = "xyes"], - [AC_MSG_WARN([Plugins not supported on non-native Windows build, plugins support cannot be enabled.]) - AC_MSG_ERROR([Cannot continue])]) + # Plugins (even core support) are totally disabled by default. + # Pass --enable-plugins=foo (with "foo" NOT an existing component) to enable plugins but build none of them. + if test "x$enable_plugins" = xyes; then + hwloc_have_plugins=yes + requested_plugins="$hwloc_components" + else if test "x$enable_plugins" != xno -a "x$enable_plugins" != x; then + hwloc_have_plugins=yes + requested_plugins=`echo $enable_plugins | sed -e 's/,/ /g'` + else + hwloc_have_plugins=no + fi fi + AC_MSG_RESULT($hwloc_have_plugins) - # If we want plugins, look for ltdl.h and libltdl if test "x$hwloc_have_plugins" = xyes; then - AC_CHECK_HEADER([ltdl.h], [], - [AC_MSG_WARN([Plugin support requested, but could not find ltdl.h]) - AC_MSG_ERROR([Cannot continue])]) - AC_CHECK_LIB([ltdl], [lt_dlopenext], - [HWLOC_LIBS="$HWLOC_LIBS -lltdl"], - [AC_MSG_WARN([Plugin support requested, but could not find libltdl]) - AC_MSG_ERROR([Cannot continue])]) - # Add libltdl static-build dependencies to hwloc.pc - HWLOC_CHECK_LTDL_DEPS + # dlopen and ltdl (at least 2.4.2) doesn't work on AIX + # posix linkers don't work well with plugins and windows dll constraints + if test "x$enable_plugin_dlopen" = x; then + if test "x$hwloc_aix" = "xyes"; then + AC_MSG_WARN([dlopen does not work on AIX, disabled by default.]) + enable_plugin_dlopen=no + else if test "x$hwloc_windows" = "xyes"; then + AC_MSG_WARN([dlopen not supported on non-native Windows build, disabled by default.]) + enable_plugin_dlopen=no + fi fi + fi + if test "x$enable_plugin_ltdl" = x; then + if test "x$hwloc_aix" = "xyes"; then + AC_MSG_WARN([ltdl does not work on AIX, disabled by default.]) + enable_plugin_dlopen=no + else if test "x$hwloc_windows" = "xyes"; then + AC_MSG_WARN([ltdl not supported on non-native Windows build, disabled by default.]) + enable_plugin_dlopen=no + fi fi + fi + + # Look for dlopen + if test "x$enable_plugin_dlopen" != xno; then + HWLOC_CHECK_DLOPEN([hwloc_dlopen_ready], [hwloc_dlopen_libs]) + fi + # Look for ltdl + if test "x$enable_plugin_ltdl" != xno; then + HWLOC_CHECK_LTDL([hwloc_ltdl_ready], [hwloc_ltdl_libs]) + fi + + # Now use dlopen by default, or ltdl, or just fail to enable plugins + AC_MSG_CHECKING([which library to use for loading plugins]) + if test "x$hwloc_dlopen_ready" = xyes; then + AC_MSG_RESULT([dlopen]) + hwloc_plugins_load=dlopen + # Now enable dlopen libs + HWLOC_DL_LIBS="$hwloc_dlopen_libs" + AC_SUBST(HWLOC_DL_LIBS) + else if test x$hwloc_ltdl_ready = xyes; then + AC_MSG_RESULT([ltdl]) + hwloc_plugins_load=ltdl + # Now enable ltdl libs + AC_DEFINE([HWLOC_HAVE_LTDL], 1, [Define to 1 if the hwloc library should use ltdl for loading plugins]) + HWLOC_LTDL_LIBS="$hwloc_ltdl_libs" + AC_SUBST(HWLOC_LTDL_LIBS) + # Add ltdl static-build dependencies to hwloc.pc + HWLOC_CHECK_LTDL_DEPS + else + AC_MSG_RESULT([none]) + AC_MSG_WARN([Plugin support requested, but could not enable dlopen or ltdl]) + AC_MSG_ERROR([Cannot continue]) + fi fi + + AC_DEFINE([HWLOC_HAVE_PLUGINS], 1, [Define to 1 if the hwloc library should support dynamically-loaded plugins]) fi AC_ARG_WITH([hwloc-plugins-path], @@ -1157,14 +1260,13 @@ hwloc_static_components_file=${hwloc_static_components_dir}/static-components.h rm -f ${hwloc_static_components_file} - # Make $enable_plugins easier to use (it contains either "yes" (all) or a list of ) - HWLOC_PREPARE_FILTER_COMPONENTS([$enable_plugins]) + HWLOC_PREPARE_FILTER_COMPONENTS([$requested_plugins]) # Now we have some hwloc__component_wantplugin=1 # See which core components want plugin and support it HWLOC_FILTER_COMPONENTS # Now we have some hwloc__component=plugin/static - # and hwloc_static/plugin_components + # and hwloc_static/plugin_components=list (space separated) AC_MSG_CHECKING([components to build statically]) AC_MSG_RESULT($hwloc_static_components) HWLOC_LIST_STATIC_COMPONENTS([$hwloc_static_components_file], [$hwloc_static_components]) @@ -1307,6 +1409,8 @@ 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"]) + AM_CONDITIONAL([HWLOC_HAVE_32BITS_PCI_DOMAIN], [test "x$enable_32bits_pci_domain" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_PLUGINS], [test "x$hwloc_have_plugins" = "xyes"]) AM_CONDITIONAL([HWLOC_PCI_BUILD_STATIC], [test "x$hwloc_pci_component" = "xstatic"]) AM_CONDITIONAL([HWLOC_OPENCL_BUILD_STATIC], [test "x$hwloc_opencl_component" = "xstatic"]) @@ -1361,6 +1465,49 @@ ]) #----------------------------------------------------------------------- + +dnl HWLOC_CHECK_DLOPEN +dnl +dnl set $1 to yes or not +dnl set $2 to -ldl or so +AC_DEFUN([HWLOC_CHECK_DLOPEN], [ + [$1]=no + AC_MSG_CHECKING([for dlopen]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #include + void *handle; + ]], [[ + handle = dlopen(NULL, RTLD_NOW|RTLD_LOCAL); + ]])], + [AC_MSG_RESULT([yes]) + [$1]=yes], + [AC_MSG_RESULT([no]) + AC_CHECK_HEADER([dlfcn.h], + [AC_CHECK_LIB([dl], [dlopen], + [[$1]=yes + [$2]=-ldl]) + ]) + ]) +]) + +#----------------------------------------------------------------------- + +dnl HWLOC_CHECK_LTDL +dnl +dnl set $1 to yes or not +dnl set $2 to -lltdl or so +AC_DEFUN([HWLOC_CHECK_LTDL], [ + [$1]=no + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_LIB([ltdl], [lt_dlopenext], + [[$1]=yes + [$2]=-lltdl]) + ]) +]) + +#----------------------------------------------------------------------- dnl HWLOC_CHECK_LTDL_DEPS dnl diff -Nru hwloc-contrib-2.1.0+dfsg/configure hwloc-contrib-2.2.0+dfsg/configure --- hwloc-contrib-2.1.0+dfsg/configure 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/configure 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for hwloc 2.1.0. +# Generated by GNU Autoconf 2.69 for hwloc 2.2.0. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='hwloc' PACKAGE_TARNAME='hwloc' -PACKAGE_VERSION='2.1.0' -PACKAGE_STRING='hwloc 2.1.0' +PACKAGE_VERSION='2.2.0' +PACKAGE_STRING='hwloc 2.2.0' PACKAGE_BUGREPORT='http://github.com/open-mpi/hwloc/issues' PACKAGE_URL='' @@ -659,6 +659,8 @@ HWLOC_PCI_BUILD_STATIC_TRUE HWLOC_HAVE_PLUGINS_FALSE HWLOC_HAVE_PLUGINS_TRUE +HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE +HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE HWLOC_HAVE_X86_CPUID_FALSE HWLOC_HAVE_X86_CPUID_TRUE HWLOC_HAVE_X86_64_FALSE @@ -780,6 +782,8 @@ HWLOC_REQUIRES HWLOC_PLUGINS_DIR HWLOC_PLUGINS_PATH +HWLOC_LTDL_LIBS +HWLOC_DL_LIBS HWLOC_HAVE_LIBXML2 HWLOC_LIBXML2_LIBS HWLOC_LIBXML2_CFLAGS @@ -961,9 +965,12 @@ enable_opencl enable_cuda enable_nvml +enable_32bits_pci_domain enable_gl enable_libudev enable_plugins +enable_plugin_dlopen +enable_plugin_ltdl enable_visibility with_x with_hwloc_plugins_path @@ -1544,7 +1551,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures hwloc 2.1.0 to adapt to many kinds of systems. +\`configure' configures hwloc 2.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1619,7 +1626,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of hwloc 2.1.0:";; + short | recursive ) echo "Configuration of hwloc 2.2.0:";; esac cat <<\_ACEOF @@ -1664,11 +1671,17 @@ --disable-opencl Disable the OpenCL device discovery --disable-cuda Disable the CUDA device discovery using libcudart --disable-nvml Disable the NVML device discovery + --enable-32bits-pci-domain + Enable 32 bits PCI domains (domains > 16bits are + ignored by default). WARNING: This breaks the + library ABI, don't enable unless really needed. --disable-gl Disable the GL display device discovery --disable-libudev Disable the Linux libudev --enable-plugins=name,... Build the given components as dynamically-loaded plugins + --disable-plugin-dlopen Do not use dlopen for loading plugins. + --disable-plugin-ltdl Do not use ltdl for loading plugins. --enable-visibility enable visibility feature of certain compilers/linkers (default: enabled on platforms that support it) @@ -1820,7 +1833,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -hwloc configure 2.1.0 +hwloc configure 2.2.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2593,7 +2606,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by hwloc $as_me 2.1.0, which was +It was created by hwloc $as_me 2.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3582,7 +3595,7 @@ # Define the identity of the package. PACKAGE='hwloc' - VERSION='2.1.0' + VERSION='2.2.0' cat >>confdefs.h <<_ACEOF @@ -18141,6 +18154,13 @@ fi + # 32bits_pci_domain? + # Check whether --enable-32bits-pci-domain was given. +if test "${enable_32bits_pci_domain+set}" = set; then : + enableval=$enable_32bits_pci_domain; +fi + + # GL/Display # Check whether --enable-gl was given. if test "${enable_gl+set}" = set; then : @@ -18162,6 +18182,21 @@ fi + # Look for dlopen + # Not --disable-dlopen because $enable_dlopen is already used/set + # Check whether --enable-plugin-dlopen was given. +if test "${enable_plugin_dlopen+set}" = set; then : + enableval=$enable_plugin_dlopen; +fi + + # Look for ltdl + # Not --disable-ltdl for consistency wrt dlopen above + # Check whether --enable-plugin-ltdl was given. +if test "${enable_plugin_ltdl+set}" = set; then : + enableval=$enable_plugin_ltdl; +fi + + # If debug mode, add -g @@ -18569,7 +18604,7 @@ # Get the version of hwloc that we are installing { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hwloc version" >&5 $as_echo_n "checking for hwloc version... " >&6; } - HWLOC_VERSION="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION`" + HWLOC_VERSION="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION`" if test "$?" != "0"; then as_fn_error $? "Cannot continue" "$LINENO" 5 fi @@ -18582,32 +18617,32 @@ _ACEOF - HWLOC_VERSION_MAJOR="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --major`" + HWLOC_VERSION_MAJOR="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --major`" cat >>confdefs.h <<_ACEOF #define HWLOC_VERSION_MAJOR $HWLOC_VERSION_MAJOR _ACEOF - HWLOC_VERSION_MINOR="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --minor`" + HWLOC_VERSION_MINOR="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --minor`" cat >>confdefs.h <<_ACEOF #define HWLOC_VERSION_MINOR $HWLOC_VERSION_MINOR _ACEOF - HWLOC_VERSION_RELEASE="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release`" + HWLOC_VERSION_RELEASE="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release`" cat >>confdefs.h <<_ACEOF #define HWLOC_VERSION_RELEASE $HWLOC_VERSION_RELEASE _ACEOF - HWLOC_VERSION_GREEK="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --greek`" + HWLOC_VERSION_GREEK="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --greek`" cat >>confdefs.h <<_ACEOF #define HWLOC_VERSION_GREEK "$HWLOC_VERSION_GREEK" _ACEOF - HWLOC_RELEASE_DATE="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release-date`" + HWLOC_RELEASE_DATE="`sh $HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release-date`" # Debug mode? @@ -22473,6 +22508,231 @@ fi + if test "$hwloc_mode" = "standalone"; then : + + # For the common developer case, if we're in a developer checkout and + # using the GNU compilers, turn on maximum warnings unless + # specifically disabled by the user. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable \"picky\" compiler mode" >&5 +$as_echo_n "checking whether to enable \"picky\" compiler mode... " >&6; } + hwloc_want_picky=0 + if test "$hwloc_c_vendor" = "gnu"; then : + if test -e "$srcdir/.git"; then : + hwloc_want_picky=1 +fi +fi + if test "$enable_picky" = "yes"; then + if test "$GCC" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + hwloc_want_picky=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Warning: --enable-picky used, but is currently only defined for the GCC compiler set -- automatically disabled" >&5 +$as_echo "$as_me: WARNING: Warning: --enable-picky used, but is currently only defined for the GCC compiler set -- automatically disabled" >&2;} + hwloc_want_picky=0 + fi + elif test "$enable_picky" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + hwloc_want_picky=0 + else + if test "$hwloc_want_picky" = 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 +$as_echo "yes (default)" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 +$as_echo "no (default)" >&6; } + fi + fi + if test "$hwloc_want_picky" = 1; then + add="-Wall -Wextra -Wunused-parameter -Wundef -Wno-long-long -Wsign-compare" + add="$add -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes" + add="$add -Wcomment -pedantic -Wshadow -Wwrite-strings -Wnested-externs" + add="$add -Wpointer-arith -Wbad-function-cast -Wold-style-definition" + add="$add -Werror-implicit-function-declaration" + + + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="-Wdiscarded-qualifiers" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wdiscarded-qualifiers" >&5 +$as_echo_n "checking if gcc supports -Wdiscarded-qualifiers... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + add="$add -Wdiscarded-qualifiers" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$tmp_save_CFLAGS" + + + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="-Wvariadic-macros" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wvariadic-macros" >&5 +$as_echo_n "checking if gcc supports -Wvariadic-macros... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + add="$add -Wvariadic-macros" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$tmp_save_CFLAGS" + + + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="-Wtype-limits" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wtype-limits" >&5 +$as_echo_n "checking if gcc supports -Wtype-limits... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + add="$add -Wtype-limits" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$tmp_save_CFLAGS" + + + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="-Wstack-usage=262144" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wstack-usage=262144" >&5 +$as_echo_n "checking if gcc supports -Wstack-usage=262144... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + add="$add -Wstack-usage=262144" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$tmp_save_CFLAGS" + + + # -Wextra enables some -Wfoo that we want to disable it at some place + + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="-Wmissing-field-initializers" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wmissing-field-initializers" >&5 +$as_echo_n "checking if gcc supports -Wmissing-field-initializers... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + add="$add -Wmissing-field-initializers" + +$as_echo "#define HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$tmp_save_CFLAGS" + + + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="-Wcast-function-type" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wcast-function-type" >&5 +$as_echo_n "checking if gcc supports -Wcast-function-type... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + add="$add -Wcast-function-type" + +$as_echo "#define HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$tmp_save_CFLAGS" + + + HWLOC_CFLAGS="$HWLOC_CFLAGS $add" + fi + +fi + # # Now detect support # @@ -22526,6 +22786,24 @@ done + if test x$hwloc_freebsd = xyes; then + + for ac_header in sys/domainset.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/domainset.h" "ac_cv_header_sys_domainset_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_domainset_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_DOMAINSET_H 1 +_ACEOF + +fi + +done + + + fi + + for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" @@ -23327,18 +23605,6 @@ fi - for ac_header in mach/mach_host.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "mach/mach_host.h" "ac_cv_header_mach_mach_host_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_mach_host_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MACH_MACH_HOST_H 1 -_ACEOF - -fi - -done - for ac_header in mach/mach_init.h do : ac_fn_c_check_header_mongrel "$LINENO" "mach/mach_init.h" "ac_cv_header_mach_mach_init_h" "$ac_includes_default" @@ -23347,81 +23613,40 @@ #define HAVE_MACH_MACH_INIT_H 1 _ACEOF - for ac_func in host_info -do : - ac_fn_c_check_func "$LINENO" "host_info" "ac_cv_func_host_info" -if test "x$ac_cv_func_host_info" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_HOST_INFO 1 -_ACEOF - -fi -done - - fi done - - for ac_header in sys/param.h + for ac_header in mach_init.h do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_param_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "mach_init.h" "ac_cv_header_mach_init_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_init_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_PARAM_H 1 +#define HAVE_MACH_INIT_H 1 _ACEOF fi done - for ac_header in sys/sysctl.h + for ac_header in mach/mach_host.h do : - ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " - $ac_includes_default - #if HAVE_SYS_PARAM_H - #include - #endif - -" -if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "mach/mach_host.h" "ac_cv_header_mach_mach_host_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_mach_host_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SYSCTL_H 1 +#define HAVE_MACH_MACH_HOST_H 1 _ACEOF - ac_fn_c_check_decl "$LINENO" "CTL_HW" "ac_cv_have_decl_CTL_HW" " - #if HAVE_SYS_PARAM_H - #include - #endif - #include - -" -if test "x$ac_cv_have_decl_CTL_HW" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_HW $ac_have_decl + for ac_func in host_info +do : + ac_fn_c_check_func "$LINENO" "host_info" "ac_cv_func_host_info" +if test "x$ac_cv_func_host_info" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_HOST_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "HW_NCPU" "ac_cv_have_decl_HW_NCPU" " - #if HAVE_SYS_PARAM_H - #include - #endif - #include -" -if test "x$ac_cv_have_decl_HW_NCPU" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_HW_NCPU $ac_have_decl -_ACEOF +done fi @@ -23563,6 +23788,201 @@ fi if test "x$hwloc_linux" != "xyes" ; then + # Don't look for sys/sysctl.h on Linux because it's deprecated and + # generates a warning in GCC10. Also it's unneeded. + for ac_header in sys/param.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_PARAM_H 1 +_ACEOF + +fi + +done + + for ac_header in sys/sysctl.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " + $ac_includes_default + #if HAVE_SYS_PARAM_H + #include + #endif + +" +if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SYSCTL_H 1 +_ACEOF + + ac_fn_c_check_decl "$LINENO" "CTL_HW" "ac_cv_have_decl_CTL_HW" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_CTL_HW" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CTL_HW $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_NCPU" "ac_cv_have_decl_HW_NCPU" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_NCPU" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_NCPU $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_REALMEM64" "ac_cv_have_decl_HW_REALMEM64" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_REALMEM64" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_REALMEM64 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_MEMSIZE64" "ac_cv_have_decl_HW_MEMSIZE64" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_MEMSIZE64" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_MEMSIZE64 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_PHYSMEM64" "ac_cv_have_decl_HW_PHYSMEM64" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_PHYSMEM64" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_PHYSMEM64 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_USERMEM64" "ac_cv_have_decl_HW_USERMEM64" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_USERMEM64" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_USERMEM64 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_REALMEM" "ac_cv_have_decl_HW_REALMEM" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_REALMEM" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_REALMEM $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_MEMSIZE" "ac_cv_have_decl_HW_MEMSIZE" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_MEMSIZE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_MEMSIZE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_PHYSMEM" "ac_cv_have_decl_HW_PHYSMEM" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_PHYSMEM" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_PHYSMEM $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "HW_USERMEM" "ac_cv_have_decl_HW_USERMEM" " + #if HAVE_SYS_PARAM_H + #include + #endif + #include + +" +if test "x$ac_cv_have_decl_HW_USERMEM" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HW_USERMEM $ac_have_decl +_ACEOF + + +fi + +done + + # Don't detect sysctl* on Linux because its sysctl() syscall is # long deprecated and unneeded. Some libc still expose the symbol # and raise a big warning at link time. @@ -24714,6 +25134,14 @@ fi + if test "x$enable_32bits_pci_domain" = "xyes"; then : + + +$as_echo "#define HWLOC_HAVE_32BITS_PCI_DOMAIN 1" >>confdefs.h + + +fi + # PCI support via libpciaccess. NOTE: we do not support # libpci/pciutils because that library is GPL and is incompatible # with our BSD license. @@ -26321,50 +26749,137 @@ # Plugin support { $as_echo "$as_me:${as_lineno-$LINENO}: checking if plugin support is enabled" >&5 $as_echo_n "checking if plugin support is enabled... " >&6; } - # Plugins (even core support) are totally disabled by default - if test "x$enable_plugins" = "x"; then : - enable_plugins=no -fi - if test "x$enable_plugins" != "xno"; then : - hwloc_have_plugins=yes -else - hwloc_have_plugins=no -fi + # Plugins (even core support) are totally disabled by default. + # Pass --enable-plugins=foo (with "foo" NOT an existing component) to enable plugins but build none of them. + if test "x$enable_plugins" = xyes; then + hwloc_have_plugins=yes + requested_plugins="$hwloc_components" + else if test "x$enable_plugins" != xno -a "x$enable_plugins" != x; then + hwloc_have_plugins=yes + requested_plugins=`echo $enable_plugins | sed -e 's/,/ /g'` + else + hwloc_have_plugins=no + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hwloc_have_plugins" >&5 $as_echo "$hwloc_have_plugins" >&6; } - if test "x$hwloc_have_plugins" = "xyes"; then : -$as_echo "#define HWLOC_HAVE_PLUGINS 1" >>confdefs.h + if test "x$hwloc_have_plugins" = xyes; then + # dlopen and ltdl (at least 2.4.2) doesn't work on AIX + # posix linkers don't work well with plugins and windows dll constraints + if test "x$enable_plugin_dlopen" = x; then + if test "x$hwloc_aix" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dlopen does not work on AIX, disabled by default." >&5 +$as_echo "$as_me: WARNING: dlopen does not work on AIX, disabled by default." >&2;} + enable_plugin_dlopen=no + else if test "x$hwloc_windows" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dlopen not supported on non-native Windows build, disabled by default." >&5 +$as_echo "$as_me: WARNING: dlopen not supported on non-native Windows build, disabled by default." >&2;} + enable_plugin_dlopen=no + fi fi + fi + if test "x$enable_plugin_ltdl" = x; then + if test "x$hwloc_aix" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ltdl does not work on AIX, disabled by default." >&5 +$as_echo "$as_me: WARNING: ltdl does not work on AIX, disabled by default." >&2;} + enable_plugin_dlopen=no + else if test "x$hwloc_windows" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ltdl not supported on non-native Windows build, disabled by default." >&5 +$as_echo "$as_me: WARNING: ltdl not supported on non-native Windows build, disabled by default." >&2;} + enable_plugin_dlopen=no + fi fi + fi -fi + # Look for dlopen + if test "x$enable_plugin_dlopen" != xno; then - # Some sanity checks about plugins - # libltdl doesn't work on AIX as of 2.4.2 - if test "x$enable_plugins" = "xyes" -a "x$hwloc_aix" = "xyes"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libltdl does not work on AIX, plugins support cannot be enabled." >&5 -$as_echo "$as_me: WARNING: libltdl does not work on AIX, plugins support cannot be enabled." >&2;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + hwloc_dlopen_ready=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + #include + void *handle; + +int +main () +{ + + handle = dlopen(NULL, RTLD_NOW|RTLD_LOCAL); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + hwloc_dlopen_ready=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no fi - # posix linkers don't work well with plugins and windows dll constraints - if test "x$enable_plugins" = "xyes" -a "x$hwloc_windows" = "xyes"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Plugins not supported on non-native Windows build, plugins support cannot be enabled." >&5 -$as_echo "$as_me: WARNING: Plugins not supported on non-native Windows build, plugins support cannot be enabled." >&2;} - as_fn_error $? "Cannot continue" "$LINENO" 5 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + hwloc_dlopen_ready=yes + hwloc_dlopen_libs=-ldl fi - # If we want plugins, look for ltdl.h and libltdl - if test "x$hwloc_have_plugins" = xyes; then - ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default" -if test "x$ac_cv_header_ltdl_h" = xyes; then : -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Plugin support requested, but could not find ltdl.h" >&5 -$as_echo "$as_me: WARNING: Plugin support requested, but could not find ltdl.h" >&2;} - as_fn_error $? "Cannot continue" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlopenext in -lltdl" >&5 + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + fi + # Look for ltdl + if test "x$enable_plugin_ltdl" != xno; then + + hwloc_ltdl_ready=no + ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default" +if test "x$ac_cv_header_ltdl_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlopenext in -lltdl" >&5 $as_echo_n "checking for lt_dlopenext in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dlopenext+:} false; then : $as_echo_n "(cached) " >&6 @@ -26401,14 +26916,38 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dlopenext" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dlopenext" >&6; } if test "x$ac_cv_lib_ltdl_lt_dlopenext" = xyes; then : - HWLOC_LIBS="$HWLOC_LIBS -lltdl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Plugin support requested, but could not find libltdl" >&5 -$as_echo "$as_me: WARNING: Plugin support requested, but could not find libltdl" >&2;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + hwloc_ltdl_ready=yes + hwloc_ltdl_libs=-lltdl fi - # Add libltdl static-build dependencies to hwloc.pc + +fi + + + + fi + + # Now use dlopen by default, or ltdl, or just fail to enable plugins + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which library to use for loading plugins" >&5 +$as_echo_n "checking which library to use for loading plugins... " >&6; } + if test "x$hwloc_dlopen_ready" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: dlopen" >&5 +$as_echo "dlopen" >&6; } + hwloc_plugins_load=dlopen + # Now enable dlopen libs + HWLOC_DL_LIBS="$hwloc_dlopen_libs" + + else if test x$hwloc_ltdl_ready = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ltdl" >&5 +$as_echo "ltdl" >&6; } + hwloc_plugins_load=ltdl + # Now enable ltdl libs + +$as_echo "#define HWLOC_HAVE_LTDL 1" >>confdefs.h + + HWLOC_LTDL_LIBS="$hwloc_ltdl_libs" + + # Add ltdl static-build dependencies to hwloc.pc # save variables that we'll modify below save_lt_cv_dlopen="$lt_cv_dlopen" @@ -26676,6 +27215,17 @@ lt_cv_dlopen_libs="$save_lt_cv_dlopen_libs" lt_cv_dlopen_self="$save_lt_cv_dlopen_self" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Plugin support requested, but could not enable dlopen or ltdl" >&5 +$as_echo "$as_me: WARNING: Plugin support requested, but could not enable dlopen or ltdl" >&2;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi fi + + +$as_echo "#define HWLOC_HAVE_PLUGINS 1" >>confdefs.h + fi @@ -26696,9 +27246,8 @@ hwloc_static_components_file=${hwloc_static_components_dir}/static-components.h rm -f ${hwloc_static_components_file} - # Make $enable_plugins easier to use (it contains either "yes" (all) or a list of ) - for name in `echo $enable_plugins | sed -e 's/,/ /g'` ; do + for name in $requested_plugins ; do str="hwloc_${name}_component_wantplugin=1" eval $str done @@ -26712,7 +27261,7 @@ eval $str str="wantplugin=\$hwloc_${name}_component_wantplugin" eval $str - if test x$hwloc_have_plugins = xyes && test x$maybeplugin = x1 && test x$wantplugin = x1 -o x$enable_plugins = xyes; then + if test x$hwloc_have_plugins = xyes -a x$maybeplugin = x1 -a x$wantplugin = x1; then hwloc_plugin_components="$hwloc_plugin_components $name" str="hwloc_${name}_component=plugin" else @@ -26723,7 +27272,7 @@ done # Now we have some hwloc__component=plugin/static - # and hwloc_static/plugin_components + # and hwloc_static/plugin_components=list (space separated) { $as_echo "$as_me:${as_lineno-$LINENO}: checking components to build statically" >&5 $as_echo_n "checking components to build statically... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hwloc_static_components" >&5 @@ -27732,6 +28281,10 @@ hwloc_generate_doxs="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen 1.6.2 has broken short name support, disabling" >&5 $as_echo "$as_me: WARNING: doxygen 1.6.2 has broken short name support, disabling" >&2;} fi + if test "x$hwloc_generate_doxs" = xyes -a "x$HWLOC_DOXYGEN_VERSION" = x1.8.16 -a "$HWLOC_top_builddir" = "$HWLOC_top_srcdir"; then : + hwloc_generate_doxs="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen 1.8.16 fails when building inside the source-tree, disabling" >&5 +$as_echo "$as_me: WARNING: doxygen 1.8.16 fails when building inside the source-tree, disabling" >&2;} +fi @@ -27977,50 +28530,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hwloc_install_doxs" >&5 $as_echo "$hwloc_install_doxs" >&6; } - # For the common developer case, if we're in a developer checkout and - # using the GNU compilers, turn on maximum warnings unless - # specifically disabled by the user. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable \"picky\" compiler mode" >&5 -$as_echo_n "checking whether to enable \"picky\" compiler mode... " >&6; } - hwloc_want_picky=0 - if test "$hwloc_c_vendor" = "gnu"; then : - if test -e "$srcdir/.git"; then : - hwloc_want_picky=1 -fi -fi - if test "$enable_picky" = "yes"; then - if test "$GCC" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - hwloc_want_picky=1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Warning: --enable-picky used, but is currently only defined for the GCC compiler set -- automatically disabled" >&5 -$as_echo "$as_me: WARNING: Warning: --enable-picky used, but is currently only defined for the GCC compiler set -- automatically disabled" >&2;} - hwloc_want_picky=0 - fi - elif test "$enable_picky" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - hwloc_want_picky=0 - else - if test "$hwloc_want_picky" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 -$as_echo "yes (default)" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } - fi - fi - if test "$hwloc_want_picky" = 1; then - add="-Wall -Wunused-parameter -Wundef -Wno-long-long -Wsign-compare" - add="$add -Wmissing-prototypes -Wstrict-prototypes" - add="$add -Wcomment -pedantic -Wshadow" - - HWLOC_CFLAGS="$HWLOC_CFLAGS $add" - fi - # Generate some files for the docs ac_config_files="$ac_config_files doc/Makefile doc/examples/Makefile doc/doxygen-config.cfg" @@ -29054,7 +29563,7 @@ # Only generate these files if we're making the tests - ac_config_files="$ac_config_files tests/Makefile tests/hwloc/Makefile tests/hwloc/linux/Makefile tests/hwloc/linux/allowed/Makefile tests/hwloc/linux/gather/Makefile tests/hwloc/x86/Makefile tests/hwloc/x86+linux/Makefile tests/hwloc/xml/Makefile tests/hwloc/ports/Makefile tests/hwloc/rename/Makefile tests/hwloc/linux/allowed/test-topology.sh tests/hwloc/linux/gather/test-gather-topology.sh tests/hwloc/linux/test-topology.sh tests/hwloc/x86/test-topology.sh tests/hwloc/x86+linux/test-topology.sh tests/hwloc/xml/test-topology.sh tests/hwloc/wrapper.sh utils/hwloc/hwloc-compress-dir utils/hwloc/hwloc-gather-topology utils/hwloc/test-hwloc-annotate.sh utils/hwloc/test-hwloc-calc.sh utils/hwloc/test-hwloc-compress-dir.sh utils/hwloc/test-hwloc-diffpatch.sh utils/hwloc/test-hwloc-distrib.sh utils/hwloc/test-hwloc-info.sh utils/hwloc/test-fake-plugin.sh utils/hwloc/test-hwloc-dump-hwdata/Makefile utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh utils/lstopo/test-lstopo.sh utils/lstopo/test-lstopo-shmem.sh utils/netloc/infiniband/netloc_ib_gather_raw contrib/hwloc-ps.www/Makefile contrib/systemd/Makefile contrib/misc/Makefile contrib/windows/Makefile contrib/windows/test-windows-version.sh tests/netloc/Makefile tests/netloc/tests.sh" + ac_config_files="$ac_config_files tests/Makefile tests/hwloc/Makefile tests/hwloc/linux/Makefile tests/hwloc/linux/allowed/Makefile tests/hwloc/linux/gather/Makefile tests/hwloc/x86/Makefile tests/hwloc/x86+linux/Makefile tests/hwloc/xml/Makefile tests/hwloc/ports/Makefile tests/hwloc/rename/Makefile tests/hwloc/linux/allowed/test-topology.sh tests/hwloc/linux/gather/test-gather-topology.sh tests/hwloc/linux/test-topology.sh tests/hwloc/x86/test-topology.sh tests/hwloc/x86+linux/test-topology.sh tests/hwloc/xml/test-topology.sh tests/hwloc/wrapper.sh utils/hwloc/hwloc-compress-dir utils/hwloc/hwloc-gather-topology utils/hwloc/test-hwloc-annotate.sh utils/hwloc/test-hwloc-calc.sh utils/hwloc/test-hwloc-compress-dir.sh utils/hwloc/test-hwloc-diffpatch.sh utils/hwloc/test-hwloc-distrib.sh utils/hwloc/test-hwloc-info.sh utils/hwloc/test-fake-plugin.sh utils/hwloc/test-hwloc-dump-hwdata/Makefile utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh utils/lstopo/test-lstopo.sh utils/lstopo/test-lstopo-shmem.sh utils/netloc/infiniband/netloc_ib_gather_raw contrib/hwloc-ps.www/Makefile contrib/systemd/Makefile contrib/completion/Makefile contrib/misc/Makefile contrib/windows/Makefile contrib/windows/test-windows-version.sh tests/netloc/Makefile tests/netloc/tests.sh" ac_config_commands="$ac_config_commands chmoding-scripts" @@ -29375,6 +29884,15 @@ fi + if test "x$enable_32bits_pci_domain" = "xyes"; then + HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE= + HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE='#' +else + HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE='#' + HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE= +fi + + if test "x$hwloc_have_plugins" = "xyes"; then HWLOC_HAVE_PLUGINS_TRUE= HWLOC_HAVE_PLUGINS_FALSE='#' @@ -29812,6 +30330,10 @@ as_fn_error $? "conditional \"HWLOC_HAVE_X86_CPUID\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE}" && test -z "${HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE}"; then + as_fn_error $? "conditional \"HWLOC_HAVE_32BITS_PCI_DOMAIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HWLOC_HAVE_PLUGINS_TRUE}" && test -z "${HWLOC_HAVE_PLUGINS_FALSE}"; then as_fn_error $? "conditional \"HWLOC_HAVE_PLUGINS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30273,7 +30795,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by hwloc $as_me 2.1.0, which was +This file was extended by hwloc $as_me 2.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30343,7 +30865,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -hwloc config.status 2.1.0 +hwloc config.status 2.2.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -30909,6 +31431,7 @@ "utils/netloc/infiniband/netloc_ib_gather_raw") CONFIG_FILES="$CONFIG_FILES utils/netloc/infiniband/netloc_ib_gather_raw" ;; "contrib/hwloc-ps.www/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/hwloc-ps.www/Makefile" ;; "contrib/systemd/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/systemd/Makefile" ;; + "contrib/completion/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/completion/Makefile" ;; "contrib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/misc/Makefile" ;; "contrib/windows/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/windows/Makefile" ;; "contrib/windows/test-windows-version.sh") CONFIG_FILES="$CONFIG_FILES contrib/windows/test-windows-version.sh" ;; @@ -32502,7 +33025,7 @@ # Plugin support hwloc_plugin_summary=$hwloc_have_plugins -test "x$hwloc_plugin_components" != "x" && hwloc_plugin_summary="yes ("`echo $hwloc_plugin_components`")" # echo removes the starting space +test "x$hwloc_plugin_components" != "x" && hwloc_plugin_summary="$hwloc_plugins_load ("`echo $hwloc_plugin_components`")" # echo removes the starting space cat <,,..." for --index/attrs/text but "," is not a completion word separator - elif [[ "$prev" == "=" && " --horiz --vert --rect --text --no-text --index --no-index --attrs --no-attrs --no-factorize --factorize " =~ " $pprev " ]] ; then + elif [[ $COMP_CWORD -ge 3 && "$prev" == "=" && " --horiz --vert --rect --text --no-text --index --no-index --attrs --no-attrs --no-factorize --factorize " =~ " ${COMP_WORDS[COMP_CWORD-2]} " ]] ; then COMPREPLY=( `compgen -W "${TYPES[*]}" -- "$cur"` ) elif [[ "$cur" == "=" && "--factorize" = "$prev" ]] ; then COMPREPLY=( `compgen -W "${TYPES[*]}"` "" "" ) @@ -125,11 +129,12 @@ fi } complete -F _lstopo lstopo +complete -F _lstopo lstopo-no-graphics complete -F _lstopo hwloc-ls -_hwloc-info(){ - local TYPES=("Machine" "Misc" "Group" "NUMANode" "Package" "L1" "L2" "L3" "L4" "L5" "L1i" "L2i" "L3i" "Core" "Bridge" "PCIDev" "OSDev" "PU") +_hwloc_info(){ + local TYPES=("Machine" "Misc" "Group" "NUMANode" "MemCache" "Package" "Die" "L1" "L2" "L3" "L4" "L5" "L1i" "L2i" "L3i" "Core" "Bridge" "PCIDev" "OSDev" "PU") local FILTERKINDS=("none" "all" "structure" "important") local OPTIONS=(--objects --topology @@ -141,7 +146,7 @@ --children --descendants -n - --restruct + --restrict --filter --no-icaches --no-io @@ -159,14 +164,12 @@ ) local cur=${COMP_WORDS[COMP_CWORD]} local prev=${COMP_WORDS[COMP_CWORD-1]} - local pprev=${COMP_WORDS[COMP_CWORD-2]} - local ppprev=${COMP_WORDS[COMP_CWORD-3]} if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` ) - elif [[ "$pprev" == "--filter" && "$cur" == ":" ]] ; then + elif [[ $COMP_CWORD -ge 3 && "${COMP_WORDS[COMP_CWORD-2]}" == "--filter" && "$cur" == ":" ]] ; then COMPREPLY=( `compgen -W "${FILTERKINDS[*]}"` ) - elif [[ "$ppprev" == "--filter" && "$prev" == ":" ]] ; then + elif [[ $COMP_CWORD -ge 4 && "${COMP_WORDS[COMP_CWORD-3]}" == "--filter" && "$prev" == ":" ]] ; then COMPREPLY=( `compgen -W "${FILTERKINDS[*]}" -- "$cur"` ) else case "$prev" in @@ -191,10 +194,10 @@ esac fi } -complete -F _hwloc-info hwloc-info +complete -F _hwloc_info hwloc-info -_hwloc-bind(){ +_hwloc_bind(){ local OPTIONS=(--cpubind --membind --mempolicy @@ -212,6 +215,7 @@ --disallowed --whole-system --hbm --no-hbm + --no-smt --no-smt=N -f --force -q --quiet -v --verbose @@ -240,11 +244,11 @@ esac fi } -complete -F _hwloc-bind hwloc-bind +complete -F _hwloc_bind hwloc-bind -_hwloc-calc(){ - local TYPES=("Machine" "Misc" "Group" "NUMANode" "Package" "L1" "L2" "L3" "L4" "L5" "L1i" "L2i" "L3i" "Core" "Bridge" "PCIDev" "OSDev" "PU") +_hwloc_calc(){ + local TYPES=("Machine" "Misc" "Group" "NUMANode" "MemCache" "Package" "Die" "L1" "L2" "L3" "L4" "L5" "L1i" "L2i" "L3i" "Core" "Bridge" "PCIDev" "OSDev" "PU") local OPTIONS=(-N --number-of -I --intersect -H --hierarchical @@ -265,6 +269,7 @@ --disallowed --whole-system --input -i --input-format --if + --no-smt --no-smt=N -q --quiet -v --verbose --version @@ -298,10 +303,10 @@ esac fi } -complete -F _hwloc-calc hwloc-calc +complete -F _hwloc_calc hwloc-calc -_hwloc-annotate(){ +_hwloc_annotate(){ local OPTIONS=(--ci --ri --cu --cd -h --help) local cur=${COMP_WORDS[COMP_CWORD]} @@ -310,10 +315,10 @@ fi _filedir xml } -complete -F _hwloc-annotate hwloc-annotate +complete -F _hwloc_annotate hwloc-annotate -_hwloc-diff(){ +_hwloc_diff(){ local OPTIONS=(--refname --version -h --help @@ -332,10 +337,10 @@ fi _filedir xml } -complete -F _hwloc-diff hwloc-diff +complete -F _hwloc_diff hwloc-diff -_hwloc-patch(){ +_hwloc_patch(){ local OPTIONS=(--R --reverse --version -h --help @@ -347,10 +352,10 @@ fi _filedir xml } -complete -F _hwloc-patch hwloc-patch +complete -F _hwloc_patch hwloc-patch -_hwloc-compress-dir(){ +_hwloc_compress_dir(){ local OPTIONS=(-R --reverse -v --verbose -h --help @@ -362,11 +367,11 @@ fi _filedir -d } -complete -F _hwloc-compress-dir hwloc-compress-dir +complete -F _hwloc_compress_dir hwloc-compress-dir -_hwloc-distrib(){ - local TYPES=("Machine" "Misc" "Group" "NUMANode" "Package" "L1" "L2" "L3" "L4" "L5" "L1i" "L2i" "L3i" "Core" "Bridge" "PCIDev" "OSDev" "PU") +_hwloc_distrib(){ + local TYPES=("Machine" "Misc" "Group" "NUMANode" "MemCache" "Package" "Die" "L1" "L2" "L3" "L4" "L5" "L1i" "L2i" "L3i" "Core" "Bridge" "PCIDev" "OSDev" "PU") local OPTIONS=(--ignore --from --to @@ -404,10 +409,10 @@ esac fi } -complete -F _hwloc-distrib hwloc-distrib +complete -F _hwloc_distrib hwloc-distrib -_hwloc-ps(){ +_hwloc_ps(){ local OPTIONS=(-a --pid --name @@ -417,6 +422,7 @@ -t --threads -e --get-last-cpu-location --pid-cmd + --uid --disallowed --whole-system --json-server --json-port @@ -433,6 +439,9 @@ --name) COMPREPLY=( "" "" ) ;; + --uid) + COMPREPLY=( "" "all" "" ) + ;; --pid) COMPREPLY=( "" "" ) ;; @@ -445,10 +454,10 @@ esac fi } -complete -F _hwloc-ps hwloc-ps +complete -F _hwloc_ps hwloc-ps -_hwloc-gather-cpuid(){ +_hwloc_gather_cpuid(){ local OPTIONS=(-c -s --silent -h --help @@ -466,10 +475,10 @@ esac fi } -complete -F _hwloc-gather-cpuid hwloc-gather-cpuid +complete -F _hwloc_gather_cpuid hwloc-gather-cpuid -_hwloc-gather-topology(){ +_hwloc_gather_topology(){ local OPTIONS=(--io --dmi --no-cpuid @@ -482,4 +491,4 @@ COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` ) fi } -complete -F _hwloc-gather-topology hwloc-gather-topology +complete -F _hwloc_gather_topology hwloc-gather-topology diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/completion/Makefile.am hwloc-contrib-2.2.0+dfsg/contrib/completion/Makefile.am --- hwloc-contrib-2.1.0+dfsg/contrib/completion/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/completion/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,8 @@ +# Copyright © 2009-2020 Inria. All rights reserved. +# +# See COPYING in top-level directory. + +# This makefile is only reached when building in standalone mode + +bashcompdir = $(sysconfdir)/bash_completion.d +dist_bashcomp_DATA = hwloc-completion.bash diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/completion/Makefile.in hwloc-contrib-2.2.0+dfsg/contrib/completion/Makefile.in --- hwloc-contrib-2.1.0+dfsg/contrib/completion/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/completion/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,603 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright © 2009-2020 Inria. All rights reserved. +# +# See COPYING in top-level directory. + +# This makefile is only reached when building in standalone mode + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = contrib/completion +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ + $(top_srcdir)/config/hwloc_check_attributes.m4 \ + $(top_srcdir)/config/hwloc_check_vendor.m4 \ + $(top_srcdir)/config/hwloc_check_visibility.m4 \ + $(top_srcdir)/config/hwloc_components.m4 \ + $(top_srcdir)/config/hwloc_internal.m4 \ + $(top_srcdir)/config/hwloc_pkg.m4 \ + $(top_srcdir)/config/libtool.m4 \ + $(top_srcdir)/config/ltoptions.m4 \ + $(top_srcdir)/config/ltsugar.m4 \ + $(top_srcdir)/config/ltversion.m4 \ + $(top_srcdir)/config/lt~obsolete.m4 \ + $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(dist_bashcomp_DATA) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ + $(top_builddir)/include/hwloc/autogen/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(bashcompdir)" +DATA = $(dist_bashcomp_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +BUNZIPP = @BUNZIPP@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CONFIGURE_DEPENDENCIES = @CONFIGURE_DEPENDENCIES@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIFF = @DIFF@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EPSTOPDF = @EPSTOPDF@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FIG2DEV = @FIG2DEV@ +GREP = @GREP@ +GS = @GS@ +HWLOC_CAIRO_CFLAGS = @HWLOC_CAIRO_CFLAGS@ +HWLOC_CAIRO_LIBS = @HWLOC_CAIRO_LIBS@ +HWLOC_CFLAGS = @HWLOC_CFLAGS@ +HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ +HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ +HWLOC_DIFF_U = @HWLOC_DIFF_U@ +HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ +HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ +HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ +HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ +HWLOC_EMBEDDED_LDFLAGS = @HWLOC_EMBEDDED_LDFLAGS@ +HWLOC_EMBEDDED_LIBS = @HWLOC_EMBEDDED_LIBS@ +HWLOC_GL_LIBS = @HWLOC_GL_LIBS@ +HWLOC_HAVE_LIBXML2 = @HWLOC_HAVE_LIBXML2@ +HWLOC_HAVE_NVML = @HWLOC_HAVE_NVML@ +HWLOC_HAVE_OPENCL = @HWLOC_HAVE_OPENCL@ +HWLOC_LDFLAGS = @HWLOC_LDFLAGS@ +HWLOC_LIBS = @HWLOC_LIBS@ +HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ +HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ +HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ +HWLOC_MS_LIB = @HWLOC_MS_LIB@ +HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ +HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ +HWLOC_NUMA_LIBS = @HWLOC_NUMA_LIBS@ +HWLOC_NVML_LIBS = @HWLOC_NVML_LIBS@ +HWLOC_OPENCL_CFLAGS = @HWLOC_OPENCL_CFLAGS@ +HWLOC_OPENCL_LDFLAGS = @HWLOC_OPENCL_LDFLAGS@ +HWLOC_OPENCL_LIBS = @HWLOC_OPENCL_LIBS@ +HWLOC_PCIACCESS_CFLAGS = @HWLOC_PCIACCESS_CFLAGS@ +HWLOC_PCIACCESS_LIBS = @HWLOC_PCIACCESS_LIBS@ +HWLOC_PLUGINS_DIR = @HWLOC_PLUGINS_DIR@ +HWLOC_PLUGINS_PATH = @HWLOC_PLUGINS_PATH@ +HWLOC_PS_LIBS = @HWLOC_PS_LIBS@ +HWLOC_RELEASE_DATE = @HWLOC_RELEASE_DATE@ +HWLOC_REQUIRES = @HWLOC_REQUIRES@ +HWLOC_TERMCAP_LIBS = @HWLOC_TERMCAP_LIBS@ +HWLOC_VERSION = @HWLOC_VERSION@ +HWLOC_W3_GENERATOR = @HWLOC_W3_GENERATOR@ +HWLOC_X11_CPPFLAGS = @HWLOC_X11_CPPFLAGS@ +HWLOC_X11_LIBS = @HWLOC_X11_LIBS@ +HWLOC_XML_LOCALIZED = @HWLOC_XML_LOCALIZED@ +HWLOC_runstatedir = @HWLOC_runstatedir@ +HWLOC_top_builddir = @HWLOC_top_builddir@ +HWLOC_top_srcdir = @HWLOC_top_srcdir@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LYNX = @LYNX@ +MAKEINDEX = @MAKEINDEX@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPI_CPPFLAGS = @MPI_CPPFLAGS@ +MPI_LDADD = @MPI_LDADD@ +NETLOC_CFLAGS = @NETLOC_CFLAGS@ +NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ +NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ +NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ +NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ +NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ +NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ +NETLOC_LIBS = @NETLOC_LIBS@ +NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PDFLATEX = @PDFLATEX@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +W3M = @W3M@ +XMKMF = @XMKMF@ +XMLLINT = @XMLLINT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libhwloc_so_version = @libhwloc_so_version@ +libnetloc_so_version = @libnetloc_so_version@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +xz = @xz@ +bashcompdir = $(sysconfdir)/bash_completion.d +dist_bashcomp_DATA = hwloc-completion.bash +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/completion/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/completion/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_bashcompDATA: $(dist_bashcomp_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bashcompdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bashcompdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bashcompdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(bashcompdir)" || exit $$?; \ + done + +uninstall-dist_bashcompDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(bashcompdir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bashcompdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_bashcompDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_bashcompDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_bashcompDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-dist_bashcompDATA + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/hwloc-ps.www/Makefile.in hwloc-contrib-2.2.0+dfsg/contrib/hwloc-ps.www/Makefile.in --- hwloc-contrib-2.1.0+dfsg/contrib/hwloc-ps.www/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/hwloc-ps.www/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -214,6 +214,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -228,6 +229,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/misc/Makefile.am hwloc-contrib-2.2.0+dfsg/contrib/misc/Makefile.am --- hwloc-contrib-2.1.0+dfsg/contrib/misc/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/misc/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # # See COPYING in top-level directory. @@ -12,4 +12,6 @@ check_PROGRAMS = hwloc-tweak-osindex +dist_doc_DATA = dynamic_SVG_example.html + EXTRA_DIST = hwloc-export-sysfs diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/misc/Makefile.in hwloc-contrib-2.2.0+dfsg/contrib/misc/Makefile.in --- hwloc-contrib-2.1.0+dfsg/contrib/misc/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/misc/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,11 +14,12 @@ @SET_MAKE@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # # See COPYING in top-level directory. # This makefile is only reached when building in standalone mode + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -112,7 +113,8 @@ $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \ + $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ $(top_builddir)/include/hwloc/autogen/config.h @@ -169,6 +171,35 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(docdir)" +DATA = $(dist_doc_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -237,6 +268,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -251,6 +283,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -398,6 +431,7 @@ AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) LDADD = $(HWLOC_top_builddir)/hwloc/libhwloc.la +dist_doc_DATA = dynamic_SVG_example.html EXTRA_DIST = hwloc-export-sysfs all: all-am @@ -489,6 +523,27 @@ clean-libtool: -rm -rf .libs _libs +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -578,8 +633,11 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) check: check-am -all-am: Makefile +all-am: Makefile $(DATA) installdirs: + for dir in "$(DESTDIR)$(docdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -633,7 +691,7 @@ info-am: -install-data-am: +install-data-am: install-dist_docDATA install-dvi: install-dvi-am @@ -679,7 +737,7 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-dist_docDATA .MAKE: check-am install-am install-strip @@ -688,14 +746,15 @@ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + install-data-am install-dist_docDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-dist_docDATA .PRECIOUS: Makefile diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/systemd/Makefile.in hwloc-contrib-2.2.0+dfsg/contrib/systemd/Makefile.in --- hwloc-contrib-2.1.0+dfsg/contrib/systemd/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/systemd/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -217,6 +217,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -231,6 +232,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-annotate.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-annotate.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-annotate.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-annotate.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-bind.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-bind.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-bind.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-bind.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-calc.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-calc.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-calc.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-calc.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc_config.h hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc_config.h --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc_config.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc_config.h 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2018 Inria. All rights reserved. + * Copyright © 2009-2019 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -11,9 +11,9 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.1.0" +#define HWLOC_VERSION "2.2.0" #define HWLOC_VERSION_MAJOR 2 -#define HWLOC_VERSION_MINOR 1 +#define HWLOC_VERSION_MINOR 2 #define HWLOC_VERSION_RELEASE 0 #define HWLOC_VERSION_GREEK "" diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-diff.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-diff.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-diff.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-diff.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-distrib.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-distrib.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-distrib.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-distrib.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-gather-cpuid.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-gather-cpuid.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-gather-cpuid.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-gather-cpuid.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-info.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-info.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-info.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-info.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-patch.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-patch.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/hwloc-patch.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/hwloc-patch.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/libhwloc.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/libhwloc.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/libhwloc.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/libhwloc.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -71,28 +71,28 @@ false true $(ProjectName)-15 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ false true $(ProjectName)-15 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ false true $(ProjectName)-15 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ false true $(ProjectName)-15 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ @@ -200,11 +200,11 @@ - - + + @@ -220,10 +220,13 @@ + + + + - + - diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/libhwloc.vcxproj.filters hwloc-contrib-2.2.0+dfsg/contrib/windows/libhwloc.vcxproj.filters --- hwloc-contrib-2.1.0+dfsg/contrib/windows/libhwloc.vcxproj.filters 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/libhwloc.vcxproj.filters 2020-03-30 18:07:31.000000000 +0000 @@ -27,10 +27,10 @@ Source Files - + Source Files - + Source Files @@ -68,22 +68,40 @@ + + Header Files + + + Header Files + Header Files Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + Header Files - + Header Files Header Files - + Header Files @@ -107,11 +125,5 @@ Header Files - - Header Files - - - Header Files - diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/lstopo-no-graphics.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/lstopo-no-graphics.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/lstopo-no-graphics.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/lstopo-no-graphics.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/lstopo.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/lstopo.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/lstopo.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/lstopo.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/lstopo-win.vcxproj hwloc-contrib-2.2.0+dfsg/contrib/windows/lstopo-win.vcxproj --- hwloc-contrib-2.1.0+dfsg/contrib/windows/lstopo-win.vcxproj 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/lstopo-win.vcxproj 2020-03-30 18:07:31.000000000 +0000 @@ -31,9 +31,12 @@ false true $(ProjectName)-12 - $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ $(SolutionDir)$(Platform)\$(Configuration)\ + + $(Platform)\$(Configuration)\$(ProjectName)\ + Level3 diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/Makefile hwloc-contrib-2.2.0+dfsg/contrib/windows/Makefile --- hwloc-contrib-2.1.0+dfsg/contrib/windows/Makefile 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/Makefile 2020-03-30 18:07:31.000000000 +0000 @@ -345,14 +345,14 @@ $(srcdir)/test-windows-version.sh.in \ $(top_srcdir)/./config/test-driver README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc21/config/missing aclocal-1.16 +ACLOCAL = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc22/config/missing aclocal-1.16 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 0 AR = ar AS = as -AUTOCONF = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc21/config/missing autoconf -AUTOHEADER = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc21/config/missing autoheader -AUTOMAKE = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc21/config/missing automake-1.16 +AUTOCONF = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc22/config/missing autoconf +AUTOHEADER = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc22/config/missing autoheader +AUTOMAKE = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc22/config/missing automake-1.16 AWK = gawk BASH = /bin/bash BUNZIPP = bunzip2 @@ -387,11 +387,12 @@ GS = /usr/bin/gs HWLOC_CAIRO_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 HWLOC_CAIRO_LIBS = -lcairo -HWLOC_CFLAGS = -fvisibility=hidden -I/usr/include/libxml2 -Wall -Wunused-parameter -Wundef -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wstrict-prototypes -Wcomment -pedantic -Wshadow +HWLOC_CFLAGS = -fvisibility=hidden -Wall -Wextra -Wunused-parameter -Wundef -Wno-long-long -Wsign-compare -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcomment -pedantic -Wshadow -Wwrite-strings -Wnested-externs -Wpointer-arith -Wbad-function-cast -Wold-style-definition -Werror-implicit-function-declaration -Wdiscarded-qualifiers -Wvariadic-macros -Wtype-limits -Wstack-usage=262144 -Wmissing-field-initializers -Wcast-function-type -I/usr/include/libxml2 HWLOC_CPPFLAGS = -I$(HWLOC_top_builddir)/include -I$(HWLOC_top_srcdir)/include HWLOC_CUDA_LIBS = HWLOC_DIFF_U = -u HWLOC_DIFF_W = -w +HWLOC_DL_LIBS = HWLOC_EMBEDDED_CFLAGS = HWLOC_EMBEDDED_CPPFLAGS = HWLOC_EMBEDDED_LDADD = @@ -406,6 +407,7 @@ HWLOC_LIBS_PRIVATE = -lpthread HWLOC_LIBXML2_CFLAGS = -I/usr/include/libxml2 HWLOC_LIBXML2_LIBS = -lxml2 +HWLOC_LTDL_LIBS = HWLOC_MS_LIB = HWLOC_MS_LIB_ARCH = X64 HWLOC_NUMA_CFLAGS = @@ -419,17 +421,17 @@ HWLOC_PLUGINS_DIR = $(libdir)/hwloc HWLOC_PLUGINS_PATH = $(libdir)/hwloc HWLOC_PS_LIBS = -HWLOC_RELEASE_DATE = Sep 30, 2019 +HWLOC_RELEASE_DATE = Mar 30, 2020 HWLOC_REQUIRES = libxml-2.0 xext x11 pciaccess HWLOC_TERMCAP_LIBS = -ltermcap -HWLOC_VERSION = 2.1.0 +HWLOC_VERSION = 2.2.0 HWLOC_W3_GENERATOR = /usr/bin/w3m HWLOC_X11_CPPFLAGS = HWLOC_X11_LIBS = -lSM -lICE -lX11 HWLOC_XML_LOCALIZED = 0 HWLOC_runstatedir = ${localstatedir}/run -HWLOC_top_builddir = /home/bgoglin/SOFT/hwloc/tmp/hwloc21 -HWLOC_top_srcdir = /home/bgoglin/SOFT/hwloc/tmp/hwloc21 +HWLOC_top_builddir = /home/bgoglin/SOFT/hwloc/tmp/hwloc22 +HWLOC_top_srcdir = /home/bgoglin/SOFT/hwloc/tmp/hwloc22 INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} @@ -446,7 +448,7 @@ LT_SYS_LIBRARY_PATH = LYNX = /usr/bin/lynx MAKEINDEX = /usr/bin/makeindex -MAKEINFO = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc21/config/missing makeinfo +MAKEINFO = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc22/config/missing makeinfo MANIFEST_TOOL = : MKDIR_P = /bin/mkdir -p MPI_CPPFLAGS = @@ -469,10 +471,10 @@ PACKAGE = hwloc PACKAGE_BUGREPORT = http://github.com/open-mpi/hwloc/issues PACKAGE_NAME = hwloc -PACKAGE_STRING = hwloc 2.1.0 +PACKAGE_STRING = hwloc 2.2.0 PACKAGE_TARNAME = hwloc PACKAGE_URL = -PACKAGE_VERSION = 2.1.0 +PACKAGE_VERSION = 2.2.0 PATH_SEPARATOR = : PDFLATEX = /usr/bin/pdflatex PKG_CONFIG = /usr/bin/pkg-config @@ -481,7 +483,7 @@ SET_MAKE = SHELL = /bin/bash STRIP = strip -VERSION = 2.1.0 +VERSION = 2.2.0 W3M = /usr/bin/w3m XMKMF = XMLLINT = xmllint @@ -489,10 +491,10 @@ X_EXTRA_LIBS = X_LIBS = X_PRE_LIBS = -lSM -lICE -abs_builddir = /home/bgoglin/SOFT/hwloc/tmp/hwloc21/contrib/windows -abs_srcdir = /home/bgoglin/SOFT/hwloc/tmp/hwloc21/contrib/windows -abs_top_builddir = /home/bgoglin/SOFT/hwloc/tmp/hwloc21 -abs_top_srcdir = /home/bgoglin/SOFT/hwloc/tmp/hwloc21 +abs_builddir = /home/bgoglin/SOFT/hwloc/tmp/hwloc22/contrib/windows +abs_srcdir = /home/bgoglin/SOFT/hwloc/tmp/hwloc22/contrib/windows +abs_top_builddir = /home/bgoglin/SOFT/hwloc/tmp/hwloc22 +abs_top_srcdir = /home/bgoglin/SOFT/hwloc/tmp/hwloc22 ac_ct_AR = ar ac_ct_CC = gcc ac_ct_CXX = g++ @@ -522,10 +524,10 @@ htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc21/config/install-sh +install_sh = ${SHELL} /home/bgoglin/SOFT/hwloc/tmp/hwloc22/config/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec -libhwloc_so_version = 16:0:1 +libhwloc_so_version = 17:0:2 libnetloc_so_version = 0:0:0 localedir = ${datarootdir}/locale localstatedir = ${prefix}/var diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/Makefile.in hwloc-contrib-2.2.0+dfsg/contrib/windows/Makefile.in --- hwloc-contrib-2.1.0+dfsg/contrib/windows/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -392,6 +392,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -406,6 +407,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/contrib/windows/test-windows-version.sh hwloc-contrib-2.2.0+dfsg/contrib/windows/test-windows-version.sh --- hwloc-contrib-2.1.0+dfsg/contrib/windows/test-windows-version.sh 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/contrib/windows/test-windows-version.sh 2020-03-30 18:07:31.000000000 +0000 @@ -5,8 +5,8 @@ # Copyright © 2018 Inria. All rights reserved. # See COPYING in top-level directory. # -HWLOC_top_builddir="/home/bgoglin/SOFT/hwloc/tmp/hwloc21" -HWLOC_top_srcdir="/home/bgoglin/SOFT/hwloc/tmp/hwloc21" +HWLOC_top_builddir="/home/bgoglin/SOFT/hwloc/tmp/hwloc22" +HWLOC_top_srcdir="/home/bgoglin/SOFT/hwloc/tmp/hwloc22" windows_config_h="$HWLOC_top_srcdir/contrib/windows/hwloc_config.h" config_h="$HWLOC_top_builddir/include/hwloc/autogen/config.h" vcxproj_file="$HWLOC_top_srcdir/contrib/windows/libhwloc.vcxproj" diff -Nru hwloc-contrib-2.1.0+dfsg/debian/changelog hwloc-contrib-2.2.0+dfsg/debian/changelog --- hwloc-contrib-2.1.0+dfsg/debian/changelog 2020-01-01 14:01:22.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/changelog 2020-03-30 19:39:10.000000000 +0000 @@ -1,3 +1,23 @@ +hwloc-contrib (2.2.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + - patches/hurd-mem: Upstreamed. + * control: Drop mention of mips. Enable libnuma-dev dep on all linux archs. + Enable valgrind dep on x32. + * hwloc-nox.install.*: Add missing /usr/sbin/hwloc-dump-hwdata. + * debian/tests: Instead of tinkering with each script, just make the normal + make check use the system-provided tools. + + -- Samuel Thibault Mon, 30 Mar 2020 21:39:10 +0200 + +hwloc-contrib (2.1.0+dfsg-4) unstable; urgency=medium + + [ Steve Langasek ] + * control: Drop libibverbs-dev build-dependency, only a test needs it, and + buildd box most probably don't have ibv set up anyway (Closes: Bug#950067) + + -- Samuel Thibault Tue, 03 Mar 2020 12:32:28 +0100 + hwloc-contrib (2.1.0+dfsg-3) unstable; urgency=medium [ Debian Janitor ] diff -Nru hwloc-contrib-2.1.0+dfsg/debian/control hwloc-contrib-2.2.0+dfsg/debian/control --- hwloc-contrib-2.1.0+dfsg/debian/control 2020-01-01 14:01:22.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/control 2020-03-30 19:39:10.000000000 +0000 @@ -2,13 +2,12 @@ Priority: optional Maintainer: Samuel Thibault Build-Depends: debhelper-compat (= 12), libltdl-dev, - valgrind [amd64 arm64 armhf i386 mips mipsel powerpc ppc64el s390x mips64el ppc64], + valgrind [amd64 arm64 armhf i386 mips64el mipsel ppc64el s390x powerpc ppc64 x32], libcairo2-dev, libx11-dev, libxml2-dev, libxml2-utils, libncurses5-dev, - libnuma-dev [amd64 arm64 i386 ia64 mips mips64 mipsel mips64el powerpc ppc64el sparc], + libnuma-dev [linux-any], libxnvctrl-dev, nvidia-cuda-dev, libpciaccess-dev, libudev-dev [linux-any], pkg-config, - libibverbs-dev [linux-any], ocl-icd-opencl-dev [!hurd-i386] | opencl-dev, opencl-headers, autoconf (>= 2.63), w3m, dpkg-dev (>= 1.16) diff -Nru hwloc-contrib-2.1.0+dfsg/debian/gbp.conf hwloc-contrib-2.2.0+dfsg/debian/gbp.conf --- hwloc-contrib-2.1.0+dfsg/debian/gbp.conf 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/gbp.conf 2020-03-30 19:39:10.000000000 +0000 @@ -1,6 +1,6 @@ [DEFAULT] -upstream-branch = upstream-2-dfsg +upstream-branch = upstream-dfsg [import-orig] -upstream-branch = upstream-2 +upstream-branch = upstream merge = False diff -Nru hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.amd64 hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.amd64 --- hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.amd64 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.amd64 2020-03-30 19:39:10.000000000 +0000 @@ -0,0 +1,3 @@ +usr/bin/lstopo-no-graphics +usr/bin/hwloc-* +usr/sbin diff -Nru hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.i386 hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.i386 --- hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.i386 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.i386 2020-03-30 19:39:10.000000000 +0000 @@ -0,0 +1,3 @@ +usr/bin/lstopo-no-graphics +usr/bin/hwloc-* +usr/sbin diff -Nru hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.x32 hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.x32 --- hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.x32 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.x32 2020-03-30 19:39:10.000000000 +0000 @@ -0,0 +1,3 @@ +usr/bin/lstopo-no-graphics +usr/bin/hwloc-* +usr/sbin diff -Nru hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.x86 hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.x86 --- hwloc-contrib-2.1.0+dfsg/debian/hwloc-nox.install.x86 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/hwloc-nox.install.x86 2020-03-30 19:39:10.000000000 +0000 @@ -0,0 +1,3 @@ +usr/bin/lstopo-no-graphics +usr/bin/hwloc-* +usr/sbin diff -Nru hwloc-contrib-2.1.0+dfsg/debian/patches/hurd-mem hwloc-contrib-2.2.0+dfsg/debian/patches/hurd-mem --- hwloc-contrib-2.1.0+dfsg/debian/patches/hurd-mem 2020-01-01 14:00:43.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/patches/hurd-mem 1970-01-01 00:00:00.000000000 +0000 @@ -1,397 +0,0 @@ -commit ba162341dfe5d1ac55fc1c0a7facf9f0b4e41939 -Author: Samuel Thibault -Date: Wed Jan 1 13:54:22 2020 +0100 - - mach: Fix header detection on GNU Mach - - Signed-off-by: Samuel Thibault - -commit aaae2bfe787b3733c1fc1b6a5821105c0c8bf7d6 -Author: Samuel Thibault -Date: Wed Jan 1 14:03:26 2020 +0100 - - bsd: Make hwloc_get_sysctl able to return 64bit values - - Signed-off-by: Samuel Thibault - -commit e93445ab422b2640adcdb7c7daff211cb93a5d1f -Author: Samuel Thibault -Date: Wed Jan 1 14:28:13 2020 +0100 - - local_memory: Factorize and generalize memory size retrieval - - Signed-off-by: Samuel Thibault - -Index: hwloc-2.1.0+dfsg/config/hwloc.m4 -=================================================================== ---- hwloc-2.1.0+dfsg.orig/config/hwloc.m4 -+++ hwloc-2.1.0+dfsg/config/hwloc.m4 -@@ -1,7 +1,7 @@ - dnl -*- Autoconf -*- - dnl - dnl Copyright © 2009-2019 Inria. All rights reserved. --dnl Copyright © 2009-2012, 2015-2017 Université Bordeaux -+dnl Copyright © 2009-2012, 2015-2017, 2020 Université Bordeaux - dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana - dnl University Research and Technology - dnl Corporation. All rights reserved. -@@ -470,14 +470,15 @@ EOF]) - _SC_PAGE_SIZE, - _SC_LARGE_PAGESIZE],,[:],[[#include ]]) - -- AC_HAVE_HEADERS([mach/mach_host.h]) -- AC_HAVE_HEADERS([mach/mach_init.h], [ -+ AC_HAVE_HEADERS([mach/mach_init.h]) -+ AC_HAVE_HEADERS([mach_init.h]) -+ AC_HAVE_HEADERS([mach/mach_host.h], [ - AC_CHECK_FUNCS([host_info]) - ]) - - AC_CHECK_HEADERS([sys/param.h]) - AC_CHECK_HEADERS([sys/sysctl.h], [ -- AC_CHECK_DECLS([CTL_HW, HW_NCPU],,,[[ -+ AC_CHECK_DECLS([CTL_HW, HW_NCPU, HW_REALMEM64, HW_MEMSIZE64, HW_PHYSMEM64, HW_USERMEM64, HW_REALMEM, HW_MEMSIZE, HW_PHYSMEM, HW_USERMEM],,,[[ - #if HAVE_SYS_PARAM_H - #include - #endif -Index: hwloc-2.1.0+dfsg/hwloc/topology.c -=================================================================== ---- hwloc-2.1.0+dfsg.orig/hwloc/topology.c -+++ hwloc-2.1.0+dfsg/hwloc/topology.c -@@ -1,7 +1,7 @@ - /* - * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. -- * Copyright © 2009-2012 Université Bordeaux -+ * Copyright © 2009-2012, 2020 Université Bordeaux - * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ -@@ -33,6 +33,9 @@ - #ifdef HAVE_MACH_MACH_INIT_H - #include - #endif -+#ifdef HAVE_MACH_INIT_H -+#include -+#endif - #ifdef HAVE_MACH_MACH_HOST_H - #include - #endif -@@ -123,15 +126,25 @@ int hwloc_get_sysctlbyname(const char *n - #endif - - #if defined(HAVE_SYSCTL) --int hwloc_get_sysctl(int name[], unsigned namelen, int *ret) -+int hwloc_get_sysctl(int name[], unsigned namelen, int64_t *ret) - { -- int n; -+ union { -+ int32_t i32; -+ int64_t i64; -+ } n; - size_t size = sizeof(n); - if (sysctl(name, namelen, &n, &size, NULL, 0)) - return -1; -- if (size != sizeof(n)) -- return -1; -- *ret = n; -+ switch (size) { -+ case sizeof(n.i32): -+ *ret = n.i32; -+ break; -+ case sizeof(n.i64): -+ *ret = n.i64; -+ break; -+ default: -+ return -1; -+ } - return 0; - } - #endif -@@ -178,8 +191,10 @@ hwloc_fallback_nbprocessors(unsigned fla - n = nn; - #elif defined(HAVE_SYSCTL) && HAVE_DECL_CTL_HW && HAVE_DECL_HW_NCPU - static int name[2] = {CTL_HW, HW_NCPU}; -- if (hwloc_get_sysctl(name, sizeof(name)/sizeof(*name), &n)) -+ int64_t nn; -+ if (hwloc_get_sysctl(name, sizeof(name)/sizeof(*name), &nn)) - n = -1; -+ n = nn; - #else - #ifdef __GNUC__ - #warning No known way to discover number of available processors on this system -@@ -188,6 +203,46 @@ hwloc_fallback_nbprocessors(unsigned fla - #endif - return n; - } -+ -+int64_t -+hwloc_fallback_memsize(void) { -+ int64_t size; -+#if defined(HAVE_HOST_INFO) && HAVE_HOST_INFO -+ struct host_basic_info info; -+ mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT; -+ host_info(mach_host_self(), HOST_BASIC_INFO, (integer_t*) &info, &count); -+ size = info.memory_size; -+#elif defined(HAVE_SYSCTL) && HAVE_DECL_CTL_HW && (HAVE_DECL_HW_REALMEM64 || HAVE_DECL_HW_MEMSIZE64 || HAVE_DECL_HW_PHYSMEM64 || HAVE_DECL_HW_USERMEM64 || HAVE_DECL_HW_REALMEM || HAVE_DECL_HW_MEMSIZE || HAVE_DECL_HW_PHYSMEM || HAVE_DECL_HW_USERMEM) -+#if HAVE_DECL_HW_MEMSIZE64 -+ static int name[2] = {CTL_HW, HW_MEMSIZE64}; -+#elif HAVE_DECL_HW_REALMEM64 -+ static int name[2] = {CTL_HW, HW_REALMEM64}; -+#elif HAVE_DECL_HW_PHYSMEM64 -+ static int name[2] = {CTL_HW, HW_PHYSMEM64}; -+#elif HAVE_DECL_HW_USERMEM64 -+ static int name[2] = {CTL_HW, HW_USERMEM64}; -+#elif HAVE_DECL_HW_MEMSIZE -+ static int name[2] = {CTL_HW, HW_MEMSIZE}; -+#elif HAVE_DECL_HW_REALMEM -+ static int name[2] = {CTL_HW, HW_REALMEM}; -+#elif HAVE_DECL_HW_PHYSMEM -+ static int name[2] = {CTL_HW, HW_PHYSMEM}; -+#elif HAVE_DECL_HW_USERMEM -+ static int name[2] = {CTL_HW, HW_USERMEM}; -+#endif -+ if (hwloc_get_sysctl(name, sizeof(name)/sizeof(*name), &size)) -+ size = -1; -+#elif defined(HAVE_SYSCTLBYNAME) -+ if (hwloc_get_sysctlbyname("hw.memsize", &size) && -+ hwloc_get_sysctlbyname("hw.realmem", &size) && -+ hwloc_get_sysctlbyname("hw.physmem", &size) && -+ hwloc_get_sysctlbyname("hw.usermem", &size)) -+ size = -1; -+#else -+ size = -1; -+#endif -+ return size; -+} - #endif /* !HWLOC_WIN_SYS */ - - /* -Index: hwloc-2.1.0+dfsg/include/private/private.h -=================================================================== ---- hwloc-2.1.0+dfsg.orig/include/private/private.h -+++ hwloc-2.1.0+dfsg/include/private/private.h -@@ -1,7 +1,7 @@ - /* - * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. -- * Copyright © 2009-2012 Université Bordeaux -+ * Copyright © 2009-2012, 2020 Université Bordeaux - * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. - * - * See COPYING in top-level directory. -@@ -224,11 +224,13 @@ struct hwloc_topology { - extern void hwloc_alloc_root_sets(hwloc_obj_t root); - extern void hwloc_setup_pu_level(struct hwloc_topology *topology, unsigned nb_pus); - extern int hwloc_get_sysctlbyname(const char *name, int64_t *n); --extern int hwloc_get_sysctl(int name[], unsigned namelen, int *n); -+extern int hwloc_get_sysctl(int name[], unsigned namelen, int64_t *n); - - /* returns the number of CPU from the OS (only valid if thissystem) */ - #define HWLOC_FALLBACK_NBPROCESSORS_INCLUDE_OFFLINE 1 /* by default we try to get only the online CPUs */ - extern int hwloc_fallback_nbprocessors(unsigned flags); -+/* returns the memory size from the OS (only valid if thissystem) */ -+extern int64_t hwloc_fallback_memsize(void); - - extern int hwloc__object_cpusets_compare_first(hwloc_obj_t obj1, hwloc_obj_t obj2); - extern void hwloc__reorder_children(hwloc_obj_t parent); -Index: hwloc-2.1.0+dfsg/hwloc/topology-freebsd.c -=================================================================== ---- hwloc-2.1.0+dfsg.orig/hwloc/topology-freebsd.c -+++ hwloc-2.1.0+dfsg/hwloc/topology-freebsd.c -@@ -1,7 +1,7 @@ - /* - * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. -- * Copyright © 2009-2010, 2012 Université Bordeaux -+ * Copyright © 2009-2010, 2012, 2020 Université Bordeaux - * Copyright © 2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ -@@ -164,20 +164,6 @@ hwloc_freebsd_get_thread_cpubind(hwloc_t - #endif - #endif - --#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) --static void --hwloc_freebsd_node_meminfo_info(struct hwloc_topology *topology) --{ -- int mib[2] = { CTL_HW, HW_PHYSMEM }; -- unsigned long physmem; -- size_t len = sizeof(physmem); -- sysctl(mib, 2, &physmem, &len, NULL, 0); -- topology->machine_memory.local_memory = physmem; -- /* we don't know anything about NUMA nodes in this backend. -- * let another backend or the core move that memory to the right NUMA node */ --} --#endif -- - static int - hwloc_look_freebsd(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus) - { -@@ -188,6 +174,7 @@ hwloc_look_freebsd(struct hwloc_backend - */ - - struct hwloc_topology *topology = backend->topology; -+ int64_t memsize; - - assert(dstatus->phase == HWLOC_DISC_PHASE_CPU); - -@@ -202,10 +189,11 @@ hwloc_look_freebsd(struct hwloc_backend - hwloc_setup_pu_level(topology, nbprocs); - } - -+ memsize = hwloc_fallback_memsize(); -+ if (memsize > 0) -+ topology->machine_memory.local_memory = memsize; -+ - /* Add FreeBSD specific information */ --#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) -- hwloc_freebsd_node_meminfo_info(topology); --#endif - hwloc_obj_add_info(topology->levels[0][0], "Backend", "FreeBSD"); - hwloc_add_uname_info(topology, NULL); - return 0; -Index: hwloc-2.1.0+dfsg/hwloc/topology-netbsd.c -=================================================================== ---- hwloc-2.1.0+dfsg.orig/hwloc/topology-netbsd.c -+++ hwloc-2.1.0+dfsg/hwloc/topology-netbsd.c -@@ -1,7 +1,7 @@ - /* - * Copyright © 2012 Aleksej Saushev, The NetBSD Foundation - * Copyright © 2009-2019 Inria. All rights reserved. -- * Copyright © 2009-2010 Université Bordeaux -+ * Copyright © 2009-2010, 2020 Université Bordeaux - * Copyright © 2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ -@@ -133,18 +133,6 @@ hwloc_netbsd_get_thisthread_cpubind(hwlo - return hwloc_netbsd_get_thread_cpubind(topology, pthread_self(), hwloc_cpuset, flags); - } - --#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) --static void --hwloc_netbsd_node_meminfo_info(struct hwloc_topology *topology) --{ -- int mib[2] = { CTL_HW, HW_PHYSMEM64 }; -- unsigned long physmem; -- size_t len = sizeof(physmem); -- sysctl(mib, 2, &physmem, &len, NULL, 0); -- topology->machine_memory.local_memory = physmem; --} --#endif -- - static int - hwloc_look_netbsd(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus) - { -@@ -155,6 +143,7 @@ hwloc_look_netbsd(struct hwloc_backend * - */ - - struct hwloc_topology *topology = backend->topology; -+ int64_t memsize; - - assert(dstatus->phase == HWLOC_DISC_PHASE_CPU); - -@@ -169,10 +158,11 @@ hwloc_look_netbsd(struct hwloc_backend * - hwloc_setup_pu_level(topology, nbprocs); - } - -+ memsize = hwloc_fallback_memsize(); -+ if (memsize > 0) -+ topology->machine_memory.local_memory = memsize;; -+ - /* Add NetBSD specific information */ --#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) -- hwloc_netbsd_node_meminfo_info(topology); --#endif - hwloc_obj_add_info(topology->levels[0][0], "Backend", "NetBSD"); - hwloc_add_uname_info(topology, NULL); - return 0; -Index: hwloc-2.1.0+dfsg/hwloc/topology-noos.c -=================================================================== ---- hwloc-2.1.0+dfsg.orig/hwloc/topology-noos.c -+++ hwloc-2.1.0+dfsg/hwloc/topology-noos.c -@@ -1,7 +1,7 @@ - /* - * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. -- * Copyright © 2009-2012 Université Bordeaux -+ * Copyright © 2009-2012, 2020 Université Bordeaux - * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ -@@ -20,22 +20,27 @@ hwloc_look_noos(struct hwloc_backend *ba - */ - - struct hwloc_topology *topology = backend->topology; -- int nbprocs; -+ int64_t memsize; - - assert(dstatus->phase == HWLOC_DISC_PHASE_CPU); - -- if (topology->levels[0][0]->cpuset) -- /* somebody discovered things */ -- return -1; -- -- nbprocs = hwloc_fallback_nbprocessors(0); -- if (nbprocs >= 1) -- topology->support.discovery->pu = 1; -- else -- nbprocs = 1; -+ if (!topology->levels[0][0]->cpuset) { -+ int nbprocs; -+ /* Nobody (even the x86 backend) created objects yet, setup basic objects */ -+ -+ nbprocs = hwloc_fallback_nbprocessors(0); -+ if (nbprocs >= 1) -+ topology->support.discovery->pu = 1; -+ else -+ nbprocs = 1; -+ hwloc_alloc_root_sets(topology->levels[0][0]); -+ hwloc_setup_pu_level(topology, nbprocs); -+ } -+ -+ memsize = hwloc_fallback_memsize(); -+ if (memsize > 0) -+ topology->machine_memory.local_memory = memsize;; - -- hwloc_alloc_root_sets(topology->levels[0][0]); -- hwloc_setup_pu_level(topology, nbprocs); - hwloc_add_uname_info(topology, NULL); - return 0; - } -Index: hwloc-2.1.0+dfsg/hwloc/topology-windows.c -=================================================================== ---- hwloc-2.1.0+dfsg.orig/hwloc/topology-windows.c -+++ hwloc-2.1.0+dfsg/hwloc/topology-windows.c -@@ -1,7 +1,7 @@ - /* - * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. -- * Copyright © 2009-2012 Université Bordeaux -+ * Copyright © 2009-2012, 2020 Université Bordeaux - * Copyright © 2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ -@@ -1199,3 +1199,9 @@ hwloc_fallback_nbprocessors(unsigned fla - - return n; - } -+ -+int64_t -+hwloc_fallback_memsize(void) { -+ /* Unused */ -+ return -1; -+} -Index: hwloc-2.1.0+dfsg/include/hwloc/rename.h -=================================================================== ---- hwloc-2.1.0+dfsg.orig/include/hwloc/rename.h -+++ hwloc-2.1.0+dfsg/include/hwloc/rename.h -@@ -709,6 +709,7 @@ extern "C" { - #define hwloc_get_sysctlbyname HWLOC_NAME(get_sysctlbyname) - #define hwloc_get_sysctl HWLOC_NAME(get_sysctl) - #define hwloc_fallback_nbprocessors HWLOC_NAME(fallback_nbprocessors) -+#define hwloc_fallback_memsize HWLOC_NAME(fallback_memsize) - - #define hwloc__object_cpusets_compare_first HWLOC_NAME(_object_cpusets_compare_first) - #define hwloc__reorder_children HWLOC_NAME(_reorder_children) diff -Nru hwloc-contrib-2.1.0+dfsg/debian/patches/series hwloc-contrib-2.2.0+dfsg/debian/patches/series --- hwloc-contrib-2.1.0+dfsg/debian/patches/series 2020-01-01 14:00:43.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/patches/series 2020-03-30 19:39:10.000000000 +0000 @@ -1,2 +1,3 @@ doc-nopdf -hurd-mem + +#use_system_hwloc diff -Nru hwloc-contrib-2.1.0+dfsg/debian/patches/use_system_hwloc hwloc-contrib-2.2.0+dfsg/debian/patches/use_system_hwloc --- hwloc-contrib-2.1.0+dfsg/debian/patches/use_system_hwloc 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/patches/use_system_hwloc 2020-03-30 19:39:10.000000000 +0000 @@ -0,0 +1,416 @@ +--- + configure.ac | 2 - + contrib/misc/Makefile.am | 2 - + doc/examples/Makefile.am | 2 - + hwloc/Makefile.am | 6 ---- + tests/hwloc/Makefile.am | 2 - + tests/hwloc/linux/allowed/test-topology.sh.in | 5 --- + tests/hwloc/linux/gather/test-gather-topology.sh.in | 4 +- + tests/hwloc/linux/test-topology.sh.in | 5 --- + tests/hwloc/x86+linux/test-topology.sh.in | 5 --- + tests/hwloc/x86/test-topology.sh.in | 5 --- + tests/hwloc/xml/test-topology.sh.in | 5 --- + utils/hwloc/Makefile.am | 14 ---------- + utils/hwloc/test-fake-plugin.sh.in | 4 +- + utils/hwloc/test-hwloc-annotate.sh.in | 2 - + utils/hwloc/test-hwloc-calc.sh.in | 2 - + utils/hwloc/test-hwloc-compress-dir.sh.in | 2 - + utils/hwloc/test-hwloc-diffpatch.sh.in | 4 +- + utils/hwloc/test-hwloc-distrib.sh.in | 2 - + utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh.in | 2 - + utils/hwloc/test-hwloc-info.sh.in | 2 - + utils/lstopo/Makefile.am | 5 --- + utils/lstopo/test-lstopo-shmem.sh.in | 5 --- + utils/lstopo/test-lstopo.sh.in | 5 --- + utils/netloc/draw/Makefile.am | 3 -- + utils/netloc/infiniband/Makefile.am | 3 -- + utils/netloc/mpi/Makefile.am | 11 ------- + utils/netloc/scotch/Makefile.am | 5 --- + 27 files changed, 24 insertions(+), 90 deletions(-) + +--- a/doc/examples/Makefile.am ++++ b/doc/examples/Makefile.am +@@ -11,7 +11,7 @@ AM_CFLAGS = $(HWLOC_CFLAGS) + AM_CPPFLAGS = $(HWLOC_CPPFLAGS) + AM_LDFLAGS = $(HWLOC_LDFLAGS) + +-LDADD = $(HWLOC_top_builddir)/hwloc/libhwloc.la ++LDADD = -lhwloc + DEPENDENCIES = $(LDADD) + + TESTS = hwloc-hello +--- a/utils/hwloc/test-hwloc-annotate.sh.in ++++ b/utils/hwloc/test-hwloc-annotate.sh.in +@@ -11,7 +11,7 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/hwloc" + builddir="$HWLOC_top_builddir/utils/hwloc" +-annotate="$builddir/hwloc-annotate" ++annotate="/usr/bin/hwloc-annotate" + + HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc + export HWLOC_PLUGINS_PATH +--- a/utils/hwloc/test-hwloc-calc.sh.in ++++ b/utils/hwloc/test-hwloc-calc.sh.in +@@ -13,7 +13,7 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/hwloc" + builddir="$HWLOC_top_builddir/utils/hwloc" +-calc="$builddir/hwloc-calc" ++calc="/usr/bin/hwloc-calc" + xmldir="$HWLOC_top_srcdir/tests/hwloc/xml" + + HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +--- a/utils/hwloc/test-hwloc-compress-dir.sh.in ++++ b/utils/hwloc/test-hwloc-compress-dir.sh.in +@@ -11,7 +11,7 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/hwloc" + builddir="$HWLOC_top_builddir/utils/hwloc" +-compress="$builddir/hwloc-compress-dir" ++compress="/usr/bin/hwloc-compress-dir" + + HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc + export HWLOC_PLUGINS_PATH +--- a/utils/hwloc/test-hwloc-diffpatch.sh.in ++++ b/utils/hwloc/test-hwloc-diffpatch.sh.in +@@ -11,8 +11,8 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/hwloc" + builddir="$HWLOC_top_builddir/utils/hwloc" +-diff="$builddir/hwloc-diff" +-patch="$builddir/hwloc-patch" ++diff="/usr/bin/hwloc-diff" ++patch="/usr/bin/hwloc-patch" + + HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc + export HWLOC_PLUGINS_PATH +--- a/utils/hwloc/test-hwloc-distrib.sh.in ++++ b/utils/hwloc/test-hwloc-distrib.sh.in +@@ -13,7 +13,7 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/hwloc" + builddir="$HWLOC_top_builddir/utils/hwloc" +-distrib="$builddir/hwloc-distrib" ++distrib="/usr/bin/hwloc-distrib" + + HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc + export HWLOC_PLUGINS_PATH +--- a/utils/hwloc/test-hwloc-info.sh.in ++++ b/utils/hwloc/test-hwloc-info.sh.in +@@ -13,7 +13,7 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/hwloc" + builddir="$HWLOC_top_builddir/utils/hwloc" +-info="$builddir/hwloc-info" ++info="/usr/bin/hwloc-info" + + HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc + export HWLOC_PLUGINS_PATH +--- a/utils/hwloc/test-fake-plugin.sh.in ++++ b/utils/hwloc/test-fake-plugin.sh.in +@@ -10,8 +10,8 @@ + + HWLOC_top_builddir="@HWLOC_top_builddir@" + builddir="$HWLOC_top_builddir" +-lstopo="$builddir/utils/lstopo/lstopo-no-graphics" +-hcalc="$builddir/utils/hwloc/hwloc-calc" ++lstopo="/usr/bin/lstopo-no-graphics" ++hcalc="/usr/bin/hwloc-calc" + + HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc/.libs + export HWLOC_PLUGINS_PATH +--- a/tests/hwloc/Makefile.am ++++ b/tests/hwloc/Makefile.am +@@ -112,7 +112,7 @@ else + hwloc_lib = libhwloc_embedded.la + endif + +-LDADD += $(HWLOC_top_builddir)/hwloc/$(hwloc_lib) ++LDADD += -lhwloc + + linux_libnuma_CFLAGS = $(AM_CFLAGS) $(HWLOC_NUMA_CFLAGS) + linux_libnuma_LDADD = $(LDADD) $(HWLOC_NUMA_LIBS) +--- a/tests/hwloc/x86+linux/test-topology.sh.in ++++ b/tests/hwloc/x86+linux/test-topology.sh.in +@@ -8,10 +8,7 @@ + + HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" +-lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics" +- +-HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +-export HWLOC_PLUGINS_PATH ++lstopo="/usr/bin/lstopo-no-graphics" + + HWLOC_DONT_ADD_VERSION_INFO=1 + export HWLOC_DONT_ADD_VERSION_INFO +--- a/tests/hwloc/xml/test-topology.sh.in ++++ b/tests/hwloc/xml/test-topology.sh.in +@@ -14,10 +14,7 @@ + + HWLOC_top_builddir="@HWLOC_top_builddir@" + HWLOC_top_srcdir="@HWLOC_top_srcdir@" +-lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics" +- +-HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +-export HWLOC_PLUGINS_PATH ++lstopo="/usr/bin/lstopo-no-graphics" + + HWLOC_DEBUG_CHECK=1 + export HWLOC_DEBUG_CHECK +--- a/tests/hwloc/linux/allowed/test-topology.sh.in ++++ b/tests/hwloc/linux/allowed/test-topology.sh.in +@@ -14,10 +14,7 @@ + + HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" +-lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics" +- +-HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +-export HWLOC_PLUGINS_PATH ++lstopo="/usr/bin/lstopo-no-graphics" + + HWLOC_THISSYSTEM=1 + export HWLOC_THISSYSTEM +--- a/tests/hwloc/linux/gather/test-gather-topology.sh.in ++++ b/tests/hwloc/linux/gather/test-gather-topology.sh.in +@@ -9,8 +9,8 @@ + # + + HWLOC_top_builddir="@HWLOC_top_builddir@" +-lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics" +-gather="$HWLOC_top_builddir/utils/hwloc/hwloc-gather-topology" ++lstopo="/usr/bin/lstopo-no-graphics" ++gather="/usr/bin/hwloc-gather-topology" + + # make sure we use default numeric formats + LANG=C +--- a/tests/hwloc/linux/test-topology.sh.in ++++ b/tests/hwloc/linux/test-topology.sh.in +@@ -14,10 +14,7 @@ + + HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" +-lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics" +- +-HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +-export HWLOC_PLUGINS_PATH ++lstopo="/usr/bin/lstopo-no-graphics" + + HWLOC_DONT_ADD_VERSION_INFO=1 + export HWLOC_DONT_ADD_VERSION_INFO +--- a/tests/hwloc/x86/test-topology.sh.in ++++ b/tests/hwloc/x86/test-topology.sh.in +@@ -8,10 +8,7 @@ + + HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" +-lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics" +- +-HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +-export HWLOC_PLUGINS_PATH ++lstopo="/usr/bin/lstopo-no-graphics" + + HWLOC_DONT_ADD_VERSION_INFO=1 + export HWLOC_DONT_ADD_VERSION_INFO +--- a/utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh.in ++++ b/utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh.in +@@ -10,7 +10,7 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/hwloc" + builddir="$HWLOC_top_builddir/utils/hwloc" +-hdhd="$builddir/hwloc-dump-hwdata" ++hdhd="/usr/sbin/hwloc-dump-hwdata" + + : ${TMPDIR=/tmp} + { +--- a/utils/lstopo/test-lstopo-shmem.sh.in ++++ b/utils/lstopo/test-lstopo-shmem.sh.in +@@ -7,10 +7,7 @@ + + HWLOC_top_builddir="@HWLOC_top_builddir@" + builddir="$HWLOC_top_builddir/utils/lstopo" +-ls="$builddir/lstopo-no-graphics" +- +-HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +-export HWLOC_PLUGINS_PATH ++ls="/usr/bin/lstopo-no-graphics" + + HWLOC_DEBUG_CHECK=1 + export HWLOC_DEBUG_CHECK +--- a/utils/lstopo/test-lstopo.sh.in ++++ b/utils/lstopo/test-lstopo.sh.in +@@ -12,10 +12,7 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" + HWLOC_top_builddir="@HWLOC_top_builddir@" + srcdir="$HWLOC_top_srcdir/utils/lstopo" + builddir="$HWLOC_top_builddir/utils/lstopo" +-ls="$builddir/lstopo-no-graphics" +- +-HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +-export HWLOC_PLUGINS_PATH ++ls="/usr/bin/lstopo-no-graphics" + + HWLOC_DEBUG_CHECK=1 + export HWLOC_DEBUG_CHECK +--- a/utils/hwloc/Makefile.am ++++ b/utils/hwloc/Makefile.am +@@ -10,7 +10,7 @@ AM_CFLAGS = $(HWLOC_CFLAGS) + AM_CPPFLAGS = $(HWLOC_CPPFLAGS) + AM_LDFLAGS = $(HWLOC_LDFLAGS) + +-LDADD = $(HWLOC_top_builddir)/hwloc/libhwloc.la ++LDADD = -lhwloc + + EXTRA_DIST = \ + test-hwloc-annotate.input test-hwloc-annotate.output \ +@@ -27,28 +27,16 @@ noinst_LTLIBRARIES = libutils_common.la + libutils_common_la_SOURCES = common-ps.c + libutils_common_la_LIBADD = $(LDADD) + +-bin_PROGRAMS = \ +- hwloc-annotate \ +- hwloc-bind \ +- hwloc-calc \ +- hwloc-diff \ +- hwloc-distrib \ +- hwloc-info \ +- hwloc-patch +- + # start tests here before recursing into subdirs + SUBDIRS = . + + if !HWLOC_HAVE_WINDOWS +-bin_PROGRAMS += hwloc-ps + endif + if HWLOC_HAVE_X86_CPUID +-bin_PROGRAMS += hwloc-gather-cpuid + endif HWLOC_HAVE_X86_CPUID + + if HWLOC_HAVE_LINUX + if HWLOC_HAVE_X86 +-sbin_PROGRAMS = hwloc-dump-hwdata + SUBDIRS += test-hwloc-dump-hwdata + endif HWLOC_HAVE_X86 + endif HWLOC_HAVE_LINUX +--- a/utils/lstopo/Makefile.am ++++ b/utils/lstopo/Makefile.am +@@ -14,9 +14,6 @@ AM_LDFLAGS = $(HWLOC_LDFLAGS) + LDADD = $(HWLOC_top_builddir)/hwloc/libhwloc.la \ + $(HWLOC_top_builddir)/utils/hwloc/libutils_common.la + +-bin_PROGRAMS = \ +- lstopo-no-graphics +- + EXTRA_DIST = \ + test-lstopo.output + +@@ -41,14 +38,12 @@ lstopo_SOURCES = $(lstopo_no_graphics_SO + lstopo_CPPFLAGS = $(AM_CPPFLAGS) + lstopo_LDADD = $(lstopo_no_graphics_LDADD) + if HWLOC_HAVE_CAIRO +-bin_PROGRAMS += lstopo + lstopo_SOURCES += lstopo-cairo.c + lstopo_CPPFLAGS += -DLSTOPO_HAVE_GRAPHICS $(HWLOC_X11_CPPFLAGS) + lstopo_CFLAGS = $(lstopo_no_graphics_CFLAGS) $(HWLOC_CAIRO_CFLAGS) + lstopo_LDADD += $(HWLOC_CAIRO_LIBS) $(HWLOC_X11_LIBS) + endif + if HWLOC_HAVE_WINDOWS +-bin_PROGRAMS += lstopo lstopo-win + lstopo_SOURCES += lstopo-windows.c + lstopo_CPPFLAGS += -DLSTOPO_HAVE_GRAPHICS + if HWLOC_HAVE_USER32 +--- a/utils/netloc/draw/Makefile.am ++++ b/utils/netloc/draw/Makefile.am +@@ -12,9 +12,6 @@ AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include + +-bin_PROGRAMS = \ +- netloc_draw_to_json +- + netloc_draw_to_json_SOURCES = \ + netloc_draw_to_json.c + +--- a/utils/netloc/infiniband/Makefile.am ++++ b/utils/netloc/infiniband/Makefile.am +@@ -19,9 +19,6 @@ AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include + +-bin_PROGRAMS = \ +- netloc_ib_extract_dats +- + netloc_ib_extract_dats_SOURCES = \ + netloc_ib_extract_dats.c + +--- a/utils/netloc/mpi/Makefile.am ++++ b/utils/netloc/mpi/Makefile.am +@@ -13,17 +13,6 @@ AM_LDFLAGS = $(HWLOC_LDFLAGS) + LDADD = $(top_builddir)/netloc/libnetloc.la \ + $(top_builddir)/hwloc/libhwloc.la + +-if BUILD_MPITOOLS +-bin_PROGRAMS = \ +- netloc_rank_order \ +- netloc_mpi_find_hosts +- +-if BUILD_NETLOCSCOTCH +-bin_PROGRAMS += \ +- netloc_mpi_rank_file +-endif +-endif +- + netloc_rank_order_SOURCES = netloc_rank_order.c + + netloc_mpi_find_hosts_SOURCES = netloc_mpi_find_hosts.c +--- a/utils/netloc/scotch/Makefile.am ++++ b/utils/netloc/scotch/Makefile.am +@@ -15,10 +15,5 @@ LDADD = $(top_builddir)/netloc/libnetloc + $(top_builddir)/hwloc/libhwloc.la \ + -lscotch -lscotcherr -lm -lpthread + +-if BUILD_NETLOCSCOTCH +-bin_PROGRAMS = \ +- netlocscotch_get_arch +-endif +- + netlocscotch_get_arch_SOURCES = \ + netlocscotch_get_arch.c +--- a/hwloc/Makefile.am ++++ b/hwloc/Makefile.am +@@ -13,12 +13,6 @@ EXTRA_DIST = dolib.c + # If we're in standalone mode, build the installable library. + # Otherwise, build the embedded library. + +-if HWLOC_BUILD_STANDALONE +-lib_LTLIBRARIES = libhwloc.la +-else +-noinst_LTLIBRARIES = libhwloc_embedded.la +-endif +- + pluginsdir = @HWLOC_PLUGINS_DIR@ + plugins_LTLIBRARIES = + plugins_ldflags = -module -avoid-version $(HWLOC_DL_LIBS) $(HWLOC_LTDL_LIBS) +--- a/configure.ac ++++ b/configure.ac +@@ -37,7 +37,7 @@ EOF + AC_CANONICAL_TARGET + + # Init automake +-AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects foreign tar-ustar parallel-tests -Wall -Werror]) ++AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects foreign tar-ustar parallel-tests -Wall]) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + + AC_LANG([C]) +--- a/contrib/misc/Makefile.am ++++ b/contrib/misc/Makefile.am +@@ -8,7 +8,7 @@ AM_CFLAGS = $(HWLOC_CFLAGS) + AM_CPPFLAGS = $(HWLOC_CPPFLAGS) + AM_LDFLAGS = $(HWLOC_LDFLAGS) + +-LDADD = $(HWLOC_top_builddir)/hwloc/libhwloc.la ++LDADD = -lhwloc + + check_PROGRAMS = hwloc-tweak-osindex + diff -Nru hwloc-contrib-2.1.0+dfsg/debian/README.source hwloc-contrib-2.2.0+dfsg/debian/README.source --- hwloc-contrib-2.1.0+dfsg/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/README.source 2020-03-30 19:39:10.000000000 +0000 @@ -0,0 +1,5 @@ +The dfsg tree is the upstream tarball, minus: + +doc/doxygen-doc/html/jquery.js +doc/doxygen-doc/html/menu.js +utils/netloc/draw/visdist/vis.min.js diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/allowed hwloc-contrib-2.2.0+dfsg/debian/tests/allowed --- hwloc-contrib-2.1.0+dfsg/debian/tests/allowed 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/allowed 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=tests/hwloc/linux/allowed/test-topology.sh /bin/sh ./debian/tests/test-util tests/hwloc/linux/allowed/test1.output diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/annotate hwloc-contrib-2.2.0+dfsg/debian/tests/annotate --- hwloc-contrib-2.1.0+dfsg/debian/tests/annotate 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/annotate 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=utils/hwloc/test-hwloc-annotate.sh /bin/sh ./debian/tests/test-util diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/calc hwloc-contrib-2.2.0+dfsg/debian/tests/calc --- hwloc-contrib-2.1.0+dfsg/debian/tests/calc 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/calc 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=utils/hwloc/test-hwloc-calc.sh /bin/sh ./debian/tests/test-util diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/compress-dir hwloc-contrib-2.2.0+dfsg/debian/tests/compress-dir --- hwloc-contrib-2.1.0+dfsg/debian/tests/compress-dir 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/compress-dir 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=utils/hwloc/test-hwloc-compress-dir.sh /bin/sh ./debian/tests/test-util diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/diffpatch hwloc-contrib-2.2.0+dfsg/debian/tests/diffpatch --- hwloc-contrib-2.1.0+dfsg/debian/tests/diffpatch 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/diffpatch 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=utils/hwloc/test-hwloc-diffpatch.sh /bin/sh ./debian/tests/test-util diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/distrib hwloc-contrib-2.2.0+dfsg/debian/tests/distrib --- hwloc-contrib-2.1.0+dfsg/debian/tests/distrib 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/distrib 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=utils/hwloc/test-hwloc-distrib.sh /bin/sh ./debian/tests/test-util diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/gather hwloc-contrib-2.2.0+dfsg/debian/tests/gather --- hwloc-contrib-2.1.0+dfsg/debian/tests/gather 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/gather 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/bash -test=tests/hwloc/linux/gather/test-gather-topology.sh /bin/sh ./debian/tests/test-util 2> >( grep -v "must run on the current system topology, while this topology doesn't come from this system." 1>&2 ) diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/info hwloc-contrib-2.2.0+dfsg/debian/tests/info --- hwloc-contrib-2.1.0+dfsg/debian/tests/info 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/info 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=utils/hwloc/test-hwloc-info.sh /bin/sh ./debian/tests/test-util diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/linux hwloc-contrib-2.2.0+dfsg/debian/tests/linux --- hwloc-contrib-2.1.0+dfsg/debian/tests/linux 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/linux 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/bin/sh -set -e -for i in tests/hwloc/linux/*.output -do - test=tests/hwloc/linux/test-topology.sh /bin/sh ./debian/tests/test-util "$i" -done diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/lstopo hwloc-contrib-2.2.0+dfsg/debian/tests/lstopo --- hwloc-contrib-2.1.0+dfsg/debian/tests/lstopo 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/lstopo 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/bin/sh -test=utils/lstopo/test-lstopo.sh /bin/sh ./debian/tests/test-util diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/tests hwloc-contrib-2.2.0+dfsg/debian/tests/tests --- hwloc-contrib-2.1.0+dfsg/debian/tests/tests 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/tests 2020-03-30 19:39:10.000000000 +0000 @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +WORKDIR=$AUTOPKGTEST_TMP +SRCDIR=$PWD + +patch -p1 < debian/patches/use_system_hwloc 2>&1 || true + +dh_autoreconf 2>&1 +dh_auto_configure 2>&1 +dh_auto_build 2>&1 +dh_auto_test 2>&1 + +cd $SRCDIR +patch -p1 -R < debian/patches/use_system_hwloc diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/test-util hwloc-contrib-2.2.0+dfsg/debian/tests/test-util --- hwloc-contrib-2.1.0+dfsg/debian/tests/test-util 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/test-util 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -#!/bin/bash -set -e - -HWLOC_VERSION=$(dpkg-parsechangelog --show-field Version | sed -e 's/-[^-]*$//' -e 's/+dfsg$//') - -base=$(basename $test) -sed \ - -e '/HWLOC_PLUGINS_PATH/d' \ - -e "/^diff=/d" \ - -e "/^patch=/d" \ - -e "/^calc=/d" \ - -e "/^hcalc=/d" \ - -e "/^annotate=/d" \ - -e "/^compress=/d" \ - -e "/^distrib=/d" \ - -e "/^info=/d" \ - -e "/^lstopo=/d" \ - -e "/^ls=/d" \ - -e "/^gather=/d" \ - -e "s=@BASH@=/bin/bash=" \ - -e "s=@DIFF@=diff=" \ - -e "s=@HWLOC_DIFF_U@=-u=" \ - -e "s=@HWLOC_DIFF_W@=-w=" \ - -e "s=@XMLLINT@=xmllint=" \ - -e "s=@HWLOC_VERSION@=$HWLOC_VERSION=" \ - -e "s=@SED@=/bin/sed=" \ - -e "s=@EXEEXT@==" \ - -e 's=@HWLOC_HAVE_PCI_TRUE@==' \ - -e "s=@HWLOC_top_srcdir@=$PWD=" \ - < $test.in > $AUTOPKGTEST_TMP/$base - -export LANG=C -export LC_ALL=C -export diff=/usr/bin/hwloc-diff -export patch=/usr/bin/hwloc-patch -export calc=/usr/bin/hwloc-calc -export hcalc=/usr/bin/hwloc-calc -export annotate=/usr/bin/hwloc-annotate -export compress=/usr/bin/hwloc-compress-dir -export distrib=/usr/bin/hwloc-distrib -export info=/usr/bin/hwloc-info -export gather=/usr/bin/hwloc-gather-topology -export lstopo=/usr/bin/lstopo-no-graphics -export ls=/usr/bin/lstopo-no-graphics -export TMPDIR=$AUTOPKGTEST_TMP -chmod +x $AUTOPKGTEST_TMP/$base -$AUTOPKGTEST_TMP/$base "$@" diff -Nru hwloc-contrib-2.1.0+dfsg/debian/tests/xml hwloc-contrib-2.2.0+dfsg/debian/tests/xml --- hwloc-contrib-2.1.0+dfsg/debian/tests/xml 2019-11-26 15:04:50.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/debian/tests/xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/bin/sh -set -e -for i in tests/hwloc/xml/*.xml tests/hwloc/xml/*.output -do - case "$i" in - */*.v1.xml ) - # This is just a hwloc v1 reference - continue;; - esac - test=tests/hwloc/xml/test-topology.sh /bin/sh ./debian/tests/test-util "$i" -done diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-config.cfg.in hwloc-contrib-2.2.0+dfsg/doc/doxygen-config.cfg.in --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-config.cfg.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-config.cfg.in 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2010-2017 Inria. All rights reserved. +# Copyright © 2010-2019 Inria. All rights reserved. # Copyright © 2009 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -23,7 +23,6 @@ @top_srcdir@/include/hwloc/cudart.h \ @top_srcdir@/include/hwloc/nvml.h \ @top_srcdir@/include/hwloc/gl.h \ - @top_srcdir@/include/hwloc/intel-mic.h \ @top_srcdir@/include/hwloc/openfabrics-verbs.h \ @top_srcdir@/include/hwloc/diff.h \ @top_srcdir@/include/hwloc/shmem.h \ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00125_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00125_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00125_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00125_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): hwloc.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@ - + +/* @license-end */
-
1 /*
2  * Copyright © 2009 CNRS
3  * Copyright © 2009-2019 Inria. All rights reserved.
4  * Copyright © 2009-2012 Université Bordeaux
5  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
6  * See COPYING in top-level directory.
7  */
8 
9 /*=====================================================================
10  * PLEASE GO READ THE DOCUMENTATION!
11  * ------------------------------------------------
12  * $tarball_directory/doc/doxygen-doc/
13  * or
14  * http://www.open-mpi.org/projects/hwloc/doc/
15  *=====================================================================
16  *
17  * FAIR WARNING: Do NOT expect to be able to figure out all the
18  * subtleties of hwloc by simply reading function prototypes and
19  * constant descrptions here in this file.
20  *
21  * Hwloc has wonderful documentation in both PDF and HTML formats for
22  * your reading pleasure. The formal documentation explains a LOT of
23  * hwloc-specific concepts, provides definitions, and discusses the
24  * "big picture" for many of the things that you'll find here in this
25  * header file.
26  *
27  * The PDF/HTML documentation was generated via Doxygen; much of what
28  * you'll see in there is also here in this file. BUT THERE IS A LOT
29  * THAT IS IN THE PDF/HTML THAT IS ***NOT*** IN hwloc.h!
30  *
31  * There are entire paragraph-length descriptions, discussions, and
32  * pretty prictures to explain subtle corner cases, provide concrete
33  * examples, etc.
34  *
35  * Please, go read the documentation. :-)
36  *
37  * Moreover there are several examples of hwloc use under doc/examples
38  * in the source tree.
39  *
40  *=====================================================================*/
41 
53 #ifndef HWLOC_H
54 #define HWLOC_H
55 
56 #include "hwloc/autogen/config.h"
57 
58 #include <sys/types.h>
59 #include <stdio.h>
60 #include <string.h>
61 #include <limits.h>
62 
63 /*
64  * Symbol transforms
65  */
66 #include "hwloc/rename.h"
67 
68 /*
69  * Bitmap definitions
70  */
71 
72 #include "hwloc/bitmap.h"
73 
74 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
79 
96 #define HWLOC_API_VERSION 0x00020100
97 
102 HWLOC_DECLSPEC unsigned hwloc_get_api_version(void);
103 
105 #define HWLOC_COMPONENT_ABI 6
106 
143 
161 
176 #define HWLOC_OBJ_TYPE_MIN HWLOC_OBJ_MACHINE
177 typedef enum {
306  HWLOC_OBJ_TYPE_MAX
308 
315 
321 
341 
361 HWLOC_DECLSPEC int hwloc_compare_types (hwloc_obj_type_t type1, hwloc_obj_type_t type2) __hwloc_attribute_const;
362 
365 };
366 
375 union hwloc_obj_attr_u;
376 
381 struct hwloc_obj {
382  /* physical information */
384  char *subtype;
386  unsigned os_index;
391 #define HWLOC_UNKNOWN_INDEX (unsigned)-1
392 
393  char *name;
398  hwloc_uint64_t total_memory;
403  /* global position */
404  int depth;
419  unsigned logical_index;
426  /* cousins are all objects of the same type (and depth) across the entire topology */
430  /* children of the same parent are siblings, even if they may have different type and depth */
431  struct hwloc_obj *parent;
432  unsigned sibling_rank;
437  unsigned arity;
441  struct hwloc_obj **children;
457  unsigned memory_arity;
475  unsigned io_arity;
487  unsigned misc_arity;
496  /* cpusets and nodesets */
561  struct hwloc_info_s *infos;
562  unsigned infos_count;
564  /* misc */
565  void *userdata;
570  hwloc_uint64_t gp_index;
575 };
579 typedef struct hwloc_obj * hwloc_obj_t;
580 
585  hwloc_uint64_t local_memory;
586  unsigned page_types_len;
593  hwloc_uint64_t size;
594  hwloc_uint64_t count;
595  } * page_types;
596  } numanode;
597 
600  hwloc_uint64_t size;
601  unsigned depth;
602  unsigned linesize;
606  } cache;
609  unsigned depth;
611  unsigned kind;
612  unsigned subkind;
613  unsigned char dont_merge;
614  } group;
617  unsigned short domain;
618  unsigned char bus, dev, func;
619  unsigned short class_id;
620  unsigned short vendor_id, device_id, subvendor_id, subdevice_id;
621  unsigned char revision;
622  float linkspeed; /* in GB/s */
623  } pcidev;
626  union {
628  } upstream;
630  union {
631  struct {
632  unsigned short domain;
633  unsigned char secondary_bus, subordinate_bus;
634  } pci;
635  } downstream;
637  unsigned depth;
638  } bridge;
642  } osdev;
643 };
644 
649 struct hwloc_info_s {
650  char *name;
651  char *value;
652 };
653 
662 struct hwloc_topology;
667 typedef struct hwloc_topology * hwloc_topology_t;
668 
675 HWLOC_DECLSPEC int hwloc_topology_init (hwloc_topology_t *topologyp);
676 
697 HWLOC_DECLSPEC int hwloc_topology_load(hwloc_topology_t topology);
698 
703 HWLOC_DECLSPEC void hwloc_topology_destroy (hwloc_topology_t topology);
704 
715 HWLOC_DECLSPEC int hwloc_topology_dup(hwloc_topology_t *newtopology, hwloc_topology_t oldtopology);
716 
734 HWLOC_DECLSPEC int hwloc_topology_abi_check(hwloc_topology_t topology);
735 
747 HWLOC_DECLSPEC void hwloc_topology_check(hwloc_topology_t topology);
748 
769 HWLOC_DECLSPEC int hwloc_topology_get_depth(hwloc_topology_t __hwloc_restrict topology) __hwloc_attribute_pure;
770 
794 HWLOC_DECLSPEC int hwloc_get_type_depth (hwloc_topology_t topology, hwloc_obj_type_t type);
795 
805 };
806 
826 HWLOC_DECLSPEC int hwloc_get_memory_parents_depth (hwloc_topology_t topology);
827 
841 static __hwloc_inline int
842 hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure;
843 
857 static __hwloc_inline int
858 hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure;
859 
866 HWLOC_DECLSPEC hwloc_obj_type_t hwloc_get_depth_type (hwloc_topology_t topology, int depth) __hwloc_attribute_pure;
867 
870 HWLOC_DECLSPEC unsigned hwloc_get_nbobjs_by_depth (hwloc_topology_t topology, int depth) __hwloc_attribute_pure;
871 
877 static __hwloc_inline int
878 hwloc_get_nbobjs_by_type (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure;
879 
884 static __hwloc_inline hwloc_obj_t
885 hwloc_get_root_obj (hwloc_topology_t topology) __hwloc_attribute_pure;
886 
888 HWLOC_DECLSPEC hwloc_obj_t hwloc_get_obj_by_depth (hwloc_topology_t topology, int depth, unsigned idx) __hwloc_attribute_pure;
889 
896 static __hwloc_inline hwloc_obj_t
897 hwloc_get_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx) __hwloc_attribute_pure;
898 
903 static __hwloc_inline hwloc_obj_t
904 hwloc_get_next_obj_by_depth (hwloc_topology_t topology, int depth, hwloc_obj_t prev);
905 
912 static __hwloc_inline hwloc_obj_t
914  hwloc_obj_t prev);
915 
932 HWLOC_DECLSPEC const char * hwloc_obj_type_string (hwloc_obj_type_t type) __hwloc_attribute_const;
933 
951 HWLOC_DECLSPEC int hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_t size,
952  hwloc_obj_t obj,
953  int verbose);
954 
966 HWLOC_DECLSPEC int hwloc_obj_attr_snprintf(char * __hwloc_restrict string, size_t size,
967  hwloc_obj_t obj, const char * __hwloc_restrict separator,
968  int verbose);
969 
993 HWLOC_DECLSPEC int hwloc_type_sscanf(const char *string,
994  hwloc_obj_type_t *typep,
995  union hwloc_obj_attr_u *attrp, size_t attrsize);
996 
1018 HWLOC_DECLSPEC int hwloc_type_sscanf_as_depth(const char *string,
1019  hwloc_obj_type_t *typep,
1020  hwloc_topology_t topology, int *depthp);
1021 
1037 static __hwloc_inline const char *
1038 hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name) __hwloc_attribute_pure;
1039 
1056 HWLOC_DECLSPEC int hwloc_obj_add_info(hwloc_obj_t obj, const char *name, const char *value);
1057 
1129 typedef enum {
1133 
1137 
1162 
1180 
1186 HWLOC_DECLSPEC int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags);
1187 
1193 HWLOC_DECLSPEC int hwloc_get_cpubind(hwloc_topology_t topology, hwloc_cpuset_t set, int flags);
1194 
1206 HWLOC_DECLSPEC int hwloc_set_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags);
1207 
1219 HWLOC_DECLSPEC int hwloc_get_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags);
1220 
1221 #ifdef hwloc_thread_t
1222 
1229 HWLOC_DECLSPEC int hwloc_set_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags);
1230 #endif
1231 
1232 #ifdef hwloc_thread_t
1233 
1240 HWLOC_DECLSPEC int hwloc_get_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags);
1241 #endif
1242 
1256 HWLOC_DECLSPEC int hwloc_get_last_cpu_location(hwloc_topology_t topology, hwloc_cpuset_t set, int flags);
1257 
1274 HWLOC_DECLSPEC int hwloc_get_proc_last_cpu_location(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags);
1275 
1355 typedef enum {
1364 
1375 
1379 
1388 
1395 
1404 
1418 typedef enum {
1424 
1429 
1437 
1443 
1456 
1468 
1484 HWLOC_DECLSPEC int hwloc_set_membind(hwloc_topology_t topology, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags);
1485 
1530 HWLOC_DECLSPEC int hwloc_get_membind(hwloc_topology_t topology, hwloc_bitmap_t set, hwloc_membind_policy_t * policy, int flags);
1531 
1544 HWLOC_DECLSPEC int hwloc_set_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags);
1545 
1585 HWLOC_DECLSPEC int hwloc_get_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_bitmap_t set, hwloc_membind_policy_t * policy, int flags);
1586 
1597 HWLOC_DECLSPEC int hwloc_set_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags);
1598 
1626 HWLOC_DECLSPEC int hwloc_get_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, hwloc_membind_policy_t * policy, int flags);
1627 
1647 HWLOC_DECLSPEC int hwloc_get_area_memlocation(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, int flags);
1648 
1656 HWLOC_DECLSPEC void *hwloc_alloc(hwloc_topology_t topology, size_t len);
1657 
1672 HWLOC_DECLSPEC void *hwloc_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc;
1673 
1683 static __hwloc_inline void *
1684 hwloc_alloc_membind_policy(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc;
1685 
1689 HWLOC_DECLSPEC int hwloc_free(hwloc_topology_t topology, void *addr, size_t len);
1690 
1727 HWLOC_DECLSPEC int hwloc_topology_set_pid(hwloc_topology_t __hwloc_restrict topology, hwloc_pid_t pid);
1728 
1757 HWLOC_DECLSPEC int hwloc_topology_set_synthetic(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict description);
1758 
1785 HWLOC_DECLSPEC int hwloc_topology_set_xml(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict xmlpath);
1786 
1813 HWLOC_DECLSPEC int hwloc_topology_set_xmlbuffer(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict buffer, int size);
1814 
1822 };
1823 
1838 HWLOC_DECLSPEC int hwloc_topology_set_components(hwloc_topology_t __hwloc_restrict topology, unsigned long flags, const char * __hwloc_restrict name);
1839 
1880 
1900 
1921 };
1922 
1932 HWLOC_DECLSPEC int hwloc_topology_set_flags (hwloc_topology_t topology, unsigned long flags);
1933 
1940 HWLOC_DECLSPEC unsigned long hwloc_topology_get_flags (hwloc_topology_t topology);
1941 
1949 HWLOC_DECLSPEC int hwloc_topology_is_thissystem(hwloc_topology_t __hwloc_restrict topology) __hwloc_attribute_pure;
1950 
1954  unsigned char pu;
1956  unsigned char numa;
1958  unsigned char numa_memory;
1960  unsigned char disallowed_pu;
1962  unsigned char disallowed_numa;
1963 };
1964 
1972  unsigned char set_thisproc_cpubind;
1974  unsigned char get_thisproc_cpubind;
1976  unsigned char set_proc_cpubind;
1978  unsigned char get_proc_cpubind;
1980  unsigned char set_thisthread_cpubind;
1982  unsigned char get_thisthread_cpubind;
1984  unsigned char set_thread_cpubind;
1986  unsigned char get_thread_cpubind;
1993 };
1994 
2002  unsigned char set_thisproc_membind;
2004  unsigned char get_thisproc_membind;
2006  unsigned char set_proc_membind;
2008  unsigned char get_proc_membind;
2010  unsigned char set_thisthread_membind;
2012  unsigned char get_thisthread_membind;
2014  unsigned char set_area_membind;
2016  unsigned char get_area_membind;
2018  unsigned char alloc_membind;
2020  unsigned char firsttouch_membind;
2022  unsigned char bind_membind;
2024  unsigned char interleave_membind;
2026  unsigned char nexttouch_membind;
2028  unsigned char migrate_membind;
2030  unsigned char get_area_memlocation;
2031 };
2032 
2043 };
2044 
2054 HWLOC_DECLSPEC const struct hwloc_topology_support *hwloc_topology_get_support(hwloc_topology_t __hwloc_restrict topology);
2055 
2072 
2080 
2094 
2109 };
2110 
2114 
2118 
2123 HWLOC_DECLSPEC int hwloc_topology_set_all_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
2124 
2129 HWLOC_DECLSPEC int hwloc_topology_set_cache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
2130 
2135 HWLOC_DECLSPEC int hwloc_topology_set_icache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
2136 
2139 HWLOC_DECLSPEC int hwloc_topology_set_io_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
2140 
2151 HWLOC_DECLSPEC void hwloc_topology_set_userdata(hwloc_topology_t topology, const void *userdata);
2152 
2158 HWLOC_DECLSPEC void * hwloc_topology_get_userdata(hwloc_topology_t topology);
2159 
2175 
2181 
2188 
2194 
2200 };
2201 
2226 HWLOC_DECLSPEC int hwloc_topology_restrict(hwloc_topology_t __hwloc_restrict topology, hwloc_const_bitmap_t set, unsigned long flags);
2227 
2235 
2244 
2248 };
2249 
2265 HWLOC_DECLSPEC int hwloc_topology_allow(hwloc_topology_t __hwloc_restrict topology, hwloc_const_cpuset_t cpuset, hwloc_const_nodeset_t nodeset, unsigned long flags);
2266 
2288 HWLOC_DECLSPEC hwloc_obj_t hwloc_topology_insert_misc_object(hwloc_topology_t topology, hwloc_obj_t parent, const char *name);
2289 
2310 HWLOC_DECLSPEC hwloc_obj_t hwloc_topology_alloc_group_object(hwloc_topology_t topology);
2311 
2348 HWLOC_DECLSPEC hwloc_obj_t hwloc_topology_insert_group_object(hwloc_topology_t topology, hwloc_obj_t group);
2349 
2359 HWLOC_DECLSPEC int hwloc_obj_add_other_obj_sets(hwloc_obj_t dst, hwloc_obj_t src);
2360 
2365 #ifdef __cplusplus
2366 } /* extern "C" */
2367 #endif
2368 
2369 
2370 /* high-level helpers */
2371 #include "hwloc/helper.h"
2372 
2373 /* inline code of some functions above */
2374 #include "hwloc/inlines.h"
2375 
2376 /* exporting to XML or synthetic */
2377 #include "hwloc/export.h"
2378 
2379 /* distances */
2380 #include "hwloc/distances.h"
2381 
2382 /* topology diffs */
2383 #include "hwloc/diff.h"
2384 
2385 /* deprecated headers */
2386 #include "hwloc/deprecated.h"
2387 
2388 #endif /* HWLOC_H */
int hwloc_obj_add_info(hwloc_obj_t obj, const char *name, const char *value)
Add the given info name and value pair to the given object.
-
const char * hwloc_obj_type_string(hwloc_obj_type_t type)
Return a constant stringified object type.
-
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:431
-
static int hwloc_get_nbobjs_by_type(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the width of level type type.
-
Move Misc objects to ancestors if their parents are removed during restriction. If this flag is not s...
Definition: hwloc.h:2193
-
Operating system network device. For instance the "eth0" interface on Linux.
Definition: hwloc.h:329
-
unsigned char get_area_membind
Definition: hwloc.h:2016
-
unsigned char func
Definition: hwloc.h:618
-
struct hwloc_obj * prev_sibling
Previous object below the same parent (inside the same list of children).
Definition: hwloc.h:434
-
unsigned io_arity
Number of I/O children. These children are listed in io_first_child.
Definition: hwloc.h:475
-
Returned by get_membind() functions when multiple threads or parts of a memory area have differing me...
Definition: hwloc.h:1402
-
unsigned memory_arity
Number of Memory children. These children are listed in memory_first_child.
Definition: hwloc.h:457
-
Virtual depth for MemCache object.
Definition: hwloc.h:804
-
unsigned long hwloc_topology_get_flags(hwloc_topology_t topology)
Get OR&#39;ed flags of a topology.
-
Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially incl...
Definition: hwloc.h:2180
-
Object type-specific Attributes.
Definition: hwloc.h:582
-
int hwloc_get_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
Get the current physical binding of process pid.
-
int hwloc_topology_load(hwloc_topology_t topology)
Build the actual topology.
-
int hwloc_get_cpubind(hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
Get current process or thread binding.
-
Flags describing actual PU binding support for this topology.
Definition: hwloc.h:1970
-
Level 4 Data (or Unified) Cache.
Definition: hwloc.h:212
-
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux...
Definition: hwloc.h:336
-
unsigned char get_area_memlocation
Definition: hwloc.h:2030
-
static int hwloc_get_type_or_below_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type or below.
-
int hwloc_topology_set_icache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all CPU instruction cache object types.
-
Only allow objects that are available to the current process.
Definition: hwloc.h:2243
-
hwloc_uint64_t total_memory
Total memory (in bytes) in NUMA nodes below this object.
Definition: hwloc.h:398
-
PCI-side of a bridge.
Definition: hwloc.h:319
-
Value returned by hwloc_compare_types() when types can not be compared.
Definition: hwloc.h:364
-
struct hwloc_topology_discovery_support * discovery
Definition: hwloc.h:2040
-
struct hwloc_topology_cpubind_support * cpubind
Definition: hwloc.h:2041
-
Move I/O objects to ancestors if their parents are removed during restriction. If this flag is not se...
Definition: hwloc.h:2199
-
int hwloc_get_memory_parents_depth(hwloc_topology_t topology)
Return the depth of parents where memory objects are attached.
-
void hwloc_topology_check(hwloc_topology_t topology)
Run internal checks on a topology structure.
-
unsigned char get_proc_last_cpu_location
Definition: hwloc.h:1990
-
int hwloc_topology_set_synthetic(hwloc_topology_t restrict topology, const char *restrict description)
Enable synthetic topology.
-
static void * hwloc_alloc_membind_policy(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Allocate some memory on NUMA memory nodes specified by set.
-
enum hwloc_obj_cache_type_e hwloc_obj_cache_type_t
Cache type.
-
void * hwloc_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Allocate some memory on NUMA memory nodes specified by set.
-
void hwloc_topology_set_userdata(hwloc_topology_t topology, const void *userdata)
Set the topology-specific userdata pointer.
-
struct hwloc_obj * memory_first_child
First Memory child. NUMA nodes and Memory-side caches are listed here (memory_arity and memory_first_...
Definition: hwloc.h:460
-
hwloc_obj_bridge_type_t downstream_type
Definition: hwloc.h:636
-
int hwloc_obj_type_snprintf(char *restrict string, size_t size, hwloc_obj_t obj, int verbose)
Stringify the type of a given topology object into a human-readable form.
-
struct hwloc_obj * misc_first_child
First Misc child. Misc objects are listed here (misc_arity and misc_first_child) instead of in the no...
Definition: hwloc.h:490
-
int hwloc_topology_set_io_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all I/O object types.
-
hwloc_obj_osdev_type_e
Type of a OS device.
Definition: hwloc.h:323
-
int hwloc_obj_attr_snprintf(char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, int verbose)
Stringify the attributes of a given topology object into a human-readable form.
-
PCI Device specific Object Attributes.
Definition: hwloc.h:616
-
Physical package. The physical package that usually gets inserted into a socket on the motherboard...
Definition: hwloc.h:187
-
Virtual depth for PCI device object level.
Definition: hwloc.h:801
-
int symmetric_subtree
Set if the subtree of normal objects below this object is symmetric, which means all normal children ...
Definition: hwloc.h:446
-
Mark all objects as allowed in the topology.
Definition: hwloc.h:2234
-
int hwloc_type_sscanf_as_depth(const char *string, hwloc_obj_type_t *typep, hwloc_topology_t topology, int *depthp)
Return an object type and its level depth from a type string.
-
Operating system openfabrics device. For instance the "mlx4_0" InfiniBand HCA, or "hfi1_0" Omni-Path ...
Definition: hwloc.h:331
-
hwloc_uint64_t local_memory
Local memory (in bytes)
Definition: hwloc.h:585
-
int hwloc_set_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags)
Bind a process pid on cpus given in physical bitmap set.
-
hwloc_const_bitmap_t hwloc_const_nodeset_t
A non-modifiable hwloc_nodeset_t.
Definition: hwloc.h:160
-
Avoid any effect on memory binding.
Definition: hwloc.h:1178
-
Array of local memory page types, NULL if no local memory and page_types is 0.
Definition: hwloc.h:592
-
struct hwloc_obj * prev_cousin
Previous object of same type and depth.
Definition: hwloc.h:428
-
Virtual depth for Misc object.
Definition: hwloc.h:803
-
int hwloc_topology_set_all_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all object types.
-
const struct hwloc_bitmap_s * hwloc_const_bitmap_t
a non-modifiable hwloc_bitmap_t
Definition: bitmap.h:70
-
Structure of a topology object.
Definition: hwloc.h:381
-
int hwloc_topology_init(hwloc_topology_t *topologyp)
Allocate a topology context.
-
Bind all threads of the current (possibly) multithreaded process.
Definition: hwloc.h:1132
-
unsigned char numa_memory
Detecting the amount of memory in NUMA nodes is supported.
Definition: hwloc.h:1958
-
float linkspeed
Definition: hwloc.h:622
-
Avoid any effect on CPU binding.
Definition: hwloc.h:1455
-
Machine. A set of processors and memory with cache coherency.
Definition: hwloc.h:178
-
struct hwloc_topology_membind_support * membind
Definition: hwloc.h:2042
-
unsigned char get_thisproc_cpubind
Definition: hwloc.h:1974
-
int hwloc_topology_set_xmlbuffer(hwloc_topology_t restrict topology, const char *restrict buffer, int size)
Enable XML based topology using a memory buffer (instead of a file, as with hwloc_topology_set_xml())...
-
unsigned arity
Number of normal children. Memory, Misc and I/O children are not listed here but rather in their dedi...
Definition: hwloc.h:437
-
hwloc_obj_type_t
Definition: hwloc.h:177
-
int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)
Bind current process or thread on cpus given in physical bitmap set.
-
unsigned char bind_membind
Definition: hwloc.h:2022
-
unsigned char get_thread_cpubind
Definition: hwloc.h:1986
-
hwloc_obj_t hwloc_topology_alloc_group_object(hwloc_topology_t topology)
Allocate a Group object to insert later with hwloc_topology_insert_group_object().
-
unsigned char set_thread_cpubind
Definition: hwloc.h:1984
-
Allocate each memory page individually on the local NUMA node of the thread that touches it...
Definition: hwloc.h:1374
-
unsigned short domain
Definition: hwloc.h:632
-
unsigned char migrate_membind
Definition: hwloc.h:2028
-
void * hwloc_topology_get_userdata(hwloc_topology_t topology)
Retrieve the topology-specific userdata pointer.
-
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
-
Assume that the selected backend provides the topology for the system on which we are running...
Definition: hwloc.h:1899
-
OS Device specific Object Attributes.
Definition: hwloc.h:640
-
int hwloc_free(hwloc_topology_t topology, void *addr, size_t len)
Free memory that was previously allocated by hwloc_alloc() or hwloc_alloc_membind().
-
unsigned char set_thisproc_cpubind
Definition: hwloc.h:1972
-
Reset the memory allocation policy to the system default. Depending on the operating system...
Definition: hwloc.h:1363
-
int hwloc_set_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Set the default memory binding policy of the specified process to prefer the NUMA node(s) specified b...
-
struct hwloc_obj * last_child
Last normal child.
Definition: hwloc.h:443
-
static int hwloc_get_type_or_above_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type or above.
-
unsigned char get_thisthread_cpubind
Definition: hwloc.h:1982
-
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
-
unsigned page_types_len
Size of array page_types.
Definition: hwloc.h:586
-
Group-specific Object Attributes.
Definition: hwloc.h:608
-
hwloc_membind_policy_t
Memory binding policy.
Definition: hwloc.h:1355
-
Allocate memory on the given nodes in an interleaved / round-robin manner. The precise layout of the ...
Definition: hwloc.h:1387
-
Ignore all objects of this type.
Definition: hwloc.h:2079
-
hwloc_uint64_t size
Size of pages.
Definition: hwloc.h:593
-
static hwloc_obj_t hwloc_get_root_obj(hwloc_topology_t topology)
Returns the top-object of the topology-tree.
-
NUMA node-specific Object Attributes.
Definition: hwloc.h:584
-
struct hwloc_obj * hwloc_obj_t
Convenience typedef; a pointer to a struct hwloc_obj.
Definition: hwloc.h:579
-
Level 3 Data (or Unified) Cache.
Definition: hwloc.h:211
-
int hwloc_set_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Bind the already-allocated memory identified by (addr, len) to the NUMA node(s) specified by set...
-
Allocate memory on the specified nodes.
Definition: hwloc.h:1378
-
Allow a custom set of objects, given to hwloc_topology_allow() as cpuset and/or nodeset parameters...
Definition: hwloc.h:2247
-
Level 1 instruction Cache (filtered out by default).
Definition: hwloc.h:215
-
Only keep likely-important objects of the given type.
Definition: hwloc.h:2108
-
char * value
Info value.
Definition: hwloc.h:651
-
Set of flags describing actual support for this topology.
Definition: hwloc.h:2039
-
unsigned depth
Depth of group object. It may change if intermediate Group objects are added.
Definition: hwloc.h:609
-
int hwloc_topology_set_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e filter)
Set the filtering for the given object type.
-
int hwloc_topology_get_depth(hwloc_topology_t restrict topology)
Get the depth of the hierarchical tree of objects.
-
Blacklist the target component from being used.
Definition: hwloc.h:1821
-
hwloc_nodeset_t nodeset
NUMA nodes covered by this object or containing this object.
Definition: hwloc.h:525
-
int hwloc_topology_get_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter)
Get the current filtering for the given object type.
-
unsigned hwloc_get_nbobjs_by_depth(hwloc_topology_t topology, int depth)
Returns the width of level at depth depth.
-
Flags describing actual discovery support for this topology.
Definition: hwloc.h:1952
-
int hwloc_topology_allow(hwloc_topology_t restrict topology, hwloc_const_cpuset_t cpuset, hwloc_const_nodeset_t nodeset, unsigned long flags)
Change the sets of allowed PUs and NUMA nodes in the topology.
-
int hwloc_topology_set_components(hwloc_topology_t restrict topology, unsigned long flags, const char *restrict name)
Prevent a discovery component from being used for a topology.
-
Operating system device (filtered out by default). They are not added to the topology unless I/O disc...
Definition: hwloc.h:269
-
unsigned char firsttouch_membind
Definition: hwloc.h:2020
-
unsigned char set_thisthread_cpubind
Definition: hwloc.h:1980
-
unsigned char set_thisproc_membind
Definition: hwloc.h:2002
-
unsigned depth
Definition: hwloc.h:637
-
Level 3 instruction Cache (filtered out by default).
Definition: hwloc.h:217
-
unsigned char subordinate_bus
Definition: hwloc.h:633
-
Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical ...
Definition: hwloc.h:197
-
unsigned hwloc_get_api_version(void)
Indicate at runtime which hwloc API version was used at build time.
-
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:497
-
int hwloc_type_sscanf(const char *string, hwloc_obj_type_t *typep, union hwloc_obj_attr_u *attrp, size_t attrsize)
Return an object type and attributes from a type string.
-
enum hwloc_obj_bridge_type_e hwloc_obj_bridge_type_t
Type of one side (upstream or downstream) of an I/O bridge.
-
Bridge specific Object Attribues.
Definition: hwloc.h:625
-
int hwloc_obj_add_other_obj_sets(hwloc_obj_t dst, hwloc_obj_t src)
Setup object cpusets/nodesets by OR&#39;ing another object&#39;s sets.
-
Set policy for a specific thread of the current process. This flag is mutually exclusive with HWLOC_M...
Definition: hwloc.h:1428
-
static const char * hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name)
Search the given key name in object infos and return the corresponding value.
-
unsigned kind
Internally-used kind of group.
Definition: hwloc.h:611
-
struct hwloc_info_s * infos
Array of stringified info type=name.
Definition: hwloc.h:561
-
unsigned subkind
Internally-used subkind to distinguish different levels of groups with same kind. ...
Definition: hwloc.h:612
-
unsigned short class_id
Definition: hwloc.h:619
-
Virtual depth for NUMA nodes.
Definition: hwloc.h:799
-
Detect the whole system, ignore reservations, include disallowed objects.
Definition: hwloc.h:1879
-
hwloc_obj_t hwloc_get_obj_by_depth(hwloc_topology_t topology, int depth, unsigned idx)
Returns the topology object at logical index idx from depth depth.
-
hwloc_obj_bridge_type_e
Type of one side (upstream or downstream) of an I/O bridge.
Definition: hwloc.h:317
-
struct hwloc_obj ** children
Normal children, children[0 .. arity -1].
Definition: hwloc.h:441
-
NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...
Definition: hwloc.h:232
-
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:262
-
Flags describing actual memory binding support for this topology.
Definition: hwloc.h:2000
-
int hwloc_set_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags)
Bind a thread thread on cpus given in physical bitmap set.
-
Get the set of allowed resources from the local operating system even if the topology was loaded from...
Definition: hwloc.h:1920
-
Only ignore objects if their entire level does not bring any structure.
Definition: hwloc.h:2093
-
Memory-side cache (filtered out by default). A cache in front of a specific NUMA node.
Definition: hwloc.h:288
-
hwloc_compare_types_e
Definition: hwloc.h:363
-
Object info.
Definition: hwloc.h:649
-
hwloc_type_filter_e
Type filtering flags.
Definition: hwloc.h:2065
-
unsigned char dont_merge
Flag preventing groups from being automatically merged with identical parent or children.
Definition: hwloc.h:613
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
hwloc_membind_flags_t
Memory binding flags.
Definition: hwloc.h:1418
-
void * hwloc_alloc(hwloc_topology_t topology, size_t len)
Allocate some memory.
-
struct hwloc_obj * next_cousin
Next object of same type and depth.
Definition: hwloc.h:427
-
Bind current thread of current process.
Definition: hwloc.h:1136
-
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
-
enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_t
Type of a OS device.
-
static hwloc_obj_t hwloc_get_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
Returns the topology object at logical index idx with type type.
-
Level 2 instruction Cache (filtered out by default).
Definition: hwloc.h:216
-
unsigned char get_thisproc_last_cpu_location
Definition: hwloc.h:1988
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
unsigned char interleave_membind
Definition: hwloc.h:2024
-
int hwloc_topology_restrict(hwloc_topology_t restrict topology, hwloc_const_bitmap_t set, unsigned long flags)
Restrict the topology to the given CPU set or nodeset.
-
Definition: hwloc.h:1436
-
Level 5 Data (or Unified) Cache.
Definition: hwloc.h:213
-
unsigned char get_proc_membind
Definition: hwloc.h:2008
-
unsigned misc_arity
Number of Misc children. These children are listed in misc_first_child.
Definition: hwloc.h:487
-
unsigned char get_proc_cpubind
Definition: hwloc.h:1978
-
static hwloc_obj_t hwloc_get_next_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev)
Returns the next object of type type.
-
struct hwloc_obj * first_child
First normal child.
Definition: hwloc.h:442
-
struct hwloc_obj * io_first_child
First I/O child. Bridges, PCI and OS devices are listed here (io_arity and io_first_child) instead of...
Definition: hwloc.h:478
-
hwloc_topology_flags_e
Flags to be set onto a topology context before load.
Definition: hwloc.h:1858
-
unsigned char alloc_membind
Definition: hwloc.h:2018
-
int hwloc_compare_types(hwloc_obj_type_t type1, hwloc_obj_type_t type2)
Compare the depth of two object types.
-
For each page bound with this policy, by next time it is touched (and next time only), it is moved from its current location to the local NUMA node of the thread where the memory reference occurred (if it needs to be moved at all).
Definition: hwloc.h:1394
-
Objects of given type exist at different depth in the topology (only for Groups). ...
Definition: hwloc.h:798
-
unsigned char numa
Detecting the number of NUMA nodes is supported.
Definition: hwloc.h:1956
-
int hwloc_topology_dup(hwloc_topology_t *newtopology, hwloc_topology_t oldtopology)
Duplicate a topology.
-
int hwloc_get_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
Query the default memory binding policy and physical locality of the specified process.
-
int depth
Vertical index in the hierarchy.
Definition: hwloc.h:404
-
hwloc_cpubind_flags_t
Process/Thread binding flags.
Definition: hwloc.h:1129
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
hwloc_cpuset_t complete_cpuset
The complete CPU set of logical processors of this object,.
Definition: hwloc.h:512
-
hwloc_obj_t hwloc_topology_insert_misc_object(hwloc_topology_t topology, hwloc_obj_t parent, const char *name)
Add a MISC object as a leaf of the topology.
-
int hwloc_get_proc_last_cpu_location(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
Get the last physical CPU where a process ran.
-
hwloc_uint64_t count
Number of pages of this size.
Definition: hwloc.h:594
-
int hwloc_get_membind(hwloc_topology_t topology, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
Query the default memory binding policy and physical locality of the current process or thread...
-
unsigned char get_thisthread_membind
Definition: hwloc.h:2012
-
unsigned linesize
Cache-line size in bytes. 0 if unknown.
Definition: hwloc.h:602
-
hwloc_restrict_flags_e
Flags to be given to hwloc_topology_restrict().
Definition: hwloc.h:2169
-
struct hwloc_obj * next_sibling
Next object below the same parent (inside the same list of children).
Definition: hwloc.h:433
-
char * name
Info name.
Definition: hwloc.h:650
-
No object of given type exists in the topology.
Definition: hwloc.h:797
-
unsigned char disallowed_pu
Detecting and identifying PU objects that are not available to the current process is supported...
Definition: hwloc.h:1960
-
unsigned short domain
Definition: hwloc.h:617
-
Group objects. Objects which do not fit in the above but are detected by hwloc and are useful to take...
Definition: hwloc.h:219
-
static hwloc_obj_t hwloc_get_next_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t prev)
Returns the next object at depth depth.
-
Instruction cache (filtered out by default).
Definition: hwloc.h:313
-
Data cache.
Definition: hwloc.h:312
-
Operating system dma engine device. For instance the "dma0chan0" DMA channel on Linux.
Definition: hwloc.h:334
-
int hwloc_get_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
Query the CPUs near the physical NUMA node(s) and binding policy of the memory identified by (addr...
-
const struct hwloc_topology_support * hwloc_topology_get_support(hwloc_topology_t restrict topology)
Retrieve the topology support.
-
hwloc_allow_flags_e
Flags to be given to hwloc_topology_allow().
Definition: hwloc.h:2229
-
Remove all objects that became Memory-less. By default, only objects that contain no PU and no memory...
Definition: hwloc.h:2187
-
Miscellaneous objects (filtered out by default). Objects without particular meaning, that can e.g. be added by the application for its own use, or by hwloc for miscellaneous objects such as MemoryModule (DIMMs). These objects are not listed in the main children list, but rather in the dedicated misc children list. Misc objects may only have Misc objects as children, and those are in the dedicated misc children list as well. Misc objects have NULL CPU and node sets.
Definition: hwloc.h:277
-
hwloc_nodeset_t complete_nodeset
The complete NUMA node set of this object,.
Definition: hwloc.h:545
-
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:383
-
Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device...
Definition: hwloc.h:326
-
hwloc_obj_t hwloc_topology_insert_group_object(hwloc_topology_t topology, hwloc_obj_t group)
Add more structure to the topology by adding an intermediate Group.
-
unsigned char nexttouch_membind
Definition: hwloc.h:2026
-
Bridge (filtered out by default). Any bridge that connects the host or an I/O bus, to another I/O bus. They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.
Definition: hwloc.h:253
-
hwloc_obj_cache_type_e
Cache type.
Definition: hwloc.h:310
-
int hwloc_topology_set_xml(hwloc_topology_t restrict topology, const char *restrict xmlpath)
Enable XML-file based topology.
-
Virtual depth for bridge object level.
Definition: hwloc.h:800
-
Die within a physical package. A subpart of the physical package, that contains multiple cores...
Definition: hwloc.h:301
-
hwloc_obj_cache_type_t type
Cache type.
Definition: hwloc.h:605
-
hwloc_obj_type_t hwloc_get_depth_type(hwloc_topology_t topology, int depth)
Returns the type of objects at depth depth.
-
int hwloc_get_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags)
Get the current physical binding of thread tid.
-
Core. A computation unit (may be shared by several logical processors).
Definition: hwloc.h:193
-
Host-side of a bridge, only possible upstream.
Definition: hwloc.h:318
-
hwloc_topology_components_flag_e
Flags to be passed to hwloc_topology_set_components()
Definition: hwloc.h:1817
-
int hwloc_set_membind(hwloc_topology_t topology, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) spe...
-
int hwloc_topology_abi_check(hwloc_topology_t topology)
Verify that the topology is compatible with the current hwloc library.
-
Consider the bitmap argument as a nodeset.
Definition: hwloc.h:1466
-
unsigned sibling_rank
Index in parent&#39;s children[] array. Or the index in parent&#39;s Memory, I/O or Misc children list...
Definition: hwloc.h:432
-
unsigned depth
Depth of cache (e.g., L1, L2, ...etc.)
Definition: hwloc.h:601
-
unsigned char set_thisthread_membind
Definition: hwloc.h:2010
-
hwloc_get_type_depth_e
Definition: hwloc.h:796
-
Unified cache.
Definition: hwloc.h:311
-
int hwloc_get_last_cpu_location(hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
Get the last physical CPU where the current process or thread ran.
-
hwloc_uint64_t size
Size of cache in bytes.
Definition: hwloc.h:600
-
Keep all objects of this type.
Definition: hwloc.h:2071
-
void * userdata
Application-given private data pointer, initialized to NULL, use it as you wish. See hwloc_topology_s...
Definition: hwloc.h:565
-
int hwloc_topology_set_pid(hwloc_topology_t restrict topology, hwloc_pid_t pid)
Change which process the topology is viewed from.
-
unsigned short vendor_id
Definition: hwloc.h:620
-
unsigned infos_count
Size of infos array.
Definition: hwloc.h:562
-
unsigned char disallowed_numa
Detecting and identifying NUMA nodes that are not available to the current process is supported...
Definition: hwloc.h:1962
-
unsigned char get_thisthread_last_cpu_location
Definition: hwloc.h:1992
-
hwloc_uint64_t gp_index
Global persistent index. Generated by hwloc, unique across the topology (contrary to os_index) and pe...
Definition: hwloc.h:570
-
Request for strict binding from the OS.
Definition: hwloc.h:1161
-
void hwloc_topology_destroy(hwloc_topology_t topology)
Terminate and free a topology context.
-
int hwloc_topology_set_flags(hwloc_topology_t topology, unsigned long flags)
Set OR&#39;ed flags to non-yet-loaded topology.
-
int hwloc_topology_set_cache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all CPU cache object types.
-
Operating system block device, or non-volatile memory device. For instance "sda" or "dax2...
Definition: hwloc.h:324
-
Cache-specific Object Attributes.
Definition: hwloc.h:599
-
Virtual depth for software device object level.
Definition: hwloc.h:802
-
unsigned char revision
Definition: hwloc.h:621
-
unsigned char set_proc_cpubind
Definition: hwloc.h:1976
-
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
-
Set policy for all threads of the specified (possibly multithreaded) process. This flag is mutually e...
Definition: hwloc.h:1423
-
int hwloc_get_area_memlocation(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, int flags)
Get the NUMA nodes where memory identified by (addr, len ) is physically allocated.
-
hwloc_bitmap_t hwloc_nodeset_t
A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes...
Definition: hwloc.h:157
-
unsigned char set_area_membind
Definition: hwloc.h:2014
-
char * subtype
Subtype string to better describe the type field.
Definition: hwloc.h:384
-
hwloc_obj_bridge_type_t upstream_type
Definition: hwloc.h:629
-
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine, except for PUs and NUMA nodes. Set to HWLOC_UNKNOWN_INDEX if unknown or irrelevant for this object.
Definition: hwloc.h:386
-
unsigned char set_proc_membind
Definition: hwloc.h:2006
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
-
Level 2 Data (or Unified) Cache.
Definition: hwloc.h:210
-
Level 1 Data (or Unified) Cache.
Definition: hwloc.h:209
-
unsigned logical_index
Horizontal index in the whole list of similar objects, hence guaranteed unique across the entire mach...
Definition: hwloc.h:419
-
unsigned char pu
Detecting the number of PU objects is supported.
Definition: hwloc.h:1954
-
unsigned char get_thisproc_membind
Definition: hwloc.h:2004
-
Migrate existing allocated memory. If the memory cannot be migrated and the HWLOC_MEMBIND_STRICT flag...
Definition: hwloc.h:1442
-
Remove all objects that became CPU-less. By default, only objects that contain no PU and no memory ar...
Definition: hwloc.h:2174
-
int associativity
Ways of associativity, -1 if fully associative, 0 if unknown.
Definition: hwloc.h:603
+
1 /*
+
2  * Copyright © 2009 CNRS
+
3  * Copyright © 2009-2020 Inria. All rights reserved.
+
4  * Copyright © 2009-2012 Université Bordeaux
+
5  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
+
6  * See COPYING in top-level directory.
+
7  */
+
8 
+
9 /*=====================================================================
+
10  * PLEASE GO READ THE DOCUMENTATION!
+
11  * ------------------------------------------------
+
12  * $tarball_directory/doc/doxygen-doc/
+
13  * or
+
14  * http://www.open-mpi.org/projects/hwloc/doc/
+
15  *=====================================================================
+
16  *
+
17  * FAIR WARNING: Do NOT expect to be able to figure out all the
+
18  * subtleties of hwloc by simply reading function prototypes and
+
19  * constant descrptions here in this file.
+
20  *
+
21  * Hwloc has wonderful documentation in both PDF and HTML formats for
+
22  * your reading pleasure. The formal documentation explains a LOT of
+
23  * hwloc-specific concepts, provides definitions, and discusses the
+
24  * "big picture" for many of the things that you'll find here in this
+
25  * header file.
+
26  *
+
27  * The PDF/HTML documentation was generated via Doxygen; much of what
+
28  * you'll see in there is also here in this file. BUT THERE IS A LOT
+
29  * THAT IS IN THE PDF/HTML THAT IS ***NOT*** IN hwloc.h!
+
30  *
+
31  * There are entire paragraph-length descriptions, discussions, and
+
32  * pretty prictures to explain subtle corner cases, provide concrete
+
33  * examples, etc.
+
34  *
+
35  * Please, go read the documentation. :-)
+
36  *
+
37  * Moreover there are several examples of hwloc use under doc/examples
+
38  * in the source tree.
+
39  *
+
40  *=====================================================================*/
+
41 
+
53 #ifndef HWLOC_H
+
54 #define HWLOC_H
+
55 
+
56 #include "hwloc/autogen/config.h"
+
57 
+
58 #include <sys/types.h>
+
59 #include <stdio.h>
+
60 #include <string.h>
+
61 #include <limits.h>
+
62 
+
63 /*
+
64  * Symbol transforms
+
65  */
+
66 #include "hwloc/rename.h"
+
67 
+
68 /*
+
69  * Bitmap definitions
+
70  */
+
71 
+
72 #include "hwloc/bitmap.h"
+
73 
+
74 
+
75 #ifdef __cplusplus
+
76 extern "C" {
+
77 #endif
+
78 
+
79 
+
96 #define HWLOC_API_VERSION 0x00020100
+
97 
+
102 HWLOC_DECLSPEC unsigned hwloc_get_api_version(void);
+
103 
+
105 #define HWLOC_COMPONENT_ABI 6
+
106 
+ + +
143 
+ + +
161 
+
176 typedef enum {
+
177 
+
179 #define HWLOC_OBJ_TYPE_MIN HWLOC_OBJ_MACHINE /* Sentinel value */
+
180 
+ + + + + + + + + + + + + + + + + + + + +
310  HWLOC_OBJ_TYPE_MAX
+ +
312 
+ + + + + +
319 
+ + + + +
325 
+ + + + + + + + +
345 
+
365 HWLOC_DECLSPEC int hwloc_compare_types (hwloc_obj_type_t type1, hwloc_obj_type_t type2) __hwloc_attribute_const;
+
366 
+
368 #define HWLOC_TYPE_UNORDERED INT_MAX
+
369 
+
378 union hwloc_obj_attr_u;
+
379 
+
384 struct hwloc_obj {
+
385  /* physical information */
+ +
387  char *subtype;
+
389  unsigned os_index;
+
394 #define HWLOC_UNKNOWN_INDEX (unsigned)-1
+
395 
+
396  char *name;
+
401  hwloc_uint64_t total_memory;
+ +
406  /* global position */
+
407  int depth;
+
422  unsigned logical_index;
+
429  /* cousins are all objects of the same type (and depth) across the entire topology */
+ + +
433  /* children of the same parent are siblings, even if they may have different type and depth */
+
434  struct hwloc_obj *parent;
+
435  unsigned sibling_rank;
+ + +
440  unsigned arity;
+
444  struct hwloc_obj **children;
+ + + +
460  unsigned memory_arity;
+ +
478  unsigned io_arity;
+ +
490  unsigned misc_arity;
+ +
499  /* cpusets and nodesets */
+ + + + +
564  struct hwloc_info_s *infos;
+
565  unsigned infos_count;
+
567  /* misc */
+
568  void *userdata;
+
573  hwloc_uint64_t gp_index;
+
578 };
+
582 typedef struct hwloc_obj * hwloc_obj_t;
+
583 
+ + +
588  hwloc_uint64_t local_memory;
+
589  unsigned page_types_len;
+ +
596  hwloc_uint64_t size;
+
597  hwloc_uint64_t count;
+
598  } * page_types;
+
599  } numanode;
+
600 
+ +
603  hwloc_uint64_t size;
+
604  unsigned depth;
+
605  unsigned linesize;
+ + +
609  } cache;
+ +
612  unsigned depth;
+
614  unsigned kind;
+
615  unsigned subkind;
+
616  unsigned char dont_merge;
+
617  } group;
+ +
620 #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN
+
621  unsigned short domain; /* Only 16bits PCI domains are supported by default */
+
622 #else
+
623  unsigned int domain; /* 32bits PCI domain support break the library ABI, hence it's disabled by default */
+
624 #endif
+
625  unsigned char bus, dev, func;
+
626  unsigned short class_id;
+ +
628  unsigned char revision;
+
629  float linkspeed; /* in GB/s */
+
630  } pcidev;
+ +
633  union {
+ +
635  } upstream;
+ +
637  union {
+
638  struct {
+
639 #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN
+
640  unsigned short domain; /* Only 16bits PCI domains are supported by default */
+
641 #else
+
642  unsigned int domain; /* 32bits PCI domain support break the library ABI, hence it's disabled by default */
+
643 #endif
+ +
645  } pci;
+
646  } downstream;
+ +
648  unsigned depth;
+
649  } bridge;
+ + +
653  } osdev;
+
654 };
+
655 
+
660 struct hwloc_info_s {
+
661  char *name;
+
662  char *value;
+
663 };
+
664 
+
673 struct hwloc_topology;
+
678 typedef struct hwloc_topology * hwloc_topology_t;
+
679 
+
686 HWLOC_DECLSPEC int hwloc_topology_init (hwloc_topology_t *topologyp);
+
687 
+
708 HWLOC_DECLSPEC int hwloc_topology_load(hwloc_topology_t topology);
+
709 
+
714 HWLOC_DECLSPEC void hwloc_topology_destroy (hwloc_topology_t topology);
+
715 
+
726 HWLOC_DECLSPEC int hwloc_topology_dup(hwloc_topology_t *newtopology, hwloc_topology_t oldtopology);
+
727 
+
745 HWLOC_DECLSPEC int hwloc_topology_abi_check(hwloc_topology_t topology);
+
746 
+
758 HWLOC_DECLSPEC void hwloc_topology_check(hwloc_topology_t topology);
+
759 
+
780 HWLOC_DECLSPEC int hwloc_topology_get_depth(hwloc_topology_t __hwloc_restrict topology) __hwloc_attribute_pure;
+
781 
+
805 HWLOC_DECLSPEC int hwloc_get_type_depth (hwloc_topology_t topology, hwloc_obj_type_t type);
+
806 
+ + + + + + + + + +
816 };
+
817 
+
837 HWLOC_DECLSPEC int hwloc_get_memory_parents_depth (hwloc_topology_t topology);
+
838 
+
852 static __hwloc_inline int
+
853 hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure;
+
854 
+
868 static __hwloc_inline int
+
869 hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure;
+
870 
+
878 HWLOC_DECLSPEC hwloc_obj_type_t hwloc_get_depth_type (hwloc_topology_t topology, int depth) __hwloc_attribute_pure;
+
879 
+
882 HWLOC_DECLSPEC unsigned hwloc_get_nbobjs_by_depth (hwloc_topology_t topology, int depth) __hwloc_attribute_pure;
+
883 
+
889 static __hwloc_inline int
+
890 hwloc_get_nbobjs_by_type (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure;
+
891 
+
896 static __hwloc_inline hwloc_obj_t
+
897 hwloc_get_root_obj (hwloc_topology_t topology) __hwloc_attribute_pure;
+
898 
+
900 HWLOC_DECLSPEC hwloc_obj_t hwloc_get_obj_by_depth (hwloc_topology_t topology, int depth, unsigned idx) __hwloc_attribute_pure;
+
901 
+
908 static __hwloc_inline hwloc_obj_t
+
909 hwloc_get_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx) __hwloc_attribute_pure;
+
910 
+
915 static __hwloc_inline hwloc_obj_t
+
916 hwloc_get_next_obj_by_depth (hwloc_topology_t topology, int depth, hwloc_obj_t prev);
+
917 
+
924 static __hwloc_inline hwloc_obj_t
+ +
926  hwloc_obj_t prev);
+
927 
+
944 HWLOC_DECLSPEC const char * hwloc_obj_type_string (hwloc_obj_type_t type) __hwloc_attribute_const;
+
945 
+
963 HWLOC_DECLSPEC int hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_t size,
+
964  hwloc_obj_t obj,
+
965  int verbose);
+
966 
+
978 HWLOC_DECLSPEC int hwloc_obj_attr_snprintf(char * __hwloc_restrict string, size_t size,
+
979  hwloc_obj_t obj, const char * __hwloc_restrict separator,
+
980  int verbose);
+
981 
+
1005 HWLOC_DECLSPEC int hwloc_type_sscanf(const char *string,
+
1006  hwloc_obj_type_t *typep,
+
1007  union hwloc_obj_attr_u *attrp, size_t attrsize);
+
1008 
+
1030 HWLOC_DECLSPEC int hwloc_type_sscanf_as_depth(const char *string,
+
1031  hwloc_obj_type_t *typep,
+
1032  hwloc_topology_t topology, int *depthp);
+
1033 
+
1049 static __hwloc_inline const char *
+
1050 hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name) __hwloc_attribute_pure;
+
1051 
+
1068 HWLOC_DECLSPEC int hwloc_obj_add_info(hwloc_obj_t obj, const char *name, const char *value);
+
1069 
+
1141 typedef enum {
+ +
1145 
+ +
1149 
+ +
1174 
+ + +
1192 
+
1198 HWLOC_DECLSPEC int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags);
+
1199 
+
1205 HWLOC_DECLSPEC int hwloc_get_cpubind(hwloc_topology_t topology, hwloc_cpuset_t set, int flags);
+
1206 
+
1218 HWLOC_DECLSPEC int hwloc_set_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags);
+
1219 
+
1231 HWLOC_DECLSPEC int hwloc_get_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags);
+
1232 
+
1233 #ifdef hwloc_thread_t
+
1234 
+
1241 HWLOC_DECLSPEC int hwloc_set_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags);
+
1242 #endif
+
1243 
+
1244 #ifdef hwloc_thread_t
+
1245 
+
1252 HWLOC_DECLSPEC int hwloc_get_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags);
+
1253 #endif
+
1254 
+
1268 HWLOC_DECLSPEC int hwloc_get_last_cpu_location(hwloc_topology_t topology, hwloc_cpuset_t set, int flags);
+
1269 
+
1286 HWLOC_DECLSPEC int hwloc_get_proc_last_cpu_location(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags);
+
1287 
+
1367 typedef enum {
+ +
1376 
+ +
1387 
+ +
1391 
+ +
1400 
+ +
1407 
+ + +
1416 
+
1430 typedef enum {
+ +
1436 
+ +
1441 
+ +
1449 
+ +
1455 
+ +
1468 
+ + +
1480 
+
1496 HWLOC_DECLSPEC int hwloc_set_membind(hwloc_topology_t topology, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags);
+
1497 
+
1542 HWLOC_DECLSPEC int hwloc_get_membind(hwloc_topology_t topology, hwloc_bitmap_t set, hwloc_membind_policy_t * policy, int flags);
+
1543 
+
1556 HWLOC_DECLSPEC int hwloc_set_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags);
+
1557 
+
1597 HWLOC_DECLSPEC int hwloc_get_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_bitmap_t set, hwloc_membind_policy_t * policy, int flags);
+
1598 
+
1609 HWLOC_DECLSPEC int hwloc_set_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags);
+
1610 
+
1638 HWLOC_DECLSPEC int hwloc_get_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, hwloc_membind_policy_t * policy, int flags);
+
1639 
+
1659 HWLOC_DECLSPEC int hwloc_get_area_memlocation(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, int flags);
+
1660 
+
1668 HWLOC_DECLSPEC void *hwloc_alloc(hwloc_topology_t topology, size_t len);
+
1669 
+
1684 HWLOC_DECLSPEC void *hwloc_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc;
+
1685 
+
1695 static __hwloc_inline void *
+
1696 hwloc_alloc_membind_policy(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc;
+
1697 
+
1701 HWLOC_DECLSPEC int hwloc_free(hwloc_topology_t topology, void *addr, size_t len);
+
1702 
+
1739 HWLOC_DECLSPEC int hwloc_topology_set_pid(hwloc_topology_t __hwloc_restrict topology, hwloc_pid_t pid);
+
1740 
+
1769 HWLOC_DECLSPEC int hwloc_topology_set_synthetic(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict description);
+
1770 
+
1797 HWLOC_DECLSPEC int hwloc_topology_set_xml(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict xmlpath);
+
1798 
+
1825 HWLOC_DECLSPEC int hwloc_topology_set_xmlbuffer(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict buffer, int size);
+
1826 
+ + +
1834 };
+
1835 
+
1850 HWLOC_DECLSPEC int hwloc_topology_set_components(hwloc_topology_t __hwloc_restrict topology, unsigned long flags, const char * __hwloc_restrict name);
+
1851 
+ + +
1892 
+ +
1912 
+ +
1933 };
+
1934 
+
1944 HWLOC_DECLSPEC int hwloc_topology_set_flags (hwloc_topology_t topology, unsigned long flags);
+
1945 
+
1952 HWLOC_DECLSPEC unsigned long hwloc_topology_get_flags (hwloc_topology_t topology);
+
1953 
+
1961 HWLOC_DECLSPEC int hwloc_topology_is_thissystem(hwloc_topology_t __hwloc_restrict topology) __hwloc_attribute_pure;
+
1962 
+ +
1966  unsigned char pu;
+
1968  unsigned char numa;
+
1970  unsigned char numa_memory;
+
1972  unsigned char disallowed_pu;
+
1974  unsigned char disallowed_numa;
+
1975 };
+
1976 
+ +
1984  unsigned char set_thisproc_cpubind;
+
1986  unsigned char get_thisproc_cpubind;
+
1988  unsigned char set_proc_cpubind;
+
1990  unsigned char get_proc_cpubind;
+
1992  unsigned char set_thisthread_cpubind;
+
1994  unsigned char get_thisthread_cpubind;
+
1996  unsigned char set_thread_cpubind;
+
1998  unsigned char get_thread_cpubind;
+ + + +
2005 };
+
2006 
+ +
2014  unsigned char set_thisproc_membind;
+
2016  unsigned char get_thisproc_membind;
+
2018  unsigned char set_proc_membind;
+
2020  unsigned char get_proc_membind;
+
2022  unsigned char set_thisthread_membind;
+
2024  unsigned char get_thisthread_membind;
+
2026  unsigned char set_area_membind;
+
2028  unsigned char get_area_membind;
+
2030  unsigned char alloc_membind;
+
2032  unsigned char firsttouch_membind;
+
2034  unsigned char bind_membind;
+
2036  unsigned char interleave_membind;
+
2038  unsigned char nexttouch_membind;
+
2040  unsigned char migrate_membind;
+
2042  unsigned char get_area_memlocation;
+
2043 };
+
2044 
+ + + + +
2055 };
+
2056 
+
2066 HWLOC_DECLSPEC const struct hwloc_topology_support *hwloc_topology_get_support(hwloc_topology_t __hwloc_restrict topology);
+
2067 
+ + +
2084 
+ +
2092 
+ +
2106 
+ +
2121 };
+
2122 
+
2125 HWLOC_DECLSPEC int hwloc_topology_set_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e filter);
+
2126 
+
2129 HWLOC_DECLSPEC int hwloc_topology_get_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter);
+
2130 
+
2135 HWLOC_DECLSPEC int hwloc_topology_set_all_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
+
2136 
+
2141 HWLOC_DECLSPEC int hwloc_topology_set_cache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
+
2142 
+
2147 HWLOC_DECLSPEC int hwloc_topology_set_icache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
+
2148 
+
2151 HWLOC_DECLSPEC int hwloc_topology_set_io_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter);
+
2152 
+
2163 HWLOC_DECLSPEC void hwloc_topology_set_userdata(hwloc_topology_t topology, const void *userdata);
+
2164 
+
2170 HWLOC_DECLSPEC void * hwloc_topology_get_userdata(hwloc_topology_t topology);
+
2171 
+ + +
2188 
+ +
2194 
+ +
2201 
+ +
2207 
+ +
2213 };
+
2214 
+
2239 HWLOC_DECLSPEC int hwloc_topology_restrict(hwloc_topology_t __hwloc_restrict topology, hwloc_const_bitmap_t set, unsigned long flags);
+
2240 
+ + +
2248 
+ +
2257 
+ +
2261 };
+
2262 
+
2278 HWLOC_DECLSPEC int hwloc_topology_allow(hwloc_topology_t __hwloc_restrict topology, hwloc_const_cpuset_t cpuset, hwloc_const_nodeset_t nodeset, unsigned long flags);
+
2279 
+
2301 HWLOC_DECLSPEC hwloc_obj_t hwloc_topology_insert_misc_object(hwloc_topology_t topology, hwloc_obj_t parent, const char *name);
+
2302 
+ +
2324 
+ +
2362 
+
2372 HWLOC_DECLSPEC int hwloc_obj_add_other_obj_sets(hwloc_obj_t dst, hwloc_obj_t src);
+
2373 
+
2378 #ifdef __cplusplus
+
2379 } /* extern "C" */
+
2380 #endif
+
2381 
+
2382 
+
2383 /* high-level helpers */
+
2384 #include "hwloc/helper.h"
+
2385 
+
2386 /* inline code of some functions above */
+
2387 #include "hwloc/inlines.h"
+
2388 
+
2389 /* exporting to XML or synthetic */
+
2390 #include "hwloc/export.h"
+
2391 
+
2392 /* distances */
+
2393 #include "hwloc/distances.h"
+
2394 
+
2395 /* topology diffs */
+
2396 #include "hwloc/diff.h"
+
2397 
+
2398 /* deprecated headers */
+
2399 #include "hwloc/deprecated.h"
+
2400 
+
2401 #endif /* HWLOC_H */
+
int hwloc_set_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Set the default memory binding policy of the specified process to prefer the NUMA node(s) specified b...
+
enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_t
Type of a OS device.
+
@ HWLOC_OBJ_OSDEV_OPENFABRICS
Operating system openfabrics device. For instance the "mlx4_0" InfiniBand HCA, or "hfi1_0" Omni-Path ...
Definition: hwloc.h:335
+
@ HWLOC_MEMBIND_STRICT
Definition: hwloc.h:1448
+
@ HWLOC_MEMBIND_MIXED
Returned by get_membind() functions when multiple threads or parts of a memory area have differing me...
Definition: hwloc.h:1414
+
hwloc_membind_flags_t
Memory binding flags.
Definition: hwloc.h:1430
+
@ HWLOC_OBJ_PCI_DEVICE
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:266
+
struct hwloc_obj_attr_u::hwloc_group_attr_s group
+
int hwloc_topology_set_flags(hwloc_topology_t topology, unsigned long flags)
Set OR'ed flags to non-yet-loaded topology.
+
hwloc_obj_bridge_type_t downstream_type
Definition: hwloc.h:647
+
@ HWLOC_OBJ_MEMCACHE
Memory-side cache (filtered out by default). A cache in front of a specific NUMA node.
Definition: hwloc.h:292
+
@ HWLOC_MEMBIND_THREAD
Set policy for a specific thread of the current process. This flag is mutually exclusive with HWLOC_M...
Definition: hwloc.h:1440
+
unsigned memory_arity
Number of Memory children. These children are listed in memory_first_child.
Definition: hwloc.h:460
+
@ HWLOC_OBJ_CACHE_INSTRUCTION
Instruction cache (filtered out by default).
Definition: hwloc.h:317
+
int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)
Bind current process or thread on cpus given in physical bitmap set.
+
unsigned char get_thisthread_membind
Definition: hwloc.h:2024
+
unsigned char set_area_membind
Definition: hwloc.h:2026
+
static const char * hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name)
Search the given key name in object infos and return the corresponding value.
+
int hwloc_topology_set_icache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all CPU instruction cache object types.
+
@ HWLOC_OBJ_CORE
Core. A computation unit (may be shared by several logical processors).
Definition: hwloc.h:197
+
unsigned char get_proc_membind
Definition: hwloc.h:2020
+
const struct hwloc_bitmap_s * hwloc_const_bitmap_t
a non-modifiable hwloc_bitmap_t
Definition: bitmap.h:70
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
unsigned short domain
Definition: hwloc.h:621
+
unsigned sibling_rank
Index in parent's children[] array. Or the index in parent's Memory, I/O or Misc children list.
Definition: hwloc.h:435
+
unsigned char get_proc_cpubind
Definition: hwloc.h:1990
+
unsigned char get_thisthread_last_cpu_location
Definition: hwloc.h:2004
+
void hwloc_topology_destroy(hwloc_topology_t topology)
Terminate and free a topology context.
+
unsigned char alloc_membind
Definition: hwloc.h:2030
+
struct hwloc_obj * next_sibling
Next object below the same parent (inside the same list of children).
Definition: hwloc.h:436
+
unsigned depth
Depth of group object. It may change if intermediate Group objects are added.
Definition: hwloc.h:612
+
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine,...
Definition: hwloc.h:389
+
unsigned char get_thread_cpubind
Definition: hwloc.h:1998
+
int hwloc_get_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
Query the default memory binding policy and physical locality of the specified process.
+
int hwloc_get_cpubind(hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
Get current process or thread binding.
+
unsigned short subdevice_id
Definition: hwloc.h:627
+
@ HWLOC_TYPE_FILTER_KEEP_ALL
Keep all objects of this type.
Definition: hwloc.h:2083
+
int hwloc_topology_set_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e filter)
Set the filtering for the given object type.
+
@ HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM
Assume that the selected backend provides the topology for the system on which we are running.
Definition: hwloc.h:1911
+
int hwloc_topology_init(hwloc_topology_t *topologyp)
Allocate a topology context.
+
unsigned char interleave_membind
Definition: hwloc.h:2036
+
@ HWLOC_OBJ_L1CACHE
Level 1 Data (or Unified) Cache.
Definition: hwloc.h:213
+
Object info.
Definition: hwloc.h:660
+
int hwloc_set_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags)
Bind a process pid on cpus given in physical bitmap set.
+
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
+
struct hwloc_obj * misc_first_child
First Misc child. Misc objects are listed here (misc_arity and misc_first_child) instead of in the no...
Definition: hwloc.h:493
+
struct hwloc_topology_cpubind_support * cpubind
Definition: hwloc.h:2053
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
unsigned short class_id
Definition: hwloc.h:626
+
@ HWLOC_CPUBIND_NOMEMBIND
Avoid any effect on memory binding.
Definition: hwloc.h:1190
+
struct hwloc_obj * next_cousin
Next object of same type and depth.
Definition: hwloc.h:430
+
@ HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST
Blacklist the target component from being used.
Definition: hwloc.h:1833
+
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:386
+
unsigned page_types_len
Size of array page_types.
Definition: hwloc.h:589
+
unsigned char get_proc_last_cpu_location
Definition: hwloc.h:2002
+
unsigned char firsttouch_membind
Definition: hwloc.h:2032
+
static hwloc_obj_t hwloc_get_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
Returns the topology object at logical index idx with type type.
+
struct hwloc_topology_membind_support * membind
Definition: hwloc.h:2054
+
hwloc_uint64_t size
Size of cache in bytes.
Definition: hwloc.h:603
+
Set of flags describing actual support for this topology.
Definition: hwloc.h:2051
+
@ HWLOC_MEMBIND_BIND
Allocate memory on the specified nodes.
Definition: hwloc.h:1390
+
@ HWLOC_OBJ_MISC
Miscellaneous objects (filtered out by default). Objects without particular meaning,...
Definition: hwloc.h:281
+
union hwloc_obj_attr_u::hwloc_bridge_attr_s::@1 downstream
+
struct hwloc_obj * hwloc_obj_t
Convenience typedef; a pointer to a struct hwloc_obj.
Definition: hwloc.h:582
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
unsigned char func
Definition: hwloc.h:625
+
@ HWLOC_OBJ_OS_DEVICE
Operating system device (filtered out by default). They are not added to the topology unless I/O disc...
Definition: hwloc.h:273
+
int hwloc_type_sscanf(const char *string, hwloc_obj_type_t *typep, union hwloc_obj_attr_u *attrp, size_t attrsize)
Return an object type and attributes from a type string.
+
int hwloc_get_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
Query the CPUs near the physical NUMA node(s) and binding policy of the memory identified by (addr,...
+
static hwloc_obj_t hwloc_get_root_obj(hwloc_topology_t topology)
Returns the top-object of the topology-tree.
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
unsigned char set_proc_cpubind
Definition: hwloc.h:1988
+
unsigned char set_thisthread_membind
Definition: hwloc.h:2022
+
struct hwloc_topology_discovery_support * discovery
Definition: hwloc.h:2052
+
void hwloc_topology_check(hwloc_topology_t topology)
Run internal checks on a topology structure.
+
Bridge specific Object Attribues.
Definition: hwloc.h:632
+
unsigned short device_id
Definition: hwloc.h:627
+
static int hwloc_get_nbobjs_by_type(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the width of level type type.
+
char * name
Info name.
Definition: hwloc.h:661
+
struct hwloc_obj * prev_cousin
Previous object of same type and depth.
Definition: hwloc.h:431
+
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
+
Flags describing actual PU binding support for this topology.
Definition: hwloc.h:1982
+
unsigned char numa_memory
Detecting the amount of memory in NUMA nodes is supported.
Definition: hwloc.h:1970
+
@ HWLOC_TYPE_DEPTH_MULTIPLE
Objects of given type exist at different depth in the topology (only for Groups).
Definition: hwloc.h:809
+
@ HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS
Remove all objects that became Memory-less. By default, only objects that contain no PU and no memory...
Definition: hwloc.h:2200
+
hwloc_obj_cache_type_t type
Cache type.
Definition: hwloc.h:608
+
int hwloc_topology_set_xmlbuffer(hwloc_topology_t restrict topology, const char *restrict buffer, int size)
Enable XML based topology using a memory buffer (instead of a file, as with hwloc_topology_set_xml())...
+
@ HWLOC_OBJ_BRIDGE_PCI
PCI-side of a bridge.
Definition: hwloc.h:323
+
@ HWLOC_OBJ_L2ICACHE
Level 2 instruction Cache (filtered out by default).
Definition: hwloc.h:220
+
OS Device specific Object Attributes.
Definition: hwloc.h:651
+
hwloc_obj_osdev_type_e
Type of a OS device.
Definition: hwloc.h:327
+
@ HWLOC_MEMBIND_FIRSTTOUCH
Allocate each memory page individually on the local NUMA node of the thread that touches it.
Definition: hwloc.h:1386
+
unsigned linesize
Cache-line size in bytes. 0 if unknown.
Definition: hwloc.h:605
+
Structure of a topology object.
Definition: hwloc.h:384
+
unsigned char set_thread_cpubind
Definition: hwloc.h:1996
+
unsigned arity
Number of normal children. Memory, Misc and I/O children are not listed here but rather in their dedi...
Definition: hwloc.h:440
+
@ HWLOC_OBJ_BRIDGE
Bridge (filtered out by default). Any bridge (or PCI switch) that connects the host or an I/O bus,...
Definition: hwloc.h:257
+
struct hwloc_obj_attr_u::hwloc_cache_attr_s cache
+
struct hwloc_obj ** children
Normal children, children[0 .. arity -1].
Definition: hwloc.h:444
+
unsigned char revision
Definition: hwloc.h:628
+
struct hwloc_pcidev_attr_s pci
Definition: hwloc.h:634
+
hwloc_obj_t hwloc_topology_insert_misc_object(hwloc_topology_t topology, hwloc_obj_t parent, const char *name)
Add a MISC object as a leaf of the topology.
+
@ HWLOC_OBJ_GROUP
Group objects. Objects which do not fit in the above but are detected by hwloc and are useful to take...
Definition: hwloc.h:223
+
@ HWLOC_OBJ_BRIDGE_HOST
Host-side of a bridge, only possible upstream.
Definition: hwloc.h:322
+
unsigned char pu
Detecting the number of PU objects is supported.
Definition: hwloc.h:1966
+
@ HWLOC_MEMBIND_PROCESS
Set policy for all threads of the specified (possibly multithreaded) process. This flag is mutually e...
Definition: hwloc.h:1435
+
int hwloc_get_memory_parents_depth(hwloc_topology_t topology)
Return the depth of parents where memory objects are attached.
+
int hwloc_compare_types(hwloc_obj_type_t type1, hwloc_obj_type_t type2)
Compare the depth of two object types.
+
@ HWLOC_OBJ_L4CACHE
Level 4 Data (or Unified) Cache.
Definition: hwloc.h:216
+
unsigned char dont_merge
Flag preventing groups from being automatically merged with identical parent or children.
Definition: hwloc.h:616
+
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:396
+
unsigned hwloc_get_api_version(void)
Indicate at runtime which hwloc API version was used at build time.
+
PCI Device specific Object Attributes.
Definition: hwloc.h:619
+
void hwloc_topology_set_userdata(hwloc_topology_t topology, const void *userdata)
Set the topology-specific userdata pointer.
+
hwloc_obj_t hwloc_get_obj_by_depth(hwloc_topology_t topology, int depth, unsigned idx)
Returns the topology object at logical index idx from depth depth.
+
char * value
Info value.
Definition: hwloc.h:662
+
void * userdata
Application-given private data pointer, initialized to NULL, use it as you wish. See hwloc_topology_s...
Definition: hwloc.h:568
+
struct hwloc_info_s * infos
Array of stringified info type=name.
Definition: hwloc.h:564
+
@ HWLOC_OBJ_OSDEV_GPU
Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device.
Definition: hwloc.h:330
+
hwloc_membind_policy_t
Memory binding policy.
Definition: hwloc.h:1367
+
unsigned char bus
Definition: hwloc.h:625
+
hwloc_uint64_t local_memory
Local memory (in bytes)
Definition: hwloc.h:588
+
@ HWLOC_TYPE_DEPTH_UNKNOWN
No object of given type exists in the topology.
Definition: hwloc.h:808
+
@ HWLOC_TYPE_DEPTH_NUMANODE
Virtual depth for NUMA nodes.
Definition: hwloc.h:810
+
hwloc_uint64_t total_memory
Total memory (in bytes) in NUMA nodes below this object.
Definition: hwloc.h:401
+
Flags describing actual discovery support for this topology.
Definition: hwloc.h:1964
+
unsigned short subvendor_id
Definition: hwloc.h:627
+
struct hwloc_obj * io_first_child
First I/O child. Bridges, PCI and OS devices are listed here (io_arity and io_first_child) instead of...
Definition: hwloc.h:481
+
unsigned char set_thisproc_cpubind
Definition: hwloc.h:1984
+
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
+
unsigned misc_arity
Number of Misc children. These children are listed in misc_first_child.
Definition: hwloc.h:490
+
hwloc_const_bitmap_t hwloc_const_nodeset_t
A non-modifiable hwloc_nodeset_t.
Definition: hwloc.h:160
+
@ HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES
Get the set of allowed resources from the local operating system even if the topology was loaded from...
Definition: hwloc.h:1932
+
@ HWLOC_MEMBIND_DEFAULT
Reset the memory allocation policy to the system default. Depending on the operating system,...
Definition: hwloc.h:1375
+
unsigned char get_thisthread_cpubind
Definition: hwloc.h:1994
+
struct hwloc_obj_attr_u::hwloc_bridge_attr_s bridge
+
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:500
+
@ HWLOC_OBJ_DIE
Die within a physical package. A subpart of the physical package, that contains multiple cores.
Definition: hwloc.h:305
+
hwloc_uint64_t gp_index
Global persistent index. Generated by hwloc, unique across the topology (contrary to os_index) and pe...
Definition: hwloc.h:573
+
unsigned char set_thisthread_cpubind
Definition: hwloc.h:1992
+
int hwloc_topology_abi_check(hwloc_topology_t topology)
Verify that the topology is compatible with the current hwloc library.
+
@ HWLOC_RESTRICT_FLAG_REMOVE_CPULESS
Remove all objects that became CPU-less. By default, only objects that contain no PU and no memory ar...
Definition: hwloc.h:2187
+
unsigned char subordinate_bus
Definition: hwloc.h:644
+
@ HWLOC_TYPE_DEPTH_PCI_DEVICE
Virtual depth for PCI device object level.
Definition: hwloc.h:812
+
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:434
+
int hwloc_set_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags)
Bind a thread thread on cpus given in physical bitmap set.
+
hwloc_obj_cache_type_e
Cache type.
Definition: hwloc.h:314
+
hwloc_uint64_t size
Size of pages.
Definition: hwloc.h:596
+
int hwloc_get_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
Get the current physical binding of process pid.
+
hwloc_cpuset_t complete_cpuset
The complete CPU set of logical processors of this object,.
Definition: hwloc.h:515
+
enum hwloc_obj_cache_type_e hwloc_obj_cache_type_t
Cache type.
+
unsigned hwloc_get_nbobjs_by_depth(hwloc_topology_t topology, int depth)
Returns the width of level at depth depth.
+
unsigned char disallowed_pu
Detecting and identifying PU objects that are not available to the current process is supported.
Definition: hwloc.h:1972
+
@ HWLOC_TYPE_FILTER_KEEP_IMPORTANT
Only keep likely-important objects of the given type.
Definition: hwloc.h:2120
+
unsigned char bind_membind
Definition: hwloc.h:2034
+
int hwloc_obj_type_snprintf(char *restrict string, size_t size, hwloc_obj_t obj, int verbose)
Stringify the type of a given topology object into a human-readable form.
+
struct hwloc_obj * last_child
Last normal child.
Definition: hwloc.h:446
+
@ HWLOC_OBJ_OSDEV_NETWORK
Operating system network device. For instance the "eth0" interface on Linux.
Definition: hwloc.h:333
+
void * hwloc_topology_get_userdata(hwloc_topology_t topology)
Retrieve the topology-specific userdata pointer.
+
int hwloc_topology_allow(hwloc_topology_t restrict topology, hwloc_const_cpuset_t cpuset, hwloc_const_nodeset_t nodeset, unsigned long flags)
Change the sets of allowed PUs and NUMA nodes in the topology.
+
int hwloc_type_sscanf_as_depth(const char *string, hwloc_obj_type_t *typep, hwloc_topology_t topology, int *depthp)
Return an object type and its level depth from a type string.
+
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
+
int hwloc_topology_set_cache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all CPU cache object types.
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
unsigned char get_thisproc_last_cpu_location
Definition: hwloc.h:2000
+
@ HWLOC_OBJ_OSDEV_DMA
Operating system dma engine device. For instance the "dma0chan0" DMA channel on Linux.
Definition: hwloc.h:338
+
int hwloc_topology_get_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter)
Get the current filtering for the given object type.
+
hwloc_type_filter_e
Type filtering flags.
Definition: hwloc.h:2077
+
hwloc_obj_type_t
Type of topology object.
Definition: hwloc.h:176
+
@ HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS
Only allow objects that are available to the current process.
Definition: hwloc.h:2256
+
hwloc_obj_t hwloc_topology_alloc_group_object(hwloc_topology_t topology)
Allocate a Group object to insert later with hwloc_topology_insert_group_object().
+
unsigned char disallowed_numa
Detecting and identifying NUMA nodes that are not available to the current process is supported.
Definition: hwloc.h:1974
+
NUMA node-specific Object Attributes.
Definition: hwloc.h:587
+
@ HWLOC_RESTRICT_FLAG_ADAPT_IO
Move I/O objects to ancestors if their parents are removed during restriction. If this flag is not se...
Definition: hwloc.h:2212
+
@ HWLOC_TYPE_FILTER_KEEP_STRUCTURE
Only ignore objects if their entire level does not bring any structure.
Definition: hwloc.h:2105
+
static hwloc_obj_t hwloc_get_next_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t prev)
Returns the next object at depth depth.
+
hwloc_allow_flags_e
Flags to be given to hwloc_topology_allow().
Definition: hwloc.h:2242
+
@ HWLOC_RESTRICT_FLAG_BYNODESET
Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially incl...
Definition: hwloc.h:2193
+
@ HWLOC_OBJ_OSDEV_BLOCK
Operating system block device, or non-volatile memory device. For instance "sda" or "dax2....
Definition: hwloc.h:328
+
int hwloc_get_proc_last_cpu_location(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
Get the last physical CPU where a process ran.
+
int hwloc_set_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Bind the already-allocated memory identified by (addr, len) to the NUMA node(s) specified by set.
+
@ HWLOC_TYPE_DEPTH_MEMCACHE
Virtual depth for MemCache object.
Definition: hwloc.h:815
+
unsigned char set_thisproc_membind
Definition: hwloc.h:2014
+
int hwloc_obj_add_info(hwloc_obj_t obj, const char *name, const char *value)
Add the given info name and value pair to the given object.
+
hwloc_obj_bridge_type_t upstream_type
Definition: hwloc.h:636
+
@ HWLOC_OBJ_PACKAGE
Physical package. The physical package that usually gets inserted into a socket on the motherboard....
Definition: hwloc.h:191
+
hwloc_obj_t hwloc_topology_insert_group_object(hwloc_topology_t topology, hwloc_obj_t group)
Add more structure to the topology by adding an intermediate Group.
+
int associativity
Ways of associativity, -1 if fully associative, 0 if unknown.
Definition: hwloc.h:606
+
unsigned kind
Internally-used kind of group.
Definition: hwloc.h:614
+
int hwloc_topology_set_components(hwloc_topology_t restrict topology, unsigned long flags, const char *restrict name)
Prevent a discovery component from being used for a topology.
+
static void * hwloc_alloc_membind_policy(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Allocate some memory on NUMA memory nodes specified by set.
+
unsigned depth
Definition: hwloc.h:648
+
@ HWLOC_OBJ_CACHE_UNIFIED
Unified cache.
Definition: hwloc.h:315
+
unsigned short domain
Definition: hwloc.h:640
+
unsigned char get_thisproc_membind
Definition: hwloc.h:2016
+
unsigned infos_count
Size of infos array.
Definition: hwloc.h:565
+
@ HWLOC_RESTRICT_FLAG_ADAPT_MISC
Move Misc objects to ancestors if their parents are removed during restriction. If this flag is not s...
Definition: hwloc.h:2206
+
const char * hwloc_obj_type_string(hwloc_obj_type_t type)
Return a constant stringified object type.
+
hwloc_cpubind_flags_t
Process/Thread binding flags.
Definition: hwloc.h:1141
+
unsigned char get_area_memlocation
Definition: hwloc.h:2042
+
unsigned char migrate_membind
Definition: hwloc.h:2040
+
char * subtype
Subtype string to better describe the type field.
Definition: hwloc.h:387
+
int hwloc_topology_restrict(hwloc_topology_t restrict topology, hwloc_const_bitmap_t set, unsigned long flags)
Restrict the topology to the given CPU set or nodeset.
+
Cache-specific Object Attributes.
Definition: hwloc.h:602
+
@ HWLOC_OBJ_MACHINE
Machine. A set of processors and memory with cache coherency.
Definition: hwloc.h:182
+
hwloc_obj_type_t hwloc_get_depth_type(hwloc_topology_t topology, int depth)
Returns the type of objects at depth depth.
+
Object type-specific Attributes.
Definition: hwloc.h:585
+
hwloc_uint64_t count
Number of pages of this size.
Definition: hwloc.h:597
+
unsigned char secondary_bus
Definition: hwloc.h:644
+
int hwloc_get_membind(hwloc_topology_t topology, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
Query the default memory binding policy and physical locality of the current process or thread.
+
unsigned char numa
Detecting the number of NUMA nodes is supported.
Definition: hwloc.h:1968
+
static int hwloc_get_type_or_below_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type or below.
+
unsigned subkind
Internally-used subkind to distinguish different levels of groups with same kind.
Definition: hwloc.h:615
+
unsigned char nexttouch_membind
Definition: hwloc.h:2038
+
hwloc_get_type_depth_e
Definition: hwloc.h:807
+
int hwloc_topology_load(hwloc_topology_t topology)
Build the actual topology.
+
hwloc_obj_bridge_type_e
Type of one side (upstream or downstream) of an I/O bridge.
Definition: hwloc.h:321
+
int symmetric_subtree
Set if the subtree of normal objects below this object is symmetric, which means all normal children ...
Definition: hwloc.h:449
+
int hwloc_obj_add_other_obj_sets(hwloc_obj_t dst, hwloc_obj_t src)
Setup object cpusets/nodesets by OR'ing another object's sets.
+
unsigned char dev
Definition: hwloc.h:625
+
@ HWLOC_CPUBIND_THREAD
Bind current thread of current process.
Definition: hwloc.h:1148
+
struct hwloc_obj * prev_sibling
Previous object below the same parent (inside the same list of children).
Definition: hwloc.h:437
+
@ HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED
Detect the whole system, ignore reservations, include disallowed objects.
Definition: hwloc.h:1891
+
hwloc_bitmap_t hwloc_nodeset_t
A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes.
Definition: hwloc.h:157
+
hwloc_topology_components_flag_e
Flags to be passed to hwloc_topology_set_components()
Definition: hwloc.h:1829
+
int hwloc_free(hwloc_topology_t topology, void *addr, size_t len)
Free memory that was previously allocated by hwloc_alloc() or hwloc_alloc_membind().
+
Flags describing actual memory binding support for this topology.
Definition: hwloc.h:2012
+
hwloc_restrict_flags_e
Flags to be given to hwloc_topology_restrict().
Definition: hwloc.h:2181
+
int hwloc_get_area_memlocation(hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, int flags)
Get the NUMA nodes where memory identified by (addr, len ) is physically allocated.
+
@ HWLOC_OBJ_L2CACHE
Level 2 Data (or Unified) Cache.
Definition: hwloc.h:214
+
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
+
int hwloc_topology_set_io_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all I/O object types.
+
@ HWLOC_CPUBIND_PROCESS
Bind all threads of the current (possibly) multithreaded process.
Definition: hwloc.h:1144
+
static int hwloc_get_type_or_above_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type or above.
+
int hwloc_get_last_cpu_location(hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
Get the last physical CPU where the current process or thread ran.
+
@ HWLOC_OBJ_L3CACHE
Level 3 Data (or Unified) Cache.
Definition: hwloc.h:215
+
unsigned char get_area_membind
Definition: hwloc.h:2028
+
int hwloc_topology_set_pid(hwloc_topology_t restrict topology, hwloc_pid_t pid)
Change which process the topology is viewed from.
+
@ HWLOC_ALLOW_FLAG_ALL
Mark all objects as allowed in the topology.
Definition: hwloc.h:2247
+
hwloc_nodeset_t nodeset
NUMA nodes covered by this object or containing this object.
Definition: hwloc.h:528
+
Array of local memory page types, NULL if no local memory and page_types is 0.
Definition: hwloc.h:595
+
@ HWLOC_TYPE_FILTER_KEEP_NONE
Ignore all objects of this type.
Definition: hwloc.h:2091
+
unsigned long hwloc_topology_get_flags(hwloc_topology_t topology)
Get OR'ed flags of a topology.
+
unsigned char get_thisproc_cpubind
Definition: hwloc.h:1986
+
int hwloc_obj_attr_snprintf(char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, int verbose)
Stringify the attributes of a given topology object into a human-readable form.
+
void * hwloc_alloc(hwloc_topology_t topology, size_t len)
Allocate some memory.
+
@ HWLOC_MEMBIND_MIGRATE
Migrate existing allocated memory. If the memory cannot be migrated and the HWLOC_MEMBIND_STRICT flag...
Definition: hwloc.h:1454
+
float linkspeed
Definition: hwloc.h:629
+
hwloc_topology_flags_e
Flags to be set onto a topology context before load.
Definition: hwloc.h:1870
+
@ HWLOC_MEMBIND_BYNODESET
Consider the bitmap argument as a nodeset.
Definition: hwloc.h:1478
+
unsigned depth
Depth of cache (e.g., L1, L2, ...etc.)
Definition: hwloc.h:604
+
@ HWLOC_TYPE_DEPTH_MISC
Virtual depth for Misc object.
Definition: hwloc.h:814
+
void * hwloc_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Allocate some memory on NUMA memory nodes specified by set.
+
@ HWLOC_OBJ_NUMANODE
NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...
Definition: hwloc.h:236
+
@ HWLOC_CPUBIND_STRICT
Request for strict binding from the OS.
Definition: hwloc.h:1173
+
unsigned logical_index
Horizontal index in the whole list of similar objects, hence guaranteed unique across the entire mach...
Definition: hwloc.h:422
+
struct hwloc_obj * first_child
First normal child.
Definition: hwloc.h:445
+
@ HWLOC_OBJ_L5CACHE
Level 5 Data (or Unified) Cache.
Definition: hwloc.h:217
+
@ HWLOC_TYPE_DEPTH_BRIDGE
Virtual depth for bridge object level.
Definition: hwloc.h:811
+
@ HWLOC_OBJ_L3ICACHE
Level 3 instruction Cache (filtered out by default).
Definition: hwloc.h:221
+
union hwloc_obj_attr_u::hwloc_bridge_attr_s::@0 upstream
+
struct hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s * page_types
+
@ HWLOC_MEMBIND_NEXTTOUCH
For each page bound with this policy, by next time it is touched (and next time only),...
Definition: hwloc.h:1406
+
const struct hwloc_topology_support * hwloc_topology_get_support(hwloc_topology_t restrict topology)
Retrieve the topology support.
+
struct hwloc_obj_attr_u::hwloc_numanode_attr_s numanode
+
@ HWLOC_MEMBIND_INTERLEAVE
Allocate memory on the given nodes in an interleaved / round-robin manner. The precise layout of the ...
Definition: hwloc.h:1399
+
unsigned io_arity
Number of I/O children. These children are listed in io_first_child.
Definition: hwloc.h:478
+
@ HWLOC_ALLOW_FLAG_CUSTOM
Allow a custom set of objects, given to hwloc_topology_allow() as cpuset and/or nodeset parameters.
Definition: hwloc.h:2260
+
@ HWLOC_OBJ_L1ICACHE
Level 1 instruction Cache (filtered out by default).
Definition: hwloc.h:219
+
struct hwloc_obj * memory_first_child
First Memory child. NUMA nodes and Memory-side caches are listed here (memory_arity and memory_first_...
Definition: hwloc.h:463
+
@ HWLOC_MEMBIND_NOCPUBIND
Avoid any effect on CPU binding.
Definition: hwloc.h:1467
+
unsigned char set_proc_membind
Definition: hwloc.h:2018
+
unsigned short vendor_id
Definition: hwloc.h:627
+
@ HWLOC_OBJ_OSDEV_COPROC
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux,...
Definition: hwloc.h:340
+
hwloc_nodeset_t complete_nodeset
The complete NUMA node set of this object,.
Definition: hwloc.h:548
+
@ HWLOC_OBJ_PU
Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical ...
Definition: hwloc.h:201
+
int hwloc_topology_set_synthetic(hwloc_topology_t restrict topology, const char *restrict description)
Enable synthetic topology.
+
int hwloc_topology_dup(hwloc_topology_t *newtopology, hwloc_topology_t oldtopology)
Duplicate a topology.
+
int hwloc_topology_set_xml(hwloc_topology_t restrict topology, const char *restrict xmlpath)
Enable XML-file based topology.
+
int hwloc_set_membind(hwloc_topology_t topology, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) spe...
+
int hwloc_topology_set_all_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter)
Set the filtering for all object types.
+
Group-specific Object Attributes.
Definition: hwloc.h:611
+
static hwloc_obj_t hwloc_get_next_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev)
Returns the next object of type type.
+
int depth
Vertical index in the hierarchy.
Definition: hwloc.h:407
+
@ HWLOC_TYPE_DEPTH_OS_DEVICE
Virtual depth for software device object level.
Definition: hwloc.h:813
+
int hwloc_get_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags)
Get the current physical binding of thread tid.
+
@ HWLOC_OBJ_CACHE_DATA
Data cache.
Definition: hwloc.h:316
+
enum hwloc_obj_bridge_type_e hwloc_obj_bridge_type_t
Type of one side (upstream or downstream) of an I/O bridge.
+
int hwloc_topology_get_depth(hwloc_topology_t restrict topology)
Get the depth of the hierarchical tree of objects.
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00128_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00128_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00128_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00128_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): helper.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2009 CNRS
3  * Copyright © 2009-2019 Inria. All rights reserved.
4  * Copyright © 2009-2012 Université Bordeaux
5  * Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
6  * See COPYING in top-level directory.
7  */
8 
13 #ifndef HWLOC_HELPER_H
14 #define HWLOC_HELPER_H
15 
16 #ifndef HWLOC_H
17 #error Please include the main hwloc.h instead
18 #endif
19 
20 #include <stdlib.h>
21 #include <errno.h>
22 
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 
41 static __hwloc_inline hwloc_obj_t
43 {
44  hwloc_obj_t obj = hwloc_get_root_obj(topology);
45  if (!hwloc_bitmap_intersects(obj->cpuset, set))
46  return NULL;
47  while (!hwloc_bitmap_isincluded(obj->cpuset, set)) {
48  /* while the object intersects without being included, look at its children */
49  hwloc_obj_t child = obj->first_child;
50  while (child) {
51  if (hwloc_bitmap_intersects(child->cpuset, set))
52  break;
53  child = child->next_sibling;
54  }
55  if (!child)
56  /* no child intersects, return their father */
57  return obj;
58  /* found one intersecting child, look at its children */
59  obj = child;
60  }
61  /* obj is included, return it */
62  return obj;
63 }
64 
70  hwloc_obj_t * __hwloc_restrict objs, int max);
71 
84 static __hwloc_inline hwloc_obj_t
86  int depth, hwloc_obj_t prev)
87 {
88  hwloc_obj_t next = hwloc_get_next_obj_by_depth(topology, depth, prev);
89  if (!next)
90  return NULL;
91  while (next && (hwloc_bitmap_iszero(next->cpuset) || !hwloc_bitmap_isincluded(next->cpuset, set)))
92  next = next->next_cousin;
93  return next;
94 }
95 
108 static __hwloc_inline hwloc_obj_t
110  hwloc_obj_type_t type, hwloc_obj_t prev)
111 {
112  int depth = hwloc_get_type_depth(topology, type);
113  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE)
114  return NULL;
115  return hwloc_get_next_obj_inside_cpuset_by_depth(topology, set, depth, prev);
116 }
117 
126 static __hwloc_inline hwloc_obj_t
128  int depth, unsigned idx) __hwloc_attribute_pure;
129 static __hwloc_inline hwloc_obj_t
131  int depth, unsigned idx)
132 {
133  hwloc_obj_t obj = hwloc_get_obj_by_depth (topology, depth, 0);
134  unsigned count = 0;
135  if (!obj)
136  return NULL;
137  while (obj) {
138  if (!hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_isincluded(obj->cpuset, set)) {
139  if (count == idx)
140  return obj;
141  count++;
142  }
143  obj = obj->next_cousin;
144  }
145  return NULL;
146 }
147 
160 static __hwloc_inline hwloc_obj_t
162  hwloc_obj_type_t type, unsigned idx) __hwloc_attribute_pure;
163 static __hwloc_inline hwloc_obj_t
165  hwloc_obj_type_t type, unsigned idx)
166 {
167  int depth = hwloc_get_type_depth(topology, type);
168  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE)
169  return NULL;
170  return hwloc_get_obj_inside_cpuset_by_depth(topology, set, depth, idx);
171 }
172 
181 static __hwloc_inline unsigned
183  int depth) __hwloc_attribute_pure;
184 static __hwloc_inline unsigned
186  int depth)
187 {
188  hwloc_obj_t obj = hwloc_get_obj_by_depth (topology, depth, 0);
189  unsigned count = 0;
190  if (!obj)
191  return 0;
192  while (obj) {
193  if (!hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_isincluded(obj->cpuset, set))
194  count++;
195  obj = obj->next_cousin;
196  }
197  return count;
198 }
199 
212 static __hwloc_inline int
214  hwloc_obj_type_t type) __hwloc_attribute_pure;
215 static __hwloc_inline int
217  hwloc_obj_type_t type)
218 {
219  int depth = hwloc_get_type_depth(topology, type);
220  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN)
221  return 0;
222  if (depth == HWLOC_TYPE_DEPTH_MULTIPLE)
223  return -1; /* FIXME: agregate nbobjs from different levels? */
224  return (int) hwloc_get_nbobjs_inside_cpuset_by_depth(topology, set, depth);
225 }
226 
240 static __hwloc_inline int
241 hwloc_get_obj_index_inside_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set,
242  hwloc_obj_t obj) __hwloc_attribute_pure;
243 static __hwloc_inline int
245  hwloc_obj_t obj)
246 {
247  int idx = 0;
248  if (!hwloc_bitmap_isincluded(obj->cpuset, set))
249  return -1;
250  /* count how many objects are inside the cpuset on the way from us to the beginning of the level */
251  while ((obj = obj->prev_cousin) != NULL)
252  if (!hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_isincluded(obj->cpuset, set))
253  idx++;
254  return idx;
255 }
256 
271 static __hwloc_inline hwloc_obj_t
272 hwloc_get_child_covering_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set,
273  hwloc_obj_t parent) __hwloc_attribute_pure;
274 static __hwloc_inline hwloc_obj_t
276  hwloc_obj_t parent)
277 {
278  hwloc_obj_t child;
279  if (hwloc_bitmap_iszero(set))
280  return NULL;
281  child = parent->first_child;
282  while (child) {
283  if (child->cpuset && hwloc_bitmap_isincluded(set, child->cpuset))
284  return child;
285  child = child->next_sibling;
286  }
287  return NULL;
288 }
289 
294 static __hwloc_inline hwloc_obj_t
295 hwloc_get_obj_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) __hwloc_attribute_pure;
296 static __hwloc_inline hwloc_obj_t
298 {
299  struct hwloc_obj *current = hwloc_get_root_obj(topology);
300  if (hwloc_bitmap_iszero(set) || !hwloc_bitmap_isincluded(set, current->cpuset))
301  return NULL;
302  while (1) {
303  hwloc_obj_t child = hwloc_get_child_covering_cpuset(topology, set, current);
304  if (!child)
305  return current;
306  current = child;
307  }
308 }
309 
320 static __hwloc_inline hwloc_obj_t
322  int depth, hwloc_obj_t prev)
323 {
324  hwloc_obj_t next = hwloc_get_next_obj_by_depth(topology, depth, prev);
325  if (!next)
326  return NULL;
327  while (next && !hwloc_bitmap_intersects(set, next->cpuset))
328  next = next->next_cousin;
329  return next;
330 }
331 
347 static __hwloc_inline hwloc_obj_t
349  hwloc_obj_type_t type, hwloc_obj_t prev)
350 {
351  int depth = hwloc_get_type_depth(topology, type);
352  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE)
353  return NULL;
354  return hwloc_get_next_obj_covering_cpuset_by_depth(topology, set, depth, prev);
355 }
356 
377 static __hwloc_inline hwloc_obj_t
378 hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology __hwloc_attribute_unused, int depth, hwloc_obj_t obj) __hwloc_attribute_pure;
379 static __hwloc_inline hwloc_obj_t
380 hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology __hwloc_attribute_unused, int depth, hwloc_obj_t obj)
381 {
382  hwloc_obj_t ancestor = obj;
383  if (obj->depth < depth)
384  return NULL;
385  while (ancestor && ancestor->depth > depth)
386  ancestor = ancestor->parent;
387  return ancestor;
388 }
389 
397 static __hwloc_inline hwloc_obj_t
398 hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_type_t type, hwloc_obj_t obj) __hwloc_attribute_pure;
399 static __hwloc_inline hwloc_obj_t
400 hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_type_t type, hwloc_obj_t obj)
401 {
402  hwloc_obj_t ancestor = obj->parent;
403  while (ancestor && ancestor->type != type)
404  ancestor = ancestor->parent;
405  return ancestor;
406 }
407 
409 static __hwloc_inline hwloc_obj_t
410 hwloc_get_common_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj1, hwloc_obj_t obj2) __hwloc_attribute_pure;
411 static __hwloc_inline hwloc_obj_t
412 hwloc_get_common_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj1, hwloc_obj_t obj2)
413 {
414  /* the loop isn't so easy since intermediate ancestors may have
415  * different depth, causing us to alternate between using obj1->parent
416  * and obj2->parent. Also, even if at some point we find ancestors of
417  * of the same depth, their ancestors may have different depth again.
418  */
419  while (obj1 != obj2) {
420  while (obj1->depth > obj2->depth)
421  obj1 = obj1->parent;
422  while (obj2->depth > obj1->depth)
423  obj2 = obj2->parent;
424  if (obj1 != obj2 && obj1->depth == obj2->depth) {
425  obj1 = obj1->parent;
426  obj2 = obj2->parent;
427  }
428  }
429  return obj1;
430 }
431 
437 static __hwloc_inline int
438 hwloc_obj_is_in_subtree (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj, hwloc_obj_t subtree_root) __hwloc_attribute_pure;
439 static __hwloc_inline int
440 hwloc_obj_is_in_subtree (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj, hwloc_obj_t subtree_root)
441 {
442  return obj->cpuset && subtree_root->cpuset && hwloc_bitmap_isincluded(obj->cpuset, subtree_root->cpuset);
443 }
444 
455 static __hwloc_inline hwloc_obj_t
456 hwloc_get_next_child (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t parent, hwloc_obj_t prev)
457 {
458  hwloc_obj_t obj;
459  int state = 0;
460  if (prev) {
461  if (prev->type == HWLOC_OBJ_MISC)
462  state = 3;
463  else if (prev->type == HWLOC_OBJ_BRIDGE || prev->type == HWLOC_OBJ_PCI_DEVICE || prev->type == HWLOC_OBJ_OS_DEVICE)
464  state = 2;
465  else if (prev->type == HWLOC_OBJ_NUMANODE)
466  state = 1;
467  obj = prev->next_sibling;
468  } else {
469  obj = parent->first_child;
470  }
471  if (!obj && state == 0) {
472  obj = parent->memory_first_child;
473  state = 1;
474  }
475  if (!obj && state == 1) {
476  obj = parent->io_first_child;
477  state = 2;
478  }
479  if (!obj && state == 2) {
480  obj = parent->misc_first_child;
481  state = 3;
482  }
483  return obj;
484 }
485 
512 HWLOC_DECLSPEC int
514 
523 HWLOC_DECLSPEC int
525 
534 HWLOC_DECLSPEC int
536 
543 HWLOC_DECLSPEC int
545 
552 HWLOC_DECLSPEC int
554 
561 HWLOC_DECLSPEC int
563 
593 static __hwloc_inline int
595  unsigned cachelevel, hwloc_obj_cache_type_t cachetype)
596 {
597  int depth;
598  int found = HWLOC_TYPE_DEPTH_UNKNOWN;
599  for (depth=0; ; depth++) {
600  hwloc_obj_t obj = hwloc_get_obj_by_depth(topology, depth, 0);
601  if (!obj)
602  break;
603  if (!hwloc_obj_type_is_dcache(obj->type) || obj->attr->cache.depth != cachelevel)
604  /* doesn't match, try next depth */
605  continue;
606  if (cachetype == (hwloc_obj_cache_type_t) -1) {
607  if (found != HWLOC_TYPE_DEPTH_UNKNOWN) {
608  /* second match, return MULTIPLE */
610  }
611  /* first match, mark it as found */
612  found = depth;
613  continue;
614  }
615  if (obj->attr->cache.type == cachetype || obj->attr->cache.type == HWLOC_OBJ_CACHE_UNIFIED)
616  /* exact match (either unified is alone, or we match instruction or data), return immediately */
617  return depth;
618  }
619  /* went to the bottom, return what we found */
620  return found;
621 }
622 
627 static __hwloc_inline hwloc_obj_t
628 hwloc_get_cache_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) __hwloc_attribute_pure;
629 static __hwloc_inline hwloc_obj_t
631 {
632  hwloc_obj_t current = hwloc_get_obj_covering_cpuset(topology, set);
633  while (current) {
634  if (hwloc_obj_type_is_dcache(current->type))
635  return current;
636  current = current->parent;
637  }
638  return NULL;
639 }
640 
645 static __hwloc_inline hwloc_obj_t
646 hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj) __hwloc_attribute_pure;
647 static __hwloc_inline hwloc_obj_t
648 hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj)
649 {
650  hwloc_obj_t current = obj->parent;
651  if (!obj->cpuset)
652  return NULL;
653  while (current) {
654  if (!hwloc_bitmap_isequal(current->cpuset, obj->cpuset)
655  && hwloc_obj_type_is_dcache(current->type))
656  return current;
657  current = current->parent;
658  }
659  return NULL;
660 }
661 
684 static __hwloc_inline hwloc_obj_t
685 hwloc_get_pu_obj_by_os_index(hwloc_topology_t topology, unsigned os_index) __hwloc_attribute_pure;
686 static __hwloc_inline hwloc_obj_t
687 hwloc_get_pu_obj_by_os_index(hwloc_topology_t topology, unsigned os_index)
688 {
689  hwloc_obj_t obj = NULL;
690  while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PU, obj)) != NULL)
691  if (obj->os_index == os_index)
692  return obj;
693  return NULL;
694 }
695 
705 static __hwloc_inline hwloc_obj_t
706 hwloc_get_numanode_obj_by_os_index(hwloc_topology_t topology, unsigned os_index) __hwloc_attribute_pure;
707 static __hwloc_inline hwloc_obj_t
709 {
710  hwloc_obj_t obj = NULL;
711  while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NUMANODE, obj)) != NULL)
712  if (obj->os_index == os_index)
713  return obj;
714  return NULL;
715 }
716 
728 /* TODO: rather provide an iterator? Provide a way to know how much should be allocated? By returning the total number of objects instead? */
729 HWLOC_DECLSPEC unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t * __hwloc_restrict objs, unsigned max);
730 
743 static __hwloc_inline hwloc_obj_t
745  hwloc_obj_type_t type1, unsigned idx1,
746  hwloc_obj_type_t type2, unsigned idx2) __hwloc_attribute_pure;
747 static __hwloc_inline hwloc_obj_t
749  hwloc_obj_type_t type1, unsigned idx1,
750  hwloc_obj_type_t type2, unsigned idx2)
751 {
752  hwloc_obj_t obj;
753  obj = hwloc_get_obj_by_type (topology, type1, idx1);
754  if (!obj)
755  return NULL;
756  return hwloc_get_obj_inside_cpuset_by_type(topology, obj->cpuset, type2, idx2);
757 }
758 
777 static __hwloc_inline hwloc_obj_t
778 hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv) __hwloc_attribute_pure;
779 static __hwloc_inline hwloc_obj_t
780 hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
781 {
782  hwloc_obj_t obj = hwloc_get_root_obj(topology);
783  int i;
784  for(i=0; i<nr; i++) {
785  if (!obj)
786  return NULL;
787  obj = hwloc_get_obj_inside_cpuset_by_type(topology, obj->cpuset, typev[i], idxv[i]);
788  }
789  return obj;
790 }
791 
807 };
808 
832 static __hwloc_inline int
834  hwloc_obj_t *roots, unsigned n_roots,
835  hwloc_cpuset_t *set,
836  unsigned n,
837  int until, unsigned long flags)
838 {
839  unsigned i;
840  unsigned tot_weight;
841  unsigned given, givenweight;
842  hwloc_cpuset_t *cpusetp = set;
843 
844  if (flags & ~HWLOC_DISTRIB_FLAG_REVERSE) {
845  errno = EINVAL;
846  return -1;
847  }
848 
849  tot_weight = 0;
850  for (i = 0; i < n_roots; i++)
851  tot_weight += (unsigned) hwloc_bitmap_weight(roots[i]->cpuset);
852 
853  for (i = 0, given = 0, givenweight = 0; i < n_roots; i++) {
854  unsigned chunk, weight;
855  hwloc_obj_t root = roots[flags & HWLOC_DISTRIB_FLAG_REVERSE ? n_roots-1-i : i];
856  hwloc_cpuset_t cpuset = root->cpuset;
857  if (root->type == HWLOC_OBJ_NUMANODE)
858  /* NUMANodes have same cpuset as their parent, but we need normal objects below */
859  root = root->parent;
860  weight = (unsigned) hwloc_bitmap_weight(cpuset);
861  if (!weight)
862  continue;
863  /* Give to root a chunk proportional to its weight.
864  * If previous chunks got rounded-up, we may get a bit less. */
865  chunk = (( (givenweight+weight) * n + tot_weight-1) / tot_weight)
866  - (( givenweight * n + tot_weight-1) / tot_weight);
867  if (!root->arity || chunk <= 1 || root->depth >= until) {
868  /* We can't split any more, put everything there. */
869  if (chunk) {
870  /* Fill cpusets with ours */
871  unsigned j;
872  for (j=0; j < chunk; j++)
873  cpusetp[j] = hwloc_bitmap_dup(cpuset);
874  } else {
875  /* We got no chunk, just merge our cpuset to a previous one
876  * (the first chunk cannot be empty)
877  * so that this root doesn't get ignored.
878  */
879  assert(given);
880  hwloc_bitmap_or(cpusetp[-1], cpusetp[-1], cpuset);
881  }
882  } else {
883  /* Still more to distribute, recurse into children */
884  hwloc_distrib(topology, root->children, root->arity, cpusetp, chunk, until, flags);
885  }
886  cpusetp += chunk;
887  given += chunk;
888  givenweight += weight;
889  }
890 
891  return 0;
892 }
893 
911 HWLOC_DECLSPEC hwloc_const_cpuset_t
912 hwloc_topology_get_complete_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure;
913 
925 HWLOC_DECLSPEC hwloc_const_cpuset_t
926 hwloc_topology_get_topology_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure;
927 
944 HWLOC_DECLSPEC hwloc_const_cpuset_t
945 hwloc_topology_get_allowed_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure;
946 
956 HWLOC_DECLSPEC hwloc_const_nodeset_t
957 hwloc_topology_get_complete_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure;
958 
970 HWLOC_DECLSPEC hwloc_const_nodeset_t
971 hwloc_topology_get_topology_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure;
972 
989 HWLOC_DECLSPEC hwloc_const_nodeset_t
990 hwloc_topology_get_allowed_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure;
991 
1011 static __hwloc_inline int
1013 {
1014  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
1015  hwloc_obj_t obj = NULL;
1016  assert(depth != HWLOC_TYPE_DEPTH_UNKNOWN);
1017  hwloc_bitmap_zero(nodeset);
1018  while ((obj = hwloc_get_next_obj_covering_cpuset_by_depth(topology, _cpuset, depth, obj)) != NULL)
1019  if (hwloc_bitmap_set(nodeset, obj->os_index) < 0)
1020  return -1;
1021  return 0;
1022 }
1023 
1032 static __hwloc_inline int
1034 {
1035  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
1036  hwloc_obj_t obj = NULL;
1037  assert(depth != HWLOC_TYPE_DEPTH_UNKNOWN);
1038  hwloc_bitmap_zero(_cpuset);
1039  while ((obj = hwloc_get_next_obj_by_depth(topology, depth, obj)) != NULL) {
1040  if (hwloc_bitmap_isset(nodeset, obj->os_index))
1041  /* no need to check obj->cpuset because objects in levels always have a cpuset */
1042  if (hwloc_bitmap_or(_cpuset, _cpuset, obj->cpuset) < 0)
1043  return -1;
1044  }
1045  return 0;
1046 }
1047 
1067 static __hwloc_inline hwloc_obj_t
1068 hwloc_get_non_io_ancestor_obj(hwloc_topology_t topology __hwloc_attribute_unused,
1069  hwloc_obj_t ioobj)
1070 {
1071  hwloc_obj_t obj = ioobj;
1072  while (obj && !obj->cpuset) {
1073  obj = obj->parent;
1074  }
1075  return obj;
1076 }
1077 
1082 static __hwloc_inline hwloc_obj_t
1084 {
1085  return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PCI_DEVICE, prev);
1086 }
1087 
1091 static __hwloc_inline hwloc_obj_t
1093  unsigned domain, unsigned bus, unsigned dev, unsigned func)
1094 {
1095  hwloc_obj_t obj = NULL;
1096  while ((obj = hwloc_get_next_pcidev(topology, obj)) != NULL) {
1097  if (obj->attr->pcidev.domain == domain
1098  && obj->attr->pcidev.bus == bus
1099  && obj->attr->pcidev.dev == dev
1100  && obj->attr->pcidev.func == func)
1101  return obj;
1102  }
1103  return NULL;
1104 }
1105 
1109 static __hwloc_inline hwloc_obj_t
1111 {
1112  unsigned domain = 0; /* default */
1113  unsigned bus, dev, func;
1114 
1115  if (sscanf(busid, "%x:%x.%x", &bus, &dev, &func) != 3
1116  && sscanf(busid, "%x:%x:%x.%x", &domain, &bus, &dev, &func) != 4) {
1117  errno = EINVAL;
1118  return NULL;
1119  }
1120 
1121  return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, func);
1122 }
1123 
1128 static __hwloc_inline hwloc_obj_t
1130 {
1131  return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_OS_DEVICE, prev);
1132 }
1133 
1138 static __hwloc_inline hwloc_obj_t
1140 {
1141  return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_BRIDGE, prev);
1142 }
1143 
1144 /* \brief Checks whether a given bridge covers a given PCI bus.
1145  */
1146 static __hwloc_inline int
1148  unsigned domain, unsigned bus)
1149 {
1150  return bridge->type == HWLOC_OBJ_BRIDGE
1152  && bridge->attr->bridge.downstream.pci.domain == domain
1153  && bridge->attr->bridge.downstream.pci.secondary_bus <= bus
1154  && bridge->attr->bridge.downstream.pci.subordinate_bus >= bus;
1155 }
1156 
1161 #ifdef __cplusplus
1162 } /* extern "C" */
1163 #endif
1164 
1165 
1166 #endif /* HWLOC_HELPER_H */
static int hwloc_get_nbobjs_inside_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type)
Return the number of objects of type type included in CPU set set.
Definition: helper.h:216
-
int hwloc_obj_type_is_cache(hwloc_obj_type_t type)
Check whether an object type is a CPU Cache (Data, Unified or Instruction).
-
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:431
-
unsigned char func
Definition: hwloc.h:618
-
static hwloc_obj_t hwloc_get_child_covering_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t parent)
Get the child covering at least CPU set set.
Definition: helper.h:275
-
union hwloc_obj_attr_u::hwloc_bridge_attr_s::@1 downstream
-
hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset(hwloc_topology_t topology)
Get complete node set.
-
hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset(hwloc_topology_t topology)
Get allowed node set.
-
static hwloc_obj_t hwloc_get_obj_below_array_by_type(hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
Find an object below a chain of objects specified by types and indexes.
Definition: helper.h:780
-
PCI-side of a bridge.
Definition: hwloc.h:319
-
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
-
enum hwloc_obj_cache_type_e hwloc_obj_cache_type_t
Cache type.
-
static hwloc_obj_t hwloc_get_obj_covering_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set)
Get the lowest object covering at least CPU set set.
Definition: helper.h:297
-
struct hwloc_obj * memory_first_child
First Memory child. NUMA nodes and Memory-side caches are listed here (memory_arity and memory_first_...
Definition: hwloc.h:460
-
hwloc_obj_bridge_type_t downstream_type
Definition: hwloc.h:636
-
struct hwloc_obj * misc_first_child
First Misc child. Misc objects are listed here (misc_arity and misc_first_child) instead of in the no...
Definition: hwloc.h:490
-
static int hwloc_obj_is_in_subtree(hwloc_topology_t topology, hwloc_obj_t obj, hwloc_obj_t subtree_root)
Returns true if obj is inside the subtree beginning with ancestor object subtree_root.
Definition: helper.h:440
-
unsigned char dev
Definition: hwloc.h:618
-
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, unsigned idx)
Return the idx -th object of type type included in CPU set set.
Definition: helper.h:164
-
static hwloc_obj_t hwloc_get_common_ancestor_obj(hwloc_topology_t topology, hwloc_obj_t obj1, hwloc_obj_t obj2)
Returns the common parent object to objects obj1 and obj2.
Definition: helper.h:412
-
static hwloc_obj_t hwloc_get_pu_obj_by_os_index(hwloc_topology_t topology, unsigned os_index)
Returns the object of type HWLOC_OBJ_PU with os_index.
Definition: helper.h:687
-
hwloc_const_bitmap_t hwloc_const_nodeset_t
A non-modifiable hwloc_nodeset_t.
Definition: hwloc.h:160
-
struct hwloc_obj * prev_cousin
Previous object of same type and depth.
Definition: hwloc.h:428
-
Structure of a topology object.
Definition: hwloc.h:381
-
static hwloc_obj_t hwloc_get_cache_covering_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set)
Get the first data (or unified) cache covering a cpuset set.
Definition: helper.h:630
-
int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap)
Compute the "weight" of bitmap bitmap (i.e., number of indexes that are in the bitmap).
-
unsigned arity
Number of normal children. Memory, Misc and I/O children are not listed here but rather in their dedi...
Definition: hwloc.h:437
-
hwloc_obj_type_t
Definition: hwloc.h:177
-
static hwloc_obj_t hwloc_get_pcidev_by_busid(hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id...
Definition: helper.h:1092
-
static unsigned hwloc_get_nbobjs_inside_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth)
Return the number of objects at depth depth included in CPU set set.
Definition: helper.h:185
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
static int hwloc_cpuset_to_nodeset(hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset)
Convert a CPU set into a NUMA node set and handle non-NUMA cases.
Definition: helper.h:1012
-
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, unsigned idx)
Return the (logically) idx -th object at depth depth included in CPU set set.
Definition: helper.h:130
-
static hwloc_obj_t hwloc_get_next_pcidev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next PCI device in the system.
Definition: helper.h:1083
-
static hwloc_obj_t hwloc_get_next_bridge(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next bridge in the system.
Definition: helper.h:1139
-
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
-
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
Return the next object at depth depth included in CPU set set.
Definition: helper.h:85
-
static hwloc_obj_t hwloc_get_root_obj(hwloc_topology_t topology)
Returns the top-object of the topology-tree.
-
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
Iterate through same-type objects covering at least CPU set set.
Definition: helper.h:348
-
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
Return the next object of type type included in CPU set set.
Definition: helper.h:109
-
static hwloc_obj_t hwloc_get_ancestor_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t obj)
Returns the ancestor object of obj at depth depth.
Definition: helper.h:380
-
hwloc_nodeset_t nodeset
NUMA nodes covered by this object or containing this object.
Definition: hwloc.h:525
-
hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset(hwloc_topology_t topology)
Get topology node set.
-
struct hwloc_obj_attr_u::hwloc_cache_attr_s cache
-
Operating system device (filtered out by default). They are not added to the topology unless I/O disc...
Definition: hwloc.h:269
-
int hwloc_obj_type_is_normal(hwloc_obj_type_t type)
Check whether an object type is Normal.
-
Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical ...
Definition: hwloc.h:197
-
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:497
-
int hwloc_obj_type_is_dcache(hwloc_obj_type_t type)
Check whether an object type is a CPU Data or Unified Cache.
-
static hwloc_obj_t hwloc_get_shared_cache_covering_obj(hwloc_topology_t topology, hwloc_obj_t obj)
Get the first data (or unified) cache shared between an object and somebody else. ...
Definition: helper.h:648
-
hwloc_obj_t hwloc_get_obj_by_depth(hwloc_topology_t topology, int depth, unsigned idx)
Returns the topology object at logical index idx from depth depth.
-
struct hwloc_obj ** children
Normal children, children[0 .. arity -1].
Definition: hwloc.h:441
-
static hwloc_obj_t hwloc_get_non_io_ancestor_obj(hwloc_topology_t topology, hwloc_obj_t ioobj)
Get the first non-I/O ancestor object.
Definition: helper.h:1068
-
static int hwloc_get_obj_index_inside_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t obj)
Return the logical index among the objects included in CPU set set.
Definition: helper.h:244
-
NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...
Definition: hwloc.h:232
-
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:262
-
static hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set)
Get the first largest object included in the given cpuset set.
Definition: helper.h:42
-
static int hwloc_bridge_covers_pcibus(hwloc_obj_t bridge, unsigned domain, unsigned bus)
Definition: helper.h:1147
-
static hwloc_obj_t hwloc_get_pcidev_by_busidstring(hwloc_topology_t topology, const char *busid)
Find the PCI device object matching the PCI bus id given as a string xxxx:yy:zz.t or yy:zz...
Definition: helper.h:1110
-
struct hwloc_obj * next_cousin
Next object of same type and depth.
Definition: hwloc.h:427
-
static hwloc_obj_t hwloc_get_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
Returns the topology object at logical index idx with type type.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
int hwloc_bitmap_isincluded(hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap)
Test whether bitmap sub_bitmap is part of bitmap super_bitmap.
-
int hwloc_obj_type_is_icache(hwloc_obj_type_t type)
Check whether an object type is a CPU Instruction Cache,.
-
hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset(hwloc_topology_t topology)
Get allowed CPU set.
-
static hwloc_obj_t hwloc_get_numanode_obj_by_os_index(hwloc_topology_t topology, unsigned os_index)
Returns the object of type HWLOC_OBJ_NUMANODE with os_index.
Definition: helper.h:708
-
hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap)
Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.
-
static hwloc_obj_t hwloc_get_next_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev)
Returns the next object of type type.
-
struct hwloc_obj * first_child
First normal child.
Definition: hwloc.h:442
-
struct hwloc_obj * io_first_child
First I/O child. Bridges, PCI and OS devices are listed here (io_arity and io_first_child) instead of...
Definition: hwloc.h:478
-
int hwloc_obj_type_is_memory(hwloc_obj_type_t type)
Check whether an object type is Memory.
-
Objects of given type exist at different depth in the topology (only for Groups). ...
Definition: hwloc.h:798
-
Distrib in reverse order, starting from the last objects.
Definition: helper.h:806
-
static hwloc_obj_t hwloc_get_next_child(hwloc_topology_t topology, hwloc_obj_t parent, hwloc_obj_t prev)
Return the next child.
Definition: helper.h:456
-
static hwloc_obj_t hwloc_get_obj_below_by_type(hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t type2, unsigned idx2)
Find an object below another object, both specified by types and indexes.
Definition: helper.h:748
-
int depth
Vertical index in the hierarchy.
Definition: hwloc.h:404
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
static int hwloc_get_cache_type_depth(hwloc_topology_t topology, unsigned cachelevel, hwloc_obj_cache_type_t cachetype)
Find the depth of cache objects matching cache level and type.
Definition: helper.h:594
-
struct hwloc_pcidev_attr_s pci
Definition: hwloc.h:627
-
struct hwloc_obj * next_sibling
Next object below the same parent (inside the same list of children).
Definition: hwloc.h:433
-
No object of given type exists in the topology.
Definition: hwloc.h:797
-
unsigned short domain
Definition: hwloc.h:617
-
static hwloc_obj_t hwloc_get_next_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t prev)
Returns the next object at depth depth.
-
int hwloc_bitmap_intersects(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmaps bitmap1 and bitmap2 intersects.
-
unsigned char bus
Definition: hwloc.h:618
-
static hwloc_obj_t hwloc_get_ancestor_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t obj)
Returns the ancestor object of obj with type type.
Definition: helper.h:400
-
Miscellaneous objects (filtered out by default). Objects without particular meaning, that can e.g. be added by the application for its own use, or by hwloc for miscellaneous objects such as MemoryModule (DIMMs). These objects are not listed in the main children list, but rather in the dedicated misc children list. Misc objects may only have Misc objects as children, and those are in the dedicated misc children list as well. Misc objects have NULL CPU and node sets.
Definition: hwloc.h:277
-
hwloc_distrib_flags_e
Flags to be given to hwloc_distrib().
Definition: helper.h:802
-
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:383
-
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
-
hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset(hwloc_topology_t topology)
Get topology CPU set.
-
Bridge (filtered out by default). Any bridge that connects the host or an I/O bus, to another I/O bus. They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.
Definition: hwloc.h:253
-
int hwloc_obj_type_is_io(hwloc_obj_type_t type)
Check whether an object type is I/O.
-
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
Iterate through same-depth objects covering at least CPU set set.
Definition: helper.h:321
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
hwloc_obj_cache_type_t type
Cache type.
Definition: hwloc.h:605
-
unsigned depth
Depth of cache (e.g., L1, L2, ...etc.)
Definition: hwloc.h:601
-
struct hwloc_obj_attr_u::hwloc_bridge_attr_s bridge
-
int hwloc_get_largest_objs_inside_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t *restrict objs, int max)
Get the set of largest objects covering exactly a given cpuset set.
-
static int hwloc_distrib(hwloc_topology_t topology, hwloc_obj_t *roots, unsigned n_roots, hwloc_cpuset_t *set, unsigned n, int until, unsigned long flags)
Distribute n items over the topology under roots.
Definition: helper.h:833
-
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
-
Unified cache.
Definition: hwloc.h:311
-
unsigned hwloc_get_closest_objs(hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *restrict objs, unsigned max)
Do a depth-first traversal of the topology to find and sort.
-
int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
-
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
-
hwloc_bitmap_t hwloc_nodeset_t
A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes...
Definition: hwloc.h:157
-
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine, except for PUs and NUMA nodes. Set to HWLOC_UNKNOWN_INDEX if unknown or irrelevant for this object.
Definition: hwloc.h:386
-
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
-
int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id)
Test whether index id is part of bitmap bitmap.
-
static int hwloc_cpuset_from_nodeset(hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset)
Convert a NUMA node set into a CPU set and handle non-NUMA cases.
Definition: helper.h:1033
-
int hwloc_bitmap_isequal(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmap bitmap1 is equal to bitmap bitmap2.
+
1 /*
+
2  * Copyright © 2009 CNRS
+
3  * Copyright © 2009-2020 Inria. All rights reserved.
+
4  * Copyright © 2009-2012 Université Bordeaux
+
5  * Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
+
6  * See COPYING in top-level directory.
+
7  */
+
8 
+
13 #ifndef HWLOC_HELPER_H
+
14 #define HWLOC_HELPER_H
+
15 
+
16 #ifndef HWLOC_H
+
17 #error Please include the main hwloc.h instead
+
18 #endif
+
19 
+
20 #include <stdlib.h>
+
21 #include <errno.h>
+
22 
+
23 
+
24 #ifdef __cplusplus
+
25 extern "C" {
+
26 #endif
+
27 
+
28 
+
41 static __hwloc_inline hwloc_obj_t
+ +
43 {
+
44  hwloc_obj_t obj = hwloc_get_root_obj(topology);
+
45  if (!hwloc_bitmap_intersects(obj->cpuset, set))
+
46  return NULL;
+
47  while (!hwloc_bitmap_isincluded(obj->cpuset, set)) {
+
48  /* while the object intersects without being included, look at its children */
+
49  hwloc_obj_t child = obj->first_child;
+
50  while (child) {
+
51  if (hwloc_bitmap_intersects(child->cpuset, set))
+
52  break;
+
53  child = child->next_sibling;
+
54  }
+
55  if (!child)
+
56  /* no child intersects, return their father */
+
57  return obj;
+
58  /* found one intersecting child, look at its children */
+
59  obj = child;
+
60  }
+
61  /* obj is included, return it */
+
62  return obj;
+
63 }
+
64 
+ +
70  hwloc_obj_t * __hwloc_restrict objs, int max);
+
71 
+
84 static __hwloc_inline hwloc_obj_t
+ +
86  int depth, hwloc_obj_t prev)
+
87 {
+
88  hwloc_obj_t next = hwloc_get_next_obj_by_depth(topology, depth, prev);
+
89  if (!next)
+
90  return NULL;
+
91  while (next && (hwloc_bitmap_iszero(next->cpuset) || !hwloc_bitmap_isincluded(next->cpuset, set)))
+
92  next = next->next_cousin;
+
93  return next;
+
94 }
+
95 
+
108 static __hwloc_inline hwloc_obj_t
+ +
110  hwloc_obj_type_t type, hwloc_obj_t prev)
+
111 {
+
112  int depth = hwloc_get_type_depth(topology, type);
+
113  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE)
+
114  return NULL;
+
115  return hwloc_get_next_obj_inside_cpuset_by_depth(topology, set, depth, prev);
+
116 }
+
117 
+
126 static __hwloc_inline hwloc_obj_t
+ +
128  int depth, unsigned idx) __hwloc_attribute_pure;
+
129 static __hwloc_inline hwloc_obj_t
+ +
131  int depth, unsigned idx)
+
132 {
+
133  hwloc_obj_t obj = hwloc_get_obj_by_depth (topology, depth, 0);
+
134  unsigned count = 0;
+
135  if (!obj)
+
136  return NULL;
+
137  while (obj) {
+
138  if (!hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_isincluded(obj->cpuset, set)) {
+
139  if (count == idx)
+
140  return obj;
+
141  count++;
+
142  }
+
143  obj = obj->next_cousin;
+
144  }
+
145  return NULL;
+
146 }
+
147 
+
160 static __hwloc_inline hwloc_obj_t
+ +
162  hwloc_obj_type_t type, unsigned idx) __hwloc_attribute_pure;
+
163 static __hwloc_inline hwloc_obj_t
+ +
165  hwloc_obj_type_t type, unsigned idx)
+
166 {
+
167  int depth = hwloc_get_type_depth(topology, type);
+
168  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE)
+
169  return NULL;
+
170  return hwloc_get_obj_inside_cpuset_by_depth(topology, set, depth, idx);
+
171 }
+
172 
+
181 static __hwloc_inline unsigned
+ +
183  int depth) __hwloc_attribute_pure;
+
184 static __hwloc_inline unsigned
+ +
186  int depth)
+
187 {
+
188  hwloc_obj_t obj = hwloc_get_obj_by_depth (topology, depth, 0);
+
189  unsigned count = 0;
+
190  if (!obj)
+
191  return 0;
+
192  while (obj) {
+
193  if (!hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_isincluded(obj->cpuset, set))
+
194  count++;
+
195  obj = obj->next_cousin;
+
196  }
+
197  return count;
+
198 }
+
199 
+
212 static __hwloc_inline int
+ +
214  hwloc_obj_type_t type) __hwloc_attribute_pure;
+
215 static __hwloc_inline int
+ +
217  hwloc_obj_type_t type)
+
218 {
+
219  int depth = hwloc_get_type_depth(topology, type);
+
220  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN)
+
221  return 0;
+
222  if (depth == HWLOC_TYPE_DEPTH_MULTIPLE)
+
223  return -1; /* FIXME: agregate nbobjs from different levels? */
+
224  return (int) hwloc_get_nbobjs_inside_cpuset_by_depth(topology, set, depth);
+
225 }
+
226 
+
240 static __hwloc_inline int
+
241 hwloc_get_obj_index_inside_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set,
+
242  hwloc_obj_t obj) __hwloc_attribute_pure;
+
243 static __hwloc_inline int
+ +
245  hwloc_obj_t obj)
+
246 {
+
247  int idx = 0;
+
248  if (!hwloc_bitmap_isincluded(obj->cpuset, set))
+
249  return -1;
+
250  /* count how many objects are inside the cpuset on the way from us to the beginning of the level */
+
251  while ((obj = obj->prev_cousin) != NULL)
+
252  if (!hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_isincluded(obj->cpuset, set))
+
253  idx++;
+
254  return idx;
+
255 }
+
256 
+
271 static __hwloc_inline hwloc_obj_t
+
272 hwloc_get_child_covering_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set,
+
273  hwloc_obj_t parent) __hwloc_attribute_pure;
+
274 static __hwloc_inline hwloc_obj_t
+ +
276  hwloc_obj_t parent)
+
277 {
+
278  hwloc_obj_t child;
+
279  if (hwloc_bitmap_iszero(set))
+
280  return NULL;
+
281  child = parent->first_child;
+
282  while (child) {
+
283  if (child->cpuset && hwloc_bitmap_isincluded(set, child->cpuset))
+
284  return child;
+
285  child = child->next_sibling;
+
286  }
+
287  return NULL;
+
288 }
+
289 
+
294 static __hwloc_inline hwloc_obj_t
+
295 hwloc_get_obj_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) __hwloc_attribute_pure;
+
296 static __hwloc_inline hwloc_obj_t
+ +
298 {
+
299  struct hwloc_obj *current = hwloc_get_root_obj(topology);
+
300  if (hwloc_bitmap_iszero(set) || !hwloc_bitmap_isincluded(set, current->cpuset))
+
301  return NULL;
+
302  while (1) {
+
303  hwloc_obj_t child = hwloc_get_child_covering_cpuset(topology, set, current);
+
304  if (!child)
+
305  return current;
+
306  current = child;
+
307  }
+
308 }
+
309 
+
320 static __hwloc_inline hwloc_obj_t
+ +
322  int depth, hwloc_obj_t prev)
+
323 {
+
324  hwloc_obj_t next = hwloc_get_next_obj_by_depth(topology, depth, prev);
+
325  if (!next)
+
326  return NULL;
+
327  while (next && !hwloc_bitmap_intersects(set, next->cpuset))
+
328  next = next->next_cousin;
+
329  return next;
+
330 }
+
331 
+
347 static __hwloc_inline hwloc_obj_t
+ + +
350 {
+
351  int depth = hwloc_get_type_depth(topology, type);
+ +
353  return NULL;
+
354  return hwloc_get_next_obj_covering_cpuset_by_depth(topology, set, depth, prev);
+
355 }
+
356 
+
377 static __hwloc_inline hwloc_obj_t
+
378 hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology __hwloc_attribute_unused, int depth, hwloc_obj_t obj) __hwloc_attribute_pure;
+
379 static __hwloc_inline hwloc_obj_t
+
380 hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology __hwloc_attribute_unused, int depth, hwloc_obj_t obj)
+
381 {
+
382  hwloc_obj_t ancestor = obj;
+
383  if (obj->depth < depth)
+
384  return NULL;
+
385  while (ancestor && ancestor->depth > depth)
+
386  ancestor = ancestor->parent;
+
387  return ancestor;
+
388 }
+
389 
+
397 static __hwloc_inline hwloc_obj_t
+
398 hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_type_t type, hwloc_obj_t obj) __hwloc_attribute_pure;
+
399 static __hwloc_inline hwloc_obj_t
+ +
401 {
+
402  hwloc_obj_t ancestor = obj->parent;
+
403  while (ancestor && ancestor->type != type)
+
404  ancestor = ancestor->parent;
+
405  return ancestor;
+
406 }
+
407 
+
409 static __hwloc_inline hwloc_obj_t
+
410 hwloc_get_common_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj1, hwloc_obj_t obj2) __hwloc_attribute_pure;
+
411 static __hwloc_inline hwloc_obj_t
+
412 hwloc_get_common_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj1, hwloc_obj_t obj2)
+
413 {
+
414  /* the loop isn't so easy since intermediate ancestors may have
+
415  * different depth, causing us to alternate between using obj1->parent
+
416  * and obj2->parent. Also, even if at some point we find ancestors of
+
417  * of the same depth, their ancestors may have different depth again.
+
418  */
+
419  while (obj1 != obj2) {
+
420  while (obj1->depth > obj2->depth)
+
421  obj1 = obj1->parent;
+
422  while (obj2->depth > obj1->depth)
+
423  obj2 = obj2->parent;
+
424  if (obj1 != obj2 && obj1->depth == obj2->depth) {
+
425  obj1 = obj1->parent;
+
426  obj2 = obj2->parent;
+
427  }
+
428  }
+
429  return obj1;
+
430 }
+
431 
+
437 static __hwloc_inline int
+
438 hwloc_obj_is_in_subtree (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj, hwloc_obj_t subtree_root) __hwloc_attribute_pure;
+
439 static __hwloc_inline int
+
440 hwloc_obj_is_in_subtree (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj, hwloc_obj_t subtree_root)
+
441 {
+
442  return obj->cpuset && subtree_root->cpuset && hwloc_bitmap_isincluded(obj->cpuset, subtree_root->cpuset);
+
443 }
+
444 
+
455 static __hwloc_inline hwloc_obj_t
+
456 hwloc_get_next_child (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t parent, hwloc_obj_t prev)
+
457 {
+
458  hwloc_obj_t obj;
+
459  int state = 0;
+
460  if (prev) {
+
461  if (prev->type == HWLOC_OBJ_MISC)
+
462  state = 3;
+
463  else if (prev->type == HWLOC_OBJ_BRIDGE || prev->type == HWLOC_OBJ_PCI_DEVICE || prev->type == HWLOC_OBJ_OS_DEVICE)
+
464  state = 2;
+
465  else if (prev->type == HWLOC_OBJ_NUMANODE)
+
466  state = 1;
+
467  obj = prev->next_sibling;
+
468  } else {
+
469  obj = parent->first_child;
+
470  }
+
471  if (!obj && state == 0) {
+
472  obj = parent->memory_first_child;
+
473  state = 1;
+
474  }
+
475  if (!obj && state == 1) {
+
476  obj = parent->io_first_child;
+
477  state = 2;
+
478  }
+
479  if (!obj && state == 2) {
+
480  obj = parent->misc_first_child;
+
481  state = 3;
+
482  }
+
483  return obj;
+
484 }
+
485 
+
512 HWLOC_DECLSPEC int
+ +
514 
+
523 HWLOC_DECLSPEC int
+ +
525 
+
534 HWLOC_DECLSPEC int
+ +
536 
+
543 HWLOC_DECLSPEC int
+ +
545 
+
552 HWLOC_DECLSPEC int
+ +
554 
+
561 HWLOC_DECLSPEC int
+ +
563 
+
593 static __hwloc_inline int
+ +
595  unsigned cachelevel, hwloc_obj_cache_type_t cachetype)
+
596 {
+
597  int depth;
+
598  int found = HWLOC_TYPE_DEPTH_UNKNOWN;
+
599  for (depth=0; ; depth++) {
+
600  hwloc_obj_t obj = hwloc_get_obj_by_depth(topology, depth, 0);
+
601  if (!obj)
+
602  break;
+
603  if (!hwloc_obj_type_is_dcache(obj->type) || obj->attr->cache.depth != cachelevel)
+
604  /* doesn't match, try next depth */
+
605  continue;
+
606  if (cachetype == (hwloc_obj_cache_type_t) -1) {
+
607  if (found != HWLOC_TYPE_DEPTH_UNKNOWN) {
+
608  /* second match, return MULTIPLE */
+ +
610  }
+
611  /* first match, mark it as found */
+
612  found = depth;
+
613  continue;
+
614  }
+
615  if (obj->attr->cache.type == cachetype || obj->attr->cache.type == HWLOC_OBJ_CACHE_UNIFIED)
+
616  /* exact match (either unified is alone, or we match instruction or data), return immediately */
+
617  return depth;
+
618  }
+
619  /* went to the bottom, return what we found */
+
620  return found;
+
621 }
+
622 
+
627 static __hwloc_inline hwloc_obj_t
+
628 hwloc_get_cache_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) __hwloc_attribute_pure;
+
629 static __hwloc_inline hwloc_obj_t
+ +
631 {
+
632  hwloc_obj_t current = hwloc_get_obj_covering_cpuset(topology, set);
+
633  while (current) {
+
634  if (hwloc_obj_type_is_dcache(current->type))
+
635  return current;
+
636  current = current->parent;
+
637  }
+
638  return NULL;
+
639 }
+
640 
+
645 static __hwloc_inline hwloc_obj_t
+
646 hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj) __hwloc_attribute_pure;
+
647 static __hwloc_inline hwloc_obj_t
+
648 hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj)
+
649 {
+
650  hwloc_obj_t current = obj->parent;
+
651  if (!obj->cpuset)
+
652  return NULL;
+
653  while (current) {
+
654  if (!hwloc_bitmap_isequal(current->cpuset, obj->cpuset)
+
655  && hwloc_obj_type_is_dcache(current->type))
+
656  return current;
+
657  current = current->parent;
+
658  }
+
659  return NULL;
+
660 }
+
661 
+
691 HWLOC_DECLSPEC int hwloc_bitmap_singlify_per_core(hwloc_topology_t topology, hwloc_bitmap_t cpuset, unsigned which);
+
692 
+
702 static __hwloc_inline hwloc_obj_t
+
703 hwloc_get_pu_obj_by_os_index(hwloc_topology_t topology, unsigned os_index) __hwloc_attribute_pure;
+
704 static __hwloc_inline hwloc_obj_t
+ +
706 {
+
707  hwloc_obj_t obj = NULL;
+
708  while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PU, obj)) != NULL)
+
709  if (obj->os_index == os_index)
+
710  return obj;
+
711  return NULL;
+
712 }
+
713 
+
723 static __hwloc_inline hwloc_obj_t
+
724 hwloc_get_numanode_obj_by_os_index(hwloc_topology_t topology, unsigned os_index) __hwloc_attribute_pure;
+
725 static __hwloc_inline hwloc_obj_t
+ +
727 {
+
728  hwloc_obj_t obj = NULL;
+
729  while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NUMANODE, obj)) != NULL)
+
730  if (obj->os_index == os_index)
+
731  return obj;
+
732  return NULL;
+
733 }
+
734 
+
746 /* TODO: rather provide an iterator? Provide a way to know how much should be allocated? By returning the total number of objects instead? */
+
747 HWLOC_DECLSPEC unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t * __hwloc_restrict objs, unsigned max);
+
748 
+
761 static __hwloc_inline hwloc_obj_t
+ +
763  hwloc_obj_type_t type1, unsigned idx1,
+
764  hwloc_obj_type_t type2, unsigned idx2) __hwloc_attribute_pure;
+
765 static __hwloc_inline hwloc_obj_t
+ +
767  hwloc_obj_type_t type1, unsigned idx1,
+
768  hwloc_obj_type_t type2, unsigned idx2)
+
769 {
+
770  hwloc_obj_t obj;
+
771  obj = hwloc_get_obj_by_type (topology, type1, idx1);
+
772  if (!obj)
+
773  return NULL;
+
774  return hwloc_get_obj_inside_cpuset_by_type(topology, obj->cpuset, type2, idx2);
+
775 }
+
776 
+
795 static __hwloc_inline hwloc_obj_t
+
796 hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv) __hwloc_attribute_pure;
+
797 static __hwloc_inline hwloc_obj_t
+
798 hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
+
799 {
+
800  hwloc_obj_t obj = hwloc_get_root_obj(topology);
+
801  int i;
+
802  for(i=0; i<nr; i++) {
+
803  if (!obj)
+
804  return NULL;
+
805  obj = hwloc_get_obj_inside_cpuset_by_type(topology, obj->cpuset, typev[i], idxv[i]);
+
806  }
+
807  return obj;
+
808 }
+
809 
+ + +
825 };
+
826 
+
850 static __hwloc_inline int
+ +
852  hwloc_obj_t *roots, unsigned n_roots,
+
853  hwloc_cpuset_t *set,
+
854  unsigned n,
+
855  int until, unsigned long flags)
+
856 {
+
857  unsigned i;
+
858  unsigned tot_weight;
+
859  unsigned given, givenweight;
+
860  hwloc_cpuset_t *cpusetp = set;
+
861 
+
862  if (flags & ~HWLOC_DISTRIB_FLAG_REVERSE) {
+
863  errno = EINVAL;
+
864  return -1;
+
865  }
+
866 
+
867  tot_weight = 0;
+
868  for (i = 0; i < n_roots; i++)
+
869  tot_weight += (unsigned) hwloc_bitmap_weight(roots[i]->cpuset);
+
870 
+
871  for (i = 0, given = 0, givenweight = 0; i < n_roots; i++) {
+
872  unsigned chunk, weight;
+
873  hwloc_obj_t root = roots[flags & HWLOC_DISTRIB_FLAG_REVERSE ? n_roots-1-i : i];
+
874  hwloc_cpuset_t cpuset = root->cpuset;
+
875  if (root->type == HWLOC_OBJ_NUMANODE)
+
876  /* NUMANodes have same cpuset as their parent, but we need normal objects below */
+
877  root = root->parent;
+
878  weight = (unsigned) hwloc_bitmap_weight(cpuset);
+
879  if (!weight)
+
880  continue;
+
881  /* Give to root a chunk proportional to its weight.
+
882  * If previous chunks got rounded-up, we may get a bit less. */
+
883  chunk = (( (givenweight+weight) * n + tot_weight-1) / tot_weight)
+
884  - (( givenweight * n + tot_weight-1) / tot_weight);
+
885  if (!root->arity || chunk <= 1 || root->depth >= until) {
+
886  /* We can't split any more, put everything there. */
+
887  if (chunk) {
+
888  /* Fill cpusets with ours */
+
889  unsigned j;
+
890  for (j=0; j < chunk; j++)
+
891  cpusetp[j] = hwloc_bitmap_dup(cpuset);
+
892  } else {
+
893  /* We got no chunk, just merge our cpuset to a previous one
+
894  * (the first chunk cannot be empty)
+
895  * so that this root doesn't get ignored.
+
896  */
+
897  assert(given);
+
898  hwloc_bitmap_or(cpusetp[-1], cpusetp[-1], cpuset);
+
899  }
+
900  } else {
+
901  /* Still more to distribute, recurse into children */
+
902  hwloc_distrib(topology, root->children, root->arity, cpusetp, chunk, until, flags);
+
903  }
+
904  cpusetp += chunk;
+
905  given += chunk;
+
906  givenweight += weight;
+
907  }
+
908 
+
909  return 0;
+
910 }
+
911 
+
929 HWLOC_DECLSPEC hwloc_const_cpuset_t
+
930 hwloc_topology_get_complete_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure;
+
931 
+
943 HWLOC_DECLSPEC hwloc_const_cpuset_t
+
944 hwloc_topology_get_topology_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure;
+
945 
+
962 HWLOC_DECLSPEC hwloc_const_cpuset_t
+
963 hwloc_topology_get_allowed_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure;
+
964 
+
974 HWLOC_DECLSPEC hwloc_const_nodeset_t
+
975 hwloc_topology_get_complete_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure;
+
976 
+
988 HWLOC_DECLSPEC hwloc_const_nodeset_t
+
989 hwloc_topology_get_topology_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure;
+
990 
+
1007 HWLOC_DECLSPEC hwloc_const_nodeset_t
+
1008 hwloc_topology_get_allowed_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure;
+
1009 
+
1030 static __hwloc_inline int
+ +
1032 {
+ +
1034  hwloc_obj_t obj = NULL;
+
1035  assert(depth != HWLOC_TYPE_DEPTH_UNKNOWN);
+ +
1037  while ((obj = hwloc_get_next_obj_covering_cpuset_by_depth(topology, _cpuset, depth, obj)) != NULL)
+
1038  if (hwloc_bitmap_set(nodeset, obj->os_index) < 0)
+
1039  return -1;
+
1040  return 0;
+
1041 }
+
1042 
+
1054 static __hwloc_inline int
+ +
1056 {
+ +
1058  hwloc_obj_t obj = NULL;
+
1059  assert(depth != HWLOC_TYPE_DEPTH_UNKNOWN);
+
1060  hwloc_bitmap_zero(_cpuset);
+
1061  while ((obj = hwloc_get_next_obj_by_depth(topology, depth, obj)) != NULL) {
+
1062  if (hwloc_bitmap_isset(nodeset, obj->os_index))
+
1063  /* no need to check obj->cpuset because objects in levels always have a cpuset */
+
1064  if (hwloc_bitmap_or(_cpuset, _cpuset, obj->cpuset) < 0)
+
1065  return -1;
+
1066  }
+
1067  return 0;
+
1068 }
+
1069 
+
1089 static __hwloc_inline hwloc_obj_t
+
1090 hwloc_get_non_io_ancestor_obj(hwloc_topology_t topology __hwloc_attribute_unused,
+
1091  hwloc_obj_t ioobj)
+
1092 {
+
1093  hwloc_obj_t obj = ioobj;
+
1094  while (obj && !obj->cpuset) {
+
1095  obj = obj->parent;
+
1096  }
+
1097  return obj;
+
1098 }
+
1099 
+
1104 static __hwloc_inline hwloc_obj_t
+ +
1106 {
+
1107  return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PCI_DEVICE, prev);
+
1108 }
+
1109 
+
1113 static __hwloc_inline hwloc_obj_t
+ +
1115  unsigned domain, unsigned bus, unsigned dev, unsigned func)
+
1116 {
+
1117  hwloc_obj_t obj = NULL;
+
1118  while ((obj = hwloc_get_next_pcidev(topology, obj)) != NULL) {
+
1119  if (obj->attr->pcidev.domain == domain
+
1120  && obj->attr->pcidev.bus == bus
+
1121  && obj->attr->pcidev.dev == dev
+
1122  && obj->attr->pcidev.func == func)
+
1123  return obj;
+
1124  }
+
1125  return NULL;
+
1126 }
+
1127 
+
1131 static __hwloc_inline hwloc_obj_t
+ +
1133 {
+
1134  unsigned domain = 0; /* default */
+
1135  unsigned bus, dev, func;
+
1136 
+
1137  if (sscanf(busid, "%x:%x.%x", &bus, &dev, &func) != 3
+
1138  && sscanf(busid, "%x:%x:%x.%x", &domain, &bus, &dev, &func) != 4) {
+
1139  errno = EINVAL;
+
1140  return NULL;
+
1141  }
+
1142 
+
1143  return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, func);
+
1144 }
+
1145 
+
1150 static __hwloc_inline hwloc_obj_t
+ +
1152 {
+
1153  return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_OS_DEVICE, prev);
+
1154 }
+
1155 
+
1160 static __hwloc_inline hwloc_obj_t
+ +
1162 {
+
1163  return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_BRIDGE, prev);
+
1164 }
+
1165 
+
1166 /* \brief Checks whether a given bridge covers a given PCI bus.
+
1167  */
+
1168 static __hwloc_inline int
+ +
1170  unsigned domain, unsigned bus)
+
1171 {
+
1172  return bridge->type == HWLOC_OBJ_BRIDGE
+ +
1174  && bridge->attr->bridge.downstream.pci.domain == domain
+
1175  && bridge->attr->bridge.downstream.pci.secondary_bus <= bus
+
1176  && bridge->attr->bridge.downstream.pci.subordinate_bus >= bus;
+
1177 }
+
1178 
+
1183 #ifdef __cplusplus
+
1184 } /* extern "C" */
+
1185 #endif
+
1186 
+
1187 
+
1188 #endif /* HWLOC_HELPER_H */
+
@ HWLOC_OBJ_PCI_DEVICE
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:266
+
static hwloc_obj_t hwloc_get_next_bridge(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next bridge in the system.
Definition: helper.h:1161
+
hwloc_obj_bridge_type_t downstream_type
Definition: hwloc.h:647
+
int hwloc_get_largest_objs_inside_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t *restrict objs, int max)
Get the set of largest objects covering exactly a given cpuset set.
+
hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset(hwloc_topology_t topology)
Get complete node set.
+
int hwloc_obj_type_is_memory(hwloc_obj_type_t type)
Check whether an object type is Memory.
+
unsigned short domain
Definition: hwloc.h:621
+
struct hwloc_obj * next_sibling
Next object below the same parent (inside the same list of children).
Definition: hwloc.h:436
+
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
+
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine,...
Definition: hwloc.h:389
+
static hwloc_obj_t hwloc_get_child_covering_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t parent)
Get the child covering at least CPU set set.
Definition: helper.h:275
+
int hwloc_obj_type_is_icache(hwloc_obj_type_t type)
Check whether an object type is a CPU Instruction Cache,.
+
int hwloc_obj_type_is_dcache(hwloc_obj_type_t type)
Check whether an object type is a CPU Data or Unified Cache.
+
int hwloc_obj_type_is_io(hwloc_obj_type_t type)
Check whether an object type is I/O.
+
static hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set)
Get the first largest object included in the given cpuset set.
Definition: helper.h:42
+
static int hwloc_cpuset_to_nodeset(hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset)
Convert a CPU set into a NUMA node set.
Definition: helper.h:1031
+
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, unsigned idx)
Return the (logically) idx -th object at depth depth included in CPU set set.
Definition: helper.h:130
+
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
+
struct hwloc_obj * misc_first_child
First Misc child. Misc objects are listed here (misc_arity and misc_first_child) instead of in the no...
Definition: hwloc.h:493
+
static hwloc_obj_t hwloc_get_numanode_obj_by_os_index(hwloc_topology_t topology, unsigned os_index)
Returns the object of type HWLOC_OBJ_NUMANODE with os_index.
Definition: helper.h:726
+
struct hwloc_obj * next_cousin
Next object of same type and depth.
Definition: hwloc.h:430
+
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:386
+
hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset(hwloc_topology_t topology)
Get allowed node set.
+
static hwloc_obj_t hwloc_get_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
Returns the topology object at logical index idx with type type.
+
@ HWLOC_OBJ_MISC
Miscellaneous objects (filtered out by default). Objects without particular meaning,...
Definition: hwloc.h:281
+
static hwloc_obj_t hwloc_get_obj_covering_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set)
Get the lowest object covering at least CPU set set.
Definition: helper.h:297
+
union hwloc_obj_attr_u::hwloc_bridge_attr_s::@1 downstream
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
unsigned char func
Definition: hwloc.h:625
+
@ HWLOC_OBJ_OS_DEVICE
Operating system device (filtered out by default). They are not added to the topology unless I/O disc...
Definition: hwloc.h:273
+
static hwloc_obj_t hwloc_get_pcidev_by_busidstring(hwloc_topology_t topology, const char *busid)
Find the PCI device object matching the PCI bus id given as a string xxxx:yy:zz.t or yy:zz....
Definition: helper.h:1132
+
static hwloc_obj_t hwloc_get_root_obj(hwloc_topology_t topology)
Returns the top-object of the topology-tree.
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
static unsigned hwloc_get_nbobjs_inside_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth)
Return the number of objects at depth depth included in CPU set set.
Definition: helper.h:185
+
static hwloc_obj_t hwloc_get_shared_cache_covering_obj(hwloc_topology_t topology, hwloc_obj_t obj)
Get the first data (or unified) cache shared between an object and somebody else.
Definition: helper.h:648
+
int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
+
struct hwloc_obj * prev_cousin
Previous object of same type and depth.
Definition: hwloc.h:431
+
static int hwloc_get_obj_index_inside_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t obj)
Return the logical index among the objects included in CPU set set.
Definition: helper.h:244
+
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
+
@ HWLOC_TYPE_DEPTH_MULTIPLE
Objects of given type exist at different depth in the topology (only for Groups).
Definition: hwloc.h:809
+
hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset(hwloc_topology_t topology)
Get topology node set.
+
hwloc_obj_cache_type_t type
Cache type.
Definition: hwloc.h:608
+
static int hwloc_get_cache_type_depth(hwloc_topology_t topology, unsigned cachelevel, hwloc_obj_cache_type_t cachetype)
Find the depth of cache objects matching cache level and type.
Definition: helper.h:594
+
@ HWLOC_OBJ_BRIDGE_PCI
PCI-side of a bridge.
Definition: hwloc.h:323
+
int hwloc_bitmap_isequal(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmap bitmap1 is equal to bitmap bitmap2.
+
Structure of a topology object.
Definition: hwloc.h:384
+
static hwloc_obj_t hwloc_get_obj_below_array_by_type(hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
Find an object below a chain of objects specified by types and indexes.
Definition: helper.h:798
+
unsigned arity
Number of normal children. Memory, Misc and I/O children are not listed here but rather in their dedi...
Definition: hwloc.h:440
+
@ HWLOC_OBJ_BRIDGE
Bridge (filtered out by default). Any bridge (or PCI switch) that connects the host or an I/O bus,...
Definition: hwloc.h:257
+
struct hwloc_obj_attr_u::hwloc_cache_attr_s cache
+
struct hwloc_obj ** children
Normal children, children[0 .. arity -1].
Definition: hwloc.h:444
+
struct hwloc_pcidev_attr_s pci
Definition: hwloc.h:634
+
int hwloc_obj_type_is_cache(hwloc_obj_type_t type)
Check whether an object type is a CPU Cache (Data, Unified or Instruction).
+
static int hwloc_cpuset_from_nodeset(hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset)
Convert a NUMA node set into a CPU set.
Definition: helper.h:1055
+
hwloc_obj_t hwloc_get_obj_by_depth(hwloc_topology_t topology, int depth, unsigned idx)
Returns the topology object at logical index idx from depth depth.
+
static int hwloc_get_nbobjs_inside_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type)
Return the number of objects of type type included in CPU set set.
Definition: helper.h:216
+
unsigned char bus
Definition: hwloc.h:625
+
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1151
+
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
Return the next object of type type included in CPU set set.
Definition: helper.h:109
+
@ HWLOC_TYPE_DEPTH_UNKNOWN
No object of given type exists in the topology.
Definition: hwloc.h:808
+
struct hwloc_obj * io_first_child
First I/O child. Bridges, PCI and OS devices are listed here (io_arity and io_first_child) instead of...
Definition: hwloc.h:481
+
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, unsigned idx)
Return the idx -th object of type type included in CPU set set.
Definition: helper.h:164
+
hwloc_const_bitmap_t hwloc_const_nodeset_t
A non-modifiable hwloc_nodeset_t.
Definition: hwloc.h:160
+
struct hwloc_obj_attr_u::hwloc_bridge_attr_s bridge
+
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:500
+
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:434
+
int hwloc_bitmap_intersects(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmaps bitmap1 and bitmap2 intersects.
+
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
Return the next object at depth depth included in CPU set set.
Definition: helper.h:85
+
enum hwloc_obj_cache_type_e hwloc_obj_cache_type_t
Cache type.
+
hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap)
Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.
+
hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset(hwloc_topology_t topology)
Get allowed CPU set.
+
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
static hwloc_obj_t hwloc_get_next_pcidev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next PCI device in the system.
Definition: helper.h:1105
+
static hwloc_obj_t hwloc_get_common_ancestor_obj(hwloc_topology_t topology, hwloc_obj_t obj1, hwloc_obj_t obj2)
Returns the common parent object to objects obj1 and obj2.
Definition: helper.h:412
+
hwloc_obj_type_t
Type of topology object.
Definition: hwloc.h:176
+
static hwloc_obj_t hwloc_get_next_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t prev)
Returns the next object at depth depth.
+
static hwloc_obj_t hwloc_get_ancestor_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t obj)
Returns the ancestor object of obj at depth depth.
Definition: helper.h:380
+
static hwloc_obj_t hwloc_get_pu_obj_by_os_index(hwloc_topology_t topology, unsigned os_index)
Returns the object of type HWLOC_OBJ_PU with os_index.
Definition: helper.h:705
+
int hwloc_bitmap_singlify_per_core(hwloc_topology_t topology, hwloc_bitmap_t cpuset, unsigned which)
Remove simultaneous multithreading PUs from a CPU set.
+
@ HWLOC_OBJ_CACHE_UNIFIED
Unified cache.
Definition: hwloc.h:315
+
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
+
int hwloc_bitmap_isincluded(hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap)
Test whether bitmap sub_bitmap is part of bitmap super_bitmap.
+
static hwloc_obj_t hwloc_get_pcidev_by_busid(hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id.
Definition: helper.h:1114
+
int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id)
Test whether index id is part of bitmap bitmap.
+
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
+
hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset(hwloc_topology_t topology)
Get topology CPU set.
+
int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap)
Compute the "weight" of bitmap bitmap (i.e., number of indexes that are in the bitmap).
+
unsigned char dev
Definition: hwloc.h:625
+
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
Iterate through same-depth objects covering at least CPU set set.
Definition: helper.h:321
+
hwloc_distrib_flags_e
Flags to be given to hwloc_distrib().
Definition: helper.h:820
+
hwloc_bitmap_t hwloc_nodeset_t
A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes.
Definition: hwloc.h:157
+
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
Iterate through same-type objects covering at least CPU set set.
Definition: helper.h:348
+
static hwloc_obj_t hwloc_get_obj_below_by_type(hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t type2, unsigned idx2)
Find an object below another object, both specified by types and indexes.
Definition: helper.h:766
+
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
+
hwloc_nodeset_t nodeset
NUMA nodes covered by this object or containing this object.
Definition: hwloc.h:528
+
unsigned depth
Depth of cache (e.g., L1, L2, ...etc.)
Definition: hwloc.h:604
+
static hwloc_obj_t hwloc_get_cache_covering_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set)
Get the first data (or unified) cache covering a cpuset set.
Definition: helper.h:630
+
@ HWLOC_OBJ_NUMANODE
NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...
Definition: hwloc.h:236
+
static hwloc_obj_t hwloc_get_next_child(hwloc_topology_t topology, hwloc_obj_t parent, hwloc_obj_t prev)
Return the next child.
Definition: helper.h:456
+
struct hwloc_obj * first_child
First normal child.
Definition: hwloc.h:445
+
struct hwloc_obj * memory_first_child
First Memory child. NUMA nodes and Memory-side caches are listed here (memory_arity and memory_first_...
Definition: hwloc.h:463
+
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
+
@ HWLOC_DISTRIB_FLAG_REVERSE
Distrib in reverse order, starting from the last objects.
Definition: helper.h:824
+
int hwloc_obj_type_is_normal(hwloc_obj_type_t type)
Check whether an object type is Normal.
+
static int hwloc_obj_is_in_subtree(hwloc_topology_t topology, hwloc_obj_t obj, hwloc_obj_t subtree_root)
Returns true if obj is inside the subtree beginning with ancestor object subtree_root.
Definition: helper.h:440
+
static hwloc_obj_t hwloc_get_non_io_ancestor_obj(hwloc_topology_t topology, hwloc_obj_t ioobj)
Get the first non-I/O ancestor object.
Definition: helper.h:1090
+
@ HWLOC_OBJ_PU
Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical ...
Definition: hwloc.h:201
+
static hwloc_obj_t hwloc_get_ancestor_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t obj)
Returns the ancestor object of obj with type type.
Definition: helper.h:400
+
unsigned hwloc_get_closest_objs(hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *restrict objs, unsigned max)
Do a depth-first traversal of the topology to find and sort.
+
static hwloc_obj_t hwloc_get_next_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev)
Returns the next object of type type.
+
int depth
Vertical index in the hierarchy.
Definition: hwloc.h:407
+
static int hwloc_bridge_covers_pcibus(hwloc_obj_t bridge, unsigned domain, unsigned bus)
Definition: helper.h:1169
+
static int hwloc_distrib(hwloc_topology_t topology, hwloc_obj_t *roots, unsigned n_roots, hwloc_cpuset_t *set, unsigned n, int until, unsigned long flags)
Distribute n items over the topology under roots.
Definition: helper.h:851
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00131_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00131_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00131_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00131_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): bitmap.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2009 CNRS
3  * Copyright © 2009-2018 Inria. All rights reserved.
4  * Copyright © 2009-2012 Université Bordeaux
5  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
6  * See COPYING in top-level directory.
7  */
8 
13 #ifndef HWLOC_BITMAP_H
14 #define HWLOC_BITMAP_H
15 
16 #include "hwloc/autogen/config.h"
17 
18 #include <assert.h>
19 
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 
68 typedef struct hwloc_bitmap_s * hwloc_bitmap_t;
70 typedef const struct hwloc_bitmap_s * hwloc_const_bitmap_t;
71 
72 
73 /*
74  * Bitmap allocation, freeing and copying.
75  */
76 
84 HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_alloc(void) __hwloc_attribute_malloc;
85 
87 HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_alloc_full(void) __hwloc_attribute_malloc;
88 
93 HWLOC_DECLSPEC void hwloc_bitmap_free(hwloc_bitmap_t bitmap);
94 
99 HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc;
100 
102 HWLOC_DECLSPEC int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src);
103 
104 
105 /*
106  * Bitmap/String Conversion
107  */
108 
118 HWLOC_DECLSPEC int hwloc_bitmap_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap);
119 
124 HWLOC_DECLSPEC int hwloc_bitmap_asprintf(char ** strp, hwloc_const_bitmap_t bitmap);
125 
128 HWLOC_DECLSPEC int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string);
129 
143 HWLOC_DECLSPEC int hwloc_bitmap_list_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap);
144 
149 HWLOC_DECLSPEC int hwloc_bitmap_list_asprintf(char ** strp, hwloc_const_bitmap_t bitmap);
150 
153 HWLOC_DECLSPEC int hwloc_bitmap_list_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string);
154 
167 HWLOC_DECLSPEC int hwloc_bitmap_taskset_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap);
168 
173 HWLOC_DECLSPEC int hwloc_bitmap_taskset_asprintf(char ** strp, hwloc_const_bitmap_t bitmap);
174 
177 HWLOC_DECLSPEC int hwloc_bitmap_taskset_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string);
178 
179 
180 /*
181  * Building bitmaps.
182  */
183 
185 HWLOC_DECLSPEC void hwloc_bitmap_zero(hwloc_bitmap_t bitmap);
186 
188 HWLOC_DECLSPEC void hwloc_bitmap_fill(hwloc_bitmap_t bitmap);
189 
191 HWLOC_DECLSPEC int hwloc_bitmap_only(hwloc_bitmap_t bitmap, unsigned id);
192 
194 HWLOC_DECLSPEC int hwloc_bitmap_allbut(hwloc_bitmap_t bitmap, unsigned id);
195 
197 HWLOC_DECLSPEC int hwloc_bitmap_from_ulong(hwloc_bitmap_t bitmap, unsigned long mask);
198 
200 HWLOC_DECLSPEC int hwloc_bitmap_from_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask);
201 
203 HWLOC_DECLSPEC int hwloc_bitmap_from_ulongs(hwloc_bitmap_t bitmap, unsigned nr, const unsigned long *masks);
204 
205 
206 /*
207  * Modifying bitmaps.
208  */
209 
211 HWLOC_DECLSPEC int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id);
212 
217 HWLOC_DECLSPEC int hwloc_bitmap_set_range(hwloc_bitmap_t bitmap, unsigned begin, int end);
218 
220 HWLOC_DECLSPEC int hwloc_bitmap_set_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask);
221 
223 HWLOC_DECLSPEC int hwloc_bitmap_clr(hwloc_bitmap_t bitmap, unsigned id);
224 
229 HWLOC_DECLSPEC int hwloc_bitmap_clr_range(hwloc_bitmap_t bitmap, unsigned begin, int end);
230 
250 HWLOC_DECLSPEC int hwloc_bitmap_singlify(hwloc_bitmap_t bitmap);
251 
252 
253 /*
254  * Consulting bitmaps.
255  */
256 
258 HWLOC_DECLSPEC unsigned long hwloc_bitmap_to_ulong(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
259 
261 HWLOC_DECLSPEC unsigned long hwloc_bitmap_to_ith_ulong(hwloc_const_bitmap_t bitmap, unsigned i) __hwloc_attribute_pure;
262 
269 HWLOC_DECLSPEC int hwloc_bitmap_to_ulongs(hwloc_const_bitmap_t bitmap, unsigned nr, unsigned long *masks);
270 
284 HWLOC_DECLSPEC int hwloc_bitmap_nr_ulongs(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
285 
290 HWLOC_DECLSPEC int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id) __hwloc_attribute_pure;
291 
296 HWLOC_DECLSPEC int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
297 
304 HWLOC_DECLSPEC int hwloc_bitmap_isfull(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
305 
310 HWLOC_DECLSPEC int hwloc_bitmap_first(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
311 
318 HWLOC_DECLSPEC int hwloc_bitmap_next(hwloc_const_bitmap_t bitmap, int prev) __hwloc_attribute_pure;
319 
324 HWLOC_DECLSPEC int hwloc_bitmap_last(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
325 
333 HWLOC_DECLSPEC int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
334 
339 HWLOC_DECLSPEC int hwloc_bitmap_first_unset(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
340 
347 HWLOC_DECLSPEC int hwloc_bitmap_next_unset(hwloc_const_bitmap_t bitmap, int prev) __hwloc_attribute_pure;
348 
353 HWLOC_DECLSPEC int hwloc_bitmap_last_unset(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
354 
370 #define hwloc_bitmap_foreach_begin(id, bitmap) \
371 do { \
372  assert(hwloc_bitmap_weight(bitmap) != -1); \
373  for (id = hwloc_bitmap_first(bitmap); \
374  (unsigned) id != (unsigned) -1; \
375  id = hwloc_bitmap_next(bitmap, id)) {
376 
384 #define hwloc_bitmap_foreach_end() \
385  } \
386 } while (0)
387 
388 
389 /*
390  * Combining bitmaps.
391  */
392 
397 HWLOC_DECLSPEC int hwloc_bitmap_or (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
398 
403 HWLOC_DECLSPEC int hwloc_bitmap_and (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
404 
409 HWLOC_DECLSPEC int hwloc_bitmap_andnot (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
410 
415 HWLOC_DECLSPEC int hwloc_bitmap_xor (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
416 
421 HWLOC_DECLSPEC int hwloc_bitmap_not (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap);
422 
423 
424 /*
425  * Comparing bitmaps.
426  */
427 
432 HWLOC_DECLSPEC int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
433 
440 HWLOC_DECLSPEC int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap) __hwloc_attribute_pure;
441 
446 HWLOC_DECLSPEC int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
447 
465 HWLOC_DECLSPEC int hwloc_bitmap_compare_first(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
466 
484 HWLOC_DECLSPEC int hwloc_bitmap_compare(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
485 
489 #ifdef __cplusplus
490 } /* extern "C" */
491 #endif
492 
493 
494 #endif /* HWLOC_BITMAP_H */
hwloc_bitmap_t hwloc_bitmap_alloc(void)
Allocate a new empty bitmap.
-
int hwloc_bitmap_from_ulong(hwloc_bitmap_t bitmap, unsigned long mask)
Setup bitmap bitmap from unsigned long mask.
-
int hwloc_bitmap_first_unset(hwloc_const_bitmap_t bitmap)
Compute the first unset index (least significant bit) in bitmap bitmap.
-
int hwloc_bitmap_last_unset(hwloc_const_bitmap_t bitmap)
Compute the last unset index (most significant bit) in bitmap bitmap.
-
int hwloc_bitmap_list_sscanf(hwloc_bitmap_t bitmap, const char *restrict string)
Parse a list string and stores it in bitmap bitmap.
-
int hwloc_bitmap_only(hwloc_bitmap_t bitmap, unsigned id)
Empty the bitmap bitmap and add bit id.
-
int hwloc_bitmap_compare_first(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Compare bitmaps bitmap1 and bitmap2 using their lowest index.
-
int hwloc_bitmap_clr(hwloc_bitmap_t bitmap, unsigned id)
Remove index id from bitmap bitmap.
-
void hwloc_bitmap_free(hwloc_bitmap_t bitmap)
Free bitmap bitmap.
-
unsigned long hwloc_bitmap_to_ulong(hwloc_const_bitmap_t bitmap)
Convert the beginning part of bitmap bitmap into unsigned long mask.
-
void hwloc_bitmap_fill(hwloc_bitmap_t bitmap)
Fill bitmap bitmap with all possible indexes (even if those objects don&#39;t exist or are otherwise unav...
-
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
-
int hwloc_bitmap_set_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
Replace i -th subset of bitmap bitmap with unsigned long mask.
-
int hwloc_bitmap_isfull(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is completely full.
-
int hwloc_bitmap_taskset_snprintf(char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
Stringify a bitmap in the taskset-specific format.
-
const struct hwloc_bitmap_s * hwloc_const_bitmap_t
a non-modifiable hwloc_bitmap_t
Definition: bitmap.h:70
-
int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap)
Compute the "weight" of bitmap bitmap (i.e., number of indexes that are in the bitmap).
-
int hwloc_bitmap_and(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
And bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
-
int hwloc_bitmap_set_range(hwloc_bitmap_t bitmap, unsigned begin, int end)
Add indexes from begin to end in bitmap bitmap.
-
int hwloc_bitmap_first(hwloc_const_bitmap_t bitmap)
Compute the first index (least significant bit) in bitmap bitmap.
-
int hwloc_bitmap_from_ulongs(hwloc_bitmap_t bitmap, unsigned nr, const unsigned long *masks)
Setup bitmap bitmap from unsigned longs masks used as first nr subsets.
-
int hwloc_bitmap_list_snprintf(char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
Stringify a bitmap in the list format.
-
int hwloc_bitmap_singlify(hwloc_bitmap_t bitmap)
Keep a single index among those set in bitmap bitmap.
-
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
-
int hwloc_bitmap_isincluded(hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap)
Test whether bitmap sub_bitmap is part of bitmap super_bitmap.
-
int hwloc_bitmap_snprintf(char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
Stringify a bitmap.
-
hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap)
Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.
-
int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char *restrict string)
Parse a bitmap string and stores it in bitmap bitmap.
-
int hwloc_bitmap_last(hwloc_const_bitmap_t bitmap)
Compute the last index (most significant bit) in bitmap bitmap.
-
int hwloc_bitmap_next_unset(hwloc_const_bitmap_t bitmap, int prev)
Compute the next unset index in bitmap bitmap which is after index prev.
-
unsigned long hwloc_bitmap_to_ith_ulong(hwloc_const_bitmap_t bitmap, unsigned i)
Convert the i -th subset of bitmap bitmap into unsigned long mask.
-
int hwloc_bitmap_from_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
Setup bitmap bitmap from unsigned long mask used as i -th subset.
-
int hwloc_bitmap_next(hwloc_const_bitmap_t bitmap, int prev)
Compute the next index in bitmap bitmap which is after index prev.
-
int hwloc_bitmap_intersects(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmaps bitmap1 and bitmap2 intersects.
-
int hwloc_bitmap_to_ulongs(hwloc_const_bitmap_t bitmap, unsigned nr, unsigned long *masks)
Convert the first nr subsets of bitmap bitmap into the array of nr unsigned long masks.
-
int hwloc_bitmap_clr_range(hwloc_bitmap_t bitmap, unsigned begin, int end)
Remove indexes from begin to end in bitmap bitmap.
-
int hwloc_bitmap_list_asprintf(char **strp, hwloc_const_bitmap_t bitmap)
Stringify a bitmap into a newly allocated list string.
-
int hwloc_bitmap_compare(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Compare bitmaps bitmap1 and bitmap2 in lexicographic order.
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
int hwloc_bitmap_xor(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Xor bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
-
int hwloc_bitmap_allbut(hwloc_bitmap_t bitmap, unsigned id)
Fill the bitmap and clear the index id.
-
int hwloc_bitmap_taskset_sscanf(hwloc_bitmap_t bitmap, const char *restrict string)
Parse a taskset-specific bitmap string and stores it in bitmap bitmap.
-
int hwloc_bitmap_taskset_asprintf(char **strp, hwloc_const_bitmap_t bitmap)
Stringify a bitmap into a newly allocated taskset-specific string.
-
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
-
int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
-
int hwloc_bitmap_andnot(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
And bitmap bitmap1 and the negation of bitmap2 and store the result in bitmap res.
-
int hwloc_bitmap_asprintf(char **strp, hwloc_const_bitmap_t bitmap)
Stringify a bitmap into a newly allocated string.
-
int hwloc_bitmap_nr_ulongs(hwloc_const_bitmap_t bitmap)
Return the number of unsigned longs required for storing bitmap bitmap entirely.
-
hwloc_bitmap_t hwloc_bitmap_alloc_full(void)
Allocate a new full bitmap.
-
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
-
int hwloc_bitmap_not(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap)
Negate bitmap bitmap and store the result in bitmap res.
-
int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id)
Test whether index id is part of bitmap bitmap.
-
int hwloc_bitmap_isequal(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmap bitmap1 is equal to bitmap bitmap2.
+
1 /*
+
2  * Copyright © 2009 CNRS
+
3  * Copyright © 2009-2018 Inria. All rights reserved.
+
4  * Copyright © 2009-2012 Université Bordeaux
+
5  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
+
6  * See COPYING in top-level directory.
+
7  */
+
8 
+
13 #ifndef HWLOC_BITMAP_H
+
14 #define HWLOC_BITMAP_H
+
15 
+
16 #include "hwloc/autogen/config.h"
+
17 
+
18 #include <assert.h>
+
19 
+
20 
+
21 #ifdef __cplusplus
+
22 extern "C" {
+
23 #endif
+
24 
+
25 
+
68 typedef struct hwloc_bitmap_s * hwloc_bitmap_t;
+
70 typedef const struct hwloc_bitmap_s * hwloc_const_bitmap_t;
+
71 
+
72 
+
73 /*
+
74  * Bitmap allocation, freeing and copying.
+
75  */
+
76 
+
84 HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_alloc(void) __hwloc_attribute_malloc;
+
85 
+
87 HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_alloc_full(void) __hwloc_attribute_malloc;
+
88 
+
93 HWLOC_DECLSPEC void hwloc_bitmap_free(hwloc_bitmap_t bitmap);
+
94 
+
99 HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc;
+
100 
+
102 HWLOC_DECLSPEC int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src);
+
103 
+
104 
+
105 /*
+
106  * Bitmap/String Conversion
+
107  */
+
108 
+
118 HWLOC_DECLSPEC int hwloc_bitmap_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap);
+
119 
+
124 HWLOC_DECLSPEC int hwloc_bitmap_asprintf(char ** strp, hwloc_const_bitmap_t bitmap);
+
125 
+
128 HWLOC_DECLSPEC int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string);
+
129 
+
143 HWLOC_DECLSPEC int hwloc_bitmap_list_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap);
+
144 
+
149 HWLOC_DECLSPEC int hwloc_bitmap_list_asprintf(char ** strp, hwloc_const_bitmap_t bitmap);
+
150 
+
153 HWLOC_DECLSPEC int hwloc_bitmap_list_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string);
+
154 
+
167 HWLOC_DECLSPEC int hwloc_bitmap_taskset_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap);
+
168 
+
173 HWLOC_DECLSPEC int hwloc_bitmap_taskset_asprintf(char ** strp, hwloc_const_bitmap_t bitmap);
+
174 
+
177 HWLOC_DECLSPEC int hwloc_bitmap_taskset_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string);
+
178 
+
179 
+
180 /*
+
181  * Building bitmaps.
+
182  */
+
183 
+
185 HWLOC_DECLSPEC void hwloc_bitmap_zero(hwloc_bitmap_t bitmap);
+
186 
+
188 HWLOC_DECLSPEC void hwloc_bitmap_fill(hwloc_bitmap_t bitmap);
+
189 
+
191 HWLOC_DECLSPEC int hwloc_bitmap_only(hwloc_bitmap_t bitmap, unsigned id);
+
192 
+
194 HWLOC_DECLSPEC int hwloc_bitmap_allbut(hwloc_bitmap_t bitmap, unsigned id);
+
195 
+
197 HWLOC_DECLSPEC int hwloc_bitmap_from_ulong(hwloc_bitmap_t bitmap, unsigned long mask);
+
198 
+
200 HWLOC_DECLSPEC int hwloc_bitmap_from_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask);
+
201 
+
203 HWLOC_DECLSPEC int hwloc_bitmap_from_ulongs(hwloc_bitmap_t bitmap, unsigned nr, const unsigned long *masks);
+
204 
+
205 
+
206 /*
+
207  * Modifying bitmaps.
+
208  */
+
209 
+
211 HWLOC_DECLSPEC int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id);
+
212 
+
217 HWLOC_DECLSPEC int hwloc_bitmap_set_range(hwloc_bitmap_t bitmap, unsigned begin, int end);
+
218 
+
220 HWLOC_DECLSPEC int hwloc_bitmap_set_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask);
+
221 
+
223 HWLOC_DECLSPEC int hwloc_bitmap_clr(hwloc_bitmap_t bitmap, unsigned id);
+
224 
+
229 HWLOC_DECLSPEC int hwloc_bitmap_clr_range(hwloc_bitmap_t bitmap, unsigned begin, int end);
+
230 
+
250 HWLOC_DECLSPEC int hwloc_bitmap_singlify(hwloc_bitmap_t bitmap);
+
251 
+
252 
+
253 /*
+
254  * Consulting bitmaps.
+
255  */
+
256 
+
258 HWLOC_DECLSPEC unsigned long hwloc_bitmap_to_ulong(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
259 
+
261 HWLOC_DECLSPEC unsigned long hwloc_bitmap_to_ith_ulong(hwloc_const_bitmap_t bitmap, unsigned i) __hwloc_attribute_pure;
+
262 
+
269 HWLOC_DECLSPEC int hwloc_bitmap_to_ulongs(hwloc_const_bitmap_t bitmap, unsigned nr, unsigned long *masks);
+
270 
+
284 HWLOC_DECLSPEC int hwloc_bitmap_nr_ulongs(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
285 
+
290 HWLOC_DECLSPEC int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id) __hwloc_attribute_pure;
+
291 
+
296 HWLOC_DECLSPEC int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
297 
+
304 HWLOC_DECLSPEC int hwloc_bitmap_isfull(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
305 
+
310 HWLOC_DECLSPEC int hwloc_bitmap_first(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
311 
+
318 HWLOC_DECLSPEC int hwloc_bitmap_next(hwloc_const_bitmap_t bitmap, int prev) __hwloc_attribute_pure;
+
319 
+
324 HWLOC_DECLSPEC int hwloc_bitmap_last(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
325 
+
333 HWLOC_DECLSPEC int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
334 
+
339 HWLOC_DECLSPEC int hwloc_bitmap_first_unset(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
340 
+
347 HWLOC_DECLSPEC int hwloc_bitmap_next_unset(hwloc_const_bitmap_t bitmap, int prev) __hwloc_attribute_pure;
+
348 
+
353 HWLOC_DECLSPEC int hwloc_bitmap_last_unset(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
+
354 
+
370 #define hwloc_bitmap_foreach_begin(id, bitmap) \
+
371 do { \
+
372  assert(hwloc_bitmap_weight(bitmap) != -1); \
+
373  for (id = hwloc_bitmap_first(bitmap); \
+
374  (unsigned) id != (unsigned) -1; \
+
375  id = hwloc_bitmap_next(bitmap, id)) {
+
376 
+
384 #define hwloc_bitmap_foreach_end() \
+
385  } \
+
386 } while (0)
+
387 
+
388 
+
389 /*
+
390  * Combining bitmaps.
+
391  */
+
392 
+
397 HWLOC_DECLSPEC int hwloc_bitmap_or (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
+
398 
+
403 HWLOC_DECLSPEC int hwloc_bitmap_and (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
+
404 
+
409 HWLOC_DECLSPEC int hwloc_bitmap_andnot (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
+
410 
+
415 HWLOC_DECLSPEC int hwloc_bitmap_xor (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
+
416 
+
421 HWLOC_DECLSPEC int hwloc_bitmap_not (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap);
+
422 
+
423 
+
424 /*
+
425  * Comparing bitmaps.
+
426  */
+
427 
+
432 HWLOC_DECLSPEC int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
+
433 
+
440 HWLOC_DECLSPEC int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap) __hwloc_attribute_pure;
+
441 
+
446 HWLOC_DECLSPEC int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
+
447 
+
465 HWLOC_DECLSPEC int hwloc_bitmap_compare_first(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
+
466 
+
484 HWLOC_DECLSPEC int hwloc_bitmap_compare(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
+
485 
+
489 #ifdef __cplusplus
+
490 } /* extern "C" */
+
491 #endif
+
492 
+
493 
+
494 #endif /* HWLOC_BITMAP_H */
+
int hwloc_bitmap_from_ulong(hwloc_bitmap_t bitmap, unsigned long mask)
Setup bitmap bitmap from unsigned long mask.
+
int hwloc_bitmap_only(hwloc_bitmap_t bitmap, unsigned id)
Empty the bitmap bitmap and add bit id.
+
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
+
unsigned long hwloc_bitmap_to_ith_ulong(hwloc_const_bitmap_t bitmap, unsigned i)
Convert the i -th subset of bitmap bitmap into unsigned long mask.
+
int hwloc_bitmap_xor(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Xor bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
+
int hwloc_bitmap_singlify(hwloc_bitmap_t bitmap)
Keep a single index among those set in bitmap bitmap.
+
int hwloc_bitmap_and(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
And bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
+
int hwloc_bitmap_isfull(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is completely full.
+
const struct hwloc_bitmap_s * hwloc_const_bitmap_t
a non-modifiable hwloc_bitmap_t
Definition: bitmap.h:70
+
int hwloc_bitmap_first_unset(hwloc_const_bitmap_t bitmap)
Compute the first unset index (least significant bit) in bitmap bitmap.
+
int hwloc_bitmap_next(hwloc_const_bitmap_t bitmap, int prev)
Compute the next index in bitmap bitmap which is after index prev.
+
int hwloc_bitmap_compare_first(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Compare bitmaps bitmap1 and bitmap2 using their lowest index.
+
int hwloc_bitmap_nr_ulongs(hwloc_const_bitmap_t bitmap)
Return the number of unsigned longs required for storing bitmap bitmap entirely.
+
int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
+
int hwloc_bitmap_list_asprintf(char **strp, hwloc_const_bitmap_t bitmap)
Stringify a bitmap into a newly allocated list string.
+
int hwloc_bitmap_first(hwloc_const_bitmap_t bitmap)
Compute the first index (least significant bit) in bitmap bitmap.
+
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
+
void hwloc_bitmap_free(hwloc_bitmap_t bitmap)
Free bitmap bitmap.
+
int hwloc_bitmap_set_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
Replace i -th subset of bitmap bitmap with unsigned long mask.
+
int hwloc_bitmap_isequal(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmap bitmap1 is equal to bitmap bitmap2.
+
int hwloc_bitmap_andnot(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
And bitmap bitmap1 and the negation of bitmap2 and store the result in bitmap res.
+
int hwloc_bitmap_clr(hwloc_bitmap_t bitmap, unsigned id)
Remove index id from bitmap bitmap.
+
int hwloc_bitmap_taskset_snprintf(char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
Stringify a bitmap in the taskset-specific format.
+
int hwloc_bitmap_intersects(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Test whether bitmaps bitmap1 and bitmap2 intersects.
+
int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char *restrict string)
Parse a bitmap string and stores it in bitmap bitmap.
+
int hwloc_bitmap_snprintf(char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
Stringify a bitmap.
+
hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap)
Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.
+
int hwloc_bitmap_asprintf(char **strp, hwloc_const_bitmap_t bitmap)
Stringify a bitmap into a newly allocated string.
+
int hwloc_bitmap_allbut(hwloc_bitmap_t bitmap, unsigned id)
Fill the bitmap and clear the index id.
+
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
+
int hwloc_bitmap_next_unset(hwloc_const_bitmap_t bitmap, int prev)
Compute the next unset index in bitmap bitmap which is after index prev.
+
int hwloc_bitmap_not(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap)
Negate bitmap bitmap and store the result in bitmap res.
+
int hwloc_bitmap_from_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
Setup bitmap bitmap from unsigned long mask used as i -th subset.
+
int hwloc_bitmap_isincluded(hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap)
Test whether bitmap sub_bitmap is part of bitmap super_bitmap.
+
int hwloc_bitmap_clr_range(hwloc_bitmap_t bitmap, unsigned begin, int end)
Remove indexes from begin to end in bitmap bitmap.
+
int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id)
Test whether index id is part of bitmap bitmap.
+
hwloc_bitmap_t hwloc_bitmap_alloc(void)
Allocate a new empty bitmap.
+
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
+
int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap)
Compute the "weight" of bitmap bitmap (i.e., number of indexes that are in the bitmap).
+
int hwloc_bitmap_last_unset(hwloc_const_bitmap_t bitmap)
Compute the last unset index (most significant bit) in bitmap bitmap.
+
int hwloc_bitmap_list_snprintf(char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
Stringify a bitmap in the list format.
+
int hwloc_bitmap_to_ulongs(hwloc_const_bitmap_t bitmap, unsigned nr, unsigned long *masks)
Convert the first nr subsets of bitmap bitmap into the array of nr unsigned long masks.
+
hwloc_bitmap_t hwloc_bitmap_alloc_full(void)
Allocate a new full bitmap.
+
void hwloc_bitmap_fill(hwloc_bitmap_t bitmap)
Fill bitmap bitmap with all possible indexes (even if those objects don't exist or are otherwise unav...
+
int hwloc_bitmap_from_ulongs(hwloc_bitmap_t bitmap, unsigned nr, const unsigned long *masks)
Setup bitmap bitmap from unsigned longs masks used as first nr subsets.
+
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
+
int hwloc_bitmap_taskset_sscanf(hwloc_bitmap_t bitmap, const char *restrict string)
Parse a taskset-specific bitmap string and stores it in bitmap bitmap.
+
int hwloc_bitmap_last(hwloc_const_bitmap_t bitmap)
Compute the last index (most significant bit) in bitmap bitmap.
+
int hwloc_bitmap_compare(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Compare bitmaps bitmap1 and bitmap2 in lexicographic order.
+
int hwloc_bitmap_set_range(hwloc_bitmap_t bitmap, unsigned begin, int end)
Add indexes from begin to end in bitmap bitmap.
+
int hwloc_bitmap_list_sscanf(hwloc_bitmap_t bitmap, const char *restrict string)
Parse a list string and stores it in bitmap bitmap.
+
int hwloc_bitmap_taskset_asprintf(char **strp, hwloc_const_bitmap_t bitmap)
Stringify a bitmap into a newly allocated taskset-specific string.
+
unsigned long hwloc_bitmap_to_ulong(hwloc_const_bitmap_t bitmap)
Convert the beginning part of bitmap bitmap into unsigned long mask.
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00134_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00134_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00134_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00134_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): export.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2009-2018 Inria. All rights reserved.
3  * Copyright © 2009-2012 Université Bordeaux
4  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
5  * See COPYING in top-level directory.
6  */
7 
12 #ifndef HWLOC_EXPORT_H
13 #define HWLOC_EXPORT_H
14 
15 #ifndef HWLOC_H
16 #error Please include the main hwloc.h instead
17 #endif
18 
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #elif 0
23 }
24 #endif
25 
26 
41 };
42 
71 HWLOC_DECLSPEC int hwloc_topology_export_xml(hwloc_topology_t topology, const char *xmlpath, unsigned long flags);
72 
105 HWLOC_DECLSPEC int hwloc_topology_export_xmlbuffer(hwloc_topology_t topology, char **xmlbuffer, int *buflen, unsigned long flags);
106 
108 HWLOC_DECLSPEC void hwloc_free_xmlbuffer(hwloc_topology_t topology, char *xmlbuffer);
109 
129  void (*export_cb)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj));
130 
156 HWLOC_DECLSPEC int hwloc_export_obj_userdata(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length);
157 
171 HWLOC_DECLSPEC int hwloc_export_obj_userdata_base64(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length);
172 
196  void (*import_cb)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length));
197 
216 
224 
234 
244 };
245 
267  HWLOC_DECLSPEC int hwloc_topology_export_synthetic(hwloc_topology_t topology, char *buffer, size_t buflen, unsigned long flags);
268 
273 #ifdef __cplusplus
274 } /* extern "C" */
275 #endif
276 
277 
278 #endif /* HWLOC_EXPORT_H */
Export the memory hierarchy as expected in hwloc 1.x.
Definition: export.h:233
-
Structure of a topology object.
Definition: hwloc.h:381
-
Do not export level attributes.
Definition: export.h:223
-
void hwloc_topology_set_userdata_export_callback(hwloc_topology_t topology, void(*export_cb)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj))
Set the application-specific callback for exporting object userdata.
-
hwloc_topology_export_xml_flags_e
Flags for exporting XML topologies.
Definition: export.h:35
-
Export XML that is loadable by hwloc v1.x. However, the export may miss some details about the topolo...
Definition: export.h:40
-
Do not export memory information.
Definition: export.h:243
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
int hwloc_export_obj_userdata_base64(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
Encode and export some object userdata to XML.
-
int hwloc_topology_export_xml(hwloc_topology_t topology, const char *xmlpath, unsigned long flags)
Export the topology into an XML file.
-
void hwloc_topology_set_userdata_import_callback(hwloc_topology_t topology, void(*import_cb)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length))
Set the application-specific callback for importing userdata.
-
Export extended types such as L2dcache as basic types such as Cache.
Definition: export.h:215
-
int hwloc_topology_export_xmlbuffer(hwloc_topology_t topology, char **xmlbuffer, int *buflen, unsigned long flags)
Export the topology into a newly-allocated XML memory buffer.
-
int hwloc_topology_export_synthetic(hwloc_topology_t topology, char *buffer, size_t buflen, unsigned long flags)
Export the topology as a synthetic string.
-
void hwloc_free_xmlbuffer(hwloc_topology_t topology, char *xmlbuffer)
Free a buffer allocated by hwloc_topology_export_xmlbuffer()
-
hwloc_topology_export_synthetic_flags_e
Flags for exporting synthetic topologies.
Definition: export.h:209
-
int hwloc_export_obj_userdata(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
Export some object userdata to XML.
+
1 /*
+
2  * Copyright © 2009-2018 Inria. All rights reserved.
+
3  * Copyright © 2009-2012 Université Bordeaux
+
4  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
+
5  * See COPYING in top-level directory.
+
6  */
+
7 
+
12 #ifndef HWLOC_EXPORT_H
+
13 #define HWLOC_EXPORT_H
+
14 
+
15 #ifndef HWLOC_H
+
16 #error Please include the main hwloc.h instead
+
17 #endif
+
18 
+
19 
+
20 #ifdef __cplusplus
+
21 extern "C" {
+
22 #elif 0
+
23 }
+
24 #endif
+
25 
+
26 
+ + +
41 };
+
42 
+
71 HWLOC_DECLSPEC int hwloc_topology_export_xml(hwloc_topology_t topology, const char *xmlpath, unsigned long flags);
+
72 
+
105 HWLOC_DECLSPEC int hwloc_topology_export_xmlbuffer(hwloc_topology_t topology, char **xmlbuffer, int *buflen, unsigned long flags);
+
106 
+
108 HWLOC_DECLSPEC void hwloc_free_xmlbuffer(hwloc_topology_t topology, char *xmlbuffer);
+
109 
+ +
129  void (*export_cb)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj));
+
130 
+
156 HWLOC_DECLSPEC int hwloc_export_obj_userdata(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length);
+
157 
+
171 HWLOC_DECLSPEC int hwloc_export_obj_userdata_base64(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length);
+
172 
+ +
196  void (*import_cb)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length));
+
197 
+ + +
216 
+ +
224 
+ +
234 
+ +
244 };
+
245 
+
267  HWLOC_DECLSPEC int hwloc_topology_export_synthetic(hwloc_topology_t topology, char *buffer, size_t buflen, unsigned long flags);
+
268 
+
273 #ifdef __cplusplus
+
274 } /* extern "C" */
+
275 #endif
+
276 
+
277 
+
278 #endif /* HWLOC_EXPORT_H */
+
void hwloc_topology_set_userdata_import_callback(hwloc_topology_t topology, void(*import_cb)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length))
Set the application-specific callback for importing userdata.
+
@ HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1
Export XML that is loadable by hwloc v1.x. However, the export may miss some details about the topolo...
Definition: export.h:40
+
hwloc_topology_export_synthetic_flags_e
Flags for exporting synthetic topologies.
Definition: export.h:209
+
@ HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1
Export the memory hierarchy as expected in hwloc 1.x.
Definition: export.h:233
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
int hwloc_export_obj_userdata_base64(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
Encode and export some object userdata to XML.
+
@ HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_IGNORE_MEMORY
Do not export memory information.
Definition: export.h:243
+
Structure of a topology object.
Definition: hwloc.h:384
+
hwloc_topology_export_xml_flags_e
Flags for exporting XML topologies.
Definition: export.h:35
+
@ HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_EXTENDED_TYPES
Export extended types such as L2dcache as basic types such as Cache.
Definition: export.h:215
+
void hwloc_free_xmlbuffer(hwloc_topology_t topology, char *xmlbuffer)
Free a buffer allocated by hwloc_topology_export_xmlbuffer()
+
int hwloc_topology_export_xml(hwloc_topology_t topology, const char *xmlpath, unsigned long flags)
Export the topology into an XML file.
+
int hwloc_export_obj_userdata(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
Export some object userdata to XML.
+
@ HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS
Do not export level attributes.
Definition: export.h:223
+
void hwloc_topology_set_userdata_export_callback(hwloc_topology_t topology, void(*export_cb)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj))
Set the application-specific callback for exporting object userdata.
+
int hwloc_topology_export_synthetic(hwloc_topology_t topology, char *buffer, size_t buflen, unsigned long flags)
Export the topology as a synthetic string.
+
int hwloc_topology_export_xmlbuffer(hwloc_topology_t topology, char **xmlbuffer, int *buflen, unsigned long flags)
Export the topology into a newly-allocated XML memory buffer.
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00137_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00137_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00137_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00137_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): distances.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2010-2019 Inria. All rights reserved.
3  * See COPYING in top-level directory.
4  */
5 
10 #ifndef HWLOC_DISTANCES_H
11 #define HWLOC_DISTANCES_H
12 
13 #ifndef HWLOC_H
14 #error Please include the main hwloc.h instead
15 #endif
16 
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #elif 0
21 }
22 #endif
23 
24 
42  unsigned nbobjs;
48  unsigned long kind;
49  hwloc_uint64_t *values;
54 };
55 
76 
91 
96 };
97 
121 HWLOC_DECLSPEC int
123  unsigned *nr, struct hwloc_distances_s **distances,
124  unsigned long kind, unsigned long flags);
125 
130 HWLOC_DECLSPEC int
132  unsigned *nr, struct hwloc_distances_s **distances,
133  unsigned long kind, unsigned long flags);
134 
139 HWLOC_DECLSPEC int
141  unsigned *nr, struct hwloc_distances_s **distances,
142  unsigned long kind, unsigned long flags);
143 
148 HWLOC_DECLSPEC int
149 hwloc_distances_get_by_name(hwloc_topology_t topology, const char *name,
150  unsigned *nr, struct hwloc_distances_s **distances,
151  unsigned long flags);
152 
158 HWLOC_DECLSPEC const char *
159 hwloc_distances_get_name(hwloc_topology_t topology, struct hwloc_distances_s *distances);
160 
165 HWLOC_DECLSPEC void
166 hwloc_distances_release(hwloc_topology_t topology, struct hwloc_distances_s *distances);
167 
180 static __hwloc_inline int
182 {
183  unsigned i;
184  for(i=0; i<distances->nbobjs; i++)
185  if (distances->objs[i] == obj)
186  return (int)i;
187  return -1;
188 }
189 
197 static __hwloc_inline int
199  hwloc_obj_t obj1, hwloc_obj_t obj2,
200  hwloc_uint64_t *value1to2, hwloc_uint64_t *value2to1)
201 {
202  int i1 = hwloc_distances_obj_index(distances, obj1);
203  int i2 = hwloc_distances_obj_index(distances, obj2);
204  if (i1 < 0 || i2 < 0)
205  return -1;
206  *value1to2 = distances->values[i1 * distances->nbobjs + i2];
207  *value2to1 = distances->values[i2 * distances->nbobjs + i1];
208  return 0;
209 }
210 
231 };
232 
247 HWLOC_DECLSPEC int hwloc_distances_add(hwloc_topology_t topology,
248  unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values,
249  unsigned long kind, unsigned long flags);
250 
259 HWLOC_DECLSPEC int hwloc_distances_remove(hwloc_topology_t topology);
260 
265 HWLOC_DECLSPEC int hwloc_distances_remove_by_depth(hwloc_topology_t topology, int depth);
266 
271 static __hwloc_inline int
273 {
274  int depth = hwloc_get_type_depth(topology, type);
275  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE)
276  return 0;
277  return hwloc_distances_remove_by_depth(topology, depth);
278 }
279 
284 HWLOC_DECLSPEC int hwloc_distances_release_remove(hwloc_topology_t topology, struct hwloc_distances_s *distances);
285 
289 #ifdef __cplusplus
290 } /* extern "C" */
291 #endif
292 
293 
294 #endif /* HWLOC_DISTANCES_H */
void hwloc_distances_release(hwloc_topology_t topology, struct hwloc_distances_s *distances)
Release a distance matrix structure previously returned by hwloc_distances_get(). ...
-
int hwloc_distances_get_by_depth(hwloc_topology_t topology, int depth, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
Retrieve distance matrices for object at a specific depth in the topology.
-
int hwloc_distances_remove_by_depth(hwloc_topology_t topology, int depth)
Remove distance matrices for objects at a specific depth in the topology.
-
int hwloc_distances_release_remove(hwloc_topology_t topology, struct hwloc_distances_s *distances)
Release and remove the given distance matrice from the topology.
-
Matrix of distances between a set of objects.
Definition: distances.h:41
-
Distance values are similar to bandwidths between objects. Values are higher for closer objects...
Definition: distances.h:90
-
Distance values are similar to latencies between objects. Values are smaller for closer objects...
Definition: distances.h:83
-
Structure of a topology object.
Definition: hwloc.h:381
-
static int hwloc_distances_remove_by_type(hwloc_topology_t topology, hwloc_obj_type_t type)
Remove distance matrices for objects of a specific type in the topology.
Definition: distances.h:272
-
hwloc_obj_type_t
Definition: hwloc.h:177
-
If grouping, consider the distance values as inaccurate and relax the comparisons during the grouping...
Definition: distances.h:230
-
hwloc_distances_add_flag_e
Flags for adding a new distances to a topology.
Definition: distances.h:220
-
const char * hwloc_distances_get_name(hwloc_topology_t topology, struct hwloc_distances_s *distances)
Get a description of what a distances structure contains.
-
static int hwloc_distances_obj_pair_values(struct hwloc_distances_s *distances, hwloc_obj_t obj1, hwloc_obj_t obj2, hwloc_uint64_t *value1to2, hwloc_uint64_t *value2to1)
Find the values between two objects in a distance matrices.
Definition: distances.h:198
-
int hwloc_distances_get(hwloc_topology_t topology, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
Retrieve distance matrices.
-
These distances were provided by the user.
Definition: distances.h:75
-
hwloc_uint64_t * values
Matrix of distances between objects, stored as a one-dimension array.
Definition: distances.h:49
-
int hwloc_distances_add(hwloc_topology_t topology, unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values, unsigned long kind, unsigned long flags)
Provide a new distance matrix.
-
These distances were obtained from the operating system or hardware.
Definition: distances.h:71
-
int hwloc_distances_remove(hwloc_topology_t topology)
Remove all distance matrices from a topology.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_obj_t * objs
Array of objects described by the distance matrix. These objects are not in any particular order...
Definition: distances.h:43
-
Objects of given type exist at different depth in the topology (only for Groups). ...
Definition: hwloc.h:798
-
static int hwloc_distances_obj_index(struct hwloc_distances_s *distances, hwloc_obj_t obj)
Find the index of an object in a distances structure.
Definition: distances.h:181
-
No object of given type exists in the topology.
Definition: hwloc.h:797
-
This distances structure covers objects of different types.
Definition: distances.h:95
-
Try to group objects based on the newly provided distance information.
Definition: distances.h:224
-
unsigned nbobjs
Number of objects described by the distance matrix.
Definition: distances.h:42
-
hwloc_distances_kind_e
Kinds of distance matrices.
Definition: distances.h:67
-
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
-
int hwloc_distances_get_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
Retrieve distance matrices for object of a specific type.
-
unsigned long kind
OR&#39;ed set of hwloc_distances_kind_e.
Definition: distances.h:48
-
int hwloc_distances_get_by_name(hwloc_topology_t topology, const char *name, unsigned *nr, struct hwloc_distances_s **distances, unsigned long flags)
Retrieve a distance matrix with the given name.
+
1 /*
+
2  * Copyright © 2010-2019 Inria. All rights reserved.
+
3  * See COPYING in top-level directory.
+
4  */
+
5 
+
10 #ifndef HWLOC_DISTANCES_H
+
11 #define HWLOC_DISTANCES_H
+
12 
+
13 #ifndef HWLOC_H
+
14 #error Please include the main hwloc.h instead
+
15 #endif
+
16 
+
17 
+
18 #ifdef __cplusplus
+
19 extern "C" {
+
20 #elif 0
+
21 }
+
22 #endif
+
23 
+
24 
+ +
42  unsigned nbobjs;
+ +
48  unsigned long kind;
+
49  hwloc_uint64_t *values;
+
54 };
+
55 
+ + + +
76 
+ + +
91 
+ +
96 };
+
97 
+
121 HWLOC_DECLSPEC int
+ +
123  unsigned *nr, struct hwloc_distances_s **distances,
+
124  unsigned long kind, unsigned long flags);
+
125 
+
130 HWLOC_DECLSPEC int
+ +
132  unsigned *nr, struct hwloc_distances_s **distances,
+
133  unsigned long kind, unsigned long flags);
+
134 
+
139 HWLOC_DECLSPEC int
+ +
141  unsigned *nr, struct hwloc_distances_s **distances,
+
142  unsigned long kind, unsigned long flags);
+
143 
+
148 HWLOC_DECLSPEC int
+
149 hwloc_distances_get_by_name(hwloc_topology_t topology, const char *name,
+
150  unsigned *nr, struct hwloc_distances_s **distances,
+
151  unsigned long flags);
+
152 
+
158 HWLOC_DECLSPEC const char *
+
159 hwloc_distances_get_name(hwloc_topology_t topology, struct hwloc_distances_s *distances);
+
160 
+
165 HWLOC_DECLSPEC void
+
166 hwloc_distances_release(hwloc_topology_t topology, struct hwloc_distances_s *distances);
+
167 
+
180 static __hwloc_inline int
+ +
182 {
+
183  unsigned i;
+
184  for(i=0; i<distances->nbobjs; i++)
+
185  if (distances->objs[i] == obj)
+
186  return (int)i;
+
187  return -1;
+
188 }
+
189 
+
197 static __hwloc_inline int
+ +
199  hwloc_obj_t obj1, hwloc_obj_t obj2,
+
200  hwloc_uint64_t *value1to2, hwloc_uint64_t *value2to1)
+
201 {
+
202  int i1 = hwloc_distances_obj_index(distances, obj1);
+
203  int i2 = hwloc_distances_obj_index(distances, obj2);
+
204  if (i1 < 0 || i2 < 0)
+
205  return -1;
+
206  *value1to2 = distances->values[i1 * distances->nbobjs + i2];
+
207  *value2to1 = distances->values[i2 * distances->nbobjs + i1];
+
208  return 0;
+
209 }
+
210 
+ + + +
231 };
+
232 
+
247 HWLOC_DECLSPEC int hwloc_distances_add(hwloc_topology_t topology,
+
248  unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values,
+
249  unsigned long kind, unsigned long flags);
+
250 
+
259 HWLOC_DECLSPEC int hwloc_distances_remove(hwloc_topology_t topology);
+
260 
+
265 HWLOC_DECLSPEC int hwloc_distances_remove_by_depth(hwloc_topology_t topology, int depth);
+
266 
+
271 static __hwloc_inline int
+ +
273 {
+
274  int depth = hwloc_get_type_depth(topology, type);
+
275  if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE)
+
276  return 0;
+
277  return hwloc_distances_remove_by_depth(topology, depth);
+
278 }
+
279 
+
284 HWLOC_DECLSPEC int hwloc_distances_release_remove(hwloc_topology_t topology, struct hwloc_distances_s *distances);
+
285 
+
289 #ifdef __cplusplus
+
290 } /* extern "C" */
+
291 #endif
+
292 
+
293 
+
294 #endif /* HWLOC_DISTANCES_H */
+
static int hwloc_distances_obj_index(struct hwloc_distances_s *distances, hwloc_obj_t obj)
Find the index of an object in a distances structure.
Definition: distances.h:181
+
Matrix of distances between a set of objects.
Definition: distances.h:41
+
unsigned long kind
OR'ed set of hwloc_distances_kind_e.
Definition: distances.h:48
+
int hwloc_distances_add(hwloc_topology_t topology, unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values, unsigned long kind, unsigned long flags)
Provide a new distance matrix.
+
unsigned nbobjs
Number of objects described by the distance matrix.
Definition: distances.h:42
+
@ HWLOC_DISTANCES_KIND_FROM_OS
These distances were obtained from the operating system or hardware.
Definition: distances.h:71
+
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
+
static int hwloc_distances_remove_by_type(hwloc_topology_t topology, hwloc_obj_type_t type)
Remove distance matrices for objects of a specific type in the topology.
Definition: distances.h:272
+
@ HWLOC_DISTANCES_ADD_FLAG_GROUP
Try to group objects based on the newly provided distance information.
Definition: distances.h:224
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
@ HWLOC_TYPE_DEPTH_MULTIPLE
Objects of given type exist at different depth in the topology (only for Groups).
Definition: hwloc.h:809
+
static int hwloc_distances_obj_pair_values(struct hwloc_distances_s *distances, hwloc_obj_t obj1, hwloc_obj_t obj2, hwloc_uint64_t *value1to2, hwloc_uint64_t *value2to1)
Find the values between two objects in a distance matrices.
Definition: distances.h:198
+
@ HWLOC_DISTANCES_KIND_FROM_USER
These distances were provided by the user.
Definition: distances.h:75
+
Structure of a topology object.
Definition: hwloc.h:384
+
hwloc_obj_t * objs
Array of objects described by the distance matrix. These objects are not in any particular order,...
Definition: distances.h:43
+
hwloc_distances_add_flag_e
Flags for adding a new distances to a topology.
Definition: distances.h:220
+
@ HWLOC_TYPE_DEPTH_UNKNOWN
No object of given type exists in the topology.
Definition: hwloc.h:808
+
@ HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE
If grouping, consider the distance values as inaccurate and relax the comparisons during the grouping...
Definition: distances.h:230
+
@ HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES
This distances structure covers objects of different types.
Definition: distances.h:95
+
int hwloc_distances_release_remove(hwloc_topology_t topology, struct hwloc_distances_s *distances)
Release and remove the given distance matrice from the topology.
+
hwloc_distances_kind_e
Kinds of distance matrices.
Definition: distances.h:67
+
@ HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH
Distance values are similar to bandwidths between objects. Values are higher for closer objects,...
Definition: distances.h:90
+
hwloc_obj_type_t
Type of topology object.
Definition: hwloc.h:176
+
int hwloc_distances_get_by_depth(hwloc_topology_t topology, int depth, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
Retrieve distance matrices for object at a specific depth in the topology.
+
@ HWLOC_DISTANCES_KIND_MEANS_LATENCY
Distance values are similar to latencies between objects. Values are smaller for closer objects,...
Definition: distances.h:83
+
const char * hwloc_distances_get_name(hwloc_topology_t topology, struct hwloc_distances_s *distances)
Get a description of what a distances structure contains.
+
int hwloc_distances_get_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
Retrieve distance matrices for object of a specific type.
+
int hwloc_distances_remove(hwloc_topology_t topology)
Remove all distance matrices from a topology.
+
int hwloc_distances_get_by_name(hwloc_topology_t topology, const char *name, unsigned *nr, struct hwloc_distances_s **distances, unsigned long flags)
Retrieve a distance matrix with the given name.
+
void hwloc_distances_release(hwloc_topology_t topology, struct hwloc_distances_s *distances)
Release a distance matrix structure previously returned by hwloc_distances_get().
+
int hwloc_distances_get(hwloc_topology_t topology, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
Retrieve distance matrices.
+
hwloc_uint64_t * values
Matrix of distances between objects, stored as a one-dimension array.
Definition: distances.h:49
+
int hwloc_distances_remove_by_depth(hwloc_topology_t topology, int depth)
Remove distance matrices for objects at a specific depth in the topology.
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00140_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00140_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00140_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00140_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): linux.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2009 CNRS
3  * Copyright © 2009-2016 Inria. All rights reserved.
4  * Copyright © 2009-2011 Université Bordeaux
5  * See COPYING in top-level directory.
6  */
7 
15 #ifndef HWLOC_LINUX_H
16 #define HWLOC_LINUX_H
17 
18 #include "hwloc.h"
19 
20 #include <stdio.h>
21 
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 
44 HWLOC_DECLSPEC int hwloc_linux_set_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set);
45 
54 HWLOC_DECLSPEC int hwloc_linux_get_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set);
55 
61 HWLOC_DECLSPEC int hwloc_linux_get_tid_last_cpu_location(hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set);
62 
70 HWLOC_DECLSPEC int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set);
71 
75 #ifdef __cplusplus
76 } /* extern "C" */
77 #endif
78 
79 
80 #endif /* HWLOC_LINUX_H */
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
-
int hwloc_linux_get_tid_last_cpu_location(hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set)
Get the last physical CPU where thread tid ran.
-
int hwloc_linux_get_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set)
Get the current binding of thread tid.
-
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
-
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
int hwloc_linux_set_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set)
Bind a thread tid on cpus given in cpuset set.
+
1 /*
+
2  * Copyright © 2009 CNRS
+
3  * Copyright © 2009-2016 Inria. All rights reserved.
+
4  * Copyright © 2009-2011 Université Bordeaux
+
5  * See COPYING in top-level directory.
+
6  */
+
7 
+
15 #ifndef HWLOC_LINUX_H
+
16 #define HWLOC_LINUX_H
+
17 
+
18 #include "hwloc.h"
+
19 
+
20 #include <stdio.h>
+
21 
+
22 
+
23 #ifdef __cplusplus
+
24 extern "C" {
+
25 #endif
+
26 
+
27 
+
44 HWLOC_DECLSPEC int hwloc_linux_set_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set);
+
45 
+
54 HWLOC_DECLSPEC int hwloc_linux_get_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set);
+
55 
+
61 HWLOC_DECLSPEC int hwloc_linux_get_tid_last_cpu_location(hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set);
+
62 
+
70 HWLOC_DECLSPEC int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set);
+
71 
+
75 #ifdef __cplusplus
+
76 } /* extern "C" */
+
77 #endif
+
78 
+
79 
+
80 #endif /* HWLOC_LINUX_H */
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
+
int hwloc_linux_get_tid_last_cpu_location(hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set)
Get the last physical CPU where thread tid ran.
+
int hwloc_linux_get_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set)
Get the current binding of thread tid.
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
+
int hwloc_linux_set_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set)
Bind a thread tid on cpus given in cpuset set.
+
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00143_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00143_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00143_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00143_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): linux-libnuma.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2009 CNRS
3  * Copyright © 2009-2017 Inria. All rights reserved.
4  * Copyright © 2009-2010, 2012 Université Bordeaux
5  * See COPYING in top-level directory.
6  */
7 
15 #ifndef HWLOC_LINUX_LIBNUMA_H
16 #define HWLOC_LINUX_LIBNUMA_H
17 
18 #include "hwloc.h"
19 
20 #include <numa.h>
21 
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 
54 static __hwloc_inline int
56  unsigned long *mask, unsigned long *maxnode)
57 {
58  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
59  unsigned long outmaxnode = -1;
60  hwloc_obj_t node = NULL;
61 
62  /* round-up to the next ulong and clear all bytes */
63  *maxnode = (*maxnode + 8*sizeof(*mask) - 1) & ~(8*sizeof(*mask) - 1);
64  memset(mask, 0, *maxnode/8);
65 
66  while ((node = hwloc_get_next_obj_covering_cpuset_by_depth(topology, cpuset, depth, node)) != NULL) {
67  if (node->os_index >= *maxnode)
68  continue;
69  mask[node->os_index/sizeof(*mask)/8] |= 1UL << (node->os_index % (sizeof(*mask)*8));
70  if (outmaxnode == (unsigned long) -1 || outmaxnode < node->os_index)
71  outmaxnode = node->os_index;
72  }
73 
74  *maxnode = outmaxnode+1;
75  return 0;
76 }
77 
88 static __hwloc_inline int
90  unsigned long *mask, unsigned long *maxnode)
91 {
92  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
93  unsigned long outmaxnode = -1;
94  hwloc_obj_t node = NULL;
95 
96  /* round-up to the next ulong and clear all bytes */
97  *maxnode = (*maxnode + 8*sizeof(*mask) - 1) & ~(8*sizeof(*mask) - 1);
98  memset(mask, 0, *maxnode/8);
99 
100  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) {
101  if (node->os_index >= *maxnode)
102  continue;
103  if (!hwloc_bitmap_isset(nodeset, node->os_index))
104  continue;
105  mask[node->os_index/sizeof(*mask)/8] |= 1UL << (node->os_index % (sizeof(*mask)*8));
106  if (outmaxnode == (unsigned long) -1 || outmaxnode < node->os_index)
107  outmaxnode = node->os_index;
108  }
109 
110  *maxnode = outmaxnode+1;
111  return 0;
112 }
113 
123 static __hwloc_inline int
125  const unsigned long *mask, unsigned long maxnode)
126 {
127  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
128  hwloc_obj_t node = NULL;
129  hwloc_bitmap_zero(cpuset);
130  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
131  if (node->os_index < maxnode
132  && (mask[node->os_index/sizeof(*mask)/8] & (1UL << (node->os_index % (sizeof(*mask)*8)))))
133  hwloc_bitmap_or(cpuset, cpuset, node->cpuset);
134  return 0;
135 }
136 
146 static __hwloc_inline int
148  const unsigned long *mask, unsigned long maxnode)
149 {
150  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
151  hwloc_obj_t node = NULL;
152  hwloc_bitmap_zero(nodeset);
153  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
154  if (node->os_index < maxnode
155  && (mask[node->os_index/sizeof(*mask)/8] & (1UL << (node->os_index % (sizeof(*mask)*8)))))
156  hwloc_bitmap_set(nodeset, node->os_index);
157  return 0;
158 }
159 
189 static __hwloc_inline struct bitmask *
190 hwloc_cpuset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset) __hwloc_attribute_malloc;
191 static __hwloc_inline struct bitmask *
193 {
194  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
195  hwloc_obj_t node = NULL;
196  struct bitmask *bitmask = numa_allocate_cpumask();
197  if (!bitmask)
198  return NULL;
199  while ((node = hwloc_get_next_obj_covering_cpuset_by_depth(topology, cpuset, depth, node)) != NULL)
200  if (node->attr->numanode.local_memory)
201  numa_bitmask_setbit(bitmask, node->os_index);
202  return bitmask;
203 }
204 
214 static __hwloc_inline struct bitmask *
215 hwloc_nodeset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset) __hwloc_attribute_malloc;
216 static __hwloc_inline struct bitmask *
218 {
219  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
220  hwloc_obj_t node = NULL;
221  struct bitmask *bitmask = numa_allocate_cpumask();
222  if (!bitmask)
223  return NULL;
224  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
225  if (hwloc_bitmap_isset(nodeset, node->os_index) && node->attr->numanode.local_memory)
226  numa_bitmask_setbit(bitmask, node->os_index);
227  return bitmask;
228 }
229 
235 static __hwloc_inline int
237  const struct bitmask *bitmask)
238 {
239  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
240  hwloc_obj_t node = NULL;
241  hwloc_bitmap_zero(cpuset);
242  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
243  if (numa_bitmask_isbitset(bitmask, node->os_index))
244  hwloc_bitmap_or(cpuset, cpuset, node->cpuset);
245  return 0;
246 }
247 
253 static __hwloc_inline int
255  const struct bitmask *bitmask)
256 {
257  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
258  hwloc_obj_t node = NULL;
259  hwloc_bitmap_zero(nodeset);
260  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
261  if (numa_bitmask_isbitset(bitmask, node->os_index))
262  hwloc_bitmap_set(nodeset, node->os_index);
263  return 0;
264 }
265 
269 #ifdef __cplusplus
270 } /* extern "C" */
271 #endif
272 
273 
274 #endif /* HWLOC_LINUX_NUMA_H */
static int hwloc_nodeset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, unsigned long *mask, unsigned long *maxnode)
Convert hwloc NUMA node set nodeset into the array of unsigned long mask.
Definition: linux-libnuma.h:89
-
static int hwloc_cpuset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const unsigned long *mask, unsigned long maxnode)
Convert the array of unsigned long mask into hwloc CPU set.
Definition: linux-libnuma.h:124
-
static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset)
Convert hwloc CPU set cpuset into the returned libnuma bitmask.
Definition: linux-libnuma.h:192
-
hwloc_uint64_t local_memory
Local memory (in bytes)
Definition: hwloc.h:585
-
hwloc_const_bitmap_t hwloc_const_nodeset_t
A non-modifiable hwloc_nodeset_t.
Definition: hwloc.h:160
-
Structure of a topology object.
Definition: hwloc.h:381
-
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
-
static int hwloc_nodeset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_nodeset_t nodeset, const struct bitmask *bitmask)
Convert libnuma bitmask bitmask into hwloc NUMA node set nodeset.
Definition: linux-libnuma.h:254
-
static int hwloc_cpuset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, unsigned long *mask, unsigned long *maxnode)
Convert hwloc CPU set cpuset into the array of unsigned long mask.
Definition: linux-libnuma.h:55
-
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:497
-
NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...
Definition: hwloc.h:232
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
static hwloc_obj_t hwloc_get_next_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t prev)
Returns the next object at depth depth.
-
static int hwloc_nodeset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_nodeset_t nodeset, const unsigned long *mask, unsigned long maxnode)
Convert the array of unsigned long mask into hwloc NUMA node set.
Definition: linux-libnuma.h:147
-
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
Iterate through same-depth objects covering at least CPU set set.
Definition: helper.h:321
-
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
-
int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
-
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
-
hwloc_bitmap_t hwloc_nodeset_t
A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes...
Definition: hwloc.h:157
-
struct hwloc_obj_attr_u::hwloc_numanode_attr_s numanode
-
static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset)
Convert hwloc NUMA node set nodeset into the returned libnuma bitmask.
Definition: linux-libnuma.h:217
-
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine, except for PUs and NUMA nodes. Set to HWLOC_UNKNOWN_INDEX if unknown or irrelevant for this object.
Definition: hwloc.h:386
-
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
-
static int hwloc_cpuset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const struct bitmask *bitmask)
Convert libnuma bitmask bitmask into hwloc CPU set cpuset.
Definition: linux-libnuma.h:236
-
int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id)
Test whether index id is part of bitmap bitmap.
+
1 /*
+
2  * Copyright © 2009 CNRS
+
3  * Copyright © 2009-2017 Inria. All rights reserved.
+
4  * Copyright © 2009-2010, 2012 Université Bordeaux
+
5  * See COPYING in top-level directory.
+
6  */
+
7 
+
15 #ifndef HWLOC_LINUX_LIBNUMA_H
+
16 #define HWLOC_LINUX_LIBNUMA_H
+
17 
+
18 #include "hwloc.h"
+
19 
+
20 #include <numa.h>
+
21 
+
22 
+
23 #ifdef __cplusplus
+
24 extern "C" {
+
25 #endif
+
26 
+
27 
+
54 static __hwloc_inline int
+ +
56  unsigned long *mask, unsigned long *maxnode)
+
57 {
+
58  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
59  unsigned long outmaxnode = -1;
+
60  hwloc_obj_t node = NULL;
+
61 
+
62  /* round-up to the next ulong and clear all bytes */
+
63  *maxnode = (*maxnode + 8*sizeof(*mask) - 1) & ~(8*sizeof(*mask) - 1);
+
64  memset(mask, 0, *maxnode/8);
+
65 
+
66  while ((node = hwloc_get_next_obj_covering_cpuset_by_depth(topology, cpuset, depth, node)) != NULL) {
+
67  if (node->os_index >= *maxnode)
+
68  continue;
+
69  mask[node->os_index/sizeof(*mask)/8] |= 1UL << (node->os_index % (sizeof(*mask)*8));
+
70  if (outmaxnode == (unsigned long) -1 || outmaxnode < node->os_index)
+
71  outmaxnode = node->os_index;
+
72  }
+
73 
+
74  *maxnode = outmaxnode+1;
+
75  return 0;
+
76 }
+
77 
+
88 static __hwloc_inline int
+ +
90  unsigned long *mask, unsigned long *maxnode)
+
91 {
+
92  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
93  unsigned long outmaxnode = -1;
+
94  hwloc_obj_t node = NULL;
+
95 
+
96  /* round-up to the next ulong and clear all bytes */
+
97  *maxnode = (*maxnode + 8*sizeof(*mask) - 1) & ~(8*sizeof(*mask) - 1);
+
98  memset(mask, 0, *maxnode/8);
+
99 
+
100  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) {
+
101  if (node->os_index >= *maxnode)
+
102  continue;
+
103  if (!hwloc_bitmap_isset(nodeset, node->os_index))
+
104  continue;
+
105  mask[node->os_index/sizeof(*mask)/8] |= 1UL << (node->os_index % (sizeof(*mask)*8));
+
106  if (outmaxnode == (unsigned long) -1 || outmaxnode < node->os_index)
+
107  outmaxnode = node->os_index;
+
108  }
+
109 
+
110  *maxnode = outmaxnode+1;
+
111  return 0;
+
112 }
+
113 
+
123 static __hwloc_inline int
+ +
125  const unsigned long *mask, unsigned long maxnode)
+
126 {
+
127  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
128  hwloc_obj_t node = NULL;
+
129  hwloc_bitmap_zero(cpuset);
+
130  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
+
131  if (node->os_index < maxnode
+
132  && (mask[node->os_index/sizeof(*mask)/8] & (1UL << (node->os_index % (sizeof(*mask)*8)))))
+
133  hwloc_bitmap_or(cpuset, cpuset, node->cpuset);
+
134  return 0;
+
135 }
+
136 
+
146 static __hwloc_inline int
+ +
148  const unsigned long *mask, unsigned long maxnode)
+
149 {
+
150  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
151  hwloc_obj_t node = NULL;
+
152  hwloc_bitmap_zero(nodeset);
+
153  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
+
154  if (node->os_index < maxnode
+
155  && (mask[node->os_index/sizeof(*mask)/8] & (1UL << (node->os_index % (sizeof(*mask)*8)))))
+
156  hwloc_bitmap_set(nodeset, node->os_index);
+
157  return 0;
+
158 }
+
159 
+
189 static __hwloc_inline struct bitmask *
+
190 hwloc_cpuset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset) __hwloc_attribute_malloc;
+
191 static __hwloc_inline struct bitmask *
+ +
193 {
+
194  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
195  hwloc_obj_t node = NULL;
+
196  struct bitmask *bitmask = numa_allocate_cpumask();
+
197  if (!bitmask)
+
198  return NULL;
+
199  while ((node = hwloc_get_next_obj_covering_cpuset_by_depth(topology, cpuset, depth, node)) != NULL)
+
200  if (node->attr->numanode.local_memory)
+
201  numa_bitmask_setbit(bitmask, node->os_index);
+
202  return bitmask;
+
203 }
+
204 
+
214 static __hwloc_inline struct bitmask *
+
215 hwloc_nodeset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset) __hwloc_attribute_malloc;
+
216 static __hwloc_inline struct bitmask *
+ +
218 {
+
219  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
220  hwloc_obj_t node = NULL;
+
221  struct bitmask *bitmask = numa_allocate_cpumask();
+
222  if (!bitmask)
+
223  return NULL;
+
224  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
+
225  if (hwloc_bitmap_isset(nodeset, node->os_index) && node->attr->numanode.local_memory)
+
226  numa_bitmask_setbit(bitmask, node->os_index);
+
227  return bitmask;
+
228 }
+
229 
+
235 static __hwloc_inline int
+ +
237  const struct bitmask *bitmask)
+
238 {
+
239  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
240  hwloc_obj_t node = NULL;
+
241  hwloc_bitmap_zero(cpuset);
+
242  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
+
243  if (numa_bitmask_isbitset(bitmask, node->os_index))
+
244  hwloc_bitmap_or(cpuset, cpuset, node->cpuset);
+
245  return 0;
+
246 }
+
247 
+
253 static __hwloc_inline int
+ +
255  const struct bitmask *bitmask)
+
256 {
+
257  int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+
258  hwloc_obj_t node = NULL;
+
259  hwloc_bitmap_zero(nodeset);
+
260  while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL)
+
261  if (numa_bitmask_isbitset(bitmask, node->os_index))
+
262  hwloc_bitmap_set(nodeset, node->os_index);
+
263  return 0;
+
264 }
+
265 
+
269 #ifdef __cplusplus
+
270 } /* extern "C" */
+
271 #endif
+
272 
+
273 
+
274 #endif /* HWLOC_LINUX_NUMA_H */
+
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine,...
Definition: hwloc.h:389
+
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
+
static int hwloc_cpuset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const struct bitmask *bitmask)
Convert libnuma bitmask bitmask into hwloc CPU set cpuset.
Definition: linux-libnuma.h:236
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
+
Structure of a topology object.
Definition: hwloc.h:384
+
static int hwloc_nodeset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, unsigned long *mask, unsigned long *maxnode)
Convert hwloc NUMA node set nodeset into the array of unsigned long mask.
Definition: linux-libnuma.h:89
+
static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset)
Convert hwloc CPU set cpuset into the returned libnuma bitmask.
Definition: linux-libnuma.h:192
+
static int hwloc_cpuset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, unsigned long *mask, unsigned long *maxnode)
Convert hwloc CPU set cpuset into the array of unsigned long mask.
Definition: linux-libnuma.h:55
+
static int hwloc_cpuset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const unsigned long *mask, unsigned long maxnode)
Convert the array of unsigned long mask into hwloc CPU set.
Definition: linux-libnuma.h:124
+
hwloc_uint64_t local_memory
Local memory (in bytes)
Definition: hwloc.h:588
+
hwloc_const_bitmap_t hwloc_const_nodeset_t
A non-modifiable hwloc_nodeset_t.
Definition: hwloc.h:160
+
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:500
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
static hwloc_obj_t hwloc_get_next_obj_by_depth(hwloc_topology_t topology, int depth, hwloc_obj_t prev)
Returns the next object at depth depth.
+
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
+
static int hwloc_nodeset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_nodeset_t nodeset, const struct bitmask *bitmask)
Convert libnuma bitmask bitmask into hwloc NUMA node set nodeset.
Definition: linux-libnuma.h:254
+
int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id)
Test whether index id is part of bitmap bitmap.
+
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
+
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
Iterate through same-depth objects covering at least CPU set set.
Definition: helper.h:321
+
hwloc_bitmap_t hwloc_nodeset_t
A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes.
Definition: hwloc.h:157
+
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
+
@ HWLOC_OBJ_NUMANODE
NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...
Definition: hwloc.h:236
+
struct hwloc_obj_attr_u::hwloc_numanode_attr_s numanode
+
static int hwloc_nodeset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_nodeset_t nodeset, const unsigned long *mask, unsigned long maxnode)
Convert the array of unsigned long mask into hwloc NUMA node set.
Definition: linux-libnuma.h:147
+
static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset)
Convert hwloc NUMA node set nodeset into the returned libnuma bitmask.
Definition: linux-libnuma.h:217
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00146_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00146_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00146_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00146_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): glibc-sched.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2009 CNRS
3  * Copyright © 2009-2013 inria. All rights reserved.
4  * Copyright © 2009-2011 Université Bordeaux
5  * Copyright © 2011 Cisco Systems, Inc. All rights reserved.
6  * See COPYING in top-level directory.
7  */
8 
17 #ifndef HWLOC_GLIBC_SCHED_H
18 #define HWLOC_GLIBC_SCHED_H
19 
20 #include "hwloc.h"
21 #include "hwloc/helper.h"
22 
23 #include <assert.h>
24 
25 #if !defined _GNU_SOURCE || !defined _SCHED_H || (!defined CPU_SETSIZE && !defined sched_priority)
26 #error Please make sure to include sched.h before including glibc-sched.h, and define _GNU_SOURCE before any inclusion of sched.h
27 #endif
28 
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 
35 #ifdef HWLOC_HAVE_CPU_SET
36 
37 
56 static __hwloc_inline int
58  cpu_set_t *schedset, size_t schedsetsize)
59 {
60 #ifdef CPU_ZERO_S
61  unsigned cpu;
62  CPU_ZERO_S(schedsetsize, schedset);
63  hwloc_bitmap_foreach_begin(cpu, hwlocset)
64  CPU_SET_S(cpu, schedsetsize, schedset);
66 #else /* !CPU_ZERO_S */
67  unsigned cpu;
68  CPU_ZERO(schedset);
69  assert(schedsetsize == sizeof(cpu_set_t));
70  hwloc_bitmap_foreach_begin(cpu, hwlocset)
71  CPU_SET(cpu, schedset);
73 #endif /* !CPU_ZERO_S */
74  return 0;
75 }
76 
84 static __hwloc_inline int
85 hwloc_cpuset_from_glibc_sched_affinity(hwloc_topology_t topology __hwloc_attribute_unused, hwloc_cpuset_t hwlocset,
86  const cpu_set_t *schedset, size_t schedsetsize)
87 {
88  int cpu;
89 #ifdef CPU_ZERO_S
90  int count;
91 #endif
92  hwloc_bitmap_zero(hwlocset);
93 #ifdef CPU_ZERO_S
94  count = CPU_COUNT_S(schedsetsize, schedset);
95  cpu = 0;
96  while (count) {
97  if (CPU_ISSET_S(cpu, schedsetsize, schedset)) {
98  hwloc_bitmap_set(hwlocset, cpu);
99  count--;
100  }
101  cpu++;
102  }
103 #else /* !CPU_ZERO_S */
104  /* sched.h does not support dynamic cpu_set_t (introduced in glibc 2.7),
105  * assume we have a very old interface without CPU_COUNT (added in 2.6)
106  */
107  assert(schedsetsize == sizeof(cpu_set_t));
108  for(cpu=0; cpu<CPU_SETSIZE; cpu++)
109  if (CPU_ISSET(cpu, schedset))
110  hwloc_bitmap_set(hwlocset, cpu);
111 #endif /* !CPU_ZERO_S */
112  return 0;
113 }
114 
118 #endif /* CPU_SET */
119 
120 
121 #ifdef __cplusplus
122 } /* extern "C" */
123 #endif
124 
125 
126 #endif /* HWLOC_GLIBC_SCHED_H */
static int hwloc_cpuset_from_glibc_sched_affinity(hwloc_topology_t topology, hwloc_cpuset_t hwlocset, const cpu_set_t *schedset, size_t schedsetsize)
Convert glibc sched affinity CPU set schedset into hwloc CPU set.
Definition: glibc-sched.h:85
-
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
-
#define hwloc_bitmap_foreach_begin(id, bitmap)
Loop macro iterating on bitmap bitmap.
Definition: bitmap.h:370
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
static int hwloc_cpuset_to_glibc_sched_affinity(hwloc_topology_t topology, hwloc_const_cpuset_t hwlocset, cpu_set_t *schedset, size_t schedsetsize)
Convert hwloc CPU set toposet into glibc sched affinity CPU set schedset.
Definition: glibc-sched.h:57
-
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
-
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
-
#define hwloc_bitmap_foreach_end()
End of loop macro iterating on a bitmap.
Definition: bitmap.h:384
+
1 /*
+
2  * Copyright © 2009 CNRS
+
3  * Copyright © 2009-2013 inria. All rights reserved.
+
4  * Copyright © 2009-2011 Université Bordeaux
+
5  * Copyright © 2011 Cisco Systems, Inc. All rights reserved.
+
6  * See COPYING in top-level directory.
+
7  */
+
8 
+
17 #ifndef HWLOC_GLIBC_SCHED_H
+
18 #define HWLOC_GLIBC_SCHED_H
+
19 
+
20 #include "hwloc.h"
+
21 #include "hwloc/helper.h"
+
22 
+
23 #include <assert.h>
+
24 
+
25 #if !defined _GNU_SOURCE || !defined _SCHED_H || (!defined CPU_SETSIZE && !defined sched_priority)
+
26 #error Please make sure to include sched.h before including glibc-sched.h, and define _GNU_SOURCE before any inclusion of sched.h
+
27 #endif
+
28 
+
29 
+
30 #ifdef __cplusplus
+
31 extern "C" {
+
32 #endif
+
33 
+
34 
+
35 #ifdef HWLOC_HAVE_CPU_SET
+
36 
+
37 
+
56 static __hwloc_inline int
+ +
58  cpu_set_t *schedset, size_t schedsetsize)
+
59 {
+
60 #ifdef CPU_ZERO_S
+
61  unsigned cpu;
+
62  CPU_ZERO_S(schedsetsize, schedset);
+
63  hwloc_bitmap_foreach_begin(cpu, hwlocset)
+
64  CPU_SET_S(cpu, schedsetsize, schedset);
+ +
66 #else /* !CPU_ZERO_S */
+
67  unsigned cpu;
+
68  CPU_ZERO(schedset);
+
69  assert(schedsetsize == sizeof(cpu_set_t));
+
70  hwloc_bitmap_foreach_begin(cpu, hwlocset)
+
71  CPU_SET(cpu, schedset);
+ +
73 #endif /* !CPU_ZERO_S */
+
74  return 0;
+
75 }
+
76 
+
84 static __hwloc_inline int
+
85 hwloc_cpuset_from_glibc_sched_affinity(hwloc_topology_t topology __hwloc_attribute_unused, hwloc_cpuset_t hwlocset,
+
86  const cpu_set_t *schedset, size_t schedsetsize)
+
87 {
+
88  int cpu;
+
89 #ifdef CPU_ZERO_S
+
90  int count;
+
91 #endif
+
92  hwloc_bitmap_zero(hwlocset);
+
93 #ifdef CPU_ZERO_S
+
94  count = CPU_COUNT_S(schedsetsize, schedset);
+
95  cpu = 0;
+
96  while (count) {
+
97  if (CPU_ISSET_S(cpu, schedsetsize, schedset)) {
+
98  hwloc_bitmap_set(hwlocset, cpu);
+
99  count--;
+
100  }
+
101  cpu++;
+
102  }
+
103 #else /* !CPU_ZERO_S */
+
104  /* sched.h does not support dynamic cpu_set_t (introduced in glibc 2.7),
+
105  * assume we have a very old interface without CPU_COUNT (added in 2.6)
+
106  */
+
107  assert(schedsetsize == sizeof(cpu_set_t));
+
108  for(cpu=0; cpu<CPU_SETSIZE; cpu++)
+
109  if (CPU_ISSET(cpu, schedset))
+
110  hwloc_bitmap_set(hwlocset, cpu);
+
111 #endif /* !CPU_ZERO_S */
+
112  return 0;
+
113 }
+
114 
+
118 #endif /* CPU_SET */
+
119 
+
120 
+
121 #ifdef __cplusplus
+
122 } /* extern "C" */
+
123 #endif
+
124 
+
125 
+
126 #endif /* HWLOC_GLIBC_SCHED_H */
+
#define hwloc_bitmap_foreach_end()
End of loop macro iterating on a bitmap.
Definition: bitmap.h:384
+
static int hwloc_cpuset_to_glibc_sched_affinity(hwloc_topology_t topology, hwloc_const_cpuset_t hwlocset, cpu_set_t *schedset, size_t schedsetsize)
Convert hwloc CPU set toposet into glibc sched affinity CPU set schedset.
Definition: glibc-sched.h:57
+
#define hwloc_bitmap_foreach_begin(id, bitmap)
Loop macro iterating on bitmap bitmap.
Definition: bitmap.h:370
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
+
int hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
+
static int hwloc_cpuset_from_glibc_sched_affinity(hwloc_topology_t topology, hwloc_cpuset_t hwlocset, const cpu_set_t *schedset, size_t schedsetsize)
Convert glibc sched affinity CPU set schedset into hwloc CPU set.
Definition: glibc-sched.h:85
+
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t.
Definition: hwloc.h:142
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00149_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00149_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00149_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00149_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): opencl.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2012-2018 Inria. All rights reserved.
3  * Copyright © 2013, 2018 Université Bordeaux. All right reserved.
4  * See COPYING in top-level directory.
5  */
6 
14 #ifndef HWLOC_OPENCL_H
15 #define HWLOC_OPENCL_H
16 
17 #include "hwloc.h"
18 #include "hwloc/autogen/config.h"
19 #include "hwloc/helper.h"
20 #ifdef HWLOC_LINUX_SYS
21 #include "hwloc/linux.h"
22 #endif
23 
24 #ifdef __APPLE__
25 #include <OpenCL/cl.h>
26 #else
27 #include <CL/cl.h>
28 #endif
29 
30 #include <stdio.h>
31 
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 /* OpenCL extensions aren't always shipped with default headers, and
39  * they don't always reflect what the installed implementations support.
40  * Try everything and let the implementation return errors when non supported.
41  */
42 /* Copyright (c) 2008-2018 The Khronos Group Inc. */
43 
44 /* needs "cl_amd_device_attribute_query" device extension, but not strictly required for clGetDeviceInfo() */
45 #define HWLOC_CL_DEVICE_TOPOLOGY_AMD 0x4037
46 typedef union {
47  struct { cl_uint type; cl_uint data[5]; } raw;
48  struct { cl_uint type; cl_char unused[17]; cl_char bus; cl_char device; cl_char function; } pcie;
50 #define HWLOC_CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD 1
51 
52 /* needs "cl_nv_device_attribute_query" device extension, but not strictly required for clGetDeviceInfo() */
53 #define HWLOC_CL_DEVICE_PCI_BUS_ID_NV 0x4008
54 #define HWLOC_CL_DEVICE_PCI_SLOT_ID_NV 0x4009
55 
56 
72 static __hwloc_inline int
74  unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)
75 {
77  cl_uint nvbus, nvslot;
78  cl_int clret;
79 
80  clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_TOPOLOGY_AMD, sizeof(amdtopo), &amdtopo, NULL);
81  if (CL_SUCCESS == clret
82  && HWLOC_CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD == amdtopo.raw.type) {
83  *domain = 0; /* can't do anything better */
84  *bus = (unsigned) amdtopo.pcie.bus;
85  *dev = (unsigned) amdtopo.pcie.device;
86  *func = (unsigned) amdtopo.pcie.function;
87  return 0;
88  }
89 
90  clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_PCI_BUS_ID_NV, sizeof(nvbus), &nvbus, NULL);
91  if (CL_SUCCESS == clret) {
92  clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_PCI_SLOT_ID_NV, sizeof(nvslot), &nvslot, NULL);
93  if (CL_SUCCESS == clret) {
94  /* FIXME: PCI bus only uses 8bit, assume nvidia hardcodes the domain in higher bits */
95  *domain = nvbus >> 8;
96  *bus = nvbus & 0xff;
97  /* non-documented but used in many other projects */
98  *dev = nvslot >> 3;
99  *func = nvslot & 0x7;
100  return 0;
101  }
102  }
103 
104  return -1;
105 }
106 
124 static __hwloc_inline int
125 hwloc_opencl_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
126  cl_device_id device __hwloc_attribute_unused,
127  hwloc_cpuset_t set)
128 {
129 #if (defined HWLOC_LINUX_SYS)
130  /* If we're on Linux, try AMD/NVIDIA extensions + the sysfs mechanism to get the local cpus */
131 #define HWLOC_OPENCL_DEVICE_SYSFS_PATH_MAX 128
132  char path[HWLOC_OPENCL_DEVICE_SYSFS_PATH_MAX];
133  unsigned pcidomain, pcibus, pcidev, pcifunc;
134 
135  if (!hwloc_topology_is_thissystem(topology)) {
136  errno = EINVAL;
137  return -1;
138  }
139 
140  if (hwloc_opencl_get_device_pci_busid(device, &pcidomain, &pcibus, &pcidev, &pcifunc) < 0) {
142  return 0;
143  }
144 
145  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/local_cpus", pcidomain, pcibus, pcidev, pcifunc);
146  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
147  || hwloc_bitmap_iszero(set))
149 #else
150  /* Non-Linux systems simply get a full cpuset */
152 #endif
153  return 0;
154 }
155 
171 static __hwloc_inline hwloc_obj_t
173  unsigned platform_index, unsigned device_index)
174 {
175  unsigned x = (unsigned) -1, y = (unsigned) -1;
176  hwloc_obj_t osdev = NULL;
177  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
178  if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
179  && osdev->name
180  && sscanf(osdev->name, "opencl%ud%u", &x, &y) == 2
181  && platform_index == x && device_index == y)
182  return osdev;
183  }
184  return NULL;
185 }
186 
207 static __hwloc_inline hwloc_obj_t
208 hwloc_opencl_get_device_osdev(hwloc_topology_t topology __hwloc_attribute_unused,
209  cl_device_id device __hwloc_attribute_unused)
210 {
211  hwloc_obj_t osdev;
212  unsigned pcidomain, pcibus, pcidevice, pcifunc;
213 
214  if (hwloc_opencl_get_device_pci_busid(device, &pcidomain, &pcibus, &pcidevice, &pcifunc) < 0) {
215  errno = EINVAL;
216  return NULL;
217  }
218 
219  osdev = NULL;
220  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
221  hwloc_obj_t pcidev = osdev->parent;
222  if (strncmp(osdev->name, "opencl", 6))
223  continue;
224  if (pcidev
225  && pcidev->type == HWLOC_OBJ_PCI_DEVICE
226  && pcidev->attr->pcidev.domain == pcidomain
227  && pcidev->attr->pcidev.bus == pcibus
228  && pcidev->attr->pcidev.dev == pcidevice
229  && pcidev->attr->pcidev.func == pcifunc)
230  return osdev;
231  /* if PCI are filtered out, we need a info attr to match on */
232  }
233 
234  return NULL;
235 }
236 
240 #ifdef __cplusplus
241 } /* extern "C" */
242 #endif
243 
244 
245 #endif /* HWLOC_OPENCL_H */
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:431
-
unsigned char func
Definition: hwloc.h:618
-
cl_char device
Definition: opencl.h:48
-
cl_char function
Definition: opencl.h:48
-
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux...
Definition: hwloc.h:336
-
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
-
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
-
unsigned char dev
Definition: hwloc.h:618
-
Structure of a topology object.
Definition: hwloc.h:381
-
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
static int hwloc_opencl_get_device_cpuset(hwloc_topology_t topology, cl_device_id device, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to OpenCL device device.
Definition: opencl.h:125
-
static hwloc_obj_t hwloc_opencl_get_device_osdev_by_index(hwloc_topology_t topology, unsigned platform_index, unsigned device_index)
Get the hwloc OS device object corresponding to the OpenCL device for the given indexes.
Definition: opencl.h:172
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:262
-
struct hwloc_cl_device_topology_amd::@3 raw
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
-
static int hwloc_opencl_get_device_pci_busid(cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)
Return the domain, bus and device IDs of the OpenCL device device.
Definition: opencl.h:73
-
cl_char bus
Definition: opencl.h:48
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
cl_uint type
Definition: opencl.h:47
-
struct hwloc_cl_device_topology_amd::@4 pcie
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
unsigned short domain
Definition: hwloc.h:617
-
static hwloc_obj_t hwloc_opencl_get_device_osdev(hwloc_topology_t topology, cl_device_id device)
Get the hwloc OS device object corresponding to OpenCL device deviceX.
Definition: opencl.h:208
-
unsigned char bus
Definition: hwloc.h:618
-
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:383
-
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
-
Definition: opencl.h:46
+
1 /*
+
2  * Copyright © 2012-2019 Inria. All rights reserved.
+
3  * Copyright © 2013, 2018 Université Bordeaux. All right reserved.
+
4  * See COPYING in top-level directory.
+
5  */
+
6 
+
14 #ifndef HWLOC_OPENCL_H
+
15 #define HWLOC_OPENCL_H
+
16 
+
17 #include "hwloc.h"
+
18 #include "hwloc/autogen/config.h"
+
19 #include "hwloc/helper.h"
+
20 #ifdef HWLOC_LINUX_SYS
+
21 #include "hwloc/linux.h"
+
22 #endif
+
23 
+
24 #ifdef __APPLE__
+
25 #include <OpenCL/cl.h>
+
26 #else
+
27 #include <CL/cl.h>
+
28 #endif
+
29 
+
30 #include <stdio.h>
+
31 
+
32 
+
33 #ifdef __cplusplus
+
34 extern "C" {
+
35 #endif
+
36 
+
37 
+
38 /* OpenCL extensions aren't always shipped with default headers, and
+
39  * they don't always reflect what the installed implementations support.
+
40  * Try everything and let the implementation return errors when non supported.
+
41  */
+
42 /* Copyright (c) 2008-2018 The Khronos Group Inc. */
+
43 
+
44 /* needs "cl_amd_device_attribute_query" device extension, but not strictly required for clGetDeviceInfo() */
+
45 #define HWLOC_CL_DEVICE_TOPOLOGY_AMD 0x4037
+
46 typedef union {
+
47  struct { cl_uint type; cl_uint data[5]; } raw;
+
48  struct { cl_uint type; cl_char unused[17]; cl_char bus; cl_char device; cl_char function; } pcie;
+ +
50 #define HWLOC_CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD 1
+
51 
+
52 /* needs "cl_nv_device_attribute_query" device extension, but not strictly required for clGetDeviceInfo() */
+
53 #define HWLOC_CL_DEVICE_PCI_BUS_ID_NV 0x4008
+
54 #define HWLOC_CL_DEVICE_PCI_SLOT_ID_NV 0x4009
+
55 #define HWLOC_CL_DEVICE_PCI_DOMAIN_ID_NV 0x400A
+
56 
+
57 
+
73 static __hwloc_inline int
+ +
75  unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)
+
76 {
+ +
78  cl_uint nvbus, nvslot, nvdomain;
+
79  cl_int clret;
+
80 
+
81  clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_TOPOLOGY_AMD, sizeof(amdtopo), &amdtopo, NULL);
+
82  if (CL_SUCCESS == clret
+
83  && HWLOC_CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD == amdtopo.raw.type) {
+
84  *domain = 0; /* can't do anything better */
+
85  *bus = (unsigned) amdtopo.pcie.bus;
+
86  *dev = (unsigned) amdtopo.pcie.device;
+
87  *func = (unsigned) amdtopo.pcie.function;
+
88  return 0;
+
89  }
+
90 
+
91  clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_PCI_BUS_ID_NV, sizeof(nvbus), &nvbus, NULL);
+
92  if (CL_SUCCESS == clret) {
+
93  clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_PCI_SLOT_ID_NV, sizeof(nvslot), &nvslot, NULL);
+
94  if (CL_SUCCESS == clret) {
+
95  clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_PCI_DOMAIN_ID_NV, sizeof(nvdomain), &nvdomain, NULL);
+
96  if (CL_SUCCESS == clret) { /* available since CUDA 10.2 */
+
97  *domain = nvdomain;
+
98  } else {
+
99  *domain = 0;
+
100  }
+
101  *bus = nvbus & 0xff;
+
102  /* non-documented but used in many other projects */
+
103  *dev = nvslot >> 3;
+
104  *func = nvslot & 0x7;
+
105  return 0;
+
106  }
+
107  }
+
108 
+
109  return -1;
+
110 }
+
111 
+
129 static __hwloc_inline int
+
130 hwloc_opencl_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
+
131  cl_device_id device __hwloc_attribute_unused,
+
132  hwloc_cpuset_t set)
+
133 {
+
134 #if (defined HWLOC_LINUX_SYS)
+
135  /* If we're on Linux, try AMD/NVIDIA extensions + the sysfs mechanism to get the local cpus */
+
136 #define HWLOC_OPENCL_DEVICE_SYSFS_PATH_MAX 128
+
137  char path[HWLOC_OPENCL_DEVICE_SYSFS_PATH_MAX];
+
138  unsigned pcidomain, pcibus, pcidev, pcifunc;
+
139 
+
140  if (!hwloc_topology_is_thissystem(topology)) {
+
141  errno = EINVAL;
+
142  return -1;
+
143  }
+
144 
+
145  if (hwloc_opencl_get_device_pci_busid(device, &pcidomain, &pcibus, &pcidev, &pcifunc) < 0) {
+ +
147  return 0;
+
148  }
+
149 
+
150  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/local_cpus", pcidomain, pcibus, pcidev, pcifunc);
+
151  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
+
152  || hwloc_bitmap_iszero(set))
+ +
154 #else
+
155  /* Non-Linux systems simply get a full cpuset */
+ +
157 #endif
+
158  return 0;
+
159 }
+
160 
+
176 static __hwloc_inline hwloc_obj_t
+ +
178  unsigned platform_index, unsigned device_index)
+
179 {
+
180  unsigned x = (unsigned) -1, y = (unsigned) -1;
+
181  hwloc_obj_t osdev = NULL;
+
182  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
183  if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
+
184  && osdev->name
+
185  && sscanf(osdev->name, "opencl%ud%u", &x, &y) == 2
+
186  && platform_index == x && device_index == y)
+
187  return osdev;
+
188  }
+
189  return NULL;
+
190 }
+
191 
+
212 static __hwloc_inline hwloc_obj_t
+
213 hwloc_opencl_get_device_osdev(hwloc_topology_t topology __hwloc_attribute_unused,
+
214  cl_device_id device __hwloc_attribute_unused)
+
215 {
+
216  hwloc_obj_t osdev;
+
217  unsigned pcidomain, pcibus, pcidevice, pcifunc;
+
218 
+
219  if (hwloc_opencl_get_device_pci_busid(device, &pcidomain, &pcibus, &pcidevice, &pcifunc) < 0) {
+
220  errno = EINVAL;
+
221  return NULL;
+
222  }
+
223 
+
224  osdev = NULL;
+
225  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
226  hwloc_obj_t pcidev = osdev->parent;
+
227  if (strncmp(osdev->name, "opencl", 6))
+
228  continue;
+
229  if (pcidev
+
230  && pcidev->type == HWLOC_OBJ_PCI_DEVICE
+
231  && pcidev->attr->pcidev.domain == pcidomain
+
232  && pcidev->attr->pcidev.bus == pcibus
+
233  && pcidev->attr->pcidev.dev == pcidevice
+
234  && pcidev->attr->pcidev.func == pcifunc)
+
235  return osdev;
+
236  /* if PCI are filtered out, we need a info attr to match on */
+
237  }
+
238 
+
239  return NULL;
+
240 }
+
241 
+
245 #ifdef __cplusplus
+
246 } /* extern "C" */
+
247 #endif
+
248 
+
249 
+
250 #endif /* HWLOC_OPENCL_H */
+
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
+
Definition: opencl.h:46
+
@ HWLOC_OBJ_PCI_DEVICE
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:266
+
struct hwloc_cl_device_topology_amd::@4 pcie
+
cl_char function
Definition: opencl.h:48
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
unsigned short domain
Definition: hwloc.h:621
+
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:386
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
unsigned char func
Definition: hwloc.h:625
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
Structure of a topology object.
Definition: hwloc.h:384
+
static int hwloc_opencl_get_device_cpuset(hwloc_topology_t topology, cl_device_id device, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to OpenCL device device.
Definition: opencl.h:130
+
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:396
+
unsigned char bus
Definition: hwloc.h:625
+
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1151
+
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
+
cl_uint type
Definition: opencl.h:47
+
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:434
+
static hwloc_obj_t hwloc_opencl_get_device_osdev_by_index(hwloc_topology_t topology, unsigned platform_index, unsigned device_index)
Get the hwloc OS device object corresponding to the OpenCL device for the given indexes.
Definition: opencl.h:177
+
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
static int hwloc_opencl_get_device_pci_busid(cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)
Return the domain, bus and device IDs of the OpenCL device device.
Definition: opencl.h:74
+
struct hwloc_cl_device_topology_amd::@3 raw
+
static hwloc_obj_t hwloc_opencl_get_device_osdev(hwloc_topology_t topology, cl_device_id device)
Get the hwloc OS device object corresponding to OpenCL device deviceX.
Definition: opencl.h:213
+
cl_char device
Definition: opencl.h:48
+
unsigned char dev
Definition: hwloc.h:625
+
cl_char bus
Definition: opencl.h:48
+
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
+
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
+
@ HWLOC_OBJ_OSDEV_COPROC
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux,...
Definition: hwloc.h:340
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00152_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00152_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00152_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00152_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): cuda.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2010-2017 Inria. All rights reserved.
3  * Copyright © 2010-2011 Université Bordeaux
4  * Copyright © 2011 Cisco Systems, Inc. All rights reserved.
5  * See COPYING in top-level directory.
6  */
7 
16 #ifndef HWLOC_CUDA_H
17 #define HWLOC_CUDA_H
18 
19 #include "hwloc.h"
20 #include "hwloc/autogen/config.h"
21 #include "hwloc/helper.h"
22 #ifdef HWLOC_LINUX_SYS
23 #include "hwloc/linux.h"
24 #endif
25 
26 #include <cuda.h>
27 
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
46 static __hwloc_inline int
47 hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
48  CUdevice cudevice, int *domain, int *bus, int *dev)
49 {
50  CUresult cres;
51 
52 #if CUDA_VERSION >= 4000
53  cres = cuDeviceGetAttribute(domain, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, cudevice);
54  if (cres != CUDA_SUCCESS) {
55  errno = ENOSYS;
56  return -1;
57  }
58 #else
59  *domain = 0;
60 #endif
61  cres = cuDeviceGetAttribute(bus, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, cudevice);
62  if (cres != CUDA_SUCCESS) {
63  errno = ENOSYS;
64  return -1;
65  }
66  cres = cuDeviceGetAttribute(dev, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, cudevice);
67  if (cres != CUDA_SUCCESS) {
68  errno = ENOSYS;
69  return -1;
70  }
71 
72  return 0;
73 }
74 
91 static __hwloc_inline int
92 hwloc_cuda_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
93  CUdevice cudevice, hwloc_cpuset_t set)
94 {
95 #ifdef HWLOC_LINUX_SYS
96  /* If we're on Linux, use the sysfs mechanism to get the local cpus */
97 #define HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX 128
98  char path[HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX];
99  int domainid, busid, deviceid;
100 
101  if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domainid, &busid, &deviceid))
102  return -1;
103 
104  if (!hwloc_topology_is_thissystem(topology)) {
105  errno = EINVAL;
106  return -1;
107  }
108 
109  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", domainid, busid, deviceid);
110  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
111  || hwloc_bitmap_iszero(set))
113 #else
114  /* Non-Linux systems simply get a full cpuset */
116 #endif
117  return 0;
118 }
119 
130 static __hwloc_inline hwloc_obj_t
131 hwloc_cuda_get_device_pcidev(hwloc_topology_t topology, CUdevice cudevice)
132 {
133  int domain, bus, dev;
134 
135  if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domain, &bus, &dev))
136  return NULL;
137 
138  return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0);
139 }
140 
156 static __hwloc_inline hwloc_obj_t
157 hwloc_cuda_get_device_osdev(hwloc_topology_t topology, CUdevice cudevice)
158 {
159  hwloc_obj_t osdev = NULL;
160  int domain, bus, dev;
161 
162  if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domain, &bus, &dev))
163  return NULL;
164 
165  osdev = NULL;
166  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
167  hwloc_obj_t pcidev = osdev->parent;
168  if (strncmp(osdev->name, "cuda", 4))
169  continue;
170  if (pcidev
171  && pcidev->type == HWLOC_OBJ_PCI_DEVICE
172  && (int) pcidev->attr->pcidev.domain == domain
173  && (int) pcidev->attr->pcidev.bus == bus
174  && (int) pcidev->attr->pcidev.dev == dev
175  && pcidev->attr->pcidev.func == 0)
176  return osdev;
177  /* if PCI are filtered out, we need a info attr to match on */
178  }
179 
180  return NULL;
181 }
182 
198 static __hwloc_inline hwloc_obj_t
200 {
201  hwloc_obj_t osdev = NULL;
202  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
203  if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
204  && osdev->name
205  && !strncmp("cuda", osdev->name, 4)
206  && atoi(osdev->name + 4) == (int) idx)
207  return osdev;
208  }
209  return NULL;
210 }
211 
215 #ifdef __cplusplus
216 } /* extern "C" */
217 #endif
218 
219 
220 #endif /* HWLOC_CUDA_H */
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:431
-
static int hwloc_cuda_get_device_cpuset(hwloc_topology_t topology, CUdevice cudevice, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device cudevice.
Definition: cuda.h:92
-
unsigned char func
Definition: hwloc.h:618
-
static hwloc_obj_t hwloc_cuda_get_device_osdev(hwloc_topology_t topology, CUdevice cudevice)
Get the hwloc OS device object corresponding to CUDA device cudevice.
Definition: cuda.h:157
-
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux...
Definition: hwloc.h:336
-
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
-
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
-
unsigned char dev
Definition: hwloc.h:618
-
Structure of a topology object.
Definition: hwloc.h:381
-
static hwloc_obj_t hwloc_get_pcidev_by_busid(hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id...
Definition: helper.h:1092
-
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
static hwloc_obj_t hwloc_cuda_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
Get the hwloc OS device object corresponding to the CUDA device whose index is idx.
Definition: cuda.h:199
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
static hwloc_obj_t hwloc_cuda_get_device_pcidev(hwloc_topology_t topology, CUdevice cudevice)
Get the hwloc PCI device object corresponding to the CUDA device cudevice.
Definition: cuda.h:131
-
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:262
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
unsigned short domain
Definition: hwloc.h:617
-
unsigned char bus
Definition: hwloc.h:618
-
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:383
-
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
static int hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology, CUdevice cudevice, int *domain, int *bus, int *dev)
Return the domain, bus and device IDs of the CUDA device cudevice.
Definition: cuda.h:47
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
+
1 /*
+
2  * Copyright © 2010-2017 Inria. All rights reserved.
+
3  * Copyright © 2010-2011 Université Bordeaux
+
4  * Copyright © 2011 Cisco Systems, Inc. All rights reserved.
+
5  * See COPYING in top-level directory.
+
6  */
+
7 
+
16 #ifndef HWLOC_CUDA_H
+
17 #define HWLOC_CUDA_H
+
18 
+
19 #include "hwloc.h"
+
20 #include "hwloc/autogen/config.h"
+
21 #include "hwloc/helper.h"
+
22 #ifdef HWLOC_LINUX_SYS
+
23 #include "hwloc/linux.h"
+
24 #endif
+
25 
+
26 #include <cuda.h>
+
27 
+
28 
+
29 #ifdef __cplusplus
+
30 extern "C" {
+
31 #endif
+
32 
+
33 
+
46 static __hwloc_inline int
+
47 hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
+
48  CUdevice cudevice, int *domain, int *bus, int *dev)
+
49 {
+
50  CUresult cres;
+
51 
+
52 #if CUDA_VERSION >= 4000
+
53  cres = cuDeviceGetAttribute(domain, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, cudevice);
+
54  if (cres != CUDA_SUCCESS) {
+
55  errno = ENOSYS;
+
56  return -1;
+
57  }
+
58 #else
+
59  *domain = 0;
+
60 #endif
+
61  cres = cuDeviceGetAttribute(bus, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, cudevice);
+
62  if (cres != CUDA_SUCCESS) {
+
63  errno = ENOSYS;
+
64  return -1;
+
65  }
+
66  cres = cuDeviceGetAttribute(dev, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, cudevice);
+
67  if (cres != CUDA_SUCCESS) {
+
68  errno = ENOSYS;
+
69  return -1;
+
70  }
+
71 
+
72  return 0;
+
73 }
+
74 
+
91 static __hwloc_inline int
+
92 hwloc_cuda_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
+
93  CUdevice cudevice, hwloc_cpuset_t set)
+
94 {
+
95 #ifdef HWLOC_LINUX_SYS
+
96  /* If we're on Linux, use the sysfs mechanism to get the local cpus */
+
97 #define HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX 128
+
98  char path[HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX];
+
99  int domainid, busid, deviceid;
+
100 
+
101  if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domainid, &busid, &deviceid))
+
102  return -1;
+
103 
+
104  if (!hwloc_topology_is_thissystem(topology)) {
+
105  errno = EINVAL;
+
106  return -1;
+
107  }
+
108 
+
109  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", domainid, busid, deviceid);
+
110  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
+
111  || hwloc_bitmap_iszero(set))
+ +
113 #else
+
114  /* Non-Linux systems simply get a full cpuset */
+ +
116 #endif
+
117  return 0;
+
118 }
+
119 
+
130 static __hwloc_inline hwloc_obj_t
+
131 hwloc_cuda_get_device_pcidev(hwloc_topology_t topology, CUdevice cudevice)
+
132 {
+
133  int domain, bus, dev;
+
134 
+
135  if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domain, &bus, &dev))
+
136  return NULL;
+
137 
+
138  return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0);
+
139 }
+
140 
+
156 static __hwloc_inline hwloc_obj_t
+
157 hwloc_cuda_get_device_osdev(hwloc_topology_t topology, CUdevice cudevice)
+
158 {
+
159  hwloc_obj_t osdev = NULL;
+
160  int domain, bus, dev;
+
161 
+
162  if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domain, &bus, &dev))
+
163  return NULL;
+
164 
+
165  osdev = NULL;
+
166  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
167  hwloc_obj_t pcidev = osdev->parent;
+
168  if (strncmp(osdev->name, "cuda", 4))
+
169  continue;
+
170  if (pcidev
+
171  && pcidev->type == HWLOC_OBJ_PCI_DEVICE
+
172  && (int) pcidev->attr->pcidev.domain == domain
+
173  && (int) pcidev->attr->pcidev.bus == bus
+
174  && (int) pcidev->attr->pcidev.dev == dev
+
175  && pcidev->attr->pcidev.func == 0)
+
176  return osdev;
+
177  /* if PCI are filtered out, we need a info attr to match on */
+
178  }
+
179 
+
180  return NULL;
+
181 }
+
182 
+
198 static __hwloc_inline hwloc_obj_t
+ +
200 {
+
201  hwloc_obj_t osdev = NULL;
+
202  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
203  if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
+
204  && osdev->name
+
205  && !strncmp("cuda", osdev->name, 4)
+
206  && atoi(osdev->name + 4) == (int) idx)
+
207  return osdev;
+
208  }
+
209  return NULL;
+
210 }
+
211 
+
215 #ifdef __cplusplus
+
216 } /* extern "C" */
+
217 #endif
+
218 
+
219 
+
220 #endif /* HWLOC_CUDA_H */
+
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
+
@ HWLOC_OBJ_PCI_DEVICE
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:266
+
static hwloc_obj_t hwloc_cuda_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
Get the hwloc OS device object corresponding to the CUDA device whose index is idx.
Definition: cuda.h:199
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
unsigned short domain
Definition: hwloc.h:621
+
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:386
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
unsigned char func
Definition: hwloc.h:625
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
Structure of a topology object.
Definition: hwloc.h:384
+
static int hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology, CUdevice cudevice, int *domain, int *bus, int *dev)
Return the domain, bus and device IDs of the CUDA device cudevice.
Definition: cuda.h:47
+
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:396
+
unsigned char bus
Definition: hwloc.h:625
+
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1151
+
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
+
static int hwloc_cuda_get_device_cpuset(hwloc_topology_t topology, CUdevice cudevice, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device cudevice.
Definition: cuda.h:92
+
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:434
+
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
static hwloc_obj_t hwloc_cuda_get_device_osdev(hwloc_topology_t topology, CUdevice cudevice)
Get the hwloc OS device object corresponding to CUDA device cudevice.
Definition: cuda.h:157
+
static hwloc_obj_t hwloc_get_pcidev_by_busid(hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id.
Definition: helper.h:1114
+
static hwloc_obj_t hwloc_cuda_get_device_pcidev(hwloc_topology_t topology, CUdevice cudevice)
Get the hwloc PCI device object corresponding to the CUDA device cudevice.
Definition: cuda.h:131
+
unsigned char dev
Definition: hwloc.h:625
+
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
+
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
+
@ HWLOC_OBJ_OSDEV_COPROC
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux,...
Definition: hwloc.h:340
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00155_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00155_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00155_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00155_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): cudart.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2010-2017 Inria. All rights reserved.
3  * Copyright © 2010-2011 Université Bordeaux
4  * Copyright © 2011 Cisco Systems, Inc. All rights reserved.
5  * See COPYING in top-level directory.
6  */
7 
16 #ifndef HWLOC_CUDART_H
17 #define HWLOC_CUDART_H
18 
19 #include "hwloc.h"
20 #include "hwloc/autogen/config.h"
21 #include "hwloc/helper.h"
22 #ifdef HWLOC_LINUX_SYS
23 #include "hwloc/linux.h"
24 #endif
25 
26 #include <cuda.h> /* for CUDA_VERSION */
27 #include <cuda_runtime_api.h>
28 
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 
47 static __hwloc_inline int
48 hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
49  int idx, int *domain, int *bus, int *dev)
50 {
51  cudaError_t cerr;
52  struct cudaDeviceProp prop;
53 
54  cerr = cudaGetDeviceProperties(&prop, idx);
55  if (cerr) {
56  errno = ENOSYS;
57  return -1;
58  }
59 
60 #if CUDA_VERSION >= 4000
61  *domain = prop.pciDomainID;
62 #else
63  *domain = 0;
64 #endif
65 
66  *bus = prop.pciBusID;
67  *dev = prop.pciDeviceID;
68 
69  return 0;
70 }
71 
88 static __hwloc_inline int
89 hwloc_cudart_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
90  int idx, hwloc_cpuset_t set)
91 {
92 #ifdef HWLOC_LINUX_SYS
93  /* If we're on Linux, use the sysfs mechanism to get the local cpus */
94 #define HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX 128
95  char path[HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX];
96  int domain, bus, dev;
97 
98  if (hwloc_cudart_get_device_pci_ids(topology, idx, &domain, &bus, &dev))
99  return -1;
100 
101  if (!hwloc_topology_is_thissystem(topology)) {
102  errno = EINVAL;
103  return -1;
104  }
105 
106  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", (unsigned) domain, (unsigned) bus, (unsigned) dev);
107  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
108  || hwloc_bitmap_iszero(set))
110 #else
111  /* Non-Linux systems simply get a full cpuset */
113 #endif
114  return 0;
115 }
116 
127 static __hwloc_inline hwloc_obj_t
129 {
130  int domain, bus, dev;
131 
132  if (hwloc_cudart_get_device_pci_ids(topology, idx, &domain, &bus, &dev))
133  return NULL;
134 
135  return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0);
136 }
137 
155 static __hwloc_inline hwloc_obj_t
157 {
158  hwloc_obj_t osdev = NULL;
159  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
160  if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
161  && osdev->name
162  && !strncmp("cuda", osdev->name, 4)
163  && atoi(osdev->name + 4) == (int) idx)
164  return osdev;
165  }
166  return NULL;
167 }
168 
172 #ifdef __cplusplus
173 } /* extern "C" */
174 #endif
175 
176 
177 #endif /* HWLOC_CUDART_H */
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux...
Definition: hwloc.h:336
-
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
-
Structure of a topology object.
Definition: hwloc.h:381
-
static hwloc_obj_t hwloc_get_pcidev_by_busid(hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id...
Definition: helper.h:1092
-
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
-
static hwloc_obj_t hwloc_cudart_get_device_pcidev(hwloc_topology_t topology, int idx)
Get the hwloc PCI device object corresponding to the CUDA device whose index is idx.
Definition: cudart.h:128
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
static int hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology, int idx, int *domain, int *bus, int *dev)
Return the domain, bus and device IDs of the CUDA device whose index is idx.
Definition: cudart.h:48
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
static hwloc_obj_t hwloc_cudart_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
Get the hwloc OS device object corresponding to the CUDA device whose index is idx.
Definition: cudart.h:156
-
static int hwloc_cudart_get_device_cpuset(hwloc_topology_t topology, int idx, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device idx.
Definition: cudart.h:89
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
+
1 /*
+
2  * Copyright © 2010-2017 Inria. All rights reserved.
+
3  * Copyright © 2010-2011 Université Bordeaux
+
4  * Copyright © 2011 Cisco Systems, Inc. All rights reserved.
+
5  * See COPYING in top-level directory.
+
6  */
+
7 
+
16 #ifndef HWLOC_CUDART_H
+
17 #define HWLOC_CUDART_H
+
18 
+
19 #include "hwloc.h"
+
20 #include "hwloc/autogen/config.h"
+
21 #include "hwloc/helper.h"
+
22 #ifdef HWLOC_LINUX_SYS
+
23 #include "hwloc/linux.h"
+
24 #endif
+
25 
+
26 #include <cuda.h> /* for CUDA_VERSION */
+
27 #include <cuda_runtime_api.h>
+
28 
+
29 
+
30 #ifdef __cplusplus
+
31 extern "C" {
+
32 #endif
+
33 
+
34 
+
47 static __hwloc_inline int
+
48 hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused,
+
49  int idx, int *domain, int *bus, int *dev)
+
50 {
+
51  cudaError_t cerr;
+
52  struct cudaDeviceProp prop;
+
53 
+
54  cerr = cudaGetDeviceProperties(&prop, idx);
+
55  if (cerr) {
+
56  errno = ENOSYS;
+
57  return -1;
+
58  }
+
59 
+
60 #if CUDA_VERSION >= 4000
+
61  *domain = prop.pciDomainID;
+
62 #else
+
63  *domain = 0;
+
64 #endif
+
65 
+
66  *bus = prop.pciBusID;
+
67  *dev = prop.pciDeviceID;
+
68 
+
69  return 0;
+
70 }
+
71 
+
88 static __hwloc_inline int
+
89 hwloc_cudart_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
+
90  int idx, hwloc_cpuset_t set)
+
91 {
+
92 #ifdef HWLOC_LINUX_SYS
+
93  /* If we're on Linux, use the sysfs mechanism to get the local cpus */
+
94 #define HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX 128
+
95  char path[HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX];
+
96  int domain, bus, dev;
+
97 
+
98  if (hwloc_cudart_get_device_pci_ids(topology, idx, &domain, &bus, &dev))
+
99  return -1;
+
100 
+
101  if (!hwloc_topology_is_thissystem(topology)) {
+
102  errno = EINVAL;
+
103  return -1;
+
104  }
+
105 
+
106  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", (unsigned) domain, (unsigned) bus, (unsigned) dev);
+
107  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
+
108  || hwloc_bitmap_iszero(set))
+ +
110 #else
+
111  /* Non-Linux systems simply get a full cpuset */
+ +
113 #endif
+
114  return 0;
+
115 }
+
116 
+
127 static __hwloc_inline hwloc_obj_t
+ +
129 {
+
130  int domain, bus, dev;
+
131 
+
132  if (hwloc_cudart_get_device_pci_ids(topology, idx, &domain, &bus, &dev))
+
133  return NULL;
+
134 
+
135  return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0);
+
136 }
+
137 
+
155 static __hwloc_inline hwloc_obj_t
+ +
157 {
+
158  hwloc_obj_t osdev = NULL;
+
159  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
160  if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
+
161  && osdev->name
+
162  && !strncmp("cuda", osdev->name, 4)
+
163  && atoi(osdev->name + 4) == (int) idx)
+
164  return osdev;
+
165  }
+
166  return NULL;
+
167 }
+
168 
+
172 #ifdef __cplusplus
+
173 } /* extern "C" */
+
174 #endif
+
175 
+
176 
+
177 #endif /* HWLOC_CUDART_H */
+
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
Structure of a topology object.
Definition: hwloc.h:384
+
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:396
+
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1151
+
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
static hwloc_obj_t hwloc_cudart_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
Get the hwloc OS device object corresponding to the CUDA device whose index is idx.
Definition: cudart.h:156
+
static hwloc_obj_t hwloc_get_pcidev_by_busid(hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id.
Definition: helper.h:1114
+
static int hwloc_cudart_get_device_cpuset(hwloc_topology_t topology, int idx, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device idx.
Definition: cudart.h:89
+
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
+
static hwloc_obj_t hwloc_cudart_get_device_pcidev(hwloc_topology_t topology, int idx)
Get the hwloc PCI device object corresponding to the CUDA device whose index is idx.
Definition: cudart.h:128
+
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
+
@ HWLOC_OBJ_OSDEV_COPROC
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux,...
Definition: hwloc.h:340
+
static int hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology, int idx, int *domain, int *bus, int *dev)
Return the domain, bus and device IDs of the CUDA device whose index is idx.
Definition: cudart.h:48
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00158_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00158_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00158_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00158_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): nvml.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2012-2016 Inria. All rights reserved.
3  * See COPYING in top-level directory.
4  */
5 
13 #ifndef HWLOC_NVML_H
14 #define HWLOC_NVML_H
15 
16 #include "hwloc.h"
17 #include "hwloc/autogen/config.h"
18 #include "hwloc/helper.h"
19 #ifdef HWLOC_LINUX_SYS
20 #include "hwloc/linux.h"
21 #endif
22 
23 #include <nvml.h>
24 
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 
55 static __hwloc_inline int
56 hwloc_nvml_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
57  nvmlDevice_t device, hwloc_cpuset_t set)
58 {
59 #ifdef HWLOC_LINUX_SYS
60  /* If we're on Linux, use the sysfs mechanism to get the local cpus */
61 #define HWLOC_NVML_DEVICE_SYSFS_PATH_MAX 128
62  char path[HWLOC_NVML_DEVICE_SYSFS_PATH_MAX];
63  nvmlReturn_t nvres;
64  nvmlPciInfo_t pci;
65 
66  if (!hwloc_topology_is_thissystem(topology)) {
67  errno = EINVAL;
68  return -1;
69  }
70 
71  nvres = nvmlDeviceGetPciInfo(device, &pci);
72  if (NVML_SUCCESS != nvres) {
73  errno = EINVAL;
74  return -1;
75  }
76 
77  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", pci.domain, pci.bus, pci.device);
78  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
79  || hwloc_bitmap_iszero(set))
81 #else
82  /* Non-Linux systems simply get a full cpuset */
84 #endif
85  return 0;
86 }
87 
101 static __hwloc_inline hwloc_obj_t
103 {
104  hwloc_obj_t osdev = NULL;
105  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
106  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
107  && osdev->name
108  && !strncmp("nvml", osdev->name, 4)
109  && atoi(osdev->name + 4) == (int) idx)
110  return osdev;
111  }
112  return NULL;
113 }
114 
128 static __hwloc_inline hwloc_obj_t
129 hwloc_nvml_get_device_osdev(hwloc_topology_t topology, nvmlDevice_t device)
130 {
131  hwloc_obj_t osdev;
132  nvmlReturn_t nvres;
133  nvmlPciInfo_t pci;
134  char uuid[64];
135 
136  if (!hwloc_topology_is_thissystem(topology)) {
137  errno = EINVAL;
138  return NULL;
139  }
140 
141  nvres = nvmlDeviceGetPciInfo(device, &pci);
142  if (NVML_SUCCESS != nvres)
143  return NULL;
144 
145  nvres = nvmlDeviceGetUUID(device, uuid, sizeof(uuid));
146  if (NVML_SUCCESS != nvres)
147  uuid[0] = '\0';
148 
149  osdev = NULL;
150  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
151  hwloc_obj_t pcidev = osdev->parent;
152  const char *info;
153 
154  if (strncmp(osdev->name, "nvml", 4))
155  continue;
156 
157  if (pcidev
158  && pcidev->type == HWLOC_OBJ_PCI_DEVICE
159  && pcidev->attr->pcidev.domain == pci.domain
160  && pcidev->attr->pcidev.bus == pci.bus
161  && pcidev->attr->pcidev.dev == pci.device
162  && pcidev->attr->pcidev.func == 0)
163  return osdev;
164 
165  info = hwloc_obj_get_info_by_name(osdev, "NVIDIAUUID");
166  if (info && !strcmp(info, uuid))
167  return osdev;
168  }
169 
170  return NULL;
171 }
172 
176 #ifdef __cplusplus
177 } /* extern "C" */
178 #endif
179 
180 
181 #endif /* HWLOC_NVML_H */
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:431
-
unsigned char func
Definition: hwloc.h:618
-
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
-
static hwloc_obj_t hwloc_nvml_get_device_osdev(hwloc_topology_t topology, nvmlDevice_t device)
Get the hwloc OS device object corresponding to NVML device device.
Definition: nvml.h:129
-
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
-
unsigned char dev
Definition: hwloc.h:618
-
Structure of a topology object.
Definition: hwloc.h:381
-
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
static const char * hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name)
Search the given key name in object infos and return the corresponding value.
-
static hwloc_obj_t hwloc_nvml_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
Get the hwloc OS device object corresponding to the NVML device whose index is idx.
Definition: nvml.h:102
-
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:262
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
unsigned short domain
Definition: hwloc.h:617
-
static int hwloc_nvml_get_device_cpuset(hwloc_topology_t topology, nvmlDevice_t device, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to NVML device device.
Definition: nvml.h:56
-
unsigned char bus
Definition: hwloc.h:618
-
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:383
-
Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device...
Definition: hwloc.h:326
-
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
+
1 /*
+
2  * Copyright © 2012-2016 Inria. All rights reserved.
+
3  * See COPYING in top-level directory.
+
4  */
+
5 
+
13 #ifndef HWLOC_NVML_H
+
14 #define HWLOC_NVML_H
+
15 
+
16 #include "hwloc.h"
+
17 #include "hwloc/autogen/config.h"
+
18 #include "hwloc/helper.h"
+
19 #ifdef HWLOC_LINUX_SYS
+
20 #include "hwloc/linux.h"
+
21 #endif
+
22 
+
23 #include <nvml.h>
+
24 
+
25 
+
26 #ifdef __cplusplus
+
27 extern "C" {
+
28 #endif
+
29 
+
30 
+
55 static __hwloc_inline int
+
56 hwloc_nvml_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
+
57  nvmlDevice_t device, hwloc_cpuset_t set)
+
58 {
+
59 #ifdef HWLOC_LINUX_SYS
+
60  /* If we're on Linux, use the sysfs mechanism to get the local cpus */
+
61 #define HWLOC_NVML_DEVICE_SYSFS_PATH_MAX 128
+
62  char path[HWLOC_NVML_DEVICE_SYSFS_PATH_MAX];
+
63  nvmlReturn_t nvres;
+
64  nvmlPciInfo_t pci;
+
65 
+
66  if (!hwloc_topology_is_thissystem(topology)) {
+
67  errno = EINVAL;
+
68  return -1;
+
69  }
+
70 
+
71  nvres = nvmlDeviceGetPciInfo(device, &pci);
+
72  if (NVML_SUCCESS != nvres) {
+
73  errno = EINVAL;
+
74  return -1;
+
75  }
+
76 
+
77  sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", pci.domain, pci.bus, pci.device);
+
78  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
+
79  || hwloc_bitmap_iszero(set))
+ +
81 #else
+
82  /* Non-Linux systems simply get a full cpuset */
+ +
84 #endif
+
85  return 0;
+
86 }
+
87 
+
101 static __hwloc_inline hwloc_obj_t
+ +
103 {
+
104  hwloc_obj_t osdev = NULL;
+
105  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
106  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
+
107  && osdev->name
+
108  && !strncmp("nvml", osdev->name, 4)
+
109  && atoi(osdev->name + 4) == (int) idx)
+
110  return osdev;
+
111  }
+
112  return NULL;
+
113 }
+
114 
+
128 static __hwloc_inline hwloc_obj_t
+
129 hwloc_nvml_get_device_osdev(hwloc_topology_t topology, nvmlDevice_t device)
+
130 {
+
131  hwloc_obj_t osdev;
+
132  nvmlReturn_t nvres;
+
133  nvmlPciInfo_t pci;
+
134  char uuid[64];
+
135 
+
136  if (!hwloc_topology_is_thissystem(topology)) {
+
137  errno = EINVAL;
+
138  return NULL;
+
139  }
+
140 
+
141  nvres = nvmlDeviceGetPciInfo(device, &pci);
+
142  if (NVML_SUCCESS != nvres)
+
143  return NULL;
+
144 
+
145  nvres = nvmlDeviceGetUUID(device, uuid, sizeof(uuid));
+
146  if (NVML_SUCCESS != nvres)
+
147  uuid[0] = '\0';
+
148 
+
149  osdev = NULL;
+
150  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
151  hwloc_obj_t pcidev = osdev->parent;
+
152  const char *info;
+
153 
+
154  if (strncmp(osdev->name, "nvml", 4))
+
155  continue;
+
156 
+
157  if (pcidev
+
158  && pcidev->type == HWLOC_OBJ_PCI_DEVICE
+
159  && pcidev->attr->pcidev.domain == pci.domain
+
160  && pcidev->attr->pcidev.bus == pci.bus
+
161  && pcidev->attr->pcidev.dev == pci.device
+
162  && pcidev->attr->pcidev.func == 0)
+
163  return osdev;
+
164 
+
165  info = hwloc_obj_get_info_by_name(osdev, "NVIDIAUUID");
+
166  if (info && !strcmp(info, uuid))
+
167  return osdev;
+
168  }
+
169 
+
170  return NULL;
+
171 }
+
172 
+
176 #ifdef __cplusplus
+
177 } /* extern "C" */
+
178 #endif
+
179 
+
180 
+
181 #endif /* HWLOC_NVML_H */
+
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
+
@ HWLOC_OBJ_PCI_DEVICE
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:266
+
static const char * hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name)
Search the given key name in object infos and return the corresponding value.
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
unsigned short domain
Definition: hwloc.h:621
+
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:386
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
unsigned char func
Definition: hwloc.h:625
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
Structure of a topology object.
Definition: hwloc.h:384
+
static int hwloc_nvml_get_device_cpuset(hwloc_topology_t topology, nvmlDevice_t device, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to NVML device device.
Definition: nvml.h:56
+
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:396
+
@ HWLOC_OBJ_OSDEV_GPU
Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device.
Definition: hwloc.h:330
+
unsigned char bus
Definition: hwloc.h:625
+
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1151
+
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
+
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:434
+
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
static hwloc_obj_t hwloc_nvml_get_device_osdev(hwloc_topology_t topology, nvmlDevice_t device)
Get the hwloc OS device object corresponding to NVML device device.
Definition: nvml.h:129
+
unsigned char dev
Definition: hwloc.h:625
+
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
+
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
+
static hwloc_obj_t hwloc_nvml_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
Get the hwloc OS device object corresponding to the NVML device whose index is idx.
Definition: nvml.h:102
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00161_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00161_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00161_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00161_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): gl.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
1 /*
2  * Copyright © 2012 Blue Brain Project, EPFL. All rights reserved.
3  * Copyright © 2012-2013 Inria. All rights reserved.
4  * See COPYING in top-level directory.
5  */
6 
14 #ifndef HWLOC_GL_H
15 #define HWLOC_GL_H
16 
17 #include "hwloc.h"
18 
19 #include <stdio.h>
20 #include <string.h>
21 
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 
53 static __hwloc_inline hwloc_obj_t
55  unsigned port, unsigned device)
56 {
57  unsigned x = (unsigned) -1, y = (unsigned) -1;
58  hwloc_obj_t osdev = NULL;
59  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
60  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
61  && osdev->name
62  && sscanf(osdev->name, ":%u.%u", &x, &y) == 2
63  && port == x && device == y)
64  return osdev;
65  }
66  errno = EINVAL;
67  return NULL;
68 }
69 
84 static __hwloc_inline hwloc_obj_t
86  const char *name)
87 {
88  hwloc_obj_t osdev = NULL;
89  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
90  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
91  && osdev->name
92  && !strcmp(name, osdev->name))
93  return osdev;
94  }
95  errno = EINVAL;
96  return NULL;
97 }
98 
110 static __hwloc_inline int
111 hwloc_gl_get_display_by_osdev(hwloc_topology_t topology __hwloc_attribute_unused,
112  hwloc_obj_t osdev,
113  unsigned *port, unsigned *device)
114 {
115  unsigned x = -1, y = -1;
116  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
117  && sscanf(osdev->name, ":%u.%u", &x, &y) == 2) {
118  *port = x;
119  *device = y;
120  return 0;
121  }
122  errno = EINVAL;
123  return -1;
124 }
125 
129 #ifdef __cplusplus
130 } /* extern "C" */
131 #endif
132 
133 
134 #endif /* HWLOC_GL_H */
135 
static hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device(hwloc_topology_t topology, unsigned port, unsigned device)
Get the hwloc OS device object corresponding to the OpenGL display given by port and device index...
Definition: gl.h:54
-
Structure of a topology object.
Definition: hwloc.h:381
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
static int hwloc_gl_get_display_by_osdev(hwloc_topology_t topology, hwloc_obj_t osdev, unsigned *port, unsigned *device)
Get the OpenGL display port and device corresponding to the given hwloc OS object.
Definition: gl.h:111
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device...
Definition: hwloc.h:326
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
-
static hwloc_obj_t hwloc_gl_get_display_osdev_by_name(hwloc_topology_t topology, const char *name)
Get the hwloc OS device object corresponding to the OpenGL display given by name. ...
Definition: gl.h:85
+
1 /*
+
2  * Copyright © 2012 Blue Brain Project, EPFL. All rights reserved.
+
3  * Copyright © 2012-2013 Inria. All rights reserved.
+
4  * See COPYING in top-level directory.
+
5  */
+
6 
+
14 #ifndef HWLOC_GL_H
+
15 #define HWLOC_GL_H
+
16 
+
17 #include "hwloc.h"
+
18 
+
19 #include <stdio.h>
+
20 #include <string.h>
+
21 
+
22 
+
23 #ifdef __cplusplus
+
24 extern "C" {
+
25 #endif
+
26 
+
27 
+
53 static __hwloc_inline hwloc_obj_t
+ +
55  unsigned port, unsigned device)
+
56 {
+
57  unsigned x = (unsigned) -1, y = (unsigned) -1;
+
58  hwloc_obj_t osdev = NULL;
+
59  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
60  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
+
61  && osdev->name
+
62  && sscanf(osdev->name, ":%u.%u", &x, &y) == 2
+
63  && port == x && device == y)
+
64  return osdev;
+
65  }
+
66  errno = EINVAL;
+
67  return NULL;
+
68 }
+
69 
+
84 static __hwloc_inline hwloc_obj_t
+ +
86  const char *name)
+
87 {
+
88  hwloc_obj_t osdev = NULL;
+
89  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+
90  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
+
91  && osdev->name
+
92  && !strcmp(name, osdev->name))
+
93  return osdev;
+
94  }
+
95  errno = EINVAL;
+
96  return NULL;
+
97 }
+
98 
+
110 static __hwloc_inline int
+
111 hwloc_gl_get_display_by_osdev(hwloc_topology_t topology __hwloc_attribute_unused,
+
112  hwloc_obj_t osdev,
+
113  unsigned *port, unsigned *device)
+
114 {
+
115  unsigned x = -1, y = -1;
+
116  if (HWLOC_OBJ_OSDEV_GPU == osdev->attr->osdev.type
+
117  && sscanf(osdev->name, ":%u.%u", &x, &y) == 2) {
+
118  *port = x;
+
119  *device = y;
+
120  return 0;
+
121  }
+
122  errno = EINVAL;
+
123  return -1;
+
124 }
+
125 
+
129 #ifdef __cplusplus
+
130 } /* extern "C" */
+
131 #endif
+
132 
+
133 
+
134 #endif /* HWLOC_GL_H */
+
135 
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
static hwloc_obj_t hwloc_gl_get_display_osdev_by_name(hwloc_topology_t topology, const char *name)
Get the hwloc OS device object corresponding to the OpenGL display given by name.
Definition: gl.h:85
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
Structure of a topology object.
Definition: hwloc.h:384
+
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:396
+
@ HWLOC_OBJ_OSDEV_GPU
Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device.
Definition: hwloc.h:330
+
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1151
+
static hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device(hwloc_topology_t topology, unsigned port, unsigned device)
Get the hwloc OS device object corresponding to the OpenGL display given by port and device index.
Definition: gl.h:54
+
static int hwloc_gl_get_display_by_osdev(hwloc_topology_t topology, hwloc_obj_t osdev, unsigned *port, unsigned *device)
Get the OpenGL display port and device corresponding to the given hwloc OS object.
Definition: gl.h:111
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00164_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00164_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00164_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00164_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): intel-mic.h Source File +Hardware Locality (hwloc): openfabrics-verbs.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
intel-mic.h
+
openfabrics-verbs.h
-
1 /*
2  * Copyright © 2013-2016 Inria. All rights reserved.
3  * See COPYING in top-level directory.
4  */
5 
13 #ifndef HWLOC_INTEL_MIC_H
14 #define HWLOC_INTEL_MIC_H
15 
16 #include "hwloc.h"
17 #include "hwloc/autogen/config.h"
18 #include "hwloc/helper.h"
19 
20 #ifdef HWLOC_LINUX_SYS
21 #include "hwloc/linux.h"
22 
23 #include <dirent.h>
24 #include <string.h>
25 #endif
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
59 static __hwloc_inline int
60 hwloc_intel_mic_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
61  int idx __hwloc_attribute_unused,
62  hwloc_cpuset_t set)
63 {
64 #ifdef HWLOC_LINUX_SYS
65  /* If we're on Linux, use the sysfs mechanism to get the local cpus */
66 #define HWLOC_INTEL_MIC_DEVICE_SYSFS_PATH_MAX 128
67  char path[HWLOC_INTEL_MIC_DEVICE_SYSFS_PATH_MAX];
68  DIR *sysdir = NULL;
69  struct dirent *dirent;
70  unsigned pcibus, pcidev, pcifunc;
71 
72  if (!hwloc_topology_is_thissystem(topology)) {
73  errno = EINVAL;
74  return -1;
75  }
76 
77  sprintf(path, "/sys/class/mic/mic%d", idx);
78  sysdir = opendir(path);
79  if (!sysdir)
80  return -1;
81 
82  while ((dirent = readdir(sysdir)) != NULL) {
83  if (sscanf(dirent->d_name, "pci_%02x:%02x.%02x", &pcibus, &pcidev, &pcifunc) == 3) {
84  sprintf(path, "/sys/class/mic/mic%d/pci_%02x:%02x.%02x/local_cpus", idx, pcibus, pcidev, pcifunc);
85  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
86  || hwloc_bitmap_iszero(set))
88  break;
89  }
90  }
91 
92  closedir(sysdir);
93 #else
94  /* Non-Linux systems simply get a full cpuset */
96 #endif
97  return 0;
98 }
99 
113 static __hwloc_inline hwloc_obj_t
115  unsigned idx)
116 {
117  hwloc_obj_t osdev = NULL;
118  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
119  if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type
120  && osdev->name
121  && !strncmp("mic", osdev->name, 3)
122  && atoi(osdev->name + 3) == (int) idx)
123  return osdev;
124  }
125  return NULL;
126 }
127 
131 #ifdef __cplusplus
132 } /* extern "C" */
133 #endif
134 
135 
136 #endif /* HWLOC_INTEL_MIC_H */
Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux...
Definition: hwloc.h:336
-
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
-
Structure of a topology object.
Definition: hwloc.h:381
-
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
static hwloc_obj_t hwloc_intel_mic_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)
Get the hwloc OS device object corresponding to the MIC device for the given index.
Definition: intel-mic.h:114
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
static int hwloc_intel_mic_get_device_cpuset(hwloc_topology_t topology, int idx, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to MIC device whose index is idx...
Definition: intel-mic.h:60
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
+
1 /*
+
2  * Copyright © 2009 CNRS
+
3  * Copyright © 2009-2016 Inria. All rights reserved.
+
4  * Copyright © 2009-2010 Université Bordeaux
+
5  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
+
6  * See COPYING in top-level directory.
+
7  */
+
8 
+
19 #ifndef HWLOC_OPENFABRICS_VERBS_H
+
20 #define HWLOC_OPENFABRICS_VERBS_H
+
21 
+
22 #include "hwloc.h"
+
23 #include "hwloc/autogen/config.h"
+
24 #ifdef HWLOC_LINUX_SYS
+
25 #include "hwloc/linux.h"
+
26 #endif
+
27 
+
28 #include <infiniband/verbs.h>
+
29 
+
30 
+
31 #ifdef __cplusplus
+
32 extern "C" {
+
33 #endif
+
34 
+
35 
+
61 static __hwloc_inline int
+
62 hwloc_ibv_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
+
63  struct ibv_device *ibdev, hwloc_cpuset_t set)
+
64 {
+
65 #ifdef HWLOC_LINUX_SYS
+
66  /* If we're on Linux, use the verbs-provided sysfs mechanism to
+
67  get the local cpus */
+
68 #define HWLOC_OPENFABRICS_VERBS_SYSFS_PATH_MAX 128
+
69  char path[HWLOC_OPENFABRICS_VERBS_SYSFS_PATH_MAX];
+
70 
+
71  if (!hwloc_topology_is_thissystem(topology)) {
+
72  errno = EINVAL;
+
73  return -1;
+
74  }
+
75 
+
76  sprintf(path, "/sys/class/infiniband/%s/device/local_cpus",
+
77  ibv_get_device_name(ibdev));
+
78  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
+
79  || hwloc_bitmap_iszero(set))
+ +
81 #else
+
82  /* Non-Linux systems simply get a full cpuset */
+ +
84 #endif
+
85  return 0;
+
86 }
+
87 
+
104 static __hwloc_inline hwloc_obj_t
+ +
106  const char *ibname)
+
107 {
+
108  hwloc_obj_t osdev = NULL;
+
109  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
+ +
111  && osdev->name && !strcmp(ibname, osdev->name))
+
112  return osdev;
+
113  }
+
114  return NULL;
+
115 }
+
116 
+
131 static __hwloc_inline hwloc_obj_t
+ +
133  struct ibv_device *ibdev)
+
134 {
+
135  if (!hwloc_topology_is_thissystem(topology)) {
+
136  errno = EINVAL;
+
137  return NULL;
+
138  }
+
139  return hwloc_ibv_get_device_osdev_by_name(topology, ibv_get_device_name(ibdev));
+
140 }
+
141 
+
145 #ifdef __cplusplus
+
146 } /* extern "C" */
+
147 #endif
+
148 
+
149 
+
150 #endif /* HWLOC_OPENFABRICS_VERBS_H */
+
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
+
@ HWLOC_OBJ_OSDEV_OPENFABRICS
Operating system openfabrics device. For instance the "mlx4_0" InfiniBand HCA, or "hfi1_0" Omni-Path ...
Definition: hwloc.h:335
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
+
static hwloc_obj_t hwloc_ibv_get_device_osdev(hwloc_topology_t topology, struct ibv_device *ibdev)
Get the hwloc OS device object corresponding to the OpenFabrics device ibdev.
Definition: openfabrics-verbs.h:132
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
static int hwloc_ibv_get_device_cpuset(hwloc_topology_t topology, struct ibv_device *ibdev, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device ibdev.
Definition: openfabrics-verbs.h:62
+
Structure of a topology object.
Definition: hwloc.h:384
+
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:396
+
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1151
+
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
+
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
+
static hwloc_obj_t hwloc_ibv_get_device_osdev_by_name(hwloc_topology_t topology, const char *ibname)
Get the hwloc OS device object corresponding to the OpenFabrics device named ibname.
Definition: openfabrics-verbs.h:105
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00167_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00167_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00167_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00167_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): openfabrics-verbs.h Source File +Hardware Locality (hwloc): diff.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
openfabrics-verbs.h
+
diff.h
-
1 /*
2  * Copyright © 2009 CNRS
3  * Copyright © 2009-2016 Inria. All rights reserved.
4  * Copyright © 2009-2010 Université Bordeaux
5  * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
6  * See COPYING in top-level directory.
7  */
8 
19 #ifndef HWLOC_OPENFABRICS_VERBS_H
20 #define HWLOC_OPENFABRICS_VERBS_H
21 
22 #include "hwloc.h"
23 #include "hwloc/autogen/config.h"
24 #ifdef HWLOC_LINUX_SYS
25 #include "hwloc/linux.h"
26 #endif
27 
28 #include <infiniband/verbs.h>
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
61 static __hwloc_inline int
62 hwloc_ibv_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused,
63  struct ibv_device *ibdev, hwloc_cpuset_t set)
64 {
65 #ifdef HWLOC_LINUX_SYS
66  /* If we're on Linux, use the verbs-provided sysfs mechanism to
67  get the local cpus */
68 #define HWLOC_OPENFABRICS_VERBS_SYSFS_PATH_MAX 128
69  char path[HWLOC_OPENFABRICS_VERBS_SYSFS_PATH_MAX];
70 
71  if (!hwloc_topology_is_thissystem(topology)) {
72  errno = EINVAL;
73  return -1;
74  }
75 
76  sprintf(path, "/sys/class/infiniband/%s/device/local_cpus",
77  ibv_get_device_name(ibdev));
78  if (hwloc_linux_read_path_as_cpumask(path, set) < 0
79  || hwloc_bitmap_iszero(set))
81 #else
82  /* Non-Linux systems simply get a full cpuset */
84 #endif
85  return 0;
86 }
87 
104 static __hwloc_inline hwloc_obj_t
106  const char *ibname)
107 {
108  hwloc_obj_t osdev = NULL;
109  while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) {
111  && osdev->name && !strcmp(ibname, osdev->name))
112  return osdev;
113  }
114  return NULL;
115 }
116 
131 static __hwloc_inline hwloc_obj_t
133  struct ibv_device *ibdev)
134 {
135  if (!hwloc_topology_is_thissystem(topology)) {
136  errno = EINVAL;
137  return NULL;
138  }
139  return hwloc_ibv_get_device_osdev_by_name(topology, ibv_get_device_name(ibdev));
140 }
141 
145 #ifdef __cplusplus
146 } /* extern "C" */
147 #endif
148 
149 
150 #endif /* HWLOC_OPENFABRICS_VERBS_H */
static hwloc_obj_t hwloc_ibv_get_device_osdev_by_name(hwloc_topology_t topology, const char *ibname)
Get the hwloc OS device object corresponding to the OpenFabrics device named ibname.
Definition: openfabrics-verbs.h:105
-
static hwloc_obj_t hwloc_ibv_get_device_osdev(hwloc_topology_t topology, struct ibv_device *ibdev)
Get the hwloc OS device object corresponding to the OpenFabrics device ibdev.
Definition: openfabrics-verbs.h:132
-
static int hwloc_ibv_get_device_cpuset(hwloc_topology_t topology, struct ibv_device *ibdev, hwloc_cpuset_t set)
Get the CPU set of logical processors that are physically close to device ibdev.
Definition: openfabrics-verbs.h:62
-
int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst.
-
Operating system openfabrics device. For instance the "mlx4_0" InfiniBand HCA, or "hfi1_0" Omni-Path ...
Definition: hwloc.h:331
-
Structure of a topology object.
Definition: hwloc.h:381
-
int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)
Does the topology context come from this system?
-
static hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)
Get the next OS device in the system.
Definition: helper.h:1129
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
char * name
Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...
Definition: hwloc.h:393
-
int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)
Convert a linux kernel cpumask file path into a hwloc bitmap set.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
-
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)
Test whether bitmap bitmap is empty.
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
+
1 /*
+
2  * Copyright © 2013-2018 Inria. All rights reserved.
+
3  * See COPYING in top-level directory.
+
4  */
+
5 
+
10 #ifndef HWLOC_DIFF_H
+
11 #define HWLOC_DIFF_H
+
12 
+
13 #ifndef HWLOC_H
+
14 #error Please include the main hwloc.h instead
+
15 #endif
+
16 
+
17 
+
18 #ifdef __cplusplus
+
19 extern "C" {
+
20 #elif 0
+
21 }
+
22 #endif
+
23 
+
24 
+ + +
68 
+ + + +
80 
+ + +
85  /* each part of the union must start with these */
+ +
87  } generic;
+
88 
+ +
91  /* used for storing integer attributes */
+ +
93  hwloc_uint64_t index; /* not used for SIZE */
+
94  hwloc_uint64_t oldvalue;
+
95  hwloc_uint64_t newvalue;
+
96  } uint64;
+
97 
+ +
100  /* used for storing name and info pairs */
+ +
102  char *name; /* not used for NAME */
+
103  char *oldvalue;
+
104  char *newvalue;
+
105  } string;
+
106 };
+
107 
+
108 
+ + +
116 
+ + +
126 
+
129 typedef union hwloc_topology_diff_u {
+ +
131  /* each part of the union must start with these */
+ +
133  union hwloc_topology_diff_u * next; /* pointer to the next element of the list, or NULL */
+
134  } generic;
+
135 
+
136  /* A difference in an object attribute. */
+ +
138  hwloc_topology_diff_type_t type; /* must be ::HWLOC_TOPOLOGY_DIFF_OBJ_ATTR */
+ +
140  /* List of attribute differences for a single object */
+ +
142  unsigned obj_index;
+ +
144  } obj_attr;
+
145 
+
146  /* A difference that is too complex. */
+ +
148  hwloc_topology_diff_type_t type; /* must be ::HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX */
+ +
150  /* Where we had to stop computing the diff in the first topology */
+ +
152  unsigned obj_index;
+
153  } too_complex;
+ +
155 
+
156 
+
194 HWLOC_DECLSPEC int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff);
+
195 
+ + +
203 };
+
204 
+
222 HWLOC_DECLSPEC int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags);
+
223 
+
226 HWLOC_DECLSPEC int hwloc_topology_diff_destroy(hwloc_topology_diff_t diff);
+
227 
+
239 HWLOC_DECLSPEC int hwloc_topology_diff_load_xml(const char *xmlpath, hwloc_topology_diff_t *diff, char **refname);
+
240 
+
250 HWLOC_DECLSPEC int hwloc_topology_diff_export_xml(hwloc_topology_diff_t diff, const char *refname, const char *xmlpath);
+
251 
+
263 HWLOC_DECLSPEC int hwloc_topology_diff_load_xmlbuffer(const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname);
+
264 
+
279 HWLOC_DECLSPEC int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen);
+
280 
+
284 #ifdef __cplusplus
+
285 } /* extern "C" */
+
286 #endif
+
287 
+
288 
+
289 #endif /* HWLOC_DIFF_H */
+
union hwloc_topology_diff_u * hwloc_topology_diff_t
One element of a difference list between two topologies.
+
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s string
+ +
union hwloc_topology_diff_u * next
Definition: diff.h:149
+
@ HWLOC_TOPOLOGY_DIFF_OBJ_ATTR
An object attribute was changed. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_o...
Definition: diff.h:115
+
hwloc_topology_diff_type_t type
Definition: diff.h:138
+ +
int hwloc_topology_diff_destroy(hwloc_topology_diff_t diff)
Destroy a list of topology differences.
+
hwloc_topology_diff_apply_flags_e
Flags to be given to hwloc_topology_diff_apply().
Definition: diff.h:198
+
hwloc_topology_diff_obj_attr_type_e
Type of one object attribute difference.
Definition: diff.h:62
+
union hwloc_topology_diff_u * next
Definition: diff.h:139
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
@ HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME
The object name is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_a...
Definition: diff.h:74
+
One element of a difference list between two topologies.
Definition: diff.h:129
+
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s uint64
+
hwloc_topology_diff_type_e
Type of one element of a difference list.
Definition: diff.h:111
+ +
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:86
+
int hwloc_topology_diff_load_xml(const char *xmlpath, hwloc_topology_diff_t *diff, char **refname)
Load a list of topology differences from a XML file.
+ +
int hwloc_topology_diff_load_xmlbuffer(const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname)
Load a list of topology differences from a XML buffer.
+
hwloc_topology_diff_type_t type
Definition: diff.h:132
+ +
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:101
+ +
int hwloc_topology_diff_export_xml(hwloc_topology_diff_t diff, const char *refname, const char *xmlpath)
Export a list of topology differences to a XML file.
+
enum hwloc_topology_diff_type_e hwloc_topology_diff_type_t
Type of one element of a difference list.
+
int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff)
Compute the difference between 2 topologies.
+
@ HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO
the value of an info attribute is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topo...
Definition: diff.h:78
+
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:92
+ + + +
union hwloc_topology_diff_u * next
Definition: diff.h:133
+
int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen)
Export a list of topology differences to a XML buffer.
+
String attribute modification with an optional name.
Definition: diff.h:99
+
@ HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX
The difference is too complex, it cannot be represented. The difference below this object has not bee...
Definition: diff.h:124
+
One object attribute difference.
Definition: diff.h:83
+
enum hwloc_topology_diff_obj_attr_type_e hwloc_topology_diff_obj_attr_type_t
Type of one object attribute difference.
+ +
int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags)
Apply a topology diff to an existing topology.
+ +
@ HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE
Apply topology diff in reverse direction.
Definition: diff.h:202
+
Integer attribute modification with an optional index.
Definition: diff.h:90
+ + + +
hwloc_topology_diff_type_t type
Definition: diff.h:148
+
@ HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE
The object local memory is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_di...
Definition: diff.h:67
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00170_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00170_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00170_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00170_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): diff.h Source File +Hardware Locality (hwloc): shmem.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
diff.h
+
shmem.h
-
1 /*
2  * Copyright © 2013-2018 Inria. All rights reserved.
3  * See COPYING in top-level directory.
4  */
5 
10 #ifndef HWLOC_DIFF_H
11 #define HWLOC_DIFF_H
12 
13 #ifndef HWLOC_H
14 #error Please include the main hwloc.h instead
15 #endif
16 
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #elif 0
21 }
22 #endif
23 
24 
68 
80 
85  /* each part of the union must start with these */
87  } generic;
88 
91  /* used for storing integer attributes */
93  hwloc_uint64_t index; /* not used for SIZE */
94  hwloc_uint64_t oldvalue;
95  hwloc_uint64_t newvalue;
96  } uint64;
97 
100  /* used for storing name and info pairs */
102  char *name; /* not used for NAME */
103  char *oldvalue;
104  char *newvalue;
105  } string;
106 };
107 
108 
116 
126 
129 typedef union hwloc_topology_diff_u {
131  /* each part of the union must start with these */
133  union hwloc_topology_diff_u * next; /* pointer to the next element of the list, or NULL */
134  } generic;
135 
136  /* A difference in an object attribute. */
138  hwloc_topology_diff_type_t type; /* must be ::HWLOC_TOPOLOGY_DIFF_OBJ_ATTR */
140  /* List of attribute differences for a single object */
142  unsigned obj_index;
144  } obj_attr;
145 
146  /* A difference that is too complex. */
148  hwloc_topology_diff_type_t type; /* must be ::HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX */
150  /* Where we had to stop computing the diff in the first topology */
152  unsigned obj_index;
153  } too_complex;
155 
156 
194 HWLOC_DECLSPEC int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff);
195 
203 };
204 
222 HWLOC_DECLSPEC int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags);
223 
226 HWLOC_DECLSPEC int hwloc_topology_diff_destroy(hwloc_topology_diff_t diff);
227 
239 HWLOC_DECLSPEC int hwloc_topology_diff_load_xml(const char *xmlpath, hwloc_topology_diff_t *diff, char **refname);
240 
250 HWLOC_DECLSPEC int hwloc_topology_diff_export_xml(hwloc_topology_diff_t diff, const char *refname, const char *xmlpath);
251 
263 HWLOC_DECLSPEC int hwloc_topology_diff_load_xmlbuffer(const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname);
264 
279 HWLOC_DECLSPEC int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen);
280 
284 #ifdef __cplusplus
285 } /* extern "C" */
286 #endif
287 
288 
289 #endif /* HWLOC_DIFF_H */
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:101
-
int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen)
Export a list of topology differences to a XML buffer.
-
Apply topology diff in reverse direction.
Definition: diff.h:202
- -
hwloc_topology_diff_type_t type
Definition: diff.h:132
-
Integer attribute modification with an optional index.
Definition: diff.h:90
- - -
One element of a difference list between two topologies.
Definition: diff.h:129
-
the value of an info attribute is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topo...
Definition: diff.h:78
- -
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:92
-
hwloc_topology_diff_type_e
Type of one element of a difference list.
Definition: diff.h:111
- - -
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s string
-
union hwloc_topology_diff_u * next
Definition: diff.h:133
-
hwloc_topology_diff_type_t type
Definition: diff.h:138
-
hwloc_topology_diff_apply_flags_e
Flags to be given to hwloc_topology_diff_apply().
Definition: diff.h:198
- - -
An object attribute was changed. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_o...
Definition: diff.h:115
-
The difference is too complex, it cannot be represented. The difference below this object has not bee...
Definition: diff.h:124
- -
enum hwloc_topology_diff_type_e hwloc_topology_diff_type_t
Type of one element of a difference list.
-
The object name is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_a...
Definition: diff.h:74
-
enum hwloc_topology_diff_obj_attr_type_e hwloc_topology_diff_obj_attr_type_t
Type of one object attribute difference.
-
union hwloc_topology_diff_u * next
Definition: diff.h:139
-
int hwloc_topology_diff_load_xmlbuffer(const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname)
Load a list of topology differences from a XML buffer.
- -
int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags)
Apply a topology diff to an existing topology.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
- -
union hwloc_topology_diff_u * next
Definition: diff.h:149
-
union hwloc_topology_diff_u * hwloc_topology_diff_t
One element of a difference list between two topologies.
- -
int hwloc_topology_diff_load_xml(const char *xmlpath, hwloc_topology_diff_t *diff, char **refname)
Load a list of topology differences from a XML file.
-
hwloc_topology_diff_type_t type
Definition: diff.h:148
-
The object local memory is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_di...
Definition: diff.h:67
-
int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff)
Compute the difference between 2 topologies.
-
String attribute modification with an optional name.
Definition: diff.h:99
-
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s uint64
- -
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:86
-
hwloc_topology_diff_obj_attr_type_e
Type of one object attribute difference.
Definition: diff.h:62
-
int hwloc_topology_diff_export_xml(hwloc_topology_diff_t diff, const char *refname, const char *xmlpath)
Export a list of topology differences to a XML file.
-
int hwloc_topology_diff_destroy(hwloc_topology_diff_t diff)
Destroy a list of topology differences.
-
One object attribute difference.
Definition: diff.h:83
- +
1 /*
+
2  * Copyright © 2013-2018 Inria. All rights reserved.
+
3  * See COPYING in top-level directory.
+
4  */
+
5 
+
10 #ifndef HWLOC_SHMEM_H
+
11 #define HWLOC_SHMEM_H
+
12 
+
13 #include "hwloc.h"
+
14 
+
15 #ifdef __cplusplus
+
16 extern "C" {
+
17 #elif 0
+
18 }
+
19 #endif
+
20 
+
21 
+
53 HWLOC_DECLSPEC int hwloc_shmem_topology_get_length(hwloc_topology_t topology,
+
54  size_t *lengthp,
+
55  unsigned long flags);
+
56 
+
82 HWLOC_DECLSPEC int hwloc_shmem_topology_write(hwloc_topology_t topology,
+
83  int fd, hwloc_uint64_t fileoffset,
+
84  void *mmap_address, size_t length,
+
85  unsigned long flags);
+
86 
+
125 HWLOC_DECLSPEC int hwloc_shmem_topology_adopt(hwloc_topology_t *topologyp,
+
126  int fd, hwloc_uint64_t fileoffset,
+
127  void *mmap_address, size_t length,
+
128  unsigned long flags);
+
132 #ifdef __cplusplus
+
133 } /* extern "C" */
+
134 #endif
+
135 
+
136 
+
137 #endif /* HWLOC_SHMEM_H */
+
int hwloc_shmem_topology_get_length(hwloc_topology_t topology, size_t *lengthp, unsigned long flags)
Get the required shared memory length for storing a topology.
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
int hwloc_shmem_topology_adopt(hwloc_topology_t *topologyp, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
Adopt a shared memory topology stored in a file.
+
int hwloc_shmem_topology_write(hwloc_topology_t topology, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
Duplicate a topology to a shared memory file.
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00173_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00173_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00173_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00173_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): shmem.h Source File +Hardware Locality (hwloc): plugins.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
-
shmem.h
+
plugins.h
-
1 /*
2  * Copyright © 2013-2018 Inria. All rights reserved.
3  * See COPYING in top-level directory.
4  */
5 
10 #ifndef HWLOC_SHMEM_H
11 #define HWLOC_SHMEM_H
12 
13 #include "hwloc.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #elif 0
18 }
19 #endif
20 
21 
53 HWLOC_DECLSPEC int hwloc_shmem_topology_get_length(hwloc_topology_t topology,
54  size_t *lengthp,
55  unsigned long flags);
56 
82 HWLOC_DECLSPEC int hwloc_shmem_topology_write(hwloc_topology_t topology,
83  int fd, hwloc_uint64_t fileoffset,
84  void *mmap_address, size_t length,
85  unsigned long flags);
86 
125 HWLOC_DECLSPEC int hwloc_shmem_topology_adopt(hwloc_topology_t *topologyp,
126  int fd, hwloc_uint64_t fileoffset,
127  void *mmap_address, size_t length,
128  unsigned long flags);
132 #ifdef __cplusplus
133 } /* extern "C" */
134 #endif
135 
136 
137 #endif /* HWLOC_SHMEM_H */
int hwloc_shmem_topology_get_length(hwloc_topology_t topology, size_t *lengthp, unsigned long flags)
Get the required shared memory length for storing a topology.
-
int hwloc_shmem_topology_write(hwloc_topology_t topology, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
Duplicate a topology to a shared memory file.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
int hwloc_shmem_topology_adopt(hwloc_topology_t *topologyp, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
Adopt a shared memory topology stored in a file.
+
1 /*
+
2  * Copyright © 2013-2020 Inria. All rights reserved.
+
3  * Copyright © 2016 Cisco Systems, Inc. All rights reserved.
+
4  * See COPYING in top-level directory.
+
5  */
+
6 
+
7 #ifndef HWLOC_PLUGINS_H
+
8 #define HWLOC_PLUGINS_H
+
9 
+
14 struct hwloc_backend;
+
15 
+
16 #include "hwloc.h"
+
17 
+
18 #ifdef HWLOC_INSIDE_PLUGIN
+
19 /* needed for hwloc_plugin_check_namespace() */
+
20 #ifdef HWLOC_HAVE_LTDL
+
21 #include <ltdl.h>
+
22 #else
+
23 #include <dlfcn.h>
+
24 #endif
+
25 #endif
+
26 
+
27 
+
28 
+ +
42  const char *name;
+
43 
+
47  unsigned phases;
+
48 
+
57  unsigned excluded_phases;
+
58 
+
62  struct hwloc_backend * (*instantiate)(struct hwloc_topology *topology, struct hwloc_disc_component *component, unsigned excluded_phases, const void *data1, const void *data2, const void *data3);
+
63 
+
76  unsigned priority;
+
77 
+ +
82 
+
87  struct hwloc_disc_component * next;
+
88 };
+
89 
+
100 typedef enum hwloc_disc_phase_e {
+ +
106 
+ +
110 
+ +
114 
+ +
118 
+ +
122 
+ +
126 
+ +
130 
+ + +
138 
+ + +
143 };
+
144 
+ + +
155 
+
159  unsigned excluded_phases;
+
160 
+
162  unsigned long flags;
+
163 };
+
164 
+ +
185  struct hwloc_disc_component * component;
+
187  struct hwloc_topology * topology;
+
189  int envvar_forced;
+
191  struct hwloc_backend * next;
+
192 
+
196  unsigned phases;
+
197 
+
199  unsigned long flags;
+
200 
+ +
208 
+
210  void * private_data;
+
214  void (*disable)(struct hwloc_backend *backend);
+
215 
+
221  int (*discover)(struct hwloc_backend *backend, struct hwloc_disc_status *status);
+
222 
+
227  int (*get_pci_busid_cpuset)(struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset);
+
228 };
+
229 
+
233 HWLOC_DECLSPEC struct hwloc_backend * hwloc_backend_alloc(struct hwloc_topology *topology, struct hwloc_disc_component *component);
+
234 
+
236 HWLOC_DECLSPEC int hwloc_backend_enable(struct hwloc_backend *backend);
+
237 
+ + +
251 
+ + +
255 
+ +
263  unsigned abi;
+
264 
+
282  int (*init)(unsigned long flags);
+
283 
+
295  void (*finalize)(unsigned long flags);
+
296 
+ +
299 
+
301  unsigned long flags;
+
302 
+
304  void * data;
+
305 };
+
306 
+
340 HWLOC_DECLSPEC struct hwloc_obj *hwloc_insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t obj);
+
341 
+
343 typedef void (*hwloc_report_error_t)(const char * msg, int line);
+
345 HWLOC_DECLSPEC void hwloc_report_os_error(const char * msg, int line);
+
347 HWLOC_DECLSPEC int hwloc_hide_errors(void);
+
348 
+
355 HWLOC_DECLSPEC struct hwloc_obj *hwloc__insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t root, hwloc_obj_t obj, hwloc_report_error_t report_error);
+
356 
+
373 HWLOC_DECLSPEC void hwloc_insert_object_by_parent(struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj);
+
374 
+ +
380 
+
389 HWLOC_DECLSPEC int hwloc_obj_add_children_sets(hwloc_obj_t obj);
+
390 
+
398 HWLOC_DECLSPEC int hwloc_topology_reconnect(hwloc_topology_t topology, unsigned long flags __hwloc_attribute_unused);
+
399 
+
421 static __hwloc_inline int
+
422 hwloc_plugin_check_namespace(const char *pluginname __hwloc_attribute_unused, const char *symbol __hwloc_attribute_unused)
+
423 {
+
424 #ifdef HWLOC_INSIDE_PLUGIN
+
425  void *sym;
+
426 #ifdef HWLOC_HAVE_LTDL
+
427  lt_dlhandle handle = lt_dlopen(NULL);
+
428 #else
+
429  void *handle = dlopen(NULL, RTLD_NOW|RTLD_LOCAL);
+
430 #endif
+
431  if (!handle)
+
432  /* cannot check, assume things will work */
+
433  return 0;
+
434 #ifdef HWLOC_HAVE_LTDL
+
435  sym = lt_dlsym(handle, symbol);
+
436  lt_dlclose(handle);
+
437 #else
+
438  sym = dlsym(handle, symbol);
+
439  dlclose(handle);
+
440 #endif
+
441  if (!sym) {
+
442  static int verboseenv_checked = 0;
+
443  static int verboseenv_value = 0;
+
444  if (!verboseenv_checked) {
+
445  const char *verboseenv = getenv("HWLOC_PLUGINS_VERBOSE");
+
446  verboseenv_value = verboseenv ? atoi(verboseenv) : 0;
+
447  verboseenv_checked = 1;
+
448  }
+
449  if (verboseenv_value)
+
450  fprintf(stderr, "Plugin `%s' disabling itself because it cannot find the `%s' core symbol.\n",
+
451  pluginname, symbol);
+
452  return -1;
+
453  }
+
454 #endif /* HWLOC_INSIDE_PLUGIN */
+
455  return 0;
+
456 }
+
457 
+
471 static __hwloc_inline int
+ +
473 {
+
474  unsigned baseclass = classid >> 8;
+
475  return (baseclass == 0x03 /* PCI_BASE_CLASS_DISPLAY */
+
476  || baseclass == 0x02 /* PCI_BASE_CLASS_NETWORK */
+
477  || baseclass == 0x01 /* PCI_BASE_CLASS_STORAGE */
+
478  || baseclass == 0x0b /* PCI_BASE_CLASS_PROCESSOR */
+
479  || classid == 0x0c04 /* PCI_CLASS_SERIAL_FIBER */
+
480  || classid == 0x0c06 /* PCI_CLASS_SERIAL_INFINIBAND */
+
481  || baseclass == 0x12 /* Processing Accelerators */);
+
482 }
+
483 
+
488 static __hwloc_inline int
+ +
490 {
+
491  return (subtype != HWLOC_OBJ_OSDEV_DMA);
+
492 }
+
493 
+
500 static __hwloc_inline int
+ +
502 {
+ +
504  hwloc_topology_get_type_filter(topology, type, &filter);
+
505  assert(filter != HWLOC_TYPE_FILTER_KEEP_IMPORTANT); /* IMPORTANT only used for I/O */
+
506  return filter == HWLOC_TYPE_FILTER_KEEP_NONE ? 0 : 1;
+
507 }
+
508 
+
513 static __hwloc_inline int
+ +
515 {
+
516  hwloc_obj_type_t type = obj->type;
+ +
518  hwloc_topology_get_type_filter(topology, type, &filter);
+
519  if (filter == HWLOC_TYPE_FILTER_KEEP_NONE)
+
520  return 0;
+
521  if (filter == HWLOC_TYPE_FILTER_KEEP_IMPORTANT) {
+
522  if (type == HWLOC_OBJ_PCI_DEVICE)
+ +
524  if (type == HWLOC_OBJ_OS_DEVICE)
+ +
526  }
+
527  return 1;
+
528 }
+
529 
+
543 HWLOC_DECLSPEC unsigned hwloc_pcidisc_find_cap(const unsigned char *config, unsigned cap);
+
544 
+
550 HWLOC_DECLSPEC int hwloc_pcidisc_find_linkspeed(const unsigned char *config, unsigned offset, float *linkspeed);
+
551 
+
556 HWLOC_DECLSPEC hwloc_obj_type_t hwloc_pcidisc_check_bridge_type(unsigned device_class, const unsigned char *config);
+
557 
+
564 HWLOC_DECLSPEC int hwloc_pcidisc_find_bridge_buses(unsigned domain, unsigned bus, unsigned dev, unsigned func,
+
565  unsigned *secondary_busp, unsigned *subordinate_busp,
+
566  const unsigned char *config);
+
567 
+
572 HWLOC_DECLSPEC void hwloc_pcidisc_tree_insert_by_busid(struct hwloc_obj **treep, struct hwloc_obj *obj);
+
573 
+
579 HWLOC_DECLSPEC int hwloc_pcidisc_tree_attach(struct hwloc_topology *topology, struct hwloc_obj *tree);
+
580 
+
597 HWLOC_DECLSPEC struct hwloc_obj * hwloc_pci_find_parent_by_busid(struct hwloc_topology *topology, unsigned domain, unsigned bus, unsigned dev, unsigned func);
+
598 
+
604 #endif /* HWLOC_PLUGINS_H */
+
unsigned long flags
Backend flags, currently always 0.
Definition: plugins.h:199
+
enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_t
Type of a OS device.
+
int(* discover)(struct hwloc_backend *backend, struct hwloc_disc_status *status)
Main discovery callback. returns -1 on error, either because it couldn't add its objects ot the exist...
Definition: plugins.h:221
+
hwloc_disc_phase_e
Discovery phase.
Definition: plugins.h:100
+
struct hwloc_obj * hwloc_pci_find_parent_by_busid(struct hwloc_topology *topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the normal parent of a PCI bus ID.
+
@ HWLOC_OBJ_PCI_DEVICE
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:266
+
void hwloc_pcidisc_tree_insert_by_busid(struct hwloc_obj **treep, struct hwloc_obj *obj)
Insert a PCI object in the given PCI tree by looking at PCI bus IDs.
+
void hwloc_insert_object_by_parent(struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj)
Insert an object somewhere in the topology.
+
void hwloc_report_os_error(const char *msg, int line)
Report an insertion error from a backend.
+
unsigned long flags
OR'ed set of hwloc_disc_status_flag_e.
Definition: plugins.h:162
+
hwloc_obj_type_t hwloc_pcidisc_check_bridge_type(unsigned device_class, const unsigned char *config)
Return the hwloc object type (PCI device or Bridge) for the given class and configuration space.
+
static int hwloc_filter_check_pcidev_subtype_important(unsigned classid)
Check whether the given PCI device classid is important.
Definition: plugins.h:472
+
hwloc_obj_osdev_type_t type
Definition: hwloc.h:652
+
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine,...
Definition: hwloc.h:389
+
hwloc_component_type_t type
Component type.
Definition: plugins.h:298
+
const char * name
Name. If this component is built as a plugin, this name does not have to match the plugin filename.
Definition: plugins.h:42
+
@ HWLOC_DISC_PHASE_GLOBAL
xml or synthetic, platform-specific components such as bgq. Discovers everything including CPU,...
Definition: plugins.h:105
+
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
+
unsigned short class_id
Definition: hwloc.h:626
+
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:386
+
unsigned hwloc_pcidisc_find_cap(const unsigned char *config, unsigned cap)
Return the offset of the given capability in the PCI config space buffer.
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
@ HWLOC_OBJ_OS_DEVICE
Operating system device (filtered out by default). They are not added to the topology unless I/O disc...
Definition: hwloc.h:273
+
static int hwloc_filter_check_keep_object(hwloc_topology_t topology, hwloc_obj_t obj)
Check whether the given object should be filtered-out.
Definition: plugins.h:514
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
hwloc_component_type_e
Generic component type.
Definition: plugins.h:248
+
unsigned long flags
Component flags, unused for now.
Definition: plugins.h:301
+
Generic component structure.
Definition: plugins.h:261
+
int hwloc_pcidisc_find_linkspeed(const unsigned char *config, unsigned offset, float *linkspeed)
Fill linkspeed by reading the PCI config space where PCI_CAP_ID_EXP is at position offset.
+
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
+
static int hwloc_filter_check_keep_object_type(hwloc_topology_t topology, hwloc_obj_type_t type)
Check whether a non-I/O object type should be filtered-out.
Definition: plugins.h:501
+
void(* disable)(struct hwloc_backend *backend)
Callback for freeing the private_data. May be NULL.
Definition: plugins.h:214
+
int hwloc_pcidisc_tree_attach(struct hwloc_topology *topology, struct hwloc_obj *tree)
Add some hostbridges on top of the given tree of PCI objects and attach them to the topology.
+
Structure of a topology object.
Definition: hwloc.h:384
+
@ HWLOC_DISC_PHASE_ANNOTATE
Annotating existing objects, adding distances, etc.
Definition: plugins.h:129
+
struct hwloc_obj * hwloc_insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t obj)
Add an object to the topology.
+
struct hwloc_obj * hwloc__insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t root, hwloc_obj_t obj, hwloc_report_error_t report_error)
Add an object to the topology and specify which error callback to use.
+
@ HWLOC_COMPONENT_TYPE_XML
The data field must point to a struct hwloc_xml_component.
Definition: plugins.h:253
+
hwloc_disc_status_flag_e
Discovery status flags.
Definition: plugins.h:140
+
Discovery backend structure.
Definition: plugins.h:183
+
@ HWLOC_DISC_PHASE_PCI
Attach PCI devices and bridges to existing CPU objects.
Definition: plugins.h:117
+
@ HWLOC_DISC_PHASE_MEMORY
Attach memory to existing CPU objects.
Definition: plugins.h:113
+
unsigned phases
Discovery phases performed by this component, possibly without some of them if excluded by other comp...
Definition: plugins.h:196
+
unsigned abi
Component ABI version, set to HWLOC_COMPONENT_ABI.
Definition: plugins.h:263
+
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:434
+
@ HWLOC_DISC_PHASE_MISC
Misc objects that gets added below anything else.
Definition: plugins.h:125
+
@ HWLOC_TYPE_FILTER_KEEP_IMPORTANT
Only keep likely-important objects of the given type.
Definition: hwloc.h:2120
+
void(* finalize)(unsigned long flags)
Process-wide component termination callback.
Definition: plugins.h:295
+
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
+
struct hwloc_backend * hwloc_backend_alloc(struct hwloc_topology *topology, struct hwloc_disc_component *component)
Allocate a backend structure, set good default values, initialize backend->component and topology,...
+
void(* hwloc_report_error_t)(const char *msg, int line)
Type of error callbacks during object insertion.
Definition: plugins.h:343
+
@ HWLOC_OBJ_OSDEV_DMA
Operating system dma engine device. For instance the "dma0chan0" DMA channel on Linux.
Definition: hwloc.h:338
+
int hwloc_topology_get_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter)
Get the current filtering for the given object type.
+
hwloc_type_filter_e
Type filtering flags.
Definition: hwloc.h:2077
+
hwloc_obj_type_t
Type of topology object.
Definition: hwloc.h:176
+
static int hwloc_filter_check_osdev_subtype_important(hwloc_obj_osdev_type_t subtype)
Check whether the given OS device subtype is important.
Definition: plugins.h:489
+
enum hwloc_disc_phase_e hwloc_disc_phase_t
Discovery phase.
+
unsigned excluded_phases
Component phases to exclude, as an OR'ed set of hwloc_disc_phase_t.
Definition: plugins.h:57
+
hwloc_disc_phase_t phase
The current discovery phase that is performed. Must match one of the phases in the component phases f...
Definition: plugins.h:154
+
char * subtype
Subtype string to better describe the type field.
Definition: hwloc.h:387
+
Discovery component structure.
Definition: plugins.h:38
+
@ HWLOC_DISC_PHASE_TWEAK
Final tweaks to a ready-to-use topology. This phase runs once the topology is loaded,...
Definition: plugins.h:136
+
@ HWLOC_DISC_STATUS_FLAG_GOT_ALLOWED_RESOURCES
The sets of allowed resources were already retrieved.
Definition: plugins.h:142
+
int(* get_pci_busid_cpuset)(struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset)
Callback to retrieve the locality of a PCI object. Called by the PCI core when attaching PCI hierarch...
Definition: plugins.h:227
+
int hwloc_pcidisc_find_bridge_buses(unsigned domain, unsigned bus, unsigned dev, unsigned func, unsigned *secondary_busp, unsigned *subordinate_busp, const unsigned char *config)
Fills the attributes of the given PCI bridge using the given PCI config space.
+
hwloc_obj_t hwloc_alloc_setup_object(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned os_index)
Allocate and initialize an object of the given type and physical index.
+
unsigned phases
Discovery phases performed by this component. OR'ed set of hwloc_disc_phase_t.
Definition: plugins.h:47
+
@ HWLOC_COMPONENT_TYPE_DISC
The data field must point to a struct hwloc_disc_component.
Definition: plugins.h:250
+
@ HWLOC_TYPE_FILTER_KEEP_NONE
Ignore all objects of this type.
Definition: hwloc.h:2091
+
static int hwloc_plugin_check_namespace(const char *pluginname, const char *symbol)
Make sure that plugins can lookup core symbols.
Definition: plugins.h:422
+
@ HWLOC_DISC_PHASE_CPU
CPU discovery.
Definition: plugins.h:109
+
int hwloc_backend_enable(struct hwloc_backend *backend)
Enable a previously allocated and setup backend.
+
void * data
Component data, pointing to a struct hwloc_disc_component or struct hwloc_xml_component.
Definition: plugins.h:304
+
int hwloc_hide_errors(void)
Check whether insertion errors are hidden.
+
@ HWLOC_DISC_PHASE_IO
I/O discovery that requires PCI devices (OS devices such as OpenCL, CUDA, etc.).
Definition: plugins.h:121
+
unsigned excluded_phases
Dynamically excluded phases. If a component decides during discovery that some phases are no longer n...
Definition: plugins.h:159
+
void * private_data
Backend private data, or NULL if none.
Definition: plugins.h:210
+
enum hwloc_component_type_e hwloc_component_type_t
Generic component type.
+
unsigned enabled_by_default
Enabled by default. If unset, if will be disabled unless explicitly requested.
Definition: plugins.h:81
+
int hwloc_topology_reconnect(hwloc_topology_t topology, unsigned long flags)
Request a reconnection of children and levels in the topology.
+
Discovery status structure.
Definition: plugins.h:150
+
int hwloc_obj_add_children_sets(hwloc_obj_t obj)
Setup object cpusets/nodesets by OR'ing its children.
+
int is_thissystem
Backend-specific 'is_thissystem' property. Set to 0 if the backend disables the thissystem flag for t...
Definition: plugins.h:207
+
unsigned priority
Component priority. Used to sort topology->components, higher priority first. Also used to decide bet...
Definition: plugins.h:76
+
int(* init)(unsigned long flags)
Process-wide component initialization callback.
Definition: plugins.h:282
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00176_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00176_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00176_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00176_source.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): plugins.h Source File +Hardware Locality (hwloc): netloc.h Source File @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,113 +27,90 @@
- + +/* @license-end */
-
plugins.h
+
netloc.h
-
1 /*
2  * Copyright © 2013-2019 Inria. All rights reserved.
3  * Copyright © 2016 Cisco Systems, Inc. All rights reserved.
4  * See COPYING in top-level directory.
5  */
6 
7 #ifndef HWLOC_PLUGINS_H
8 #define HWLOC_PLUGINS_H
9 
14 struct hwloc_backend;
15 
16 #include "hwloc.h"
17 
18 #ifdef HWLOC_INSIDE_PLUGIN
19 /* needed for hwloc_plugin_check_namespace() */
20 #include <ltdl.h>
21 #endif
22 
23 
24 
38  const char *name;
39 
43  unsigned phases;
44 
53  unsigned excluded_phases;
54 
58  struct hwloc_backend * (*instantiate)(struct hwloc_topology *topology, struct hwloc_disc_component *component, unsigned excluded_phases, const void *data1, const void *data2, const void *data3);
59 
72  unsigned priority;
73 
78 
83  struct hwloc_disc_component * next;
84 };
85 
96 typedef enum hwloc_disc_phase_e {
102 
106 
110 
114 
118 
122 
126 
134 
139 };
140 
151 
155  unsigned excluded_phases;
156 
158  unsigned long flags;
159 };
160 
181  struct hwloc_disc_component * component;
183  struct hwloc_topology * topology;
185  int envvar_forced;
187  struct hwloc_backend * next;
188 
192  unsigned phases;
193 
195  unsigned long flags;
196 
204 
206  void * private_data;
210  void (*disable)(struct hwloc_backend *backend);
211 
217  int (*discover)(struct hwloc_backend *backend, struct hwloc_disc_status *status);
218 
223  int (*get_pci_busid_cpuset)(struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset);
224 };
225 
229 HWLOC_DECLSPEC struct hwloc_backend * hwloc_backend_alloc(struct hwloc_topology *topology, struct hwloc_disc_component *component);
230 
232 HWLOC_DECLSPEC int hwloc_backend_enable(struct hwloc_backend *backend);
233 
247 
251 
259  unsigned abi;
260 
278  int (*init)(unsigned long flags);
279 
291  void (*finalize)(unsigned long flags);
292 
294  hwloc_component_type_t type;
295 
297  unsigned long flags;
298 
300  void * data;
301 };
302 
336 HWLOC_DECLSPEC struct hwloc_obj *hwloc_insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t obj);
337 
339 typedef void (*hwloc_report_error_t)(const char * msg, int line);
341 HWLOC_DECLSPEC void hwloc_report_os_error(const char * msg, int line);
343 HWLOC_DECLSPEC int hwloc_hide_errors(void);
344 
351 HWLOC_DECLSPEC struct hwloc_obj *hwloc__insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t root, hwloc_obj_t obj, hwloc_report_error_t report_error);
352 
369 HWLOC_DECLSPEC void hwloc_insert_object_by_parent(struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj);
370 
376 
385 HWLOC_DECLSPEC int hwloc_obj_add_children_sets(hwloc_obj_t obj);
386 
394 HWLOC_DECLSPEC int hwloc_topology_reconnect(hwloc_topology_t topology, unsigned long flags __hwloc_attribute_unused);
395 
417 static __hwloc_inline int
418 hwloc_plugin_check_namespace(const char *pluginname __hwloc_attribute_unused, const char *symbol __hwloc_attribute_unused)
419 {
420 #ifdef HWLOC_INSIDE_PLUGIN
421  lt_dlhandle handle;
422  void *sym;
423  handle = lt_dlopen(NULL);
424  if (!handle)
425  /* cannot check, assume things will work */
426  return 0;
427  sym = lt_dlsym(handle, symbol);
428  lt_dlclose(handle);
429  if (!sym) {
430  static int verboseenv_checked = 0;
431  static int verboseenv_value = 0;
432  if (!verboseenv_checked) {
433  const char *verboseenv = getenv("HWLOC_PLUGINS_VERBOSE");
434  verboseenv_value = verboseenv ? atoi(verboseenv) : 0;
435  verboseenv_checked = 1;
436  }
437  if (verboseenv_value)
438  fprintf(stderr, "Plugin `%s' disabling itself because it cannot find the `%s' core symbol.\n",
439  pluginname, symbol);
440  return -1;
441  }
442 #endif /* HWLOC_INSIDE_PLUGIN */
443  return 0;
444 }
445 
459 static __hwloc_inline int
461 {
462  unsigned baseclass = classid >> 8;
463  return (baseclass == 0x03 /* PCI_BASE_CLASS_DISPLAY */
464  || baseclass == 0x02 /* PCI_BASE_CLASS_NETWORK */
465  || baseclass == 0x01 /* PCI_BASE_CLASS_STORAGE */
466  || baseclass == 0x0b /* PCI_BASE_CLASS_PROCESSOR */
467  || classid == 0x0c04 /* PCI_CLASS_SERIAL_FIBER */
468  || classid == 0x0c06 /* PCI_CLASS_SERIAL_INFINIBAND */
469  || baseclass == 0x12 /* Processing Accelerators */);
470 }
471 
476 static __hwloc_inline int
478 {
479  return (subtype != HWLOC_OBJ_OSDEV_DMA);
480 }
481 
488 static __hwloc_inline int
490 {
492  hwloc_topology_get_type_filter(topology, type, &filter);
493  assert(filter != HWLOC_TYPE_FILTER_KEEP_IMPORTANT); /* IMPORTANT only used for I/O */
494  return filter == HWLOC_TYPE_FILTER_KEEP_NONE ? 0 : 1;
495 }
496 
501 static __hwloc_inline int
503 {
504  hwloc_obj_type_t type = obj->type;
506  hwloc_topology_get_type_filter(topology, type, &filter);
507  if (filter == HWLOC_TYPE_FILTER_KEEP_NONE)
508  return 0;
509  if (filter == HWLOC_TYPE_FILTER_KEEP_IMPORTANT) {
510  if (type == HWLOC_OBJ_PCI_DEVICE)
512  if (type == HWLOC_OBJ_OS_DEVICE)
514  }
515  return 1;
516 }
517 
531 HWLOC_DECLSPEC unsigned hwloc_pcidisc_find_cap(const unsigned char *config, unsigned cap);
532 
538 HWLOC_DECLSPEC int hwloc_pcidisc_find_linkspeed(const unsigned char *config, unsigned offset, float *linkspeed);
539 
544 HWLOC_DECLSPEC hwloc_obj_type_t hwloc_pcidisc_check_bridge_type(unsigned device_class, const unsigned char *config);
545 
552 HWLOC_DECLSPEC int hwloc_pcidisc_find_bridge_buses(unsigned domain, unsigned bus, unsigned dev, unsigned func,
553  unsigned *secondary_busp, unsigned *subordinate_busp,
554  const unsigned char *config);
555 
560 HWLOC_DECLSPEC void hwloc_pcidisc_tree_insert_by_busid(struct hwloc_obj **treep, struct hwloc_obj *obj);
561 
567 HWLOC_DECLSPEC int hwloc_pcidisc_tree_attach(struct hwloc_topology *topology, struct hwloc_obj *tree);
568 
585 HWLOC_DECLSPEC struct hwloc_obj * hwloc_pci_find_parent_by_busid(struct hwloc_topology *topology, unsigned domain, unsigned bus, unsigned dev, unsigned func);
586 
592 #endif /* HWLOC_PLUGINS_H */
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:431
-
int is_thissystem
Backend-specific &#39;is_thissystem&#39; property. Set to 0 if the backend disables the thissystem flag for t...
Definition: plugins.h:203
-
Annotating existing objects, adding distances, etc.
Definition: plugins.h:125
-
hwloc_disc_status_flag_e
Discovery status flags.
Definition: plugins.h:136
-
static int hwloc_filter_check_keep_object(hwloc_topology_t topology, hwloc_obj_t obj)
Check whether the given object should be filtered-out.
Definition: plugins.h:502
-
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
-
unsigned excluded_phases
Component phases to exclude, as an OR&#39;ed set of hwloc_disc_phase_t.
Definition: plugins.h:53
-
Discovery backend structure.
Definition: plugins.h:179
-
Attach PCI devices and bridges to existing CPU objects.
Definition: plugins.h:113
-
Structure of a topology object.
Definition: hwloc.h:381
-
The sets of allowed resources were already retrieved.
Definition: plugins.h:138
-
static int hwloc_plugin_check_namespace(const char *pluginname, const char *symbol)
Make sure that plugins can lookup core symbols.
Definition: plugins.h:418
-
hwloc_obj_type_t
Definition: hwloc.h:177
-
void hwloc_pcidisc_tree_insert_by_busid(struct hwloc_obj **treep, struct hwloc_obj *obj)
Insert a PCI object in the given PCI tree by looking at PCI bus IDs.
-
Misc objects that gets added below anything else.
Definition: plugins.h:121
-
struct hwloc_backend * hwloc_backend_alloc(struct hwloc_topology *topology, struct hwloc_disc_component *component)
Allocate a backend structure, set good default values, initialize backend->component and topology...
-
unsigned phases
Discovery phases performed by this component, possibly without some of them if excluded by other comp...
Definition: plugins.h:192
-
Discovery status structure.
Definition: plugins.h:146
-
unsigned hwloc_pcidisc_find_cap(const unsigned char *config, unsigned cap)
Return the offset of the given capability in the PCI config space buffer.
-
I/O discovery that requires PCI devices (OS devices such as OpenCL, CUDA, etc.).
Definition: plugins.h:117
-
enum hwloc_component_type_e hwloc_component_type_t
Generic component type.
-
Ignore all objects of this type.
Definition: hwloc.h:2079
-
static int hwloc_filter_check_keep_object_type(hwloc_topology_t topology, hwloc_obj_type_t type)
Check whether a non-I/O object type should be filtered-out.
Definition: plugins.h:489
-
unsigned abi
Component ABI version, set to HWLOC_COMPONENT_ABI.
Definition: plugins.h:259
-
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
-
Only keep likely-important objects of the given type.
Definition: hwloc.h:2108
-
struct hwloc_obj * hwloc_pci_find_parent_by_busid(struct hwloc_topology *topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
Find the normal parent of a PCI bus ID.
-
void(* hwloc_report_error_t)(const char *msg, int line)
Type of error callbacks during object insertion.
Definition: plugins.h:339
-
const char * name
Name. If this component is built as a plugin, this name does not have to match the plugin filename...
Definition: plugins.h:38
-
int hwloc_topology_get_type_filter(hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter)
Get the current filtering for the given object type.
-
void * private_data
Backend private data, or NULL if none.
Definition: plugins.h:206
-
unsigned long flags
Component flags, unused for now.
Definition: plugins.h:297
-
int hwloc_hide_errors(void)
Check whether insertion errors are hidden.
-
Operating system device (filtered out by default). They are not added to the topology unless I/O disc...
Definition: hwloc.h:269
-
hwloc_obj_t hwloc_alloc_setup_object(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned os_index)
Allocate and initialize an object of the given type and physical index.
-
unsigned enabled_by_default
Enabled by default. If unset, if will be disabled unless explicitly requested.
Definition: plugins.h:77
-
struct hwloc_obj * hwloc__insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t root, hwloc_obj_t obj, hwloc_report_error_t report_error)
Add an object to the topology and specify which error callback to use.
-
Generic component structure.
Definition: plugins.h:257
-
static int hwloc_filter_check_pcidev_subtype_important(unsigned classid)
Check whether the given PCI device classid is important.
Definition: plugins.h:460
-
int(* discover)(struct hwloc_backend *backend, struct hwloc_disc_status *status)
Main discovery callback. returns -1 on error, either because it couldn&#39;t add its objects ot the exist...
Definition: plugins.h:217
-
hwloc_component_type_e
Generic component type.
Definition: plugins.h:244
-
int hwloc_pcidisc_find_linkspeed(const unsigned char *config, unsigned offset, float *linkspeed)
Fill linkspeed by reading the PCI config space where PCI_CAP_ID_EXP is at position offset...
-
unsigned short class_id
Definition: hwloc.h:619
-
hwloc_disc_phase_t phase
The current discovery phase that is performed. Must match one of the phases in the component phases f...
Definition: plugins.h:150
-
unsigned excluded_phases
Dynamically excluded phases. If a component decides during discovery that some phases are no longer n...
Definition: plugins.h:155
-
PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enab...
Definition: hwloc.h:262
-
Final tweaks to a ready-to-use topology. This phase runs once the topology is loaded, before it is returned to the topology. Hence it may only use the main hwloc API for modifying the topology, for instance by restricting it, adding info attributes, etc.
Definition: plugins.h:132
-
Attach memory to existing CPU objects.
Definition: plugins.h:109
-
unsigned phases
Discovery phases performed by this component. OR&#39;ed set of hwloc_disc_phase_t.
Definition: plugins.h:43
-
CPU discovery.
Definition: plugins.h:105
-
hwloc_type_filter_e
Type filtering flags.
Definition: hwloc.h:2065
-
The data field must point to a struct hwloc_disc_component.
Definition: plugins.h:246
-
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
-
enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_t
Type of a OS device.
-
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:667
-
The data field must point to a struct hwloc_xml_component.
Definition: plugins.h:249
-
xml or synthetic, platform-specific components such as bgq. Discovers everything including CPU...
Definition: plugins.h:101
-
unsigned long flags
OR&#39;ed set of hwloc_disc_status_flag_e.
Definition: plugins.h:158
-
hwloc_obj_type_t hwloc_pcidisc_check_bridge_type(unsigned device_class, const unsigned char *config)
Return the hwloc object type (PCI device or Bridge) for the given class and configuration space...
-
void(* disable)(struct hwloc_backend *backend)
Callback for freeing the private_data. May be NULL.
Definition: plugins.h:210
-
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:400
-
Operating system dma engine device. For instance the "dma0chan0" DMA channel on Linux.
Definition: hwloc.h:334
-
static int hwloc_filter_check_osdev_subtype_important(hwloc_obj_osdev_type_t subtype)
Check whether the given OS device subtype is important.
Definition: plugins.h:477
-
int hwloc_pcidisc_tree_attach(struct hwloc_topology *topology, struct hwloc_obj *tree)
Add some hostbridges on top of the given tree of PCI objects and attach them to the topology...
-
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:383
-
void hwloc_insert_object_by_parent(struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj)
Insert an object somewhere in the topology.
-
int hwloc_obj_add_children_sets(hwloc_obj_t obj)
Setup object cpusets/nodesets by OR&#39;ing its children.
-
void hwloc_report_os_error(const char *msg, int line)
Report an insertion error from a backend.
-
int hwloc_backend_enable(struct hwloc_backend *backend)
Enable a previously allocated and setup backend.
-
void * data
Component data, pointing to a struct hwloc_disc_component or struct hwloc_xml_component.
Definition: plugins.h:300
-
struct hwloc_obj * hwloc_insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t obj)
Add an object to the topology.
-
unsigned priority
Component priority. Used to sort topology->components, higher priority first. Also used to decide bet...
Definition: plugins.h:72
-
int hwloc_pcidisc_find_bridge_buses(unsigned domain, unsigned bus, unsigned dev, unsigned func, unsigned *secondary_busp, unsigned *subordinate_busp, const unsigned char *config)
Fills the attributes of the given PCI bridge using the given PCI config space.
-
Discovery component structure.
Definition: plugins.h:34
-
enum hwloc_disc_phase_e hwloc_disc_phase_t
Discovery phase.
-
int hwloc_topology_reconnect(hwloc_topology_t topology, unsigned long flags)
Request a reconnection of children and levels in the topology.
-
char * subtype
Subtype string to better describe the type field.
Definition: hwloc.h:384
-
hwloc_component_type_t type
Component type.
Definition: plugins.h:294
-
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine, except for PUs and NUMA nodes. Set to HWLOC_UNKNOWN_INDEX if unknown or irrelevant for this object.
Definition: hwloc.h:386
-
hwloc_disc_phase_e
Discovery phase.
Definition: plugins.h:96
-
unsigned long flags
Backend flags, currently always 0.
Definition: plugins.h:195
-
hwloc_obj_osdev_type_t type
Definition: hwloc.h:641
+
1 /*
+
2  * Copyright © 2013-2014 Cisco Systems, Inc. All rights reserved.
+
3  * Copyright © 2013-2014 University of Wisconsin-La Crosse.
+
4  * All rights reserved.
+
5  * Copyright © 2015-2016 Inria. All rights reserved.
+
6  *
+
7  * $COPYRIGHT$
+
8  *
+
9  * Additional copyrights may follow
+
10  * See COPYING in top-level directory.
+
11  *
+
12  * $HEADER$
+
13  */
+
14 
+
15 #ifndef _NETLOC_H_
+
16 #define _NETLOC_H_
+
17 
+
18 #ifndef _GNU_SOURCE
+
19 #define _GNU_SOURCE // for asprintf
+
20 #endif
+
21 
+
22 #include <hwloc/autogen/config.h>
+
23 
+
24 #include <hwloc.h>
+
25 
+
26 #ifdef __cplusplus
+
27 extern "C" {
+
28 #endif
+
29 
+
36 enum {
+ +
38  NETLOC_ERROR = -1,
+ + + + + + + + +
47 };
+
48 
+
49 
+
50 #ifdef __cplusplus
+
51 } /* extern "C" */
+
52 #endif
+
53 
+
56 #endif // _NETLOC_H_
+
@ NETLOC_ERROR_MAX
Definition: netloc.h:46
+
@ NETLOC_ERROR_NOT_IMPL
Definition: netloc.h:43
+
@ NETLOC_SUCCESS
Definition: netloc.h:37
+
@ NETLOC_ERROR_MULTIPLE
Definition: netloc.h:42
+
@ NETLOC_ERROR_NOTDIR
Definition: netloc.h:39
+
@ NETLOC_ERROR
Definition: netloc.h:38
+
@ NETLOC_ERROR_EXISTS
Definition: netloc.h:44
+
@ NETLOC_ERROR_EMPTY
Definition: netloc.h:41
+
@ NETLOC_ERROR_NOT_FOUND
Definition: netloc.h:45
+
@ NETLOC_ERROR_NOENT
Definition: netloc.h:40
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00179.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00179.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00179.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00179.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,129 @@ + + + + + + + +Hardware Locality (hwloc): API version + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + +
+
+ +
+
API version
+
+
+ + + + + + +

+Macros

#define HWLOC_API_VERSION   0x00020100
 
#define HWLOC_COMPONENT_ABI   6
 
+ + + +

+Functions

unsigned hwloc_get_api_version (void)
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ HWLOC_API_VERSION

+ +
+
+ + + + +
#define HWLOC_API_VERSION   0x00020100
+
+ +

Indicate at build time which hwloc API version is being used.

+

This number is updated to (X<<16)+(Y<<8)+Z when a new release X.Y.Z actually modifies the API.

+

Users may check for available features at build time using this number (see How do I handle API changes?).

+
Note
This should not be confused with HWLOC_VERSION, the library version. Two stable releases of the same series usually have the same HWLOC_API_VERSION even if their HWLOC_VERSION are different.
+ +
+
+ +

◆ HWLOC_COMPONENT_ABI

+ +
+
+ + + + +
#define HWLOC_COMPONENT_ABI   6
+
+ +

Current component and plugin ABI version (see hwloc/plugins.h)

+ +
+
+

Function Documentation

+ +

◆ hwloc_get_api_version()

+ +
+
+ + + + + + + + +
unsigned hwloc_get_api_version (void )
+
+ +

Indicate at runtime which hwloc API version was used at build time.

+

Should be HWLOC_API_VERSION if running on the same version.

+ +
+
+
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00179_source.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00179_source.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00179_source.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00179_source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): netloc.h Source File - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - - -
-
-
-
netloc.h
-
-
-
1 /*
2  * Copyright © 2013-2014 Cisco Systems, Inc. All rights reserved.
3  * Copyright © 2013-2014 University of Wisconsin-La Crosse.
4  * All rights reserved.
5  * Copyright © 2015-2016 Inria. All rights reserved.
6  *
7  * $COPYRIGHT$
8  *
9  * Additional copyrights may follow
10  * See COPYING in top-level directory.
11  *
12  * $HEADER$
13  */
14 
15 #ifndef _NETLOC_H_
16 #define _NETLOC_H_
17 
18 #ifndef _GNU_SOURCE
19 #define _GNU_SOURCE // for asprintf
20 #endif
21 
22 #include <hwloc/autogen/config.h>
23 
24 #include <hwloc.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
36 enum {
38  NETLOC_ERROR = -1,
47 };
48 
49 
50 #ifdef __cplusplus
51 } /* extern "C" */
52 #endif
53 
56 #endif // _NETLOC_H_
Definition: netloc.h:41
-
Definition: netloc.h:44
-
Definition: netloc.h:46
-
Definition: netloc.h:45
-
Definition: netloc.h:42
-
Definition: netloc.h:39
-
Definition: netloc.h:37
-
Definition: netloc.h:38
-
Definition: netloc.h:40
-
Definition: netloc.h:43
-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00180.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00180.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00180.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00180.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,141 @@ + + + + + + + +Hardware Locality (hwloc): Object Sets (hwloc_cpuset_t and hwloc_nodeset_t) + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + +
+
+ +
+
Object Sets (hwloc_cpuset_t and hwloc_nodeset_t)
+
+
+ + + + + + + + + + +

+Typedefs

typedef hwloc_bitmap_t hwloc_cpuset_t
 
typedef hwloc_const_bitmap_t hwloc_const_cpuset_t
 
typedef hwloc_bitmap_t hwloc_nodeset_t
 
typedef hwloc_const_bitmap_t hwloc_const_nodeset_t
 
+

Detailed Description

+

Hwloc uses bitmaps to represent two distinct kinds of object sets: CPU sets (hwloc_cpuset_t) and NUMA node sets (hwloc_nodeset_t). These types are both typedefs to a common back end type (hwloc_bitmap_t), and therefore all the hwloc bitmap functions are applicable to both hwloc_cpuset_t and hwloc_nodeset_t (see The bitmap API).

+

The rationale for having two different types is that even though the actions one wants to perform on these types are the same (e.g., enable and disable individual items in the set/mask), they're used in very different contexts: one for specifying which processors to use and one for specifying which NUMA nodes to use. Hence, the name difference is really just to reflect the intent of where the type is used.

+

Typedef Documentation

+ +

◆ hwloc_const_cpuset_t

+ +
+
+ +

A non-modifiable hwloc_cpuset_t.

+ +
+
+ +

◆ hwloc_const_nodeset_t

+ +
+
+ +

A non-modifiable hwloc_nodeset_t.

+ +
+
+ +

◆ hwloc_cpuset_t

+ +
+
+ + + + +
typedef hwloc_bitmap_t hwloc_cpuset_t
+
+ +

A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.

+

It may be consulted and modified with the bitmap API as any hwloc_bitmap_t (see hwloc/bitmap.h).

+

Each bit may be converted into a PU object using hwloc_get_pu_obj_by_os_index().

+ +
+
+ +

◆ hwloc_nodeset_t

+ +
+
+ + + + +
typedef hwloc_bitmap_t hwloc_nodeset_t
+
+ +

A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes.

+

It may be consulted and modified with the bitmap API as any hwloc_bitmap_t (see hwloc/bitmap.h). Each bit may be converted into a NUMA node object using hwloc_get_numanode_obj_by_os_index().

+

When binding memory on a system without any NUMA node, the single main memory bank is considered as NUMA node #0.

+

See also Converting between CPU sets and node sets.

+ +
+
+
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00181.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00181.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00181.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00181.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,379 @@ + + + + + + + +Hardware Locality (hwloc): Object Types + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + +
+
+ +
+
Object Types
+
+
+ + + + +

+Macros

#define HWLOC_TYPE_UNORDERED
 
+ + + + + + + +

+Typedefs

typedef enum hwloc_obj_cache_type_e hwloc_obj_cache_type_t
 
typedef enum hwloc_obj_bridge_type_e hwloc_obj_bridge_type_t
 
typedef enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_t
 
+ + + + + + + + + +

+Enumerations

enum  hwloc_obj_type_t {
+  HWLOC_OBJ_MACHINE, +HWLOC_OBJ_PACKAGE, +HWLOC_OBJ_CORE, +HWLOC_OBJ_PU, +
+  HWLOC_OBJ_L1CACHE, +HWLOC_OBJ_L2CACHE, +HWLOC_OBJ_L3CACHE, +HWLOC_OBJ_L4CACHE, +
+  HWLOC_OBJ_L5CACHE, +HWLOC_OBJ_L1ICACHE, +HWLOC_OBJ_L2ICACHE, +HWLOC_OBJ_L3ICACHE, +
+  HWLOC_OBJ_GROUP, +HWLOC_OBJ_NUMANODE, +HWLOC_OBJ_BRIDGE, +HWLOC_OBJ_PCI_DEVICE, +
+  HWLOC_OBJ_OS_DEVICE, +HWLOC_OBJ_MISC, +HWLOC_OBJ_MEMCACHE, +HWLOC_OBJ_DIE +
+ }
 
enum  hwloc_obj_cache_type_e { HWLOC_OBJ_CACHE_UNIFIED, +HWLOC_OBJ_CACHE_DATA, +HWLOC_OBJ_CACHE_INSTRUCTION + }
 
enum  hwloc_obj_bridge_type_e { HWLOC_OBJ_BRIDGE_HOST, +HWLOC_OBJ_BRIDGE_PCI + }
 
enum  hwloc_obj_osdev_type_e {
+  HWLOC_OBJ_OSDEV_BLOCK, +HWLOC_OBJ_OSDEV_GPU, +HWLOC_OBJ_OSDEV_NETWORK, +HWLOC_OBJ_OSDEV_OPENFABRICS, +
+  HWLOC_OBJ_OSDEV_DMA, +HWLOC_OBJ_OSDEV_COPROC +
+ }
 
+ + + +

+Functions

int hwloc_compare_types (hwloc_obj_type_t type1, hwloc_obj_type_t type2)
 
+

Detailed Description

+

Macro Definition Documentation

+ +

◆ HWLOC_TYPE_UNORDERED

+ +
+
+ + + + +
#define HWLOC_TYPE_UNORDERED
+
+ +

Value returned by hwloc_compare_types() when types can not be compared.

+ +
+
+

Typedef Documentation

+ +

◆ hwloc_obj_bridge_type_t

+ +
+
+ +

Type of one side (upstream or downstream) of an I/O bridge.

+ +
+
+ +

◆ hwloc_obj_cache_type_t

+ +
+
+ +

Cache type.

+ +
+
+ +

◆ hwloc_obj_osdev_type_t

+ +
+
+ +

Type of a OS device.

+ +
+
+

Enumeration Type Documentation

+ +

◆ hwloc_obj_bridge_type_e

+ +
+
+ + + + +
enum hwloc_obj_bridge_type_e
+
+ +

Type of one side (upstream or downstream) of an I/O bridge.

+ + + +
Enumerator
HWLOC_OBJ_BRIDGE_HOST 

Host-side of a bridge, only possible upstream.

+
HWLOC_OBJ_BRIDGE_PCI 

PCI-side of a bridge.

+
+ +
+
+ +

◆ hwloc_obj_cache_type_e

+ +
+
+ + + + +
enum hwloc_obj_cache_type_e
+
+ +

Cache type.

+ + + + +
Enumerator
HWLOC_OBJ_CACHE_UNIFIED 

Unified cache.

+
HWLOC_OBJ_CACHE_DATA 

Data cache.

+
HWLOC_OBJ_CACHE_INSTRUCTION 

Instruction cache (filtered out by default).

+
+ +
+
+ +

◆ hwloc_obj_osdev_type_e

+ +
+
+ + + + +
enum hwloc_obj_osdev_type_e
+
+ +

Type of a OS device.

+ + + + + + + +
Enumerator
HWLOC_OBJ_OSDEV_BLOCK 

Operating system block device, or non-volatile memory device. For instance "sda" or "dax2.0" on Linux.

+
HWLOC_OBJ_OSDEV_GPU 

Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device.

+
HWLOC_OBJ_OSDEV_NETWORK 

Operating system network device. For instance the "eth0" interface on Linux.

+
HWLOC_OBJ_OSDEV_OPENFABRICS 

Operating system openfabrics device. For instance the "mlx4_0" InfiniBand HCA, or "hfi1_0" Omni-Path interface on Linux.

+
HWLOC_OBJ_OSDEV_DMA 

Operating system dma engine device. For instance the "dma0chan0" DMA channel on Linux.

+
HWLOC_OBJ_OSDEV_COPROC 

Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux, "opencl0d0" for a OpenCL device, "cuda0" for a CUDA device.

+
+ +
+
+ +

◆ hwloc_obj_type_t

+ +
+
+ + + + +
enum hwloc_obj_type_t
+
+ +

Type of topology object.

+
Note
Do not rely on the ordering or completeness of the values as new ones may be defined in the future! If you need to compare types, use hwloc_compare_types() instead.
+ + + + + + + + + + + + + + + + + + + + + +
Enumerator
HWLOC_OBJ_MACHINE 

Machine. A set of processors and memory with cache coherency.

+

This type is always used for the root object of a topology, and never used anywhere else. Hence its parent is always NULL.

+
HWLOC_OBJ_PACKAGE 

Physical package. The physical package that usually gets inserted into a socket on the motherboard. A processor package usually contains multiple cores, and possibly some dies.

+
HWLOC_OBJ_CORE 

Core. A computation unit (may be shared by several logical processors).

+
HWLOC_OBJ_PU 

Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical processors, e.g. in the case of an SMT core).

+

This is the smallest object representing CPU resources, it cannot have any child except Misc objects.

+

Objects of this kind are always reported and can thus be used as fallback when others are not.

+
HWLOC_OBJ_L1CACHE 

Level 1 Data (or Unified) Cache.

+
HWLOC_OBJ_L2CACHE 

Level 2 Data (or Unified) Cache.

+
HWLOC_OBJ_L3CACHE 

Level 3 Data (or Unified) Cache.

+
HWLOC_OBJ_L4CACHE 

Level 4 Data (or Unified) Cache.

+
HWLOC_OBJ_L5CACHE 

Level 5 Data (or Unified) Cache.

+
HWLOC_OBJ_L1ICACHE 

Level 1 instruction Cache (filtered out by default).

+
HWLOC_OBJ_L2ICACHE 

Level 2 instruction Cache (filtered out by default).

+
HWLOC_OBJ_L3ICACHE 

Level 3 instruction Cache (filtered out by default).

+
HWLOC_OBJ_GROUP 

Group objects. Objects which do not fit in the above but are detected by hwloc and are useful to take into account for affinity. For instance, some operating systems expose their arbitrary processors aggregation this way. And hwloc may insert such objects to group NUMA nodes according to their distances. See also What are these Group objects in my topology?.

+

These objects are removed when they do not bring any structure (see HWLOC_TYPE_FILTER_KEEP_STRUCTURE).

+
HWLOC_OBJ_NUMANODE 

NUMA node. An object that contains memory that is directly and byte-accessible to the host processors. It is usually close to some cores (the corresponding objects are descendants of the NUMA node object in the hwloc tree).

+

This is the smallest object representing Memory resources, it cannot have any child except Misc objects. However it may have Memory-side cache parents.

+

There is always at least one such object in the topology even if the machine is not NUMA.

+

Memory objects are not listed in the main children list, but rather in the dedicated Memory children list.

+

NUMA nodes have a special depth HWLOC_TYPE_DEPTH_NUMANODE instead of a normal depth just like other objects in the main tree.

+
HWLOC_OBJ_BRIDGE 

Bridge (filtered out by default). Any bridge (or PCI switch) that connects the host or an I/O bus, to another I/O bus. They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.

+
HWLOC_OBJ_PCI_DEVICE 

PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.

+
HWLOC_OBJ_OS_DEVICE 

Operating system device (filtered out by default). They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.

+
HWLOC_OBJ_MISC 

Miscellaneous objects (filtered out by default). Objects without particular meaning, that can e.g. be added by the application for its own use, or by hwloc for miscellaneous objects such as MemoryModule (DIMMs). These objects are not listed in the main children list, but rather in the dedicated misc children list. Misc objects may only have Misc objects as children, and those are in the dedicated misc children list as well. Misc objects have NULL CPU and node sets.

+
HWLOC_OBJ_MEMCACHE 

Memory-side cache (filtered out by default). A cache in front of a specific NUMA node.

+

This object always has at least one NUMA node as a memory child.

+

Memory objects are not listed in the main children list, but rather in the dedicated Memory children list.

+

Memory-side cache have a special depth HWLOC_TYPE_DEPTH_MEMCACHE instead of a normal depth just like other objects in the main tree.

+
HWLOC_OBJ_DIE 

Die within a physical package. A subpart of the physical package, that contains multiple cores.

+
+ +
+
+

Function Documentation

+ +

◆ hwloc_compare_types()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_compare_types (hwloc_obj_type_t type1,
hwloc_obj_type_t type2 
)
+
+ +

Compare the depth of two object types.

+

Types shouldn't be compared as they are, since newer ones may be added in the future. This function returns less than, equal to, or greater than zero respectively if type1 objects usually include type2 objects, are the same as type2 objects, or are included in type2 objects. If the types can not be compared (because neither is usually contained in the other), HWLOC_TYPE_UNORDERED is returned. Object types containing CPUs can always be compared (usually, a system contains machines which contain nodes which contain packages which contain caches, which contain cores, which contain processors).

+
Note
HWLOC_OBJ_PU will always be the deepest, while HWLOC_OBJ_MACHINE is always the highest.
+
+This does not mean that the actual topology will respect that order: e.g. as of today cores may also contain caches, and packages may also contain nodes. This is thus just to be seen as a fallback comparison method.
+ +
+
+
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00182.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00182.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00182.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00182.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): API version +Hardware Locality (hwloc): Object Structure and Attributes @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,93 +27,55 @@
- + +/* @license-end */
-
API version
+
Object Structure and Attributes
- - - - - + + + + + + +

-Macros

#define HWLOC_API_VERSION   0x00020100
 
#define HWLOC_COMPONENT_ABI   6
 

+Data Structures

struct  hwloc_obj
 
union  hwloc_obj_attr_u
 
struct  hwloc_info_s
 
- - - + + +

-Functions

unsigned hwloc_get_api_version (void)
 

+Typedefs

typedef struct hwloc_objhwloc_obj_t
 

Detailed Description

-

Macro Definition Documentation

- -

◆ HWLOC_API_VERSION

+

Typedef Documentation

+ +

◆ hwloc_obj_t

- +
#define HWLOC_API_VERSION   0x00020100typedef struct hwloc_obj* hwloc_obj_t
-

Indicate at build time which hwloc API version is being used.

-

This number is updated to (X<<16)+(Y<<8)+Z when a new release X.Y.Z actually modifies the API.

-

Users may check for available features at build time using this number (see How do I handle API changes?).

-
Note
This should not be confused with HWLOC_VERSION, the library version. Two stable releases of the same series usually have the same HWLOC_API_VERSION even if their HWLOC_VERSION are different.
- -
-
- -

◆ HWLOC_COMPONENT_ABI

- -
-
- - - - -
#define HWLOC_COMPONENT_ABI   6
-
- -

Current component and plugin ABI version (see hwloc/plugins.h)

- -
-
-

Function Documentation

- -

◆ hwloc_get_api_version()

- -
-
- - - - - - - - -
unsigned hwloc_get_api_version (void )
-
- -

Indicate at runtime which hwloc API version was used at build time.

-

Should be HWLOC_API_VERSION if running on the same version.

+

Convenience typedef; a pointer to a struct hwloc_obj.

@@ -122,7 +84,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00183.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00183.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00183.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00183.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Object Sets (hwloc_cpuset_t and hwloc_nodeset_t) +Hardware Locality (hwloc): Topology Creation and Destruction @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,105 +27,239 @@
- + +/* @license-end */
-
Object Sets (hwloc_cpuset_t and hwloc_nodeset_t)
+
Topology Creation and Destruction
- - - - - - - - + + +

Typedefs

typedef hwloc_bitmap_t hwloc_cpuset_t
 
typedef hwloc_const_bitmap_t hwloc_const_cpuset_t
 
typedef hwloc_bitmap_t hwloc_nodeset_t
 
typedef hwloc_const_bitmap_t hwloc_const_nodeset_t
 
typedef struct hwloc_topology * hwloc_topology_t
 
+ + + + + + + + + + + + +

+Functions

int hwloc_topology_init (hwloc_topology_t *topologyp)
 
int hwloc_topology_load (hwloc_topology_t topology)
 
void hwloc_topology_destroy (hwloc_topology_t topology)
 
int hwloc_topology_dup (hwloc_topology_t *newtopology, hwloc_topology_t oldtopology)
 
int hwloc_topology_abi_check (hwloc_topology_t topology)
 
void hwloc_topology_check (hwloc_topology_t topology)
 

Detailed Description

-

Hwloc uses bitmaps to represent two distinct kinds of object sets: CPU sets (hwloc_cpuset_t) and NUMA node sets (hwloc_nodeset_t). These types are both typedefs to a common back end type (hwloc_bitmap_t), and therefore all the hwloc bitmap functions are applicable to both hwloc_cpuset_t and hwloc_nodeset_t (see The bitmap API).

-

The rationale for having two different types is that even though the actions one wants to perform on these types are the same (e.g., enable and disable individual items in the set/mask), they're used in very different contexts: one for specifying which processors to use and one for specifying which NUMA nodes to use. Hence, the name difference is really just to reflect the intent of where the type is used.

Typedef Documentation

- -

◆ hwloc_const_cpuset_t

+ +

◆ hwloc_topology_t

- +
typedef hwloc_const_bitmap_t hwloc_const_cpuset_ttypedef struct hwloc_topology* hwloc_topology_t
-

A non-modifiable hwloc_cpuset_t.

+

Topology context.

+

To be initialized with hwloc_topology_init() and built with hwloc_topology_load().

- -

◆ hwloc_const_nodeset_t

+

Function Documentation

+ +

◆ hwloc_topology_abi_check()

- + + + + +
typedef hwloc_const_bitmap_t hwloc_const_nodeset_tint hwloc_topology_abi_check (hwloc_topology_t topology)
-

A non-modifiable hwloc_nodeset_t.

+

Verify that the topology is compatible with the current hwloc library.

+

This is useful when using the same topology structure (in memory) in different libraries that may use different hwloc installations (for instance if one library embeds a specific version of hwloc, while another library uses a default system-wide hwloc installation).

+

If all libraries/programs use the same hwloc installation, this function always returns success.

+
Returns
0 on success.
+
+-1 with errno set to EINVAL if incompatible.
+
Note
If sharing between processes with hwloc_shmem_topology_write(), the relevant check is already performed inside hwloc_shmem_topology_adopt().
- -

◆ hwloc_cpuset_t

+ +

◆ hwloc_topology_check()

- + + + + +
typedef hwloc_bitmap_t hwloc_cpuset_tvoid hwloc_topology_check (hwloc_topology_t topology)
-

A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.

-

It may be consulted and modified with the bitmap API as any hwloc_bitmap_t (see hwloc/bitmap.h).

-

Each bit may be converted into a PU object using hwloc_get_pu_obj_by_os_index().

+

Run internal checks on a topology structure.

+

The program aborts if an inconsistency is detected in the given topology.

+
Parameters
+ + +
topologyis the topology to be checked
+
+
+
Note
This routine is only useful to developers.
+
+The input topology should have been previously loaded with hwloc_topology_load().
- -

◆ hwloc_nodeset_t

+ +

◆ hwloc_topology_destroy()

- + + + + +
typedef hwloc_bitmap_t hwloc_nodeset_tvoid hwloc_topology_destroy (hwloc_topology_t topology)
-

A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes.

-

It may be consulted and modified with the bitmap API as any hwloc_bitmap_t (see hwloc/bitmap.h). Each bit may be converted into a NUMA node object using hwloc_get_numanode_obj_by_os_index().

-

When binding memory on a system without any NUMA node, the single main memory bank is considered as NUMA node #0.

-

See also Converting between CPU sets and node sets.

+

Terminate and free a topology context.

+
Parameters
+ + +
topologyis the topology to be freed
+
+
+ +
+
+ +

◆ hwloc_topology_dup()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_topology_dup (hwloc_topology_tnewtopology,
hwloc_topology_t oldtopology 
)
+
+ +

Duplicate a topology.

+

The entire topology structure as well as its objects are duplicated into a new one.

+

This is useful for keeping a backup while modifying a topology.

+
Note
Object userdata is not duplicated since hwloc does not know what it point to. The objects of both old and new topologies will point to the same userdata.
+ +
+
+ +

◆ hwloc_topology_init()

+ +
+
+ + + + + + + + +
int hwloc_topology_init (hwloc_topology_ttopologyp)
+
+ +

Allocate a topology context.

+
Parameters
+ + +
[out]topologypis assigned a pointer to the new allocated context.
+
+
+
Returns
0 on success, -1 on error.
+ +
+
+ +

◆ hwloc_topology_load()

+ +
+
+ + + + + + + + +
int hwloc_topology_load (hwloc_topology_t topology)
+
+ +

Build the actual topology.

+

Build the actual topology once initialized with hwloc_topology_init() and tuned with Topology Detection Configuration and Query and Changing the Source of Topology Discovery routines. No other routine may be called earlier using this topology context.

+
Parameters
+ + +
topologyis the topology to be loaded with objects.
+
+
+
Returns
0 on success, -1 on error.
+
Note
On failure, the topology is reinitialized. It should be either destroyed with hwloc_topology_destroy() or configured and loaded again.
+
+This function may be called only once per topology.
+
+The binding of the current thread or process may temporarily change during this call but it will be restored before it returns.
+
See also
Topology Detection Configuration and Query and Changing the Source of Topology Discovery
@@ -134,7 +268,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00184.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00184.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00184.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00184.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Object Types +Hardware Locality (hwloc): Object levels, depths and types @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,348 +27,530 @@
- + +/* @license-end */
-
Object Types
+
Object levels, depths and types
- - - -

-Macros

#define HWLOC_OBJ_TYPE_MIN   HWLOC_OBJ_MACHINE
 
- - - - - - - -

-Typedefs

typedef enum hwloc_obj_cache_type_e hwloc_obj_cache_type_t
 
typedef enum hwloc_obj_bridge_type_e hwloc_obj_bridge_type_t
 
typedef enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_t
 
- - - - - - - - - - +

Enumerations

enum  hwloc_obj_type_t {
-  HWLOC_OBJ_MACHINE, -HWLOC_OBJ_PACKAGE, -HWLOC_OBJ_CORE, -HWLOC_OBJ_PU, -
-  HWLOC_OBJ_L1CACHE, -HWLOC_OBJ_L2CACHE, -HWLOC_OBJ_L3CACHE, -HWLOC_OBJ_L4CACHE, -
-  HWLOC_OBJ_L5CACHE, -HWLOC_OBJ_L1ICACHE, -HWLOC_OBJ_L2ICACHE, -HWLOC_OBJ_L3ICACHE, -
-  HWLOC_OBJ_GROUP, -HWLOC_OBJ_NUMANODE, -HWLOC_OBJ_BRIDGE, -HWLOC_OBJ_PCI_DEVICE, -
-  HWLOC_OBJ_OS_DEVICE, -HWLOC_OBJ_MISC, -HWLOC_OBJ_MEMCACHE, -HWLOC_OBJ_DIE -
- }
 
enum  hwloc_obj_cache_type_e { HWLOC_OBJ_CACHE_UNIFIED, -HWLOC_OBJ_CACHE_DATA, -HWLOC_OBJ_CACHE_INSTRUCTION - }
 
enum  hwloc_obj_bridge_type_e { HWLOC_OBJ_BRIDGE_HOST, -HWLOC_OBJ_BRIDGE_PCI - }
 
enum  hwloc_obj_osdev_type_e {
-  HWLOC_OBJ_OSDEV_BLOCK, -HWLOC_OBJ_OSDEV_GPU, -HWLOC_OBJ_OSDEV_NETWORK, -HWLOC_OBJ_OSDEV_OPENFABRICS, +
enum  hwloc_get_type_depth_e {
+  HWLOC_TYPE_DEPTH_UNKNOWN, +HWLOC_TYPE_DEPTH_MULTIPLE, +HWLOC_TYPE_DEPTH_NUMANODE, +HWLOC_TYPE_DEPTH_BRIDGE,
-  HWLOC_OBJ_OSDEV_DMA, -HWLOC_OBJ_OSDEV_COPROC +  HWLOC_TYPE_DEPTH_PCI_DEVICE, +HWLOC_TYPE_DEPTH_OS_DEVICE, +HWLOC_TYPE_DEPTH_MISC, +HWLOC_TYPE_DEPTH_MEMCACHE
}
 
enum  hwloc_compare_types_e { HWLOC_TYPE_UNORDERED - }
 
 
- - + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

int hwloc_compare_types (hwloc_obj_type_t type1, hwloc_obj_type_t type2)
 
int hwloc_topology_get_depth (hwloc_topology_t restrict topology)
 
int hwloc_get_type_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 
int hwloc_get_memory_parents_depth (hwloc_topology_t topology)
 
static int hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 
static int hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 
hwloc_obj_type_t hwloc_get_depth_type (hwloc_topology_t topology, int depth)
 
unsigned hwloc_get_nbobjs_by_depth (hwloc_topology_t topology, int depth)
 
static int hwloc_get_nbobjs_by_type (hwloc_topology_t topology, hwloc_obj_type_t type)
 
static hwloc_obj_t hwloc_get_root_obj (hwloc_topology_t topology)
 
hwloc_obj_t hwloc_get_obj_by_depth (hwloc_topology_t topology, int depth, unsigned idx)
 
static hwloc_obj_t hwloc_get_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
 
static hwloc_obj_t hwloc_get_next_obj_by_depth (hwloc_topology_t topology, int depth, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev)
 

Detailed Description

-

Macro Definition Documentation

- -

◆ HWLOC_OBJ_TYPE_MIN

+

Be sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers.

+

Enumeration Type Documentation

+ +

◆ hwloc_get_type_depth_e

- +
#define HWLOC_OBJ_TYPE_MIN   HWLOC_OBJ_MACHINEenum hwloc_get_type_depth_e
- -

Type of topology object.

-
Note
Do not rely on the ordering or completeness of the values as new ones may be defined in the future! If you need to compare types, use hwloc_compare_types() instead.Sentinel value
+ + + + + + + + + +
Enumerator
HWLOC_TYPE_DEPTH_UNKNOWN 

No object of given type exists in the topology.

+
HWLOC_TYPE_DEPTH_MULTIPLE 

Objects of given type exist at different depth in the topology (only for Groups).

+
HWLOC_TYPE_DEPTH_NUMANODE 

Virtual depth for NUMA nodes.

+
HWLOC_TYPE_DEPTH_BRIDGE 

Virtual depth for bridge object level.

+
HWLOC_TYPE_DEPTH_PCI_DEVICE 

Virtual depth for PCI device object level.

+
HWLOC_TYPE_DEPTH_OS_DEVICE 

Virtual depth for software device object level.

+
HWLOC_TYPE_DEPTH_MISC 

Virtual depth for Misc object.

+
HWLOC_TYPE_DEPTH_MEMCACHE 

Virtual depth for MemCache object.

+
-

Typedef Documentation

- -

◆ hwloc_obj_bridge_type_t

+

Function Documentation

+ +

◆ hwloc_get_depth_type()

- + + + + + + + + + + + + + + +
typedef enum hwloc_obj_bridge_type_e hwloc_obj_bridge_type_thwloc_obj_type_t hwloc_get_depth_type (hwloc_topology_t topology,
int depth 
)
-

Type of one side (upstream or downstream) of an I/O bridge.

+

Returns the type of objects at depth depth.

+

depth should between 0 and hwloc_topology_get_depth()-1, or a virtual depth such as HWLOC_TYPE_DEPTH_NUMANODE.

+
Returns
(hwloc_obj_type_t)-1 if depth depth does not exist.
- -

◆ hwloc_obj_cache_type_t

+ +

◆ hwloc_get_memory_parents_depth()

- + + + + +
typedef enum hwloc_obj_cache_type_e hwloc_obj_cache_type_tint hwloc_get_memory_parents_depth (hwloc_topology_t topology)
-

Cache type.

+

Return the depth of parents where memory objects are attached.

+

Memory objects have virtual negative depths because they are not part of the main CPU-side hierarchy of objects. This depth should not be compared with other level depths.

+

If all Memory objects are attached to Normal parents at the same depth, this parent depth may be compared to other as usual, for instance for knowing whether NUMA nodes is attached above or below Packages.

+
Returns
The depth of Normal parents of all memory children if all these parents have the same depth. For instance the depth of the Package level if all NUMA nodes are attached to Package objects.
+
+HWLOC_TYPE_DEPTH_MULTIPLE if Normal parents of all memory children do not have the same depth. For instance if some NUMA nodes are attached to Packages while others are attached to Groups.
- -

◆ hwloc_obj_osdev_type_t

+ +

◆ hwloc_get_nbobjs_by_depth()

- + + + + + + + + + + + + + + +
typedef enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_tunsigned hwloc_get_nbobjs_by_depth (hwloc_topology_t topology,
int depth 
)
-

Type of a OS device.

+

Returns the width of level at depth depth.

-

Enumeration Type Documentation

- -

◆ hwloc_compare_types_e

+ +

◆ hwloc_get_nbobjs_by_type()

+ + + @@ -27,54 +27,258 @@
- + + + + + + + + + + + + + + +
enum hwloc_compare_types_estatic int hwloc_get_nbobjs_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type 
)
-
- - + + +
Enumerator
HWLOC_TYPE_UNORDERED 

Value returned by hwloc_compare_types() when types can not be compared.

-
+inlinestatic
+
+ +

Returns the width of level type type.

+

If no object for that type exists, 0 is returned. If there are several levels with objects of that type, -1 is returned.

- -

◆ hwloc_obj_bridge_type_e

+ +

◆ hwloc_get_next_obj_by_depth()

+ + + + + +
- + + + + + + + + + + + + + + + + + + + + +
enum hwloc_obj_bridge_type_estatic hwloc_obj_t hwloc_get_next_obj_by_depth (hwloc_topology_t topology,
int depth,
hwloc_obj_t prev 
)
+
+inlinestatic
-

Type of one side (upstream or downstream) of an I/O bridge.

- - - +

Returns the next object at depth depth.

+

If prev is NULL, return the first object at depth depth.

+ + + + +

◆ hwloc_get_next_obj_by_type()

+ +
+
+
Enumerator
HWLOC_OBJ_BRIDGE_HOST 

Host-side of a bridge, only possible upstream.

-
HWLOC_OBJ_BRIDGE_PCI 

PCI-side of a bridge.

-
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static hwloc_obj_t hwloc_get_next_obj_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type,
hwloc_obj_t prev 
)
+
+inlinestatic
+
+ +

Returns the next object of type type.

+

If prev is NULL, return the first object at type type. If there are multiple or no depth for given type, return NULL and let the caller fallback to hwloc_get_next_obj_by_depth().

- -

◆ hwloc_obj_cache_type_e

+ +

◆ hwloc_get_obj_by_depth()

- + + + + + + + + + + + + + + + + + + + + +
enum hwloc_obj_cache_type_ehwloc_obj_t hwloc_get_obj_by_depth (hwloc_topology_t topology,
int depth,
unsigned idx 
)
-

Cache type.

- - - - -
Enumerator
HWLOC_OBJ_CACHE_UNIFIED 

Unified cache.

-
HWLOC_OBJ_CACHE_DATA 

Data cache.

-
HWLOC_OBJ_CACHE_INSTRUCTION 

Instruction cache (filtered out by default).

-
+

Returns the topology object at logical index idx from depth depth.

- -

◆ hwloc_obj_osdev_type_e

+ +

◆ hwloc_get_obj_by_type()

+ + + + + +
- + + + + + + + + + + + + + + + + + + + + +
enum hwloc_obj_osdev_type_estatic hwloc_obj_t hwloc_get_obj_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type,
unsigned idx 
)
+
+inlinestatic
-

Type of a OS device.

- - - - - - - +

Returns the topology object at logical index idx with type type.

+

If no object for that type exists, NULL is returned. If there are several levels with objects of that type (HWLOC_OBJ_GROUP), NULL is returned and the caller may fallback to hwloc_get_obj_by_depth().

+ + + + +

◆ hwloc_get_root_obj()

+ +
+
+
Enumerator
HWLOC_OBJ_OSDEV_BLOCK 

Operating system block device, or non-volatile memory device. For instance "sda" or "dax2.0" on Linux.

-
HWLOC_OBJ_OSDEV_GPU 

Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device.

-
HWLOC_OBJ_OSDEV_NETWORK 

Operating system network device. For instance the "eth0" interface on Linux.

-
HWLOC_OBJ_OSDEV_OPENFABRICS 

Operating system openfabrics device. For instance the "mlx4_0" InfiniBand HCA, or "hfi1_0" Omni-Path interface on Linux.

-
HWLOC_OBJ_OSDEV_DMA 

Operating system dma engine device. For instance the "dma0chan0" DMA channel on Linux.

-
HWLOC_OBJ_OSDEV_COPROC 

Operating system co-processor device. For instance "mic0" for a Xeon Phi (MIC) on Linux, "opencl0d0" for a OpenCL device, "cuda0" for a CUDA device.

-
+ + + +
+ + + + + + + + +
static hwloc_obj_t hwloc_get_root_obj (hwloc_topology_t topology)
+
+inlinestatic
+
+ +

Returns the top-object of the topology-tree.

+

Its type is HWLOC_OBJ_MACHINE.

- -

◆ hwloc_obj_type_t

+ +

◆ hwloc_get_type_depth()

- + + + + + + + + + + + + + + +
enum hwloc_obj_type_tint hwloc_get_type_depth (hwloc_topology_t topology,
hwloc_obj_type_t type 
)
- - - - - - - - - - - - - - - - - - - - - + +

Returns the depth of objects of type type.

+

If no object of this type is present on the underlying architecture, or if the OS doesn't provide this kind of information, the function returns HWLOC_TYPE_DEPTH_UNKNOWN.

+

If type is absent but a similar type is acceptable, see also hwloc_get_type_or_below_depth() and hwloc_get_type_or_above_depth().

+

If HWLOC_OBJ_GROUP is given, the function may return HWLOC_TYPE_DEPTH_MULTIPLE if multiple levels of Groups exist.

+

If a NUMA node, I/O or Misc object type is given, the function returns a virtual value because these objects are stored in special levels that are not CPU-related. This virtual depth may be passed to other hwloc functions such as hwloc_get_obj_by_depth() but it should not be considered as an actual depth by the application. In particular, it should not be compared with any other object depth or with the entire topology depth.

See also
hwloc_get_memory_parents_depth().
+
+hwloc_type_sscanf_as_depth() for returning the depth of objects whose type is given as a string.
+ + + + +

◆ hwloc_get_type_or_above_depth()

+ +
+
+
Enumerator
HWLOC_OBJ_MACHINE 

Machine. A set of processors and memory with cache coherency.

-

This type is always used for the root object of a topology, and never used anywhere else. Hence its parent is always NULL.

-
HWLOC_OBJ_PACKAGE 

Physical package. The physical package that usually gets inserted into a socket on the motherboard. A processor package usually contains multiple cores, and possibly some dies.

-
HWLOC_OBJ_CORE 

Core. A computation unit (may be shared by several logical processors).

-
HWLOC_OBJ_PU 

Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical processors, e.g. in the case of an SMT core).

-

This is the smallest object representing CPU resources, it cannot have any child except Misc objects.

-

Objects of this kind are always reported and can thus be used as fallback when others are not.

-
HWLOC_OBJ_L1CACHE 

Level 1 Data (or Unified) Cache.

-
HWLOC_OBJ_L2CACHE 

Level 2 Data (or Unified) Cache.

-
HWLOC_OBJ_L3CACHE 

Level 3 Data (or Unified) Cache.

-
HWLOC_OBJ_L4CACHE 

Level 4 Data (or Unified) Cache.

-
HWLOC_OBJ_L5CACHE 

Level 5 Data (or Unified) Cache.

-
HWLOC_OBJ_L1ICACHE 

Level 1 instruction Cache (filtered out by default).

-
HWLOC_OBJ_L2ICACHE 

Level 2 instruction Cache (filtered out by default).

-
HWLOC_OBJ_L3ICACHE 

Level 3 instruction Cache (filtered out by default).

-
HWLOC_OBJ_GROUP 

Group objects. Objects which do not fit in the above but are detected by hwloc and are useful to take into account for affinity. For instance, some operating systems expose their arbitrary processors aggregation this way. And hwloc may insert such objects to group NUMA nodes according to their distances. See also What are these Group objects in my topology?.

-

These objects are removed when they do not bring any structure (see HWLOC_TYPE_FILTER_KEEP_STRUCTURE).

-
HWLOC_OBJ_NUMANODE 

NUMA node. An object that contains memory that is directly and byte-accessible to the host processors. It is usually close to some cores (the corresponding objects are descendants of the NUMA node object in the hwloc tree).

-

This is the smallest object representing Memory resources, it cannot have any child except Misc objects. However it may have Memory-side cache parents.

-

There is always at least one such object in the topology even if the machine is not NUMA.

-

Memory objects are not listed in the main children list, but rather in the dedicated Memory children list.

-

NUMA nodes have a special depth HWLOC_TYPE_DEPTH_NUMANODE instead of a normal depth just like other objects in the main tree.

-
HWLOC_OBJ_BRIDGE 

Bridge (filtered out by default). Any bridge that connects the host or an I/O bus, to another I/O bus. They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.

-
HWLOC_OBJ_PCI_DEVICE 

PCI device (filtered out by default). They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.

-
HWLOC_OBJ_OS_DEVICE 

Operating system device (filtered out by default). They are not added to the topology unless I/O discovery is enabled with hwloc_topology_set_flags(). I/O objects are not listed in the main children list, but rather in the dedicated io children list. I/O objects have NULL CPU and node sets.

-
HWLOC_OBJ_MISC 

Miscellaneous objects (filtered out by default). Objects without particular meaning, that can e.g. be added by the application for its own use, or by hwloc for miscellaneous objects such as MemoryModule (DIMMs). These objects are not listed in the main children list, but rather in the dedicated misc children list. Misc objects may only have Misc objects as children, and those are in the dedicated misc children list as well. Misc objects have NULL CPU and node sets.

-
HWLOC_OBJ_MEMCACHE 

Memory-side cache (filtered out by default). A cache in front of a specific NUMA node.

-

This object always has at least one NUMA node as a memory child.

-

Memory objects are not listed in the main children list, but rather in the dedicated Memory children list.

-

Memory-side cache have a special depth HWLOC_TYPE_DEPTH_MEMCACHE instead of a normal depth just like other objects in the main tree.

-
HWLOC_OBJ_DIE 

Die within a physical package. A subpart of the physical package, that contains multiple cores.

-
+ + + +
+ + + + + + + + + + + + + + + + + + +
static int hwloc_get_type_or_above_depth (hwloc_topology_t topology,
hwloc_obj_type_t type 
)
+
+inlinestatic
+
+ +

Returns the depth of objects of type type or above.

+

If no object of this type is present on the underlying architecture, the function returns the depth of the first "present" object typically containing type.

+

This function is only meaningful for normal object types. If a memory, I/O or Misc object type is given, the corresponding virtual depth is always returned (see hwloc_get_type_depth()).

+

May return HWLOC_TYPE_DEPTH_MULTIPLE for HWLOC_OBJ_GROUP just like hwloc_get_type_depth().

-

Function Documentation

- -

◆ hwloc_compare_types()

+ +

◆ hwloc_get_type_or_below_depth()

+ + + + + +
- + - - + + - - + + @@ -376,13 +558,39 @@
int hwloc_compare_types static int hwloc_get_type_or_below_depth (hwloc_obj_type_t type1, hwloc_topology_t topology,
hwloc_obj_type_t type2 hwloc_obj_type_t type 
+
+inlinestatic
+
+ +

Returns the depth of objects of type type or below.

+

If no object of this type is present on the underlying architecture, the function returns the depth of the first "present" object typically found inside type.

+

This function is only meaningful for normal object types. If a memory, I/O or Misc object type is given, the corresponding virtual depth is always returned (see hwloc_get_type_depth()).

+

May return HWLOC_TYPE_DEPTH_MULTIPLE for HWLOC_OBJ_GROUP just like hwloc_get_type_depth().

+ +
+
+ +

◆ hwloc_topology_get_depth()

+ +
+
+ + + + + + + + +
int hwloc_topology_get_depth (hwloc_topology_t restrict topology)
-

Compare the depth of two object types.

-

Types shouldn't be compared as they are, since newer ones may be added in the future. This function returns less than, equal to, or greater than zero respectively if type1 objects usually include type2 objects, are the same as type2 objects, or are included in type2 objects. If the types can not be compared (because neither is usually contained in the other), HWLOC_TYPE_UNORDERED is returned. Object types containing CPUs can always be compared (usually, a system contains machines which contain nodes which contain packages which contain caches, which contain cores, which contain processors).

-
Note
HWLOC_OBJ_PU will always be the deepest, while HWLOC_OBJ_MACHINE is always the highest.
-
-This does not mean that the actual topology will respect that order: e.g. as of today cores may also contain caches, and packages may also contain nodes. This is thus just to be seen as a fallback comparison method.
+

Get the depth of the hierarchical tree of objects.

+

This is the depth of HWLOC_OBJ_PU objects plus one.

+
Note
NUMA nodes, I/O and Misc objects are ignored when computing the depth of the tree (they are placed on special levels).
@@ -391,7 +599,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00185.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00185.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00185.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00185.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Object Structure and Attributes +Hardware Locality (hwloc): Converting between Object Types and Attributes, and Strings @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Object Structure and Attributes
+
Converting between Object Types and Attributes, and Strings
- - - - - - - -

-Data Structures

struct  hwloc_obj
 
union  hwloc_obj_attr_u
 
struct  hwloc_info_s
 
- - - + + + + + + + + + + +

-Typedefs

typedef struct hwloc_objhwloc_obj_t
 

+Functions

const char * hwloc_obj_type_string (hwloc_obj_type_t type)
 
int hwloc_obj_type_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, int verbose)
 
int hwloc_obj_attr_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, int verbose)
 
int hwloc_type_sscanf (const char *string, hwloc_obj_type_t *typep, union hwloc_obj_attr_u *attrp, size_t attrsize)
 
int hwloc_type_sscanf_as_depth (const char *string, hwloc_obj_type_t *typep, hwloc_topology_t topology, int *depthp)
 

Detailed Description

-

Typedef Documentation

- -

◆ hwloc_obj_t

+

Function Documentation

+ +

◆ hwloc_obj_attr_snprintf()

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
typedef struct hwloc_obj* hwloc_obj_tint hwloc_obj_attr_snprintf (char *restrict string,
size_t size,
hwloc_obj_t obj,
const char *restrict separator,
int verbose 
)
+
+ +

Stringify the attributes of a given topology object into a human-readable form.

+

Attribute values are separated by separator.

+

Only the major attributes are printed in non-verbose mode.

+

If size is 0, string may safely be NULL.

+
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
+ +
+
+ +

◆ hwloc_obj_type_snprintf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_obj_type_snprintf (char *restrict string,
size_t size,
hwloc_obj_t obj,
int verbose 
)
+
+ +

Stringify the type of a given topology object into a human-readable form.

+

Contrary to hwloc_obj_type_string(), this function includes object-specific attributes (such as the Group depth, the Bridge type, or OS device type) in the output, and it requires the caller to provide the output buffer.

+

The output is guaranteed to be the same for all objects of a same topology level.

+

If verbose is 1, longer type names are used, e.g. L1Cache instead of L1.

+

The output string may be parsed back by hwloc_type_sscanf().

+

If size is 0, string may safely be NULL.

+
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
+ +
+
+ +

◆ hwloc_obj_type_string()

+ +
+
+ + + + + + + + +
const char* hwloc_obj_type_string (hwloc_obj_type_t type)
+
+ +

Return a constant stringified object type.

+

This function is the basic way to convert a generic type into a string. The output string may be parsed back by hwloc_type_sscanf().

+

hwloc_obj_type_snprintf() may return a more precise output for a specific object, but it requires the caller to provide the output buffer.

+ +
+
+ +

◆ hwloc_type_sscanf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_type_sscanf (const char * string,
hwloc_obj_type_ttypep,
union hwloc_obj_attr_uattrp,
size_t attrsize 
)
+
+ +

Return an object type and attributes from a type string.

+

Convert strings such as "Package" or "L1iCache" into the corresponding types. Matching is case-insensitive, and only the first letters are actually required to match.

+

The matched object type is set in typep (which cannot be NULL).

+

Type-specific attributes, for instance Cache type, Cache depth, Group depth, Bridge type or OS Device type may be returned in attrp. Attributes that are not specified in the string (for instance "Group" without a depth, or "L2Cache" without a cache type) are set to -1.

+

attrp is only filled if not NULL and if its size specified in attrsize is large enough. It should be at least as large as union hwloc_obj_attr_u.

+
Returns
0 if a type was correctly identified, otherwise -1.
+
Note
This function is guaranteed to match any string returned by hwloc_obj_type_string() or hwloc_obj_type_snprintf().
+
+This is an extended version of the now deprecated hwloc_obj_type_sscanf().
+ +
+
+ +

◆ hwloc_type_sscanf_as_depth()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_type_sscanf_as_depth (const char * string,
hwloc_obj_type_ttypep,
hwloc_topology_t topology,
int * depthp 
)
-

Convenience typedef; a pointer to a struct hwloc_obj.

+

Return an object type and its level depth from a type string.

+

Convert strings such as "Package" or "L1iCache" into the corresponding types and return in depthp the depth of the corresponding level in the topology topology.

+

If no object of this type is present on the underlying architecture, HWLOC_TYPE_DEPTH_UNKNOWN is returned.

+

If multiple such levels exist (for instance if giving Group without any depth), the function may return HWLOC_TYPE_DEPTH_MULTIPLE instead.

+

The matched object type is set in typep if typep is non NULL.

+
Note
This function is similar to hwloc_type_sscanf() followed by hwloc_get_type_depth() but it also automatically disambiguates multiple group levels etc.
+
+This function is guaranteed to match any string returned by hwloc_obj_type_string() or hwloc_obj_type_snprintf().
@@ -83,7 +287,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00186.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00186.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00186.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00186.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Topology Creation and Destruction +Hardware Locality (hwloc): Consulting and Adding Key-Value Info Attributes @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,164 +27,57 @@
- + +/* @license-end */
-
Topology Creation and Destruction
+
Consulting and Adding Key-Value Info Attributes
- - - -

-Typedefs

typedef struct hwloc_topology * hwloc_topology_t
 
- - - - - - - - - - - - + + + +

Functions

int hwloc_topology_init (hwloc_topology_t *topologyp)
 
int hwloc_topology_load (hwloc_topology_t topology)
 
void hwloc_topology_destroy (hwloc_topology_t topology)
 
int hwloc_topology_dup (hwloc_topology_t *newtopology, hwloc_topology_t oldtopology)
 
int hwloc_topology_abi_check (hwloc_topology_t topology)
 
void hwloc_topology_check (hwloc_topology_t topology)
 
static const char * hwloc_obj_get_info_by_name (hwloc_obj_t obj, const char *name)
 
int hwloc_obj_add_info (hwloc_obj_t obj, const char *name, const char *value)
 

Detailed Description

-

Typedef Documentation

- -

◆ hwloc_topology_t

- -
-
- - - - -
typedef struct hwloc_topology* hwloc_topology_t
-
- -

Topology context.

-

To be initialized with hwloc_topology_init() and built with hwloc_topology_load().

- -
-

Function Documentation

- -

◆ hwloc_topology_abi_check()

+ +

◆ hwloc_obj_add_info()

- + - - - + + -
int hwloc_topology_abi_check int hwloc_obj_add_info (hwloc_topology_t topology)hwloc_obj_t obj,
-
- -

Verify that the topology is compatible with the current hwloc library.

-

This is useful when using the same topology structure (in memory) in different libraries that may use different hwloc installations (for instance if one library embeds a specific version of hwloc, while another library uses a default system-wide hwloc installation).

-

If all libraries/programs use the same hwloc installation, this function always returns success.

-
Returns
0 on success.
-
--1 with errno set to EINVAL if incompatible.
-
Note
If sharing between processes with hwloc_shmem_topology_write(), the relevant check is already performed inside hwloc_shmem_topology_adopt().
- -
-
- -

◆ hwloc_topology_check()

- -
-
- - - - - - - -
void hwloc_topology_check (hwloc_topology_t topology)
-
- -

Run internal checks on a topology structure.

-

The program aborts if an inconsistency is detected in the given topology.

-
Parameters
- - -
topologyis the topology to be checked
-
-
-
Note
This routine is only useful to developers.
-
-The input topology should have been previously loaded with hwloc_topology_load().
- -
-
- -

◆ hwloc_topology_destroy()

- -
-
- - - - - - + - -
void hwloc_topology_destroy (hwloc_topology_t topology)
-
- -

Terminate and free a topology context.

-
Parameters
- - -
topologyis the topology to be freed
-
-
- -
-
- -

◆ hwloc_topology_dup()

- -
-
- - - - - - + + - - + + @@ -194,71 +87,53 @@
int hwloc_topology_dup (hwloc_topology_tnewtopology, const char * name,
hwloc_topology_t oldtopology const char * value 
-

Duplicate a topology.

-

The entire topology structure as well as its objects are duplicated into a new one.

-

This is useful for keeping a backup while modifying a topology.

-
Note
Object userdata is not duplicated since hwloc does not know what it point to. The objects of both old and new topologies will point to the same userdata.
+

Add the given info name and value pair to the given object.

+

The info is appended to the existing info array even if another key with the same name already exists.

+

The input strings are copied before being added in the object infos.

+
Returns
0 on success, -1 on error.
+
Note
This function may be used to enforce object colors in the lstopo graphical output by using "lstopoStyle" as a name and "Background=#rrggbb" as a value. See CUSTOM COLORS in the lstopo(1) manpage for details.
+
+If value contains some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml() in hwloc/export.h.
- -

◆ hwloc_topology_init()

+ +

◆ hwloc_obj_get_info_by_name()

+ + + + + +
- + - - + + + + + + + -
int hwloc_topology_init static const char* hwloc_obj_get_info_by_name (hwloc_topology_ttopologyp)hwloc_obj_t obj,
const char * name 
-
- -

Allocate a topology context.

-
Parameters
- - -
[out]topologypis assigned a pointer to the new allocated context.
-
-
-
Returns
0 on success, -1 on error.
- -
- - -

◆ hwloc_topology_load()

- -
-
- - - - - + +
int hwloc_topology_load (hwloc_topology_t topology) )
+
+inlinestatic
-

Build the actual topology.

-

Build the actual topology once initialized with hwloc_topology_init() and tuned with Topology Detection Configuration and Query and Changing the Source of Topology Discovery routines. No other routine may be called earlier using this topology context.

-
Parameters
- - -
topologyis the topology to be loaded with objects.
-
-
-
Returns
0 on success, -1 on error.
-
Note
On failure, the topology is reinitialized. It should be either destroyed with hwloc_topology_destroy() or configured and loaded again.
-
-This function may be called only once per topology.
-
-The binding of the current thread or process may temporarily change during this call but it will be restored before it returns.
-
See also
Topology Detection Configuration and Query and Changing the Source of Topology Discovery
+

Search the given key name in object infos and return the corresponding value.

+

If multiple keys match the given name, only the first one is returned.

+
Returns
NULL if no such key exists.
@@ -267,7 +142,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00187.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00187.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00187.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00187.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Object levels, depths and types +Hardware Locality (hwloc): CPU binding @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
@@ -42,108 +43,113 @@ Enumerations | Functions
-
Object levels, depths and types
+
CPU binding
- - +

Enumerations

enum  hwloc_get_type_depth_e {
-  HWLOC_TYPE_DEPTH_UNKNOWN, -HWLOC_TYPE_DEPTH_MULTIPLE, -HWLOC_TYPE_DEPTH_NUMANODE, -HWLOC_TYPE_DEPTH_BRIDGE, -
-  HWLOC_TYPE_DEPTH_PCI_DEVICE, -HWLOC_TYPE_DEPTH_OS_DEVICE, -HWLOC_TYPE_DEPTH_MISC, -HWLOC_TYPE_DEPTH_MEMCACHE -
+
enum  hwloc_cpubind_flags_t { HWLOC_CPUBIND_PROCESS, +HWLOC_CPUBIND_THREAD, +HWLOC_CPUBIND_STRICT, +HWLOC_CPUBIND_NOMEMBIND }
 
 
- - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +

Functions

int hwloc_topology_get_depth (hwloc_topology_t restrict topology)
 
int hwloc_get_type_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 
int hwloc_get_memory_parents_depth (hwloc_topology_t topology)
 
static int hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 
static int hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 
hwloc_obj_type_t hwloc_get_depth_type (hwloc_topology_t topology, int depth)
 
unsigned hwloc_get_nbobjs_by_depth (hwloc_topology_t topology, int depth)
 
static int hwloc_get_nbobjs_by_type (hwloc_topology_t topology, hwloc_obj_type_t type)
 
static hwloc_obj_t hwloc_get_root_obj (hwloc_topology_t topology)
 
hwloc_obj_t hwloc_get_obj_by_depth (hwloc_topology_t topology, int depth, unsigned idx)
 
static hwloc_obj_t hwloc_get_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
 
static hwloc_obj_t hwloc_get_next_obj_by_depth (hwloc_topology_t topology, int depth, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev)
 
int hwloc_set_cpubind (hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)
 
int hwloc_get_cpubind (hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
 
int hwloc_set_proc_cpubind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags)
 
int hwloc_get_proc_cpubind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
 
int hwloc_set_thread_cpubind (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags)
 
int hwloc_get_thread_cpubind (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags)
 
int hwloc_get_last_cpu_location (hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
 
int hwloc_get_proc_last_cpu_location (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
 

Detailed Description

-

Be sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers.

+

Some operating systems only support binding threads or processes to a single PU. Others allow binding to larger sets such as entire Cores or Packages or even random sets of invididual PUs. In such operating system, the scheduler is free to run the task on one of these PU, then migrate it to another PU, etc. It is often useful to call hwloc_bitmap_singlify() on the target CPU set before passing it to the binding function to avoid these expensive migrations. See the documentation of hwloc_bitmap_singlify() for details.

+

Some operating systems do not provide all hwloc-supported mechanisms to bind processes, threads, etc. hwloc_topology_get_support() may be used to query about the actual CPU binding support in the currently used operating system.

+

When the requested binding operation is not available and the HWLOC_CPUBIND_STRICT flag was passed, the function returns -1. errno is set to ENOSYS when it is not possible to bind the requested kind of object processes/threads. errno is set to EXDEV when the requested cpuset can not be enforced (e.g. some systems only allow one CPU, and some other systems only allow one NUMA node).

+

If HWLOC_CPUBIND_STRICT was not passed, the function may fail as well, or the operating system may use a slightly different operation (with side-effects, smaller binding set, etc.) when the requested operation is not exactly supported.

+

The most portable version that should be preferred over the others, whenever possible, is the following one which just binds the current program, assuming it is single-threaded:

+
hwloc_set_cpubind(topology, set, 0),
+

If the program may be multithreaded, the following one should be preferred to only bind the current thread:

+
See also
Some example codes are available under doc/examples/ in the source tree.
+
Note
To unbind, just call the binding function with either a full cpuset or a cpuset equal to the system cpuset.
+
+On some operating systems, CPU binding may have effects on memory binding, see HWLOC_CPUBIND_NOMEMBIND
+
+Running lstopo --top or hwloc-ps can be a very convenient tool to check how binding actually happened.

Enumeration Type Documentation

- -

◆ hwloc_get_type_depth_e

+ +

◆ hwloc_cpubind_flags_t

+ +

Process/Thread binding flags.

+

These bit flags can be used to refine the binding policy.

+

The default (0) is to bind the current process, assumed to be single-threaded, in a non-strict way. This is the most portable way to bind as all operating systems usually provide it.

+
Note
Not all systems support all kinds of binding. See the "Detailed Description" section of CPU binding for a description of errors that can occur.
- - - - - - - -
Enumerator
HWLOC_TYPE_DEPTH_UNKNOWN 

No object of given type exists in the topology.

-
HWLOC_TYPE_DEPTH_MULTIPLE 

Objects of given type exist at different depth in the topology (only for Groups).

-
HWLOC_TYPE_DEPTH_NUMANODE 

Virtual depth for NUMA nodes.

+
Enumerator
HWLOC_CPUBIND_PROCESS 

Bind all threads of the current (possibly) multithreaded process.

HWLOC_TYPE_DEPTH_BRIDGE 

Virtual depth for bridge object level.

+
HWLOC_CPUBIND_THREAD 

Bind current thread of current process.

HWLOC_TYPE_DEPTH_PCI_DEVICE 

Virtual depth for PCI device object level.

+
HWLOC_CPUBIND_STRICT 

Request for strict binding from the OS.

+

By default, when the designated CPUs are all busy while other CPUs are idle, operating systems may execute the thread/process on those other CPUs instead of the designated CPUs, to let them progress anyway. Strict binding means that the thread/process will _never_ execute on other cpus than the designated CPUs, even when those are busy with other tasks and other CPUs are idle.

+
Note
Depending on the operating system, strict binding may not be possible (e.g., the OS does not implement it) or not allowed (e.g., for an administrative reasons), and the function will fail in that case.
+

When retrieving the binding of a process, this flag checks whether all its threads actually have the same binding. If the flag is not given, the binding of each thread will be accumulated.

+
Note
This flag is meaningless when retrieving the binding of a thread.
HWLOC_TYPE_DEPTH_OS_DEVICE 

Virtual depth for software device object level.

-
HWLOC_TYPE_DEPTH_MISC 

Virtual depth for Misc object.

-
HWLOC_TYPE_DEPTH_MEMCACHE 

Virtual depth for MemCache object.

+
HWLOC_CPUBIND_NOMEMBIND 

Avoid any effect on memory binding.

+

On some operating systems, some CPU binding function would also bind the memory on the corresponding NUMA node. It is often not a problem for the application, but if it is, setting this flag will make hwloc avoid using OS functions that would also bind memory. This will however reduce the support of CPU bindings, i.e. potentially return -1 with errno set to ENOSYS in some cases.

+

This flag is only meaningful when used with functions that set the CPU binding. It is ignored when used with functions that get CPU binding information.

Function Documentation

- -

◆ hwloc_get_depth_type()

+ +

◆ hwloc_get_cpubind()

- + - + + + + + + + - + @@ -153,54 +159,34 @@
hwloc_obj_type_t hwloc_get_depth_type int hwloc_get_cpubind (hwloc_topology_t hwloc_topology_t  topology,
hwloc_cpuset_t set,
int depth flags 
-

Returns the type of objects at depth depth.

-

depth should between 0 and hwloc_topology_get_depth()-1.

-
Returns
(hwloc_obj_type_t)-1 if depth depth does not exist.
+

Get current process or thread binding.

+

Writes into set the physical cpuset which the process or thread (according to flags) was last bound to.

- -

◆ hwloc_get_memory_parents_depth()

+ +

◆ hwloc_get_last_cpu_location()

- + - - - + + -
int hwloc_get_memory_parents_depth int hwloc_get_last_cpu_location (hwloc_topology_t topology)hwloc_topology_t topology,
-
- -

Return the depth of parents where memory objects are attached.

-

Memory objects have virtual negative depths because they are not part of the main CPU-side hierarchy of objects. This depth should not be compared with other level depths.

-

If all Memory objects are attached to Normal parents at the same depth, this parent depth may be compared to other as usual, for instance for knowing whether NUMA nodes is attached above or below Packages.

-
Returns
The depth of Normal parents of all memory children if all these parents have the same depth. For instance the depth of the Package level if all NUMA nodes are attached to Package objects.
-
-HWLOC_TYPE_DEPTH_MULTIPLE if Normal parents of all memory children do not have the same depth. For instance if some NUMA nodes are attached to Packages while others are attached to Groups.
- -
-
- -

◆ hwloc_get_nbobjs_by_depth()

- -
-
- - - - - + + + + - + @@ -210,75 +196,41 @@
unsigned hwloc_get_nbobjs_by_depth (hwloc_topology_t topology, hwloc_cpuset_t set,
int depth flags 
-

Returns the width of level at depth depth.

+

Get the last physical CPU where the current process or thread ran.

+

The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated.

+

flags can include either HWLOC_CPUBIND_PROCESS or HWLOC_CPUBIND_THREAD to specify whether the query should be for the whole process (union of all CPUs on which all threads are running), or only the current thread. If the process is single-threaded, flags can be set to zero to let hwloc use whichever method is available on the underlying OS.

- -

◆ hwloc_get_nbobjs_by_type()

+ +

◆ hwloc_get_proc_cpubind()

- - - - - -
- + - + - - - - - - - - -
static int hwloc_get_nbobjs_by_type int hwloc_get_proc_cpubind (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type 
)
-
-inlinestatic
-
- -

Returns the width of level type type.

-

If no object for that type exists, 0 is returned. If there are several levels with objects of that type, -1 is returned.

- -
-
- -

◆ hwloc_get_next_obj_by_depth()

- -
-
- - - - - -
- - - - - - + + - - + + - - + + @@ -286,44 +238,46 @@
static hwloc_obj_t hwloc_get_next_obj_by_depth (hwloc_topology_t topology, hwloc_pid_t pid,
int depth, hwloc_cpuset_t set,
hwloc_obj_t prev int flags 
-
-inlinestatic
-

Returns the next object at depth depth.

-

If prev is NULL, return the first object at depth depth.

+

Get the current physical binding of process pid.

+
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
+
+As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the binding for that specific thread is returned.
+
+On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in flags.
- -

◆ hwloc_get_next_obj_by_type()

+ +

◆ hwloc_get_proc_last_cpu_location()

- - - - - -
- + - + - - + + + + + + + + - - + + @@ -331,41 +285,47 @@
static hwloc_obj_t hwloc_get_next_obj_by_type int hwloc_get_proc_last_cpu_location (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type, hwloc_pid_t pid,
hwloc_cpuset_t set,
hwloc_obj_t prev int flags 
-
-inlinestatic
-

Returns the next object of type type.

-

If prev is NULL, return the first object at type type. If there are multiple or no depth for given type, return NULL and let the caller fallback to hwloc_get_next_obj_by_depth().

+

Get the last physical CPU where a process ran.

+

The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated.

+
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
+
+As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the last CPU location of that specific thread is returned.
+
+On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in flags.
- -

◆ hwloc_get_obj_by_depth()

+ +

◆ hwloc_get_thread_cpubind()

- + - + - - + + + + + + + + - - + + @@ -375,36 +335,36 @@
hwloc_obj_t hwloc_get_obj_by_depth int hwloc_get_thread_cpubind (hwloc_topology_t hwloc_topology_t  topology,
int depth, hwloc_thread_t thread,
hwloc_cpuset_t set,
unsigned idx int flags 
-

Returns the topology object at logical index idx from depth depth.

+

Get the current physical binding of thread tid.

+
Note
hwloc_thread_t is pthread_t on Unix platforms, and HANDLE on native Windows platforms.
+
+HWLOC_CPUBIND_PROCESS can not be used in flags.
- -

◆ hwloc_get_obj_by_type()

+ +

◆ hwloc_set_cpubind()

- - - - - -
- + - + - - + + - - + + @@ -412,64 +372,44 @@
static hwloc_obj_t hwloc_get_obj_by_type int hwloc_set_cpubind (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type, hwloc_const_cpuset_t set,
unsigned idx int flags 
-
-inlinestatic
-

Returns the topology object at logical index idx with type type.

-

If no object for that type exists, NULL is returned. If there are several levels with objects of that type (HWLOC_OBJ_GROUP), NULL is returned and the caller may fallback to hwloc_get_obj_by_depth().

+

Bind current process or thread on cpus given in physical bitmap set.

+
Returns
-1 with errno set to ENOSYS if the action is not supported
+
+-1 with errno set to EXDEV if the binding cannot be enforced
- -

◆ hwloc_get_root_obj()

+ +

◆ hwloc_set_proc_cpubind()

- - - - - -
- + - - + + + + + + + -
static hwloc_obj_t hwloc_get_root_obj int hwloc_set_proc_cpubind (hwloc_topology_t topology)hwloc_topology_t topology,
hwloc_pid_t pid,
-
-inlinestatic
-
- -

Returns the top-object of the topology-tree.

-

Its type is HWLOC_OBJ_MACHINE.

- -
-
- -

◆ hwloc_get_type_depth()

- -
-
- - - - - + + + + - - + + @@ -479,77 +419,44 @@
int hwloc_get_type_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set,
hwloc_obj_type_t type int flags 
-

Returns the depth of objects of type type.

-

If no object of this type is present on the underlying architecture, or if the OS doesn't provide this kind of information, the function returns HWLOC_TYPE_DEPTH_UNKNOWN.

-

If type is absent but a similar type is acceptable, see also hwloc_get_type_or_below_depth() and hwloc_get_type_or_above_depth().

-

If HWLOC_OBJ_GROUP is given, the function may return HWLOC_TYPE_DEPTH_MULTIPLE if multiple levels of Groups exist.

-

If a NUMA node, I/O or Misc object type is given, the function returns a virtual value because these objects are stored in special levels that are not CPU-related. This virtual depth may be passed to other hwloc functions such as hwloc_get_obj_by_depth() but it should not be considered as an actual depth by the application. In particular, it should not be compared with any other object depth or with the entire topology depth.

See also
hwloc_get_memory_parents_depth().
+

Bind a process pid on cpus given in physical bitmap set.

+
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
+
+As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the binding is applied to that specific thread.
-hwloc_type_sscanf_as_depth() for returning the depth of objects whose type is given as a string.
+On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in flags.
- -

◆ hwloc_get_type_or_above_depth()

+ +

◆ hwloc_set_thread_cpubind()

- - - - - -
- + - + - - + + + - - - -
static int hwloc_get_type_or_above_depth int hwloc_set_thread_cpubind (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type hwloc_thread_t thread,
)
-
-inlinestatic
-
- -

Returns the depth of objects of type type or above.

-

If no object of this type is present on the underlying architecture, the function returns the depth of the first "present" object typically containing type.

-

This function is only meaningful for normal object types. If a memory, I/O or Misc object type is given, the corresponding virtual depth is always returned (see hwloc_get_type_depth()).

-

May return HWLOC_TYPE_DEPTH_MULTIPLE for HWLOC_OBJ_GROUP just like hwloc_get_type_depth().

- -
-
- -

◆ hwloc_get_type_or_below_depth()

- -
-
- - - - - -
- - - - - - + + - - + + @@ -557,48 +464,23 @@
static int hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set,
hwloc_obj_type_t type int flags 
-
-inlinestatic
-
- -

Returns the depth of objects of type type or below.

-

If no object of this type is present on the underlying architecture, the function returns the depth of the first "present" object typically found inside type.

-

This function is only meaningful for normal object types. If a memory, I/O or Misc object type is given, the corresponding virtual depth is always returned (see hwloc_get_type_depth()).

-

May return HWLOC_TYPE_DEPTH_MULTIPLE for HWLOC_OBJ_GROUP just like hwloc_get_type_depth().

- -
-
- -

◆ hwloc_topology_get_depth()

- -
-
- - - - - - - - -
int hwloc_topology_get_depth (hwloc_topology_t restrict topology)
-

Get the depth of the hierarchical tree of objects.

-

This is the depth of HWLOC_OBJ_PU objects plus one.

-
Note
NUMA nodes, I/O and Misc objects are ignored when computing the depth of the tree (they are placed on special levels).
+

Bind a thread thread on cpus given in physical bitmap set.

+
Note
hwloc_thread_t is pthread_t on Unix platforms, and HANDLE on native Windows platforms.
+
+HWLOC_CPUBIND_PROCESS can not be used in flags.
+
int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)
Bind current process or thread on cpus given in physical bitmap set.
+
@ HWLOC_CPUBIND_THREAD
Bind current thread of current process.
Definition: hwloc.h:1148
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00188.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00188.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00188.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00188.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Converting between Object Types and Attributes, and Strings +Hardware Locality (hwloc): Memory binding @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,74 +27,232 @@ - + +/* @license-end */
-
Converting between Object Types and Attributes, and Strings
+
Memory binding
+ + + + + +

+Enumerations

enum  hwloc_membind_policy_t {
+  HWLOC_MEMBIND_DEFAULT, +HWLOC_MEMBIND_FIRSTTOUCH, +HWLOC_MEMBIND_BIND, +HWLOC_MEMBIND_INTERLEAVE, +
+  HWLOC_MEMBIND_NEXTTOUCH, +HWLOC_MEMBIND_MIXED +
+ }
 
enum  hwloc_membind_flags_t {
+  HWLOC_MEMBIND_PROCESS, +HWLOC_MEMBIND_THREAD, +HWLOC_MEMBIND_STRICT, +HWLOC_MEMBIND_MIGRATE, +
+  HWLOC_MEMBIND_NOCPUBIND, +HWLOC_MEMBIND_BYNODESET +
+ }
 
- - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +

Functions

const char * hwloc_obj_type_string (hwloc_obj_type_t type)
 
int hwloc_obj_type_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, int verbose)
 
int hwloc_obj_attr_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, int verbose)
 
int hwloc_type_sscanf (const char *string, hwloc_obj_type_t *typep, union hwloc_obj_attr_u *attrp, size_t attrsize)
 
int hwloc_type_sscanf_as_depth (const char *string, hwloc_obj_type_t *typep, hwloc_topology_t topology, int *depthp)
 
int hwloc_set_membind (hwloc_topology_t topology, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_get_membind (hwloc_topology_t topology, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
 
int hwloc_set_proc_membind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_get_proc_membind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
 
int hwloc_set_area_membind (hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_get_area_membind (hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
 
int hwloc_get_area_memlocation (hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, int flags)
 
void * hwloc_alloc (hwloc_topology_t topology, size_t len)
 
void * hwloc_alloc_membind (hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
static void * hwloc_alloc_membind_policy (hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_free (hwloc_topology_t topology, void *addr, size_t len)
 

Detailed Description

+

Memory binding can be done three ways:

+
    +
  • explicit memory allocation thanks to hwloc_alloc_membind() and friends: the binding will have effect on the memory allocated by these functions.
  • +
  • implicit memory binding through binding policy: hwloc_set_membind() and friends only define the current policy of the process, which will be applied to the subsequent calls to malloc() and friends.
  • +
  • migration of existing memory ranges, thanks to hwloc_set_area_membind() and friends, which move already-allocated data.
  • +
+

Not all operating systems support all three ways. hwloc_topology_get_support() may be used to query about the actual memory binding support in the currently used operating system.

+

When the requested binding operation is not available and the HWLOC_MEMBIND_STRICT flag was passed, the function returns -1. errno will be set to ENOSYS when the system does support the specified action or policy (e.g., some systems only allow binding memory on a per-thread basis, whereas other systems only allow binding memory for all threads in a process). errno will be set to EXDEV when the requested set can not be enforced (e.g., some systems only allow binding memory to a single NUMA node).

+

If HWLOC_MEMBIND_STRICT was not passed, the function may fail as well, or the operating system may use a slightly different operation (with side-effects, smaller binding set, etc.) when the requested operation is not exactly supported.

+

The most portable form that should be preferred over the others whenever possible is as follows. It allocates some memory hopefully bound to the specified set. To do so, hwloc will possibly have to change the current memory binding policy in order to actually get the memory bound, if the OS does not provide any other way to simply allocate bound memory without changing the policy for all allocations. That is the difference with hwloc_alloc_membind(), which will never change the current memory binding policy.

+
hwloc_alloc_membind_policy(topology, size, set,
+ +

Each hwloc memory binding function takes a bitmap argument that is a CPU set by default, or a NUMA memory node set if the flag HWLOC_MEMBIND_BYNODESET is specified. See Object Sets (hwloc_cpuset_t and hwloc_nodeset_t) and The bitmap API for a discussion of CPU sets and NUMA memory node sets. It is also possible to convert between CPU set and node set using hwloc_cpuset_to_nodeset() or hwloc_cpuset_from_nodeset().

+

Memory binding by CPU set cannot work for CPU-less NUMA memory nodes. Binding by nodeset should therefore be preferred whenever possible.

+
See also
Some example codes are available under doc/examples/ in the source tree.
+
Note
On some operating systems, memory binding affects the CPU binding; see HWLOC_MEMBIND_NOCPUBIND
+

Enumeration Type Documentation

+ +

◆ hwloc_membind_flags_t

+ +
+
+ + + + +
enum hwloc_membind_flags_t
+
+ +

Memory binding flags.

+

These flags can be used to refine the binding policy. All flags can be logically OR'ed together with the exception of HWLOC_MEMBIND_PROCESS and HWLOC_MEMBIND_THREAD; these two flags are mutually exclusive.

+

Not all systems support all kinds of binding. hwloc_topology_get_support() may be used to query about the actual memory binding support in the currently used operating system. See the "Detailed Description" section of Memory binding for a description of errors that can occur.

+ + + + + + + +
Enumerator
HWLOC_MEMBIND_PROCESS 

Set policy for all threads of the specified (possibly multithreaded) process. This flag is mutually exclusive with HWLOC_MEMBIND_THREAD.

+
HWLOC_MEMBIND_THREAD 

Set policy for a specific thread of the current process. This flag is mutually exclusive with HWLOC_MEMBIND_PROCESS.

+
HWLOC_MEMBIND_STRICT 

Request strict binding from the OS. The function will fail if the binding can not be guaranteed / completely enforced.

+

This flag has slightly different meanings depending on which function it is used with.

+
HWLOC_MEMBIND_MIGRATE 

Migrate existing allocated memory. If the memory cannot be migrated and the HWLOC_MEMBIND_STRICT flag is passed, an error will be returned.

+
HWLOC_MEMBIND_NOCPUBIND 

Avoid any effect on CPU binding.

+

On some operating systems, some underlying memory binding functions also bind the application to the corresponding CPU(s). Using this flag will cause hwloc to avoid using OS functions that could potentially affect CPU bindings. Note, however, that using NOCPUBIND may reduce hwloc's overall memory binding support. Specifically: some of hwloc's memory binding functions may fail with errno set to ENOSYS when used with NOCPUBIND.

+
HWLOC_MEMBIND_BYNODESET 

Consider the bitmap argument as a nodeset.

+

The bitmap argument is considered a nodeset if this flag is given, or a cpuset otherwise by default.

+

Memory binding by CPU set cannot work for CPU-less NUMA memory nodes. Binding by nodeset should therefore be preferred whenever possible.

+
+ +
+
+ +

◆ hwloc_membind_policy_t

+ +
+
+ + + + +
enum hwloc_membind_policy_t
+
+ +

Memory binding policy.

+

These constants can be used to choose the binding policy. Only one policy can be used at a time (i.e., the values cannot be OR'ed together).

+

Not all systems support all kinds of binding. hwloc_topology_get_support() may be used to query about the actual memory binding policy support in the currently used operating system. See the "Detailed Description" section of Memory binding for a description of errors that can occur.

+ + + + + + + +
Enumerator
HWLOC_MEMBIND_DEFAULT 

Reset the memory allocation policy to the system default. Depending on the operating system, this may correspond to HWLOC_MEMBIND_FIRSTTOUCH (Linux, FreeBSD), or HWLOC_MEMBIND_BIND (AIX, HP-UX, Solaris, Windows). This policy is never returned by get membind functions. The nodeset argument is ignored.

+
HWLOC_MEMBIND_FIRSTTOUCH 

Allocate each memory page individually on the local NUMA node of the thread that touches it.

+

The given nodeset should usually be hwloc_topology_get_topology_nodeset() so that the touching thread may run and allocate on any node in the system.

+

On AIX, if the nodeset is smaller, pages are allocated locally (if the local node is in the nodeset) or from a random non-local node (otherwise).

+
HWLOC_MEMBIND_BIND 

Allocate memory on the specified nodes.

+
HWLOC_MEMBIND_INTERLEAVE 

Allocate memory on the given nodes in an interleaved / round-robin manner. The precise layout of the memory across multiple NUMA nodes is OS/system specific. Interleaving can be useful when threads distributed across the specified NUMA nodes will all be accessing the whole memory range concurrently, since the interleave will then balance the memory references.

+
HWLOC_MEMBIND_NEXTTOUCH 

For each page bound with this policy, by next time it is touched (and next time only), it is moved from its current location to the local NUMA node of the thread where the memory reference occurred (if it needs to be moved at all).

+
HWLOC_MEMBIND_MIXED 

Returned by get_membind() functions when multiple threads or parts of a memory area have differing memory binding policies. Also returned when binding is unknown because binding hooks are empty when the topology is loaded from XML without HWLOC_THISSYSTEM=1, etc.

+
+ +
+

Function Documentation

- -

◆ hwloc_obj_attr_snprintf()

+ +

◆ hwloc_alloc()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void* hwloc_alloc (hwloc_topology_t topology,
size_t len 
)
+
+ +

Allocate some memory.

+

This is equivalent to malloc(), except that it tries to allocate page-aligned memory from the OS.

+
Note
The allocated memory should be freed with hwloc_free().
+ +
+
+ +

◆ hwloc_alloc_membind()

- + - - + + - + - - + + - - + + - + @@ -104,43 +262,55 @@
int hwloc_obj_attr_snprintf void* hwloc_alloc_membind (char *restrict string, hwloc_topology_t topology,
size_t size, len,
hwloc_obj_t obj, hwloc_const_bitmap_t set,
const char *restrict separator, hwloc_membind_policy_t policy,
int verbose flags 
-

Stringify the attributes of a given topology object into a human-readable form.

-

Attribute values are separated by separator.

-

Only the major attributes are printed in non-verbose mode.

-

If size is 0, string may safely be NULL.

-
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
+

Allocate some memory on NUMA memory nodes specified by set.

+
Returns
NULL with errno set to ENOSYS if the action is not supported and HWLOC_MEMBIND_STRICT is given
+
+NULL with errno set to EXDEV if the binding cannot be enforced and HWLOC_MEMBIND_STRICT is given
+
+NULL with errno set to ENOMEM if the memory allocation failed even before trying to bind.
+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

+
Note
The allocated memory should be freed with hwloc_free().
- -

◆ hwloc_obj_type_snprintf()

+ +

◆ hwloc_alloc_membind_policy()

+ + + + + +
- + - - + + - + - - + + + + + + + + - + @@ -148,69 +318,150 @@
int hwloc_obj_type_snprintf static void* hwloc_alloc_membind_policy (char *restrict string, hwloc_topology_t topology,
size_t size, len,
hwloc_obj_t obj, hwloc_const_bitmap_t set,
hwloc_membind_policy_t policy,
int verbose flags 
+
+inlinestatic
-

Stringify the type of a given topology object into a human-readable form.

-

Contrary to hwloc_obj_type_string(), this function includes object-specific attributes (such as the Group depth, the Bridge type, or OS device type) in the output, and it requires the caller to provide the output buffer.

-

The output is guaranteed to be the same for all objects of a same topology level.

-

If verbose is 1, longer type names are used, e.g. L1Cache instead of L1.

-

The output string may be parsed back by hwloc_type_sscanf().

-

If size is 0, string may safely be NULL.

-
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
+

Allocate some memory on NUMA memory nodes specified by set.

+

This is similar to hwloc_alloc_membind_nodeset() except that it is allowed to change the current memory binding policy, thus providing more binding support, at the expense of changing the current state.

+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

- -

◆ hwloc_obj_type_string()

+ +

◆ hwloc_free()

- + - - + + + + + + + + + + + + + + + + + +
const char* hwloc_obj_type_string int hwloc_free (hwloc_obj_type_t type)hwloc_topology_t topology,
void * addr,
size_t len 
)
-

Return a constant stringified object type.

-

This function is the basic way to convert a generic type into a string. The output string may be parsed back by hwloc_type_sscanf().

-

hwloc_obj_type_snprintf() may return a more precise output for a specific object, but it requires the caller to provide the output buffer.

+

Free memory that was previously allocated by hwloc_alloc() or hwloc_alloc_membind().

- -

◆ hwloc_type_sscanf()

+ +

◆ hwloc_get_area_membind()

- + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_type_sscanf int hwloc_get_area_membind (const char * string, hwloc_topology_t topology,
hwloc_obj_type_ttypep, const void * addr,
union hwloc_obj_attr_uattrp, size_t len,
hwloc_bitmap_t set,
hwloc_membind_policy_tpolicy,
int flags 
)
+
+ +

Query the CPUs near the physical NUMA node(s) and binding policy of the memory identified by (addr, len ).

+

This function has two output parameters: set and policy. The values returned in these parameters depend on both the flags passed in and the memory binding policies and nodesets of the pages in the address range.

+

If HWLOC_MEMBIND_STRICT is specified, the target pages are first checked to see if they all have the same memory binding policy and nodeset. If they do not, -1 is returned and errno is set to EXDEV. If they are identical across all pages, the set and policy are returned in set and policy, respectively.

+

If HWLOC_MEMBIND_STRICT is not specified, the union of all NUMA node(s) containing pages in the address range is calculated. If all pages in the target have the same policy, it is returned in policy. Otherwise, policy is set to HWLOC_MEMBIND_MIXED.

+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

+

If any other flags are specified, -1 is returned and errno is set to EINVAL.

+

If len is 0, -1 is returned and errno is set to EINVAL.

+ +
+
+ +

◆ hwloc_get_area_memlocation()

+ +
+
+ + + + + + + + + + + + - + + + + + + + + + + + + + @@ -220,47 +471,263 @@
int hwloc_get_area_memlocation (hwloc_topology_t topology,
const void * addr,
size_t attrsize len,
hwloc_bitmap_t set,
int flags 
-

Return an object type and attributes from a type string.

-

Convert strings such as "Package" or "L1iCache" into the corresponding types. Matching is case-insensitive, and only the first letters are actually required to match.

-

The matched object type is set in typep (which cannot be NULL).

-

Type-specific attributes, for instance Cache type, Cache depth, Group depth, Bridge type or OS Device type may be returned in attrp. Attributes that are not specified in the string (for instance "Group" without a depth, or "L2Cache" without a cache type) are set to -1.

-

attrp is only filled if not NULL and if its size specified in attrsize is large enough. It should be at least as large as union hwloc_obj_attr_u.

-
Returns
0 if a type was correctly identified, otherwise -1.
-
Note
This function is guaranteed to match any string returned by hwloc_obj_type_string() or hwloc_obj_type_snprintf().
+

Get the NUMA nodes where memory identified by (addr, len ) is physically allocated.

+

Fills set according to the NUMA nodes where the memory area pages are physically allocated. If no page is actually allocated yet, set may be empty.

+

If pages spread to multiple nodes, it is not specified whether they spread equitably, or whether most of them are on a single node, etc.

+

The operating system may move memory pages from one processor to another at any time according to their binding, so this function may return something that is already outdated.

+

If HWLOC_MEMBIND_BYNODESET is specified in flags, set is considered a nodeset. Otherwise it's a cpuset.

+

If len is 0, set is emptied.

+ +
+
+ +

◆ hwloc_get_membind()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_get_membind (hwloc_topology_t topology,
hwloc_bitmap_t set,
hwloc_membind_policy_tpolicy,
int flags 
)
+
+ +

Query the default memory binding policy and physical locality of the current process or thread.

+

This function has two output parameters: set and policy. The values returned in these parameters depend on both the flags passed in and the current memory binding policies and nodesets in the queried target.

+

Passing the HWLOC_MEMBIND_PROCESS flag specifies that the query target is the current policies and nodesets for all the threads in the current process. Passing HWLOC_MEMBIND_THREAD specifies that the query target is the current policy and nodeset for only the thread invoking this function.

+

If neither of these flags are passed (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-based OS functions or thread-based OS functions, depending on which are available.

+

HWLOC_MEMBIND_STRICT is only meaningful when HWLOC_MEMBIND_PROCESS is also specified. In this case, hwloc will check the default memory policies and nodesets for all threads in the process. If they are not identical, -1 is returned and errno is set to EXDEV. If they are identical, the values are returned in set and policy.

+

Otherwise, if HWLOC_MEMBIND_PROCESS is specified (and HWLOC_MEMBIND_STRICT is not specified), the default set from each thread is logically OR'ed together. If all threads' default policies are the same, policy is set to that policy. If they are different, policy is set to HWLOC_MEMBIND_MIXED.

+

In the HWLOC_MEMBIND_THREAD case (or when neither HWLOC_MEMBIND_PROCESS or HWLOC_MEMBIND_THREAD is specified), there is only one set and policy; they are returned in set and policy, respectively.

+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

+

If any other flags are specified, -1 is returned and errno is set to EINVAL.

+ +
+
+ +

◆ hwloc_get_proc_membind()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_get_proc_membind (hwloc_topology_t topology,
hwloc_pid_t pid,
hwloc_bitmap_t set,
hwloc_membind_policy_tpolicy,
int flags 
)
+
+ +

Query the default memory binding policy and physical locality of the specified process.

+

This function has two output parameters: set and policy. The values returned in these parameters depend on both the flags passed in and the current memory binding policies and nodesets in the queried target.

+

Passing the HWLOC_MEMBIND_PROCESS flag specifies that the query target is the current policies and nodesets for all the threads in the specified process. If HWLOC_MEMBIND_PROCESS is not specified (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-based OS functions or thread-based OS functions, depending on which are available.

+

Note that it does not make sense to pass HWLOC_MEMBIND_THREAD to this function.

+

If HWLOC_MEMBIND_STRICT is specified, hwloc will check the default memory policies and nodesets for all threads in the specified process. If they are not identical, -1 is returned and errno is set to EXDEV. If they are identical, the values are returned in set and policy.

+

Otherwise, set is set to the logical OR of all threads' default set. If all threads' default policies are the same, policy is set to that policy. If they are different, policy is set to HWLOC_MEMBIND_MIXED.

+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

+

If any other flags are specified, -1 is returned and errno is set to EINVAL.

+
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
+ +
+
+ +

◆ hwloc_set_area_membind()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_set_area_membind (hwloc_topology_t topology,
const void * addr,
size_t len,
hwloc_const_bitmap_t set,
hwloc_membind_policy_t policy,
int flags 
)
+
+ +

Bind the already-allocated memory identified by (addr, len) to the NUMA node(s) specified by set.

+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

+
Returns
0 if len is 0.
-This is an extended version of the now deprecated hwloc_obj_type_sscanf().
+-1 with errno set to ENOSYS if the action is not supported +
+-1 with errno set to EXDEV if the binding cannot be enforced
- -

◆ hwloc_type_sscanf_as_depth()

+ +

◆ hwloc_set_membind()

- + - - + + + + + + + + - - + + - + + + + + + + + +
int hwloc_type_sscanf_as_depth int hwloc_set_membind (const char * string, hwloc_topology_t topology,
hwloc_const_bitmap_t set,
hwloc_obj_type_ttypep, hwloc_membind_policy_t policy,
hwloc_topology_t int flags 
)
+
+ +

Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) specified by set.

+

If neither HWLOC_MEMBIND_PROCESS nor HWLOC_MEMBIND_THREAD is specified, the current process is assumed to be single-threaded. This is the most portable form as it permits hwloc to use either process-based OS functions or thread-based OS functions, depending on which are available.

+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

+
Returns
-1 with errno set to ENOSYS if the action is not supported
+
+-1 with errno set to EXDEV if the binding cannot be enforced
+ +
+
+ +

◆ hwloc_set_proc_membind()

+ +
+
+ + + + + - - + + + + + + + + + + + + + + + + + + + + @@ -270,23 +737,23 @@
int hwloc_set_proc_membind (hwloc_topology_t  topology,
int * depthp hwloc_pid_t pid,
hwloc_const_bitmap_t set,
hwloc_membind_policy_t policy,
int flags 
-

Return an object type and its level depth from a type string.

-

Convert strings such as "Package" or "L1iCache" into the corresponding types and return in depthp the depth of the corresponding level in the topology topology.

-

If no object of this type is present on the underlying architecture, HWLOC_TYPE_DEPTH_UNKNOWN is returned.

-

If multiple such levels exist (for instance if giving Group without any depth), the function may return HWLOC_TYPE_DEPTH_MULTIPLE instead.

-

The matched object type is set in typep if typep is non NULL.

-
Note
This function is similar to hwloc_type_sscanf() followed by hwloc_get_type_depth() but it also automatically disambiguates multiple group levels etc.
+

Set the default memory binding policy of the specified process to prefer the NUMA node(s) specified by set.

+

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

+
Returns
-1 with errno set to ENOSYS if the action is not supported
-This function is guaranteed to match any string returned by hwloc_obj_type_string() or hwloc_obj_type_snprintf().
+-1 with errno set to EXDEV if the binding cannot be enforced
+
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
+
@ HWLOC_MEMBIND_BIND
Allocate memory on the specified nodes.
Definition: hwloc.h:1390
+
static void * hwloc_alloc_membind_policy(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Allocate some memory on NUMA memory nodes specified by set.
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00189.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00189.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00189.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00189.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Consulting and Adding Key-Value Info Attributes +Hardware Locality (hwloc): Changing the Source of Topology Discovery @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,56 +27,128 @@ - + +/* @license-end */
-
Consulting and Adding Key-Value Info Attributes
+
Changing the Source of Topology Discovery
+ + + +

+Enumerations

enum  hwloc_topology_components_flag_e { HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST + }
 
- - - - + + + + + + + + + +

Functions

static const char * hwloc_obj_get_info_by_name (hwloc_obj_t obj, const char *name)
 
int hwloc_obj_add_info (hwloc_obj_t obj, const char *name, const char *value)
 
int hwloc_topology_set_pid (hwloc_topology_t restrict topology, hwloc_pid_t pid)
 
int hwloc_topology_set_synthetic (hwloc_topology_t restrict topology, const char *restrict description)
 
int hwloc_topology_set_xml (hwloc_topology_t restrict topology, const char *restrict xmlpath)
 
int hwloc_topology_set_xmlbuffer (hwloc_topology_t restrict topology, const char *restrict buffer, int size)
 
int hwloc_topology_set_components (hwloc_topology_t restrict topology, unsigned long flags, const char *restrict name)
 

Detailed Description

+

If none of the functions below is called, the default is to detect all the objects of the machine that the caller is allowed to access.

+

This default behavior may also be modified through environment variables if the application did not modify it already. Setting HWLOC_XMLFILE in the environment enforces the discovery from a XML file as if hwloc_topology_set_xml() had been called. Setting HWLOC_SYNTHETIC enforces a synthetic topology as if hwloc_topology_set_synthetic() had been called.

+

Finally, HWLOC_THISSYSTEM enforces the return value of hwloc_topology_is_thissystem().

+

Enumeration Type Documentation

+ +

◆ hwloc_topology_components_flag_e

+ +
+
+ +

Flags to be passed to hwloc_topology_set_components()

+ + +
Enumerator
HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST 

Blacklist the target component from being used.

+
+ +
+

Function Documentation

- -

◆ hwloc_obj_add_info()

+ +

◆ hwloc_topology_set_components()

- + - - + + + + + + + + - - + + + + + + + + +
int hwloc_obj_add_info int hwloc_topology_set_components (hwloc_obj_t obj, hwloc_topology_t restrict topology,
unsigned long flags,
const char * name, const char *restrict name 
)
+
+ +

Prevent a discovery component from being used for a topology.

+

name is the name of the discovery component that should not be used when loading topology topology. The name is a string such as "cuda".

+

For components with multiple phases, it may also be suffixed with the name of a phase, for instance "linux:io".

+

flags should be HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST.

+

This may be used to avoid expensive parts of the discovery process. For instance, CUDA-specific discovery may be expensive and unneeded while generic I/O discovery could still be useful.

+ +
+
+ +

◆ hwloc_topology_set_pid()

+ +
+
+ + + + + + - - + + @@ -86,36 +158,112 @@
int hwloc_topology_set_pid (hwloc_topology_t restrict topology,
const char * value hwloc_pid_t pid 
-

Add the given info name and value pair to the given object.

-

The info is appended to the existing info array even if another key with the same name already exists.

-

The input strings are copied before being added in the object infos.

-
Returns
0 on success, -1 on error.
-
Note
This function may be used to enforce object colors in the lstopo graphical output by using "lstopoStyle" as a name and "Background=#rrggbb" as a value. See CUSTOM COLORS in the lstopo(1) manpage for details.
+

Change which process the topology is viewed from.

+

On some systems, processes may have different views of the machine, for instance the set of allowed CPUs. By default, hwloc exposes the view from the current process. Calling hwloc_topology_set_pid() permits to make it expose the topology of the machine from the point of view of another process.

+
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
-If value contains some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml() in hwloc/export.h.
+-1 is returned and errno is set to ENOSYS on platforms that do not support this feature.
- -

◆ hwloc_obj_get_info_by_name()

+ +

◆ hwloc_topology_set_synthetic()

- - - - - -
- + - - + + - - + + + + + + + + +
static const char* hwloc_obj_get_info_by_name int hwloc_topology_set_synthetic (hwloc_obj_t obj, hwloc_topology_t restrict topology,
const char * name const char *restrict description 
)
+
+ +

Enable synthetic topology.

+

Gather topology information from the given description, a space-separated string of <type:number> describing the object type and arity at each level. All types may be omitted (space-separated string of numbers) so that hwloc chooses all types according to usual topologies. See also the Synthetic topologies.

+

Setting the environment variable HWLOC_SYNTHETIC may also result in this behavior.

+

If description was properly parsed and describes a valid topology configuration, this function returns 0. Otherwise -1 is returned and errno is set to EINVAL.

+

Note that this function does not actually load topology information; it just tells hwloc where to load it from. You'll still need to invoke hwloc_topology_load() to actually load the topology information.

+
Note
For convenience, this backend provides empty binding hooks which just return success.
+
+On success, the synthetic component replaces the previously enabled component (if any), but the topology is not actually modified until hwloc_topology_load().
+ +
+ + +

◆ hwloc_topology_set_xml()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_topology_set_xml (hwloc_topology_t restrict topology,
const char *restrict xmlpath 
)
+
+ +

Enable XML-file based topology.

+

Gather topology information from the XML file given at xmlpath. Setting the environment variable HWLOC_XMLFILE may also result in this behavior. This file may have been generated earlier with hwloc_topology_export_xml() in hwloc/export.h, or lstopo file.xml.

+

Note that this function does not actually load topology information; it just tells hwloc where to load it from. You'll still need to invoke hwloc_topology_load() to actually load the topology information.

+
Returns
-1 with errno set to EINVAL on failure to read the XML file.
+
Note
See also hwloc_topology_set_userdata_import_callback() for importing application-specific object userdata.
+
+For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM has to be set to assert that the loaded file is really the underlying system.
+
+On success, the XML component replaces the previously enabled component (if any), but the topology is not actually modified until hwloc_topology_load().
+ +
+
+ +

◆ hwloc_topology_set_xmlbuffer()

+ +
+
+ + + + + + + + + + + + + + + + + + @@ -123,16 +271,17 @@
int hwloc_topology_set_xmlbuffer (hwloc_topology_t restrict topology,
const char *restrict buffer,
int size 
-
-inlinestatic
-

Search the given key name in object infos and return the corresponding value.

-

If multiple keys match the given name, only the first one is returned.

-
Returns
NULL if no such key exists.
+

Enable XML based topology using a memory buffer (instead of a file, as with hwloc_topology_set_xml()).

+

Gather topology information from the XML memory buffer given at buffer and of length size. This buffer may have been filled earlier with hwloc_topology_export_xmlbuffer() in hwloc/export.h.

+

Note that this function does not actually load topology information; it just tells hwloc where to load it from. You'll still need to invoke hwloc_topology_load() to actually load the topology information.

+
Returns
-1 with errno set to EINVAL on failure to read the XML buffer.
+
Note
See also hwloc_topology_set_userdata_import_callback() for importing application-specific object userdata.
+
+For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM has to be set to assert that the loaded file is really the underlying system.
+
+On success, the XML component replaces the previously enabled component (if any), but the topology is not actually modified until hwloc_topology_load().
@@ -141,7 +290,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00190.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00190.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00190.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00190.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): CPU binding +Hardware Locality (hwloc): Topology Detection Configuration and Query @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,163 +27,221 @@
- + +/* @license-end */
-
CPU binding
+
Topology Detection Configuration and Query
+ + + + + + + + + +

+Data Structures

struct  hwloc_topology_discovery_support
 
struct  hwloc_topology_cpubind_support
 
struct  hwloc_topology_membind_support
 
struct  hwloc_topology_support
 
- + + - +

Enumerations

enum  hwloc_cpubind_flags_t { HWLOC_CPUBIND_PROCESS, -HWLOC_CPUBIND_THREAD, -HWLOC_CPUBIND_STRICT, -HWLOC_CPUBIND_NOMEMBIND +
enum  hwloc_topology_flags_e { HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED, +HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, +HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES + }
 
enum  hwloc_type_filter_e { HWLOC_TYPE_FILTER_KEEP_ALL, +HWLOC_TYPE_FILTER_KEEP_NONE, +HWLOC_TYPE_FILTER_KEEP_STRUCTURE, +HWLOC_TYPE_FILTER_KEEP_IMPORTANT }
 
 
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +

Functions

int hwloc_set_cpubind (hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)
 
int hwloc_get_cpubind (hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
 
int hwloc_set_proc_cpubind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags)
 
int hwloc_get_proc_cpubind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
 
int hwloc_set_thread_cpubind (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags)
 
int hwloc_get_thread_cpubind (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags)
 
int hwloc_get_last_cpu_location (hwloc_topology_t topology, hwloc_cpuset_t set, int flags)
 
int hwloc_get_proc_last_cpu_location (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags)
 
int hwloc_topology_set_flags (hwloc_topology_t topology, unsigned long flags)
 
unsigned long hwloc_topology_get_flags (hwloc_topology_t topology)
 
int hwloc_topology_is_thissystem (hwloc_topology_t restrict topology)
 
const struct hwloc_topology_supporthwloc_topology_get_support (hwloc_topology_t restrict topology)
 
int hwloc_topology_set_type_filter (hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e filter)
 
int hwloc_topology_get_type_filter (hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter)
 
int hwloc_topology_set_all_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
int hwloc_topology_set_cache_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
int hwloc_topology_set_icache_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
int hwloc_topology_set_io_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
void hwloc_topology_set_userdata (hwloc_topology_t topology, const void *userdata)
 
void * hwloc_topology_get_userdata (hwloc_topology_t topology)
 

Detailed Description

-

Some operating systems only support binding threads or processes to a single PU. Others allow binding to larger sets such as entire Cores or Packages or even random sets of invididual PUs. In such operating system, the scheduler is free to run the task on one of these PU, then migrate it to another PU, etc. It is often useful to call hwloc_bitmap_singlify() on the target CPU set before passing it to the binding function to avoid these expensive migrations. See the documentation of hwloc_bitmap_singlify() for details.

-

Some operating systems do not provide all hwloc-supported mechanisms to bind processes, threads, etc. hwloc_topology_get_support() may be used to query about the actual CPU binding support in the currently used operating system.

-

When the requested binding operation is not available and the HWLOC_CPUBIND_STRICT flag was passed, the function returns -1. errno is set to ENOSYS when it is not possible to bind the requested kind of object processes/threads. errno is set to EXDEV when the requested cpuset can not be enforced (e.g. some systems only allow one CPU, and some other systems only allow one NUMA node).

-

If HWLOC_CPUBIND_STRICT was not passed, the function may fail as well, or the operating system may use a slightly different operation (with side-effects, smaller binding set, etc.) when the requested operation is not exactly supported.

-

The most portable version that should be preferred over the others, whenever possible, is the following one which just binds the current program, assuming it is single-threaded:

-
hwloc_set_cpubind(topology, set, 0),

If the program may be multithreaded, the following one should be preferred to only bind the current thread:

-
See also
Some example codes are available under doc/examples/ in the source tree.
-
Note
To unbind, just call the binding function with either a full cpuset or a cpuset equal to the system cpuset.
-
-On some operating systems, CPU binding may have effects on memory binding, see HWLOC_CPUBIND_NOMEMBIND
-
-Running lstopo --top or hwloc-ps can be a very convenient tool to check how binding actually happened.
+

Several functions can optionally be called between hwloc_topology_init() and hwloc_topology_load() to configure how the detection should be performed, e.g. to ignore some objects types, define a synthetic topology, etc.

Enumeration Type Documentation

- -

◆ hwloc_cpubind_flags_t

+ +

◆ hwloc_topology_flags_e

+ +
+
+ + + + +
enum hwloc_topology_flags_e
+
+ +

Flags to be set onto a topology context before load.

+

Flags should be given to hwloc_topology_set_flags(). They may also be returned by hwloc_topology_get_flags().

+ + + + +
Enumerator
HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED 

Detect the whole system, ignore reservations, include disallowed objects.

+

Gather all resources, even if some were disabled by the administrator. For instance, ignore Linux Cgroup/Cpusets and gather all processors and memory nodes.

+

When this flag is not set, PUs and NUMA nodes that are disallowed are not added to the topology. Parent objects (package, core, cache, etc.) are added only if some of their children are allowed. All existing PUs and NUMA nodes in the topology are allowed. hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset() are equal to the root object cpuset and nodeset.

+

When this flag is set, the actual sets of allowed PUs and NUMA nodes are given by hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset(). They may be smaller than the root object cpuset and nodeset.

+

If the current topology is exported to XML and reimported later, this flag should be set again in the reimported topology so that disallowed resources are reimported as well.

+
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM 

Assume that the selected backend provides the topology for the system on which we are running.

+

This forces hwloc_topology_is_thissystem() to return 1, i.e. makes hwloc assume that the selected backend provides the topology for the system on which we are running, even if it is not the OS-specific backend but the XML backend for instance. This means making the binding functions actually call the OS-specific system calls and really do binding, while the XML backend would otherwise provide empty hooks just returning success.

+

Setting the environment variable HWLOC_THISSYSTEM may also result in the same behavior.

+

This can be used for efficiency reasons to first detect the topology once, save it to an XML file, and quickly reload it later through the XML backend, but still having binding functions actually do bind.

+
HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES 

Get the set of allowed resources from the local operating system even if the topology was loaded from XML or synthetic description.

+

If the topology was loaded from XML or from a synthetic string, restrict it by applying the current process restrictions such as Linux Cgroup/Cpuset.

+

This is useful when the topology is not loaded directly from the local machine (e.g. for performance reason) and it comes with all resources, while the running process is restricted to only parts of the machine.

+

This flag is ignored unless HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM is also set since the loaded topology must match the underlying machine where restrictions will be gathered from.

+

Setting the environment variable HWLOC_THISSYSTEM_ALLOWED_RESOURCES would result in the same behavior.

+
+ +
+
+ +

◆ hwloc_type_filter_e

-

Process/Thread binding flags.

-

These bit flags can be used to refine the binding policy.

-

The default (0) is to bind the current process, assumed to be single-threaded, in a non-strict way. This is the most portable way to bind as all operating systems usually provide it.

-
Note
Not all systems support all kinds of binding. See the "Detailed Description" section of CPU binding for a description of errors that can occur.
+

Type filtering flags.

+

By default, most objects are kept (HWLOC_TYPE_FILTER_KEEP_ALL). Instruction caches, I/O and Misc objects are ignored by default (HWLOC_TYPE_FILTER_KEEP_NONE). Die and Group levels are ignored unless they bring structure (HWLOC_TYPE_FILTER_KEEP_STRUCTURE).

+

Note that group objects are also ignored individually (without the entire level) when they do not bring structure.

- - - -
Enumerator
HWLOC_CPUBIND_PROCESS 

Bind all threads of the current (possibly) multithreaded process.

+
Enumerator
HWLOC_TYPE_FILTER_KEEP_ALL 

Keep all objects of this type.

+

Cannot be set for HWLOC_OBJ_GROUP (groups are designed only to add more structure to the topology).

HWLOC_CPUBIND_THREAD 

Bind current thread of current process.

+
HWLOC_TYPE_FILTER_KEEP_NONE 

Ignore all objects of this type.

+

The bottom-level type HWLOC_OBJ_PU, the HWLOC_OBJ_NUMANODE type, and the top-level type HWLOC_OBJ_MACHINE may not be ignored.

HWLOC_CPUBIND_STRICT 

Request for strict binding from the OS.

-

By default, when the designated CPUs are all busy while other CPUs are idle, operating systems may execute the thread/process on those other CPUs instead of the designated CPUs, to let them progress anyway. Strict binding means that the thread/process will _never_ execute on other cpus than the designated CPUs, even when those are busy with other tasks and other CPUs are idle.

-
Note
Depending on the operating system, strict binding may not be possible (e.g., the OS does not implement it) or not allowed (e.g., for an administrative reasons), and the function will fail in that case.
-

When retrieving the binding of a process, this flag checks whether all its threads actually have the same binding. If the flag is not given, the binding of each thread will be accumulated.

-
Note
This flag is meaningless when retrieving the binding of a thread.
+
HWLOC_TYPE_FILTER_KEEP_STRUCTURE 

Only ignore objects if their entire level does not bring any structure.

+

Keep the entire level of objects if at least one of these objects adds structure to the topology. An object brings structure when it has multiple children and it is not the only child of its parent.

+

If all objects in the level are the only child of their parent, and if none of them has multiple children, the entire level is removed.

+

Cannot be set for I/O and Misc objects since the topology structure does not matter there.

HWLOC_CPUBIND_NOMEMBIND 

Avoid any effect on memory binding.

-

On some operating systems, some CPU binding function would also bind the memory on the corresponding NUMA node. It is often not a problem for the application, but if it is, setting this flag will make hwloc avoid using OS functions that would also bind memory. This will however reduce the support of CPU bindings, i.e. potentially return -1 with errno set to ENOSYS in some cases.

-

This flag is only meaningful when used with functions that set the CPU binding. It is ignored when used with functions that get CPU binding information.

+
HWLOC_TYPE_FILTER_KEEP_IMPORTANT 

Only keep likely-important objects of the given type.

+

It is only useful for I/O object types. For HWLOC_OBJ_PCI_DEVICE and HWLOC_OBJ_OS_DEVICE, it means that only objects of major/common kinds are kept (storage, network, OpenFabrics, Intel MICs, CUDA, OpenCL, NVML, and displays). Also, only OS devices directly attached on PCI (e.g. no USB) are reported. For HWLOC_OBJ_BRIDGE, it means that bridges are kept only if they have children.

+

This flag equivalent to HWLOC_TYPE_FILTER_KEEP_ALL for Normal, Memory and Misc types since they are likely important.

Function Documentation

- -

◆ hwloc_get_cpubind()

+ +

◆ hwloc_topology_get_flags()

- + - - - - - - - - - - - + + - - +
int hwloc_get_cpubind unsigned long hwloc_topology_get_flags (hwloc_topology_t topology,
hwloc_cpuset_t set,
hwloc_topology_t topology) int flags 
+
+ +

Get OR'ed flags of a topology.

+

Get the OR'ed set of hwloc_topology_flags_e of a topology.

+
Returns
the flags previously set with hwloc_topology_set_flags().
+ +
+
+ +

◆ hwloc_topology_get_support()

+ +
+
+ + + + + - -
const struct hwloc_topology_support* hwloc_topology_get_support (hwloc_topology_t restrict topology) )
-

Get current process or thread binding.

-

Writes into set the physical cpuset which the process or thread (according to flags) was last bound to.

+

Retrieve the topology support.

+

Each flag indicates whether a feature is supported. If set to 0, the feature is not supported. If set to 1, the feature is supported, but the corresponding call may still fail in some corner cases.

+

These features are also listed by hwloc-info --support

- -

◆ hwloc_get_last_cpu_location()

+ +

◆ hwloc_topology_get_type_filter()

- + - + - - + + - - + + @@ -193,41 +251,71 @@
int hwloc_get_last_cpu_location int hwloc_topology_get_type_filter (hwloc_topology_t hwloc_topology_t  topology,
hwloc_cpuset_t set, hwloc_obj_type_t type,
int flags enum hwloc_type_filter_efilter 
-

Get the last physical CPU where the current process or thread ran.

-

The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated.

-

flags can include either HWLOC_CPUBIND_PROCESS or HWLOC_CPUBIND_THREAD to specify whether the query should be for the whole process (union of all CPUs on which all threads are running), or only the current thread. If the process is single-threaded, flags can be set to zero to let hwloc use whichever method is available on the underlying OS.

+

Get the current filtering for the given object type.

- -

◆ hwloc_get_proc_cpubind()

+ +

◆ hwloc_topology_get_userdata()

- + - - + + + +
int hwloc_get_proc_cpubind void* hwloc_topology_get_userdata (hwloc_topology_t topology, hwloc_topology_t topology)
+
+ +

Retrieve the topology-specific userdata pointer.

+

Retrieve the application-given private data pointer that was previously set with hwloc_topology_set_userdata().

+ +
+
+ +

◆ hwloc_topology_is_thissystem()

+ +
+
+ - + + + + - - +
int hwloc_topology_is_thissystem (hwloc_topology_t restrict topology) hwloc_pid_t pid,
+
+ +

Does the topology context come from this system?

+
Returns
1 if this topology context was built using the system running this program.
+
+0 instead (for instance if using another file-system root, a XML topology file, or a synthetic topology).
+ +
+
+ +

◆ hwloc_topology_set_all_types_filter()

+ +
+
+ - - - - + + + + - - + + @@ -237,43 +325,58 @@
hwloc_cpuset_t set, int hwloc_topology_set_all_types_filter (hwloc_topology_t topology,
int flags enum hwloc_type_filter_e filter 
-

Get the current physical binding of process pid.

-
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
-
-As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the binding for that specific thread is returned.
-
-On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in flags.
+

Set the filtering for all object types.

+

If some types do not support this filtering, they are silently ignored.

- -

◆ hwloc_get_proc_last_cpu_location()

+ +

◆ hwloc_topology_set_cache_types_filter()

- + - + - - + + - - - + + + +
int hwloc_get_proc_last_cpu_location int hwloc_topology_set_cache_types_filter (hwloc_topology_t hwloc_topology_t  topology,
hwloc_pid_t pid, enum hwloc_type_filter_e filter 
hwloc_cpuset_t set, )
+
+ +

Set the filtering for all CPU cache object types.

+

Memory-side caches are not involved since they are not CPU caches.

+ +
+
+ +

◆ hwloc_topology_set_flags()

+ +
+
+ + + + + + - + @@ -284,45 +387,30 @@
int hwloc_topology_set_flags (hwloc_topology_t topology,
int unsigned long  flags 
-

Get the last physical CPU where a process ran.

-

The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated.

-
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
-
-As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the last CPU location of that specific thread is returned.
-
-On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in flags.
+

Set OR'ed flags to non-yet-loaded topology.

+

Set a OR'ed set of hwloc_topology_flags_e onto a topology that was not yet loaded.

+

If this function is called multiple times, the last invokation will erase and replace the set of flags that was previously set.

+

The flags set in a topology may be retrieved with hwloc_topology_get_flags()

- -

◆ hwloc_get_thread_cpubind()

+ +

◆ hwloc_topology_set_icache_types_filter()

- + - + - - - - - - - - - - - - - - + + @@ -332,36 +420,28 @@
int hwloc_get_thread_cpubind int hwloc_topology_set_icache_types_filter (hwloc_topology_t hwloc_topology_t  topology,
hwloc_thread_t thread,
hwloc_cpuset_t set,
int flags enum hwloc_type_filter_e filter 
-

Get the current physical binding of thread tid.

-
Note
hwloc_thread_t is pthread_t on Unix platforms, and HANDLE on native Windows platforms.
-
-HWLOC_CPUBIND_PROCESS can not be used in flags.
+

Set the filtering for all CPU instruction cache object types.

+

Memory-side caches are not involved since they are not CPU caches.

- -

◆ hwloc_set_cpubind()

+ +

◆ hwloc_topology_set_io_types_filter()

- + - + - - - - - - - - + + @@ -371,42 +451,33 @@
int hwloc_set_cpubind int hwloc_topology_set_io_types_filter (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_cpuset_t set,
int flags enum hwloc_type_filter_e filter 
-

Bind current process or thread on cpus given in physical bitmap set.

-
Returns
-1 with errno set to ENOSYS if the action is not supported
-
--1 with errno set to EXDEV if the binding cannot be enforced
+

Set the filtering for all I/O object types.

- -

◆ hwloc_set_proc_cpubind()

+ +

◆ hwloc_topology_set_type_filter()

- + - + - - - - - - - - + + - - + + @@ -416,44 +487,27 @@
int hwloc_set_proc_cpubind int hwloc_topology_set_type_filter (hwloc_topology_t hwloc_topology_t  topology,
hwloc_pid_t pid,
hwloc_const_cpuset_t set, hwloc_obj_type_t type,
int flags enum hwloc_type_filter_e filter 
-

Bind a process pid on cpus given in physical bitmap set.

-
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
-
-As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the binding is applied to that specific thread.
-
-On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in flags.
+

Set the filtering for the given object type.

- -

◆ hwloc_set_thread_cpubind()

+ +

◆ hwloc_topology_set_userdata()

- + - + - - - - - - - - - - - - - - + + @@ -463,10 +517,10 @@
int hwloc_set_thread_cpubind void hwloc_topology_set_userdata (hwloc_topology_t hwloc_topology_t  topology,
hwloc_thread_t thread,
hwloc_const_cpuset_t set,
int flags const void * userdata 
-

Bind a thread thread on cpus given in physical bitmap set.

-
Note
hwloc_thread_t is pthread_t on Unix platforms, and HANDLE on native Windows platforms.
-
-HWLOC_CPUBIND_PROCESS can not be used in flags.
+

Set the topology-specific userdata pointer.

+

Each topology may store one application-given private data pointer. It is initialized to NULL. hwloc will never modify it.

+

Use it as you wish, after hwloc_topology_init() and until hwloc_topolog_destroy().

+

This pointer is not exported to XML.

@@ -475,7 +529,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00191.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00191.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00191.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00191.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Memory binding +Hardware Locality (hwloc): Modifying a loaded Topology @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
@@ -42,369 +43,118 @@ Enumerations | Functions
-
Memory binding
+
Modifying a loaded Topology
- - - + - +

Enumerations

enum  hwloc_membind_policy_t {
-  HWLOC_MEMBIND_DEFAULT, -HWLOC_MEMBIND_FIRSTTOUCH, -HWLOC_MEMBIND_BIND, -HWLOC_MEMBIND_INTERLEAVE, +
enum  hwloc_restrict_flags_e {
+  HWLOC_RESTRICT_FLAG_REMOVE_CPULESS, +HWLOC_RESTRICT_FLAG_BYNODESET = (1UL<<3), +HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS, +HWLOC_RESTRICT_FLAG_ADAPT_MISC,
-  HWLOC_MEMBIND_NEXTTOUCH, -HWLOC_MEMBIND_MIXED +  HWLOC_RESTRICT_FLAG_ADAPT_IO
}
 
enum  hwloc_membind_flags_t {
-  HWLOC_MEMBIND_PROCESS, -HWLOC_MEMBIND_THREAD, -HWLOC_MEMBIND_STRICT, -HWLOC_MEMBIND_MIGRATE, -
-  HWLOC_MEMBIND_NOCPUBIND, -HWLOC_MEMBIND_BYNODESET -
+
 
enum  hwloc_allow_flags_e { HWLOC_ALLOW_FLAG_ALL, +HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS, +HWLOC_ALLOW_FLAG_CUSTOM }
 
 
- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +

Functions

int hwloc_set_membind (hwloc_topology_t topology, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_get_membind (hwloc_topology_t topology, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
 
int hwloc_set_proc_membind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_get_proc_membind (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
 
int hwloc_set_area_membind (hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_get_area_membind (hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags)
 
int hwloc_get_area_memlocation (hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, int flags)
 
void * hwloc_alloc (hwloc_topology_t topology, size_t len)
 
void * hwloc_alloc_membind (hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
static void * hwloc_alloc_membind_policy (hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
 
int hwloc_free (hwloc_topology_t topology, void *addr, size_t len)
 
int hwloc_topology_restrict (hwloc_topology_t restrict topology, hwloc_const_bitmap_t set, unsigned long flags)
 
int hwloc_topology_allow (hwloc_topology_t restrict topology, hwloc_const_cpuset_t cpuset, hwloc_const_nodeset_t nodeset, unsigned long flags)
 
hwloc_obj_t hwloc_topology_insert_misc_object (hwloc_topology_t topology, hwloc_obj_t parent, const char *name)
 
hwloc_obj_t hwloc_topology_alloc_group_object (hwloc_topology_t topology)
 
hwloc_obj_t hwloc_topology_insert_group_object (hwloc_topology_t topology, hwloc_obj_t group)
 
int hwloc_obj_add_other_obj_sets (hwloc_obj_t dst, hwloc_obj_t src)
 

Detailed Description

-

Memory binding can be done three ways:

-
    -
  • explicit memory allocation thanks to hwloc_alloc_membind() and friends: the binding will have effect on the memory allocated by these functions.
  • -
  • implicit memory binding through binding policy: hwloc_set_membind() and friends only define the current policy of the process, which will be applied to the subsequent calls to malloc() and friends.
  • -
  • migration of existing memory ranges, thanks to hwloc_set_area_membind() and friends, which move already-allocated data.
  • -
-

Not all operating systems support all three ways. hwloc_topology_get_support() may be used to query about the actual memory binding support in the currently used operating system.

-

When the requested binding operation is not available and the HWLOC_MEMBIND_STRICT flag was passed, the function returns -1. errno will be set to ENOSYS when the system does support the specified action or policy (e.g., some systems only allow binding memory on a per-thread basis, whereas other systems only allow binding memory for all threads in a process). errno will be set to EXDEV when the requested set can not be enforced (e.g., some systems only allow binding memory to a single NUMA node).

-

If HWLOC_MEMBIND_STRICT was not passed, the function may fail as well, or the operating system may use a slightly different operation (with side-effects, smaller binding set, etc.) when the requested operation is not exactly supported.

-

The most portable form that should be preferred over the others whenever possible is as follows. It allocates some memory hopefully bound to the specified set. To do so, hwloc will possibly have to change the current memory binding policy in order to actually get the memory bound, if the OS does not provide any other way to simply allocate bound memory without changing the policy for all allocations. That is the difference with hwloc_alloc_membind(), which will never change the current memory binding policy.

-

Each hwloc memory binding function takes a bitmap argument that is a CPU set by default, or a NUMA memory node set if the flag HWLOC_MEMBIND_BYNODESET is specified. See Object Sets (hwloc_cpuset_t and hwloc_nodeset_t) and The bitmap API for a discussion of CPU sets and NUMA memory node sets. It is also possible to convert between CPU set and node set using hwloc_cpuset_to_nodeset() or hwloc_cpuset_from_nodeset().

-

Memory binding by CPU set cannot work for CPU-less NUMA memory nodes. Binding by nodeset should therefore be preferred whenever possible.

-
See also
Some example codes are available under doc/examples/ in the source tree.
-
Note
On some operating systems, memory binding affects the CPU binding; see HWLOC_MEMBIND_NOCPUBIND

Enumeration Type Documentation

- -

◆ hwloc_membind_flags_t

+ +

◆ hwloc_allow_flags_e

-

Memory binding flags.

-

These flags can be used to refine the binding policy. All flags can be logically OR'ed together with the exception of HWLOC_MEMBIND_PROCESS and HWLOC_MEMBIND_THREAD; these two flags are mutually exclusive.

-

Not all systems support all kinds of binding. hwloc_topology_get_support() may be used to query about the actual memory binding support in the currently used operating system. See the "Detailed Description" section of Memory binding for a description of errors that can occur.

+

Flags to be given to hwloc_topology_allow().

- - - - - -
Enumerator
HWLOC_MEMBIND_PROCESS 

Set policy for all threads of the specified (possibly multithreaded) process. This flag is mutually exclusive with HWLOC_MEMBIND_THREAD.

-
HWLOC_MEMBIND_THREAD 

Set policy for a specific thread of the current process. This flag is mutually exclusive with HWLOC_MEMBIND_PROCESS.

-
HWLOC_MEMBIND_STRICT 

Request strict binding from the OS. The function will fail if the binding can not be guaranteed / completely enforced.

-

This flag has slightly different meanings depending on which function it is used with.

+
Enumerator
HWLOC_ALLOW_FLAG_ALL 

Mark all objects as allowed in the topology.

+

cpuset and nođeset given to hwloc_topology_allow() must be NULL.

HWLOC_MEMBIND_MIGRATE 

Migrate existing allocated memory. If the memory cannot be migrated and the HWLOC_MEMBIND_STRICT flag is passed, an error will be returned.

+
HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS 

Only allow objects that are available to the current process.

+

The topology must have HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM so that the set of available resources can actually be retrieved from the operating system.

+

cpuset and nođeset given to hwloc_topology_allow() must be NULL.

HWLOC_MEMBIND_NOCPUBIND 

Avoid any effect on CPU binding.

-

On some operating systems, some underlying memory binding functions also bind the application to the corresponding CPU(s). Using this flag will cause hwloc to avoid using OS functions that could potentially affect CPU bindings. Note, however, that using NOCPUBIND may reduce hwloc's overall memory binding support. Specifically: some of hwloc's memory binding functions may fail with errno set to ENOSYS when used with NOCPUBIND.

-
HWLOC_MEMBIND_BYNODESET 

Consider the bitmap argument as a nodeset.

-

The bitmap argument is considered a nodeset if this flag is given, or a cpuset otherwise by default.

-

Memory binding by CPU set cannot work for CPU-less NUMA memory nodes. Binding by nodeset should therefore be preferred whenever possible.

+
HWLOC_ALLOW_FLAG_CUSTOM 

Allow a custom set of objects, given to hwloc_topology_allow() as cpuset and/or nodeset parameters.

- -

◆ hwloc_membind_policy_t

+ +

◆ hwloc_restrict_flags_e

-

Memory binding policy.

-

These constants can be used to choose the binding policy. Only one policy can be used at a time (i.e., the values cannot be OR'ed together).

-

Not all systems support all kinds of binding. hwloc_topology_get_support() may be used to query about the actual memory binding policy support in the currently used operating system. See the "Detailed Description" section of Memory binding for a description of errors that can occur.

+

Flags to be given to hwloc_topology_restrict().

- - - - - -
Enumerator
HWLOC_MEMBIND_DEFAULT 

Reset the memory allocation policy to the system default. Depending on the operating system, this may correspond to HWLOC_MEMBIND_FIRSTTOUCH (Linux), or HWLOC_MEMBIND_BIND (AIX, HP-UX, Solaris, Windows). This policy is never returned by get membind functions. The nodeset argument is ignored.

-
HWLOC_MEMBIND_FIRSTTOUCH 

Allocate each memory page individually on the local NUMA node of the thread that touches it.

-

The given nodeset should usually be hwloc_topology_get_topology_nodeset() so that the touching thread may run and allocate on any node in the system.

-

On AIX, if the nodeset is smaller, pages are allocated locally (if the local node is in the nodeset) or from a random non-local node (otherwise).

+
Enumerator
HWLOC_RESTRICT_FLAG_REMOVE_CPULESS 

Remove all objects that became CPU-less. By default, only objects that contain no PU and no memory are removed. This flag may not be used with HWLOC_RESTRICT_FLAG_BYNODESET.

HWLOC_MEMBIND_BIND 

Allocate memory on the specified nodes.

+
HWLOC_RESTRICT_FLAG_BYNODESET 

Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially included in the given set. This flag may not be used with HWLOC_RESTRICT_FLAG_REMOVE_CPULESS.

HWLOC_MEMBIND_INTERLEAVE 

Allocate memory on the given nodes in an interleaved / round-robin manner. The precise layout of the memory across multiple NUMA nodes is OS/system specific. Interleaving can be useful when threads distributed across the specified NUMA nodes will all be accessing the whole memory range concurrently, since the interleave will then balance the memory references.

+
HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS 

Remove all objects that became Memory-less. By default, only objects that contain no PU and no memory are removed. This flag may only be used with HWLOC_RESTRICT_FLAG_BYNODESET.

HWLOC_MEMBIND_NEXTTOUCH 

For each page bound with this policy, by next time it is touched (and next time only), it is moved from its current location to the local NUMA node of the thread where the memory reference occurred (if it needs to be moved at all).

+
HWLOC_RESTRICT_FLAG_ADAPT_MISC 

Move Misc objects to ancestors if their parents are removed during restriction. If this flag is not set, Misc objects are removed when their parents are removed.

HWLOC_MEMBIND_MIXED 

Returned by get_membind() functions when multiple threads or parts of a memory area have differing memory binding policies. Also returned when binding is unknown because binding hooks are empty when the topology is loaded from XML without HWLOC_THISSYSTEM=1, etc.

+
HWLOC_RESTRICT_FLAG_ADAPT_IO 

Move I/O objects to ancestors if their parents are removed during restriction. If this flag is not set, I/O devices and bridges are removed when their parents are removed.

Function Documentation

- -

◆ hwloc_alloc()

- -
-
- - - - - - - - - - - - - - - - - - -
void* hwloc_alloc (hwloc_topology_t topology,
size_t len 
)
-
- -

Allocate some memory.

-

This is equivalent to malloc(), except that it tries to allocate page-aligned memory from the OS.

-
Note
The allocated memory should be freed with hwloc_free().
- -
-
- -

◆ hwloc_alloc_membind()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void* hwloc_alloc_membind (hwloc_topology_t topology,
size_t len,
hwloc_const_bitmap_t set,
hwloc_membind_policy_t policy,
int flags 
)
-
- -

Allocate some memory on NUMA memory nodes specified by set.

-
Returns
NULL with errno set to ENOSYS if the action is not supported and HWLOC_MEMBIND_STRICT is given
-
-NULL with errno set to EXDEV if the binding cannot be enforced and HWLOC_MEMBIND_STRICT is given
-
-NULL with errno set to ENOMEM if the memory allocation failed even before trying to bind.
-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

-
Note
The allocated memory should be freed with hwloc_free().
- -
-
- -

◆ hwloc_alloc_membind_policy()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static void* hwloc_alloc_membind_policy (hwloc_topology_t topology,
size_t len,
hwloc_const_bitmap_t set,
hwloc_membind_policy_t policy,
int flags 
)
-
-inlinestatic
-
- -

Allocate some memory on NUMA memory nodes specified by set.

-

This is similar to hwloc_alloc_membind_nodeset() except that it is allowed to change the current memory binding policy, thus providing more binding support, at the expense of changing the current state.

-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

- -
-
- -

◆ hwloc_free()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_free (hwloc_topology_t topology,
void * addr,
size_t len 
)
-
- -

Free memory that was previously allocated by hwloc_alloc() or hwloc_alloc_membind().

- -
-
- -

◆ hwloc_get_area_membind()

+ +

◆ hwloc_obj_add_other_obj_sets()

- + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + @@ -414,97 +164,65 @@
int hwloc_get_area_membind int hwloc_obj_add_other_obj_sets (hwloc_topology_t topology,
const void * addr,
size_t len,
hwloc_bitmap_t set,
hwloc_membind_policy_tpolicy, hwloc_obj_t dst,
int flags hwloc_obj_t src 
-

Query the CPUs near the physical NUMA node(s) and binding policy of the memory identified by (addr, len ).

-

This function has two output parameters: set and policy. The values returned in these parameters depend on both the flags passed in and the memory binding policies and nodesets of the pages in the address range.

-

If HWLOC_MEMBIND_STRICT is specified, the target pages are first checked to see if they all have the same memory binding policy and nodeset. If they do not, -1 is returned and errno is set to EXDEV. If they are identical across all pages, the set and policy are returned in set and policy, respectively.

-

If HWLOC_MEMBIND_STRICT is not specified, the union of all NUMA node(s) containing pages in the address range is calculated. If all pages in the target have the same policy, it is returned in policy. Otherwise, policy is set to HWLOC_MEMBIND_MIXED.

-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

-

If any other flags are specified, -1 is returned and errno is set to EINVAL.

-

If len is 0, -1 is returned and errno is set to EINVAL.

+

Setup object cpusets/nodesets by OR'ing another object's sets.

+

For each defined cpuset or nodeset in src, allocate the corresponding set in dst and add src to it by OR'ing sets.

+

This function is convenient between hwloc_topology_alloc_group_object() and hwloc_topology_insert_group_object(). It builds the sets of the new Group that will be inserted as a new intermediate parent of several objects.

- -

◆ hwloc_get_area_memlocation()

+ +

◆ hwloc_topology_alloc_group_object()

- + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_get_area_memlocation hwloc_obj_t hwloc_topology_alloc_group_object (hwloc_topology_t topology,
hwloc_topology_t topology) const void * addr,
size_t len,
hwloc_bitmap_t set,
int flags 
)
-

Get the NUMA nodes where memory identified by (addr, len ) is physically allocated.

-

Fills set according to the NUMA nodes where the memory area pages are physically allocated. If no page is actually allocated yet, set may be empty.

-

If pages spread to multiple nodes, it is not specified whether they spread equitably, or whether most of them are on a single node, etc.

-

The operating system may move memory pages from one processor to another at any time according to their binding, so this function may return something that is already outdated.

-

If HWLOC_MEMBIND_BYNODESET is specified in flags, set is considered a nodeset. Otherwise it's a cpuset.

-

If len is 0, set is emptied.

+

Allocate a Group object to insert later with hwloc_topology_insert_group_object().

+

This function returns a new Group object. The caller should (at least) initialize its sets before inserting the object. See hwloc_topology_insert_group_object().

+

The subtype object attribute may be set to display something else than "Group" as the type name for this object in lstopo. Custom name/value info pairs may be added with hwloc_obj_add_info() after insertion.

+

The kind group attribute should be 0. The subkind group attribute may be set to identify multiple Groups of the same level.

+

It is recommended not to set any other object attribute before insertion, since the Group may get discarded during insertion.

+

The object will be destroyed if passed to hwloc_topology_insert_group_object() without any set defined.

- -

◆ hwloc_get_membind()

+ +

◆ hwloc_topology_allow()

- + - + - - + + - - + + - + @@ -515,115 +233,31 @@
int hwloc_get_membind int hwloc_topology_allow (hwloc_topology_t hwloc_topology_t restrict  topology,
hwloc_bitmap_t set, hwloc_const_cpuset_t cpuset,
hwloc_membind_policy_tpolicy, hwloc_const_nodeset_t nodeset,
int unsigned long  flags 
-

Query the default memory binding policy and physical locality of the current process or thread.

-

This function has two output parameters: set and policy. The values returned in these parameters depend on both the flags passed in and the current memory binding policies and nodesets in the queried target.

-

Passing the HWLOC_MEMBIND_PROCESS flag specifies that the query target is the current policies and nodesets for all the threads in the current process. Passing HWLOC_MEMBIND_THREAD specifies that the query target is the current policy and nodeset for only the thread invoking this function.

-

If neither of these flags are passed (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-based OS functions or thread-based OS functions, depending on which are available.

-

HWLOC_MEMBIND_STRICT is only meaningful when HWLOC_MEMBIND_PROCESS is also specified. In this case, hwloc will check the default memory policies and nodesets for all threads in the process. If they are not identical, -1 is returned and errno is set to EXDEV. If they are identical, the values are returned in set and policy.

-

Otherwise, if HWLOC_MEMBIND_PROCESS is specified (and HWLOC_MEMBIND_STRICT is not specified), the default set from each thread is logically OR'ed together. If all threads' default policies are the same, policy is set to that policy. If they are different, policy is set to HWLOC_MEMBIND_MIXED.

-

In the HWLOC_MEMBIND_THREAD case (or when neither HWLOC_MEMBIND_PROCESS or HWLOC_MEMBIND_THREAD is specified), there is only one set and policy; they are returned in set and policy, respectively.

-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

-

If any other flags are specified, -1 is returned and errno is set to EINVAL.

+

Change the sets of allowed PUs and NUMA nodes in the topology.

+

This function only works if the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set on the topology. It does not modify any object, it only changes the sets returned by hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset().

+

It is notably useful when importing a topology from another process running in a different Linux Cgroup.

+

flags must be set to one flag among hwloc_allow_flags_e.

+
Note
Removing objects from a topology should rather be performed with hwloc_topology_restrict().
- -

◆ hwloc_get_proc_membind()

+ +

◆ hwloc_topology_insert_group_object()

- + - + - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_get_proc_membind hwloc_obj_t hwloc_topology_insert_group_object (hwloc_topology_t hwloc_topology_t  topology,
hwloc_pid_t pid,
hwloc_bitmap_t set,
hwloc_membind_policy_tpolicy,
int flags 
)
-
- -

Query the default memory binding policy and physical locality of the specified process.

-

This function has two output parameters: set and policy. The values returned in these parameters depend on both the flags passed in and the current memory binding policies and nodesets in the queried target.

-

Passing the HWLOC_MEMBIND_PROCESS flag specifies that the query target is the current policies and nodesets for all the threads in the specified process. If HWLOC_MEMBIND_PROCESS is not specified (which is the most portable method), the process is assumed to be single threaded. This allows hwloc to use either process-based OS functions or thread-based OS functions, depending on which are available.

-

Note that it does not make sense to pass HWLOC_MEMBIND_THREAD to this function.

-

If HWLOC_MEMBIND_STRICT is specified, hwloc will check the default memory policies and nodesets for all threads in the specified process. If they are not identical, -1 is returned and errno is set to EXDEV. If they are identical, the values are returned in set and policy.

-

Otherwise, set is set to the logical OR of all threads' default set. If all threads' default policies are the same, policy is set to that policy. If they are different, policy is set to HWLOC_MEMBIND_MIXED.

-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

-

If any other flags are specified, -1 is returned and errno is set to EINVAL.

-
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
- -
-
- -

◆ hwloc_set_area_membind()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -633,45 +267,48 @@
int hwloc_set_area_membind (hwloc_topology_t topology,
const void * addr,
size_t len,
hwloc_const_bitmap_t set,
hwloc_membind_policy_t policy,
int flags hwloc_obj_t group 
-

Bind the already-allocated memory identified by (addr, len) to the NUMA node(s) specified by set.

-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

-
Returns
0 if len is 0.
+

Add more structure to the topology by adding an intermediate Group.

+

The caller should first allocate a new Group object with hwloc_topology_alloc_group_object(). Then it must setup at least one of its CPU or node sets to specify the final location of the Group in the topology. Then the object can be passed to this function for actual insertion in the topology.

+

The group dont_merge attribute may be set to prevent the core from ever merging this object with another object hierarchically-identical.

+

Either the cpuset or nodeset field (or both, if compatible) must be set to a non-empty bitmap. The complete_cpuset or complete_nodeset may be set instead if inserting with respect to the complete topology (including disallowed, offline or unknown objects).

+

It grouping several objects, hwloc_obj_add_other_obj_sets() is an easy way to build the Group sets iteratively.

+

These sets cannot be larger than the current topology, or they would get restricted silently.

+

The core will setup the other sets after actual insertion.

+
Returns
The inserted object if it was properly inserted.
+
+An existing object if the Group was discarded because the topology already contained an object at the same location (the Group did not add any locality information). Any name/info key pair set before inserting is appended to the existing object.
--1 with errno set to ENOSYS if the action is not supported
+NULL if the insertion failed because of conflicting sets in topology tree.
--1 with errno set to EXDEV if the binding cannot be enforced
+NULL if Group objects are filtered-out of the topology (HWLOC_TYPE_FILTER_KEEP_NONE). +
+NULL if the object was discarded because no set was initialized in the Group before insert, or all of them were empty.
- -

◆ hwloc_set_membind()

+ +

◆ hwloc_topology_insert_misc_object()

- + - + - - + + - - - - - - - - + + @@ -681,49 +318,41 @@
int hwloc_set_membind hwloc_obj_t hwloc_topology_insert_misc_object (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_bitmap_t set, hwloc_obj_t parent,
hwloc_membind_policy_t policy,
int flags const char * name 
-

Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) specified by set.

-

If neither HWLOC_MEMBIND_PROCESS nor HWLOC_MEMBIND_THREAD is specified, the current process is assumed to be single-threaded. This is the most portable form as it permits hwloc to use either process-based OS functions or thread-based OS functions, depending on which are available.

-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

-
Returns
-1 with errno set to ENOSYS if the action is not supported
+

Add a MISC object as a leaf of the topology.

+

A new MISC object will be created and inserted into the topology at the position given by parent. It is appended to the list of existing Misc children, without ever adding any intermediate hierarchy level. This is useful for annotating the topology without actually changing the hierarchy.

+

name is supposed to be unique across all Misc objects in the topology. It will be duplicated to setup the new object attributes.

+

The new leaf object will not have any cpuset.

+
Returns
the newly-created object
+
+NULL on error.
--1 with errno set to EXDEV if the binding cannot be enforced
+NULL if Misc objects are filtered-out of the topology (HWLOC_TYPE_FILTER_KEEP_NONE).
+
Note
If name contains some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml() in hwloc/export.h.
- -

◆ hwloc_set_proc_membind()

+ +

◆ hwloc_topology_restrict()

- + - + - - - - - - - + - - - - - - - + @@ -734,12 +363,16 @@
int hwloc_set_proc_membind int hwloc_topology_restrict (hwloc_topology_t hwloc_topology_t restrict  topology,
hwloc_pid_t pid,
hwloc_const_bitmap_t hwloc_const_bitmap_t  set,
hwloc_membind_policy_t policy,
int unsigned long  flags 
-

Set the default memory binding policy of the specified process to prefer the NUMA node(s) specified by set.

-

If HWLOC_MEMBIND_BYNODESET is specified, set is considered a nodeset. Otherwise it's a cpuset.

-
Returns
-1 with errno set to ENOSYS if the action is not supported
+

Restrict the topology to the given CPU set or nodeset.

+

Topology topology is modified so as to remove all objects that are not included (or partially included) in the CPU set set. All objects CPU and node sets are restricted accordingly.

+

If HWLOC_RESTRICT_FLAG_BYNODESET is passed in flags, set is considered a nodeset instead of a CPU set.

+

flags is a OR'ed set of hwloc_restrict_flags_e.

+
Note
This call may not be reverted by restricting back to a larger set. Once dropped during restriction, objects may not be brought back, except by loading another topology with hwloc_topology_load().
+
Returns
0 on success.
+
+-1 with errno set to EINVAL if the input set is invalid. The topology is not modified in this case.
--1 with errno set to EXDEV if the binding cannot be enforced
-
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
+-1 with errno set to ENOMEM on failure to allocate internal data. The topology is reinitialized in this case. It should be either destroyed with hwloc_topology_destroy() or configured and loaded again.
@@ -748,7 +381,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00192.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00192.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00192.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00192.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Changing the Source of Topology Discovery +Hardware Locality (hwloc): Finding Objects inside a CPU set @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,93 +27,117 @@
- + +/* @license-end */
-
Changing the Source of Topology Discovery
+
Finding Objects inside a CPU set
- - - -

-Enumerations

enum  hwloc_topology_components_flag_e { HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST - }
 
- - - - - - - - - - + + + + + + + + + + + + + + + + + +

Functions

int hwloc_topology_set_pid (hwloc_topology_t restrict topology, hwloc_pid_t pid)
 
int hwloc_topology_set_synthetic (hwloc_topology_t restrict topology, const char *restrict description)
 
int hwloc_topology_set_xml (hwloc_topology_t restrict topology, const char *restrict xmlpath)
 
int hwloc_topology_set_xmlbuffer (hwloc_topology_t restrict topology, const char *restrict buffer, int size)
 
int hwloc_topology_set_components (hwloc_topology_t restrict topology, unsigned long flags, const char *restrict name)
 
static hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 
int hwloc_get_largest_objs_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t *restrict objs, int max)
 
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, unsigned idx)
 
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, unsigned idx)
 
static unsigned hwloc_get_nbobjs_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth)
 
static int hwloc_get_nbobjs_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type)
 
static int hwloc_get_obj_index_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t obj)
 

Detailed Description

-

If none of the functions below is called, the default is to detect all the objects of the machine that the caller is allowed to access.

-

This default behavior may also be modified through environment variables if the application did not modify it already. Setting HWLOC_XMLFILE in the environment enforces the discovery from a XML file as if hwloc_topology_set_xml() had been called. Setting HWLOC_SYNTHETIC enforces a synthetic topology as if hwloc_topology_set_synthetic() had been called.

-

Finally, HWLOC_THISSYSTEM enforces the return value of hwloc_topology_is_thissystem().

-

Enumeration Type Documentation

- -

◆ hwloc_topology_components_flag_e

+

Function Documentation

+ +

◆ hwloc_get_first_largest_obj_inside_cpuset()

+ + + + + +
- + + + + + + + + + + + + + + +
enum hwloc_topology_components_flag_estatic hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset (hwloc_topology_t topology,
hwloc_const_cpuset_t set 
)
+
+inlinestatic
-

Flags to be passed to hwloc_topology_set_components()

- - -
Enumerator
HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST 

Blacklist the target component from being used.

-
+

Get the first largest object included in the given cpuset set.

+
Returns
the first object that is included in set and whose parent is not.
+

This is convenient for iterating over all largest objects within a CPU set by doing a loop getting the first largest object and clearing its CPU set from the remaining CPU set.

-

Function Documentation

- -

◆ hwloc_topology_set_components()

+ +

◆ hwloc_get_largest_objs_inside_cpuset()

- + - + - - + + - - + + + + + + + + @@ -123,31 +147,37 @@
int hwloc_topology_set_components int hwloc_get_largest_objs_inside_cpuset (hwloc_topology_t restrict hwloc_topology_t  topology,
unsigned long flags, hwloc_const_cpuset_t set,
const char *restrict name hwloc_obj_t *restrict objs,
int max 
-

Prevent a discovery component from being used for a topology.

-

name is the name of the discovery component that should not be used when loading topology topology. The name is a string such as "cuda".

-

For components with multiple phases, it may also be suffixed with the name of a phase, for instance "linux:io".

-

flags should be HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST.

-

This may be used to avoid expensive parts of the discovery process. For instance, CUDA-specific discovery may be expensive and unneeded while generic I/O discovery could still be useful.

+

Get the set of largest objects covering exactly a given cpuset set.

+
Returns
the number of objects returned in objs.
- -

◆ hwloc_topology_set_pid()

+ +

◆ hwloc_get_nbobjs_inside_cpuset_by_depth()

+ + + + + +
- + - + - - + + + + + + + + @@ -155,33 +185,46 @@
int hwloc_topology_set_pid static unsigned hwloc_get_nbobjs_inside_cpuset_by_depth (hwloc_topology_t restrict hwloc_topology_t  topology,
hwloc_pid_t pid hwloc_const_cpuset_t set,
int depth 
+
+inlinestatic
-

Change which process the topology is viewed from.

-

On some systems, processes may have different views of the machine, for instance the set of allowed CPUs. By default, hwloc exposes the view from the current process. Calling hwloc_topology_set_pid() permits to make it expose the topology of the machine from the point of view of another process.

-
Note
hwloc_pid_t is pid_t on Unix platforms, and HANDLE on native Windows platforms.
+

Return the number of objects at depth depth included in CPU set set.

+
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
--1 is returned and errno is set to ENOSYS on platforms that do not support this feature.
+This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
- -

◆ hwloc_topology_set_synthetic()

+ +

◆ hwloc_get_nbobjs_inside_cpuset_by_type()

+ + + + + +
- + - + - - + + + + + + + + @@ -189,36 +232,53 @@
int hwloc_topology_set_synthetic static int hwloc_get_nbobjs_inside_cpuset_by_type (hwloc_topology_t restrict hwloc_topology_t  topology,
const char *restrict description hwloc_const_cpuset_t set,
hwloc_obj_type_t type 
+
+inlinestatic
-

Enable synthetic topology.

-

Gather topology information from the given description, a space-separated string of <type:number> describing the object type and arity at each level. All types may be omitted (space-separated string of numbers) so that hwloc chooses all types according to usual topologies. See also the Synthetic topologies.

-

Setting the environment variable HWLOC_SYNTHETIC may also result in this behavior.

-

If description was properly parsed and describes a valid topology configuration, this function returns 0. Otherwise -1 is returned and errno is set to EINVAL.

-

Note that this function does not actually load topology information; it just tells hwloc where to load it from. You'll still need to invoke hwloc_topology_load() to actually load the topology information.

-
Note
For convenience, this backend provides empty binding hooks which just return success.
+

Return the number of objects of type type included in CPU set set.

+

If no object for that type exists inside CPU set set, 0 is returned. If there are several levels with objects of that type inside CPU set set, -1 is returned.

+
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-On success, the synthetic component replaces the previously enabled component (if any), but the topology is not actually modified until hwloc_topology_load().
+This function cannot work if objects of the given type do not have CPU sets (I/O objects).
- -

◆ hwloc_topology_set_xml()

+ +

◆ hwloc_get_next_obj_inside_cpuset_by_depth()

+ + + + + +
- + - + - - + + + + + + + + + + + + + + @@ -226,43 +286,155 @@
int hwloc_topology_set_xml static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth (hwloc_topology_t restrict hwloc_topology_t  topology,
const char *restrict xmlpath hwloc_const_cpuset_t set,
int depth,
hwloc_obj_t prev 
+
+inlinestatic
-

Enable XML-file based topology.

-

Gather topology information from the XML file given at xmlpath. Setting the environment variable HWLOC_XMLFILE may also result in this behavior. This file may have been generated earlier with hwloc_topology_export_xml() in hwloc/export.h, or lstopo file.xml.

-

Note that this function does not actually load topology information; it just tells hwloc where to load it from. You'll still need to invoke hwloc_topology_load() to actually load the topology information.

-
Returns
-1 with errno set to EINVAL on failure to read the XML file.
-
Note
See also hwloc_topology_set_userdata_import_callback() for importing application-specific object userdata.
+

Return the next object at depth depth included in CPU set set.

+

If prev is NULL, return the first object at depth depth included in set. The next invokation should pass the previous return value in prev so as to obtain the next object in set.

+
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM has to be set to assert that the loaded file is really the underlying system.
+This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
+ +
+
+ +

◆ hwloc_get_next_obj_inside_cpuset_by_type()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
hwloc_obj_type_t type,
hwloc_obj_t prev 
)
+
+inlinestatic
+
+ +

Return the next object of type type included in CPU set set.

+

If there are multiple or no depth for given type, return NULL and let the caller fallback to hwloc_get_next_obj_inside_cpuset_by_depth().

+
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-On success, the XML component replaces the previously enabled component (if any), but the topology is not actually modified until hwloc_topology_load().
+This function cannot work if objects of the given type do not have CPU sets (I/O or Misc objects).
- -

◆ hwloc_topology_set_xmlbuffer()

+ +

◆ hwloc_get_obj_index_inside_cpuset()

+ + + + + +
- + - + - - + + + + + + + + + + + + + + +
int hwloc_topology_set_xmlbuffer static int hwloc_get_obj_index_inside_cpuset (hwloc_topology_t restrict hwloc_topology_t  topology,
const char *restrict buffer, hwloc_const_cpuset_t set,
hwloc_obj_t obj 
)
+
+inlinestatic
+
+ +

Return the logical index among the objects included in CPU set set.

+

Consult all objects in the same level as obj and inside CPU set set in the logical order, and return the index of obj within them. If set covers the entire topology, this is the logical index of obj. Otherwise, this is similar to a logical index within the part of the topology defined by CPU set set.

+
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
+
+This function cannot work if obj does not have CPU sets (I/O objects).
+ +
+
+ +

◆ hwloc_get_obj_inside_cpuset_by_depth()

+ +
+
+ + + + + +
+ + + + + + + + + + + + - + + + + + + + @@ -270,17 +442,71 @@
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
int size depth,
unsigned idx 
+
+inlinestatic
-

Enable XML based topology using a memory buffer (instead of a file, as with hwloc_topology_set_xml()).

-

Gather topology information from the XML memory buffer given at buffer and of length size. This buffer may have been filled earlier with hwloc_topology_export_xmlbuffer() in hwloc/export.h.

-

Note that this function does not actually load topology information; it just tells hwloc where to load it from. You'll still need to invoke hwloc_topology_load() to actually load the topology information.

-
Returns
-1 with errno set to EINVAL on failure to read the XML buffer.
-
Note
See also hwloc_topology_set_userdata_import_callback() for importing application-specific object userdata.
+

Return the (logically) idx -th object at depth depth included in CPU set set.

+
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM has to be set to assert that the loaded file is really the underlying system.
+This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
+ +
+
+ +

◆ hwloc_get_obj_inside_cpuset_by_type()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_type (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
hwloc_obj_type_t type,
unsigned idx 
)
+
+inlinestatic
+
+ +

Return the idx -th object of type type included in CPU set set.

+

If there are multiple or no depth for given type, return NULL and let the caller fallback to hwloc_get_obj_inside_cpuset_by_depth().

+
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-On success, the XML component replaces the previously enabled component (if any), but the topology is not actually modified until hwloc_topology_load().
+This function cannot work if objects of the given type do not have CPU sets (I/O or Misc objects).
@@ -289,7 +515,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00193.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00193.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00193.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00193.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Topology Detection Configuration and Query +Hardware Locality (hwloc): Finding Objects covering at least CPU set @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,294 +27,64 @@
- + +/* @license-end */
-
Topology Detection Configuration and Query
+
Finding Objects covering at least CPU set
- - - - - - - - - -

-Data Structures

struct  hwloc_topology_discovery_support
 
struct  hwloc_topology_cpubind_support
 
struct  hwloc_topology_membind_support
 
struct  hwloc_topology_support
 
- - - - - -

-Enumerations

enum  hwloc_topology_flags_e { HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED, -HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM, -HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES - }
 
enum  hwloc_type_filter_e { HWLOC_TYPE_FILTER_KEEP_ALL, -HWLOC_TYPE_FILTER_KEEP_NONE, -HWLOC_TYPE_FILTER_KEEP_STRUCTURE, -HWLOC_TYPE_FILTER_KEEP_IMPORTANT - }
 
- - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +

Functions

int hwloc_topology_set_flags (hwloc_topology_t topology, unsigned long flags)
 
unsigned long hwloc_topology_get_flags (hwloc_topology_t topology)
 
int hwloc_topology_is_thissystem (hwloc_topology_t restrict topology)
 
const struct hwloc_topology_supporthwloc_topology_get_support (hwloc_topology_t restrict topology)
 
int hwloc_topology_set_type_filter (hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e filter)
 
int hwloc_topology_get_type_filter (hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter)
 
int hwloc_topology_set_all_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
int hwloc_topology_set_cache_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
int hwloc_topology_set_icache_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
int hwloc_topology_set_io_types_filter (hwloc_topology_t topology, enum hwloc_type_filter_e filter)
 
void hwloc_topology_set_userdata (hwloc_topology_t topology, const void *userdata)
 
void * hwloc_topology_get_userdata (hwloc_topology_t topology)
 
static hwloc_obj_t hwloc_get_child_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t parent)
 
static hwloc_obj_t hwloc_get_obj_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
 

Detailed Description

-

Several functions can optionally be called between hwloc_topology_init() and hwloc_topology_load() to configure how the detection should be performed, e.g. to ignore some objects types, define a synthetic topology, etc.

-

Enumeration Type Documentation

- -

◆ hwloc_topology_flags_e

- -
-
- - - - -
enum hwloc_topology_flags_e
-
- -

Flags to be set onto a topology context before load.

-

Flags should be given to hwloc_topology_set_flags(). They may also be returned by hwloc_topology_get_flags().

- - - - -
Enumerator
HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED 

Detect the whole system, ignore reservations, include disallowed objects.

-

Gather all resources, even if some were disabled by the administrator. For instance, ignore Linux Cgroup/Cpusets and gather all processors and memory nodes.

-

When this flag is not set, PUs and NUMA nodes that are disallowed are not added to the topology. Parent objects (package, core, cache, etc.) are added only if some of their children are allowed. All existing PUs and NUMA nodes in the topology are allowed. hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset() are equal to the root object cpuset and nodeset.

-

When this flag is set, the actual sets of allowed PUs and NUMA nodes are given by hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset(). They may be smaller than the root object cpuset and nodeset.

-

If the current topology is exported to XML and reimported later, this flag should be set again in the reimported topology so that disallowed resources are reimported as well.

-
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM 

Assume that the selected backend provides the topology for the system on which we are running.

-

This forces hwloc_topology_is_thissystem() to return 1, i.e. makes hwloc assume that the selected backend provides the topology for the system on which we are running, even if it is not the OS-specific backend but the XML backend for instance. This means making the binding functions actually call the OS-specific system calls and really do binding, while the XML backend would otherwise provide empty hooks just returning success.

-

Setting the environment variable HWLOC_THISSYSTEM may also result in the same behavior.

-

This can be used for efficiency reasons to first detect the topology once, save it to an XML file, and quickly reload it later through the XML backend, but still having binding functions actually do bind.

-
HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES 

Get the set of allowed resources from the local operating system even if the topology was loaded from XML or synthetic description.

-

If the topology was loaded from XML or from a synthetic string, restrict it by applying the current process restrictions such as Linux Cgroup/Cpuset.

-

This is useful when the topology is not loaded directly from the local machine (e.g. for performance reason) and it comes with all resources, while the running process is restricted to only parts of the machine.

-

This flag is ignored unless HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM is also set since the loaded topology must match the underlying machine where restrictions will be gathered from.

-

Setting the environment variable HWLOC_THISSYSTEM_ALLOWED_RESOURCES would result in the same behavior.

-
- -
-
- -

◆ hwloc_type_filter_e

- -
-
- - - - -
enum hwloc_type_filter_e
-
- -

Type filtering flags.

-

By default, most objects are kept (HWLOC_TYPE_FILTER_KEEP_ALL). Instruction caches, I/O and Misc objects are ignored by default (HWLOC_TYPE_FILTER_KEEP_NONE). Die and Group levels are ignored unless they bring structure (HWLOC_TYPE_FILTER_KEEP_STRUCTURE).

-

Note that group objects are also ignored individually (without the entire level) when they do not bring structure.

- - - - - -
Enumerator
HWLOC_TYPE_FILTER_KEEP_ALL 

Keep all objects of this type.

-

Cannot be set for HWLOC_OBJ_GROUP (groups are designed only to add more structure to the topology).

-
HWLOC_TYPE_FILTER_KEEP_NONE 

Ignore all objects of this type.

-

The bottom-level type HWLOC_OBJ_PU, the HWLOC_OBJ_NUMANODE type, and the top-level type HWLOC_OBJ_MACHINE may not be ignored.

-
HWLOC_TYPE_FILTER_KEEP_STRUCTURE 

Only ignore objects if their entire level does not bring any structure.

-

Keep the entire level of objects if at least one of these objects adds structure to the topology. An object brings structure when it has multiple children and it is not the only child of its parent.

-

If all objects in the level are the only child of their parent, and if none of them has multiple children, the entire level is removed.

-

Cannot be set for I/O and Misc objects since the topology structure does not matter there.

-
HWLOC_TYPE_FILTER_KEEP_IMPORTANT 

Only keep likely-important objects of the given type.

-

It is only useful for I/O object types. For HWLOC_OBJ_PCI_DEVICE and HWLOC_OBJ_OS_DEVICE, it means that only objects of major/common kinds are kept (storage, network, OpenFabrics, Intel MICs, CUDA, OpenCL, NVML, and displays). Also, only OS devices directly attached on PCI (e.g. no USB) are reported. For HWLOC_OBJ_BRIDGE, it means that bridges are kept only if they have children.

-

This flag equivalent to HWLOC_TYPE_FILTER_KEEP_ALL for Normal, Memory and Misc types since they are likely important.

-
- -
-

Function Documentation

- -

◆ hwloc_topology_get_flags()

- -
-
- - - - - - - - -
unsigned long hwloc_topology_get_flags (hwloc_topology_t topology)
-
- -

Get OR'ed flags of a topology.

-

Get the OR'ed set of hwloc_topology_flags_e of a topology.

-
Returns
the flags previously set with hwloc_topology_set_flags().
- -
-
- -

◆ hwloc_topology_get_support()

- -
-
- - - - - - - - -
const struct hwloc_topology_support* hwloc_topology_get_support (hwloc_topology_t restrict topology)
-
- -

Retrieve the topology support.

-

Each flag indicates whether a feature is supported. If set to 0, the feature is not supported. If set to 1, the feature is supported, but the corresponding call may still fail in some corner cases.

-

These features are also listed by hwloc-info --support

- -
-
- -

◆ hwloc_topology_get_type_filter()

+ +

◆ hwloc_get_child_covering_cpuset()

+ + + + + +
- + - + - - + + - - - - - - - - -
int hwloc_topology_get_type_filter static hwloc_obj_t hwloc_get_child_covering_cpuset (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type, hwloc_const_cpuset_t set,
enum hwloc_type_filter_efilter 
)
-
- -

Get the current filtering for the given object type.

- -
- - -

◆ hwloc_topology_get_userdata()

- -
-
- - - - - - - - -
void* hwloc_topology_get_userdata (hwloc_topology_t topology)
-
- -

Retrieve the topology-specific userdata pointer.

-

Retrieve the application-given private data pointer that was previously set with hwloc_topology_set_userdata().

- -
-
- -

◆ hwloc_topology_is_thissystem()

- -
-
- - - - - - - - -
int hwloc_topology_is_thissystem (hwloc_topology_t restrict topology)
-
- -

Does the topology context come from this system?

-
Returns
1 if this topology context was built using the system running this program.
-
-0 instead (for instance if using another file-system root, a XML topology file, or a synthetic topology).
- -
-
- -

◆ hwloc_topology_set_all_types_filter()

- -
-
- - - - - - - - - - - - + + @@ -322,94 +92,51 @@
int hwloc_topology_set_all_types_filter (hwloc_topology_t topology,
enum hwloc_type_filter_e filter hwloc_obj_t parent 
+
+inlinestatic
-

Set the filtering for all object types.

-

If some types do not support this filtering, they are silently ignored.

+

Get the child covering at least CPU set set.

+
Returns
NULL if no child matches or if set is empty.
+
Note
This function cannot work if parent does not have a CPU set (I/O or Misc objects).
- -

◆ hwloc_topology_set_cache_types_filter()

+ +

◆ hwloc_get_next_obj_covering_cpuset_by_depth()

+ + + + + +
- + - + - - - - - - - - -
int hwloc_topology_set_cache_types_filter static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth (hwloc_topology_t hwloc_topology_t  topology,
enum hwloc_type_filter_e filter 
)
-
- -

Set the filtering for all CPU cache object types.

-

Memory-side caches are not involved since they are not CPU caches.

- -
- - -

◆ hwloc_topology_set_flags()

- -
-
- - - - - - + + - - - - - - - - -
int hwloc_topology_set_flags (hwloc_topology_t topology, hwloc_const_cpuset_t set,
unsigned long flags 
)
-
- -

Set OR'ed flags to non-yet-loaded topology.

-

Set a OR'ed set of hwloc_topology_flags_e onto a topology that was not yet loaded.

-

If this function is called multiple times, the last invokation will erase and replace the set of flags that was previously set.

-

The flags set in a topology may be retrieved with hwloc_topology_get_flags()

- -
-
- -

◆ hwloc_topology_set_icache_types_filter()

- -
-
- - - - - - + + - - + + @@ -417,66 +144,51 @@
int hwloc_topology_set_icache_types_filter (hwloc_topology_t topology, int depth,
enum hwloc_type_filter_e filter hwloc_obj_t prev 
+
+inlinestatic
-

Set the filtering for all CPU instruction cache object types.

-

Memory-side caches are not involved since they are not CPU caches.

+

Iterate through same-depth objects covering at least CPU set set.

+

If object prev is NULL, return the first object at depth depth covering at least part of CPU set set. The next invokation should pass the previous return value in prev so as to obtain the next object covering at least another part of set.

+
Note
This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
- -

◆ hwloc_topology_set_io_types_filter()

+ +

◆ hwloc_get_next_obj_covering_cpuset_by_type()

+ + + + + +
- + - + - - - - - - - - -
int hwloc_topology_set_io_types_filter static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type (hwloc_topology_t hwloc_topology_t  topology,
enum hwloc_type_filter_e filter 
)
-
- -

Set the filtering for all I/O object types.

- -
- - -

◆ hwloc_topology_set_type_filter()

- -
-
- - - - - - + + - + - - + + @@ -484,29 +196,40 @@
int hwloc_topology_set_type_filter (hwloc_topology_t topology, hwloc_const_cpuset_t set,
hwloc_obj_type_t hwloc_obj_type_t  type,
enum hwloc_type_filter_e filter hwloc_obj_t prev 
+
+inlinestatic
-

Set the filtering for the given object type.

+

Iterate through same-type objects covering at least CPU set set.

+

If object prev is NULL, return the first object of type type covering at least part of CPU set set. The next invokation should pass the previous return value in prev so as to obtain the next object of type type covering at least another part of set.

+

If there are no or multiple depths for type type, NULL is returned. The caller may fallback to hwloc_get_next_obj_covering_cpuset_by_depth() for each depth.

+
Note
This function cannot work if objects of the given type do not have CPU sets (I/O or Misc objects).
- -

◆ hwloc_topology_set_userdata()

+ +

◆ hwloc_get_obj_covering_cpuset()

+ + + + + +
- + - + - - + + @@ -514,12 +237,15 @@
void hwloc_topology_set_userdata static hwloc_obj_t hwloc_get_obj_covering_cpuset (hwloc_topology_t hwloc_topology_t  topology,
const void * userdata hwloc_const_cpuset_t set 
+
+inlinestatic
-

Set the topology-specific userdata pointer.

-

Each topology may store one application-given private data pointer. It is initialized to NULL. hwloc will never modify it.

-

Use it as you wish, after hwloc_topology_init() and until hwloc_topolog_destroy().

-

This pointer is not exported to XML.

+

Get the lowest object covering at least CPU set set.

+
Returns
NULL if no object matches or if set is empty.
@@ -528,7 +254,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00194.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00194.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00194.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00194.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Modifying a loaded Topology +Hardware Locality (hwloc): Looking at Ancestor and Child Objects @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,202 +27,112 @@
- + +/* @license-end */
-
Modifying a loaded Topology
+
Looking at Ancestor and Child Objects
- - - - - -

-Enumerations

enum  hwloc_restrict_flags_e {
-  HWLOC_RESTRICT_FLAG_REMOVE_CPULESS, -HWLOC_RESTRICT_FLAG_BYNODESET = (1UL<<3), -HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS, -HWLOC_RESTRICT_FLAG_ADAPT_MISC, -
-  HWLOC_RESTRICT_FLAG_ADAPT_IO -
- }
 
enum  hwloc_allow_flags_e { HWLOC_ALLOW_FLAG_ALL, -HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS, -HWLOC_ALLOW_FLAG_CUSTOM - }
 
- - - - - - - - - - - - + + + + + + + + + +

Functions

int hwloc_topology_restrict (hwloc_topology_t restrict topology, hwloc_const_bitmap_t set, unsigned long flags)
 
int hwloc_topology_allow (hwloc_topology_t restrict topology, hwloc_const_cpuset_t cpuset, hwloc_const_nodeset_t nodeset, unsigned long flags)
 
hwloc_obj_t hwloc_topology_insert_misc_object (hwloc_topology_t topology, hwloc_obj_t parent, const char *name)
 
hwloc_obj_t hwloc_topology_alloc_group_object (hwloc_topology_t topology)
 
hwloc_obj_t hwloc_topology_insert_group_object (hwloc_topology_t topology, hwloc_obj_t group)
 
int hwloc_obj_add_other_obj_sets (hwloc_obj_t dst, hwloc_obj_t src)
 
static hwloc_obj_t hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology, int depth, hwloc_obj_t obj)
 
static hwloc_obj_t hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t obj)
 
static hwloc_obj_t hwloc_get_common_ancestor_obj (hwloc_topology_t topology, hwloc_obj_t obj1, hwloc_obj_t obj2)
 
static int hwloc_obj_is_in_subtree (hwloc_topology_t topology, hwloc_obj_t obj, hwloc_obj_t subtree_root)
 
static hwloc_obj_t hwloc_get_next_child (hwloc_topology_t topology, hwloc_obj_t parent, hwloc_obj_t prev)
 

Detailed Description

-

Enumeration Type Documentation

- -

◆ hwloc_allow_flags_e

- -
-
- - - - -
enum hwloc_allow_flags_e
-
- -

Flags to be given to hwloc_topology_allow().

- - - - -
Enumerator
HWLOC_ALLOW_FLAG_ALL 

Mark all objects as allowed in the topology.

-

cpuset and nođeset given to hwloc_topology_allow() must be NULL.

-
HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS 

Only allow objects that are available to the current process.

-

The topology must have HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM so that the set of available resources can actually be retrieved from the operating system.

-

cpuset and nođeset given to hwloc_topology_allow() must be NULL.

-
HWLOC_ALLOW_FLAG_CUSTOM 

Allow a custom set of objects, given to hwloc_topology_allow() as cpuset and/or nodeset parameters.

-
- -
-
- -

◆ hwloc_restrict_flags_e

- -
-
- - - - -
enum hwloc_restrict_flags_e
-
- -

Flags to be given to hwloc_topology_restrict().

- - - - - - -
Enumerator
HWLOC_RESTRICT_FLAG_REMOVE_CPULESS 

Remove all objects that became CPU-less. By default, only objects that contain no PU and no memory are removed.

-
HWLOC_RESTRICT_FLAG_BYNODESET 

Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially included in the given set. This flag may not be used with HWLOC_RESTRICT_FLAG_BYNODESET.

-
HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS 

Remove all objects that became Memory-less. By default, only objects that contain no PU and no memory are removed. This flag may only be used with HWLOC_RESTRICT_FLAG_BYNODESET.

-
HWLOC_RESTRICT_FLAG_ADAPT_MISC 

Move Misc objects to ancestors if their parents are removed during restriction. If this flag is not set, Misc objects are removed when their parents are removed.

-
HWLOC_RESTRICT_FLAG_ADAPT_IO 

Move I/O objects to ancestors if their parents are removed during restriction. If this flag is not set, I/O devices and bridges are removed when their parents are removed.

-
- -
-
+

Be sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers.

Function Documentation

- -

◆ hwloc_obj_add_other_obj_sets()

+ +

◆ hwloc_get_ancestor_obj_by_depth()

+ + + + + +
- + - - + + - - + + + - - + + -
int hwloc_obj_add_other_obj_sets static hwloc_obj_t hwloc_get_ancestor_obj_by_depth (hwloc_obj_t dst, hwloc_topology_t topology,
hwloc_obj_t src int depth,
)hwloc_obj_t obj 
-
- -

Setup object cpusets/nodesets by OR'ing another object's sets.

-

For each defined cpuset or nodeset in src, allocate the corresponding set in dst and add src to it by OR'ing sets.

-

This function is convenient between hwloc_topology_alloc_group_object() and hwloc_topology_insert_group_object(). It builds the sets of the new Group that will be inserted as a new intermediate parent of several objects.

- -
- - -

◆ hwloc_topology_alloc_group_object()

- -
-
- - - - - + +
hwloc_obj_t hwloc_topology_alloc_group_object (hwloc_topology_t topology) )
+
+inlinestatic
-

Allocate a Group object to insert later with hwloc_topology_insert_group_object().

-

This function returns a new Group object. The caller should (at least) initialize its sets before inserting the object. See hwloc_topology_insert_group_object().

-

The subtype object attribute may be set to display something else than "Group" as the type name for this object in lstopo. Custom name/value info pairs may be added with hwloc_obj_add_info() after insertion.

-

The kind group attribute should be 0. The subkind group attribute may be set to identify multiple Groups of the same level.

-

It is recommended not to set any other object attribute before insertion, since the Group may get discarded during insertion.

-

The object will be destroyed if passed to hwloc_topology_insert_group_object() without any set defined.

+

Returns the ancestor object of obj at depth depth.

+
Note
depth should not be the depth of PU or NUMA objects since they are ancestors of no objects (except Misc or I/O). This function rather expects an intermediate level depth, such as the depth of Packages, Cores, or Caches.
- -

◆ hwloc_topology_allow()

+ +

◆ hwloc_get_ancestor_obj_by_type()

+ + + + + +
- + - + - - - - - - - - + + - - + + @@ -230,33 +140,44 @@
int hwloc_topology_allow static hwloc_obj_t hwloc_get_ancestor_obj_by_type (hwloc_topology_t restrict hwloc_topology_t  topology,
hwloc_const_cpuset_t cpuset,
hwloc_const_nodeset_t nodeset, hwloc_obj_type_t type,
unsigned long flags hwloc_obj_t obj 
+
+inlinestatic
-

Change the sets of allowed PUs and NUMA nodes in the topology.

-

This function only works if the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set on the topology. It does not modify any object, it only changes the sets returned by hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset().

-

It is notably useful when importing a topology from another process running in a different Linux Cgroup.

-

flags must be set to one flag among hwloc_allow_flags_e.

-
Note
Removing objects from a topology should rather be performed with hwloc_topology_restrict().
+

Returns the ancestor object of obj with type type.

+
Note
type should not be HWLOC_OBJ_PU or HWLOC_OBJ_NUMANODE since these objects are ancestors of no objects (except Misc or I/O). This function rather expects an intermediate object type, such as HWLOC_OBJ_PACKAGE, HWLOC_OBJ_CORE, etc.
- -

◆ hwloc_topology_insert_group_object()

+ +

◆ hwloc_get_common_ancestor_obj()

+ + + + + +
- + - + - - + + + + + + + + @@ -264,50 +185,43 @@
hwloc_obj_t hwloc_topology_insert_group_object static hwloc_obj_t hwloc_get_common_ancestor_obj (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_t group hwloc_obj_t obj1,
hwloc_obj_t obj2 
+
+inlinestatic
-

Add more structure to the topology by adding an intermediate Group.

-

The caller should first allocate a new Group object with hwloc_topology_alloc_group_object(). Then it must setup at least one of its CPU or node sets to specify the final location of the Group in the topology. Then the object can be passed to this function for actual insertion in the topology.

-

The group dont_merge attribute may be set to prevent the core from ever merging this object with another object hierarchically-identical.

-

Either the cpuset or nodeset field (or both, if compatible) must be set to a non-empty bitmap. The complete_cpuset or complete_nodeset may be set instead if inserting with respect to the complete topology (including disallowed, offline or unknown objects).

-

It grouping several objects, hwloc_obj_add_other_obj_sets() is an easy way to build the Group sets iteratively.

-

These sets cannot be larger than the current topology, or they would get restricted silently.

-

The core will setup the other sets after actual insertion.

-
Returns
The inserted object if it was properly inserted.
-
-An existing object if the Group was discarded because the topology already contained an object at the same location (the Group did not add any locality information). Any name/info key pair set before inserting is appended to the existing object.
-
-NULL if the insertion failed because of conflicting sets in topology tree.
-
-NULL if Group objects are filtered-out of the topology (HWLOC_TYPE_FILTER_KEEP_NONE).
-
-NULL if the object was discarded because no set was initialized in the Group before insert, or all of them were empty.
+

Returns the common parent object to objects obj1 and obj2.

- -

◆ hwloc_topology_insert_misc_object()

+ +

◆ hwloc_get_next_child()

+ + + + + +
- + - + - + - - + + @@ -315,44 +229,46 @@
hwloc_obj_t hwloc_topology_insert_misc_object static hwloc_obj_t hwloc_get_next_child (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_t hwloc_obj_t  parent,
const char * name hwloc_obj_t prev 
+
+inlinestatic
-

Add a MISC object as a leaf of the topology.

-

A new MISC object will be created and inserted into the topology at the position given by parent. It is appended to the list of existing Misc children, without ever adding any intermediate hierarchy level. This is useful for annotating the topology without actually changing the hierarchy.

-

name is supposed to be unique across all Misc objects in the topology. It will be duplicated to setup the new object attributes.

-

The new leaf object will not have any cpuset.

-
Returns
the newly-created object
-
-NULL on error.
-
-NULL if Misc objects are filtered-out of the topology (HWLOC_TYPE_FILTER_KEEP_NONE).
-
Note
If name contains some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml() in hwloc/export.h.
+

Return the next child.

+

Return the next child among the normal children list, then among the memory children list, then among the I/O children list, then among the Misc children list.

+

If prev is NULL, return the first child.

+

Return NULL when there is no next child.

- -

◆ hwloc_topology_restrict()

+ +

◆ hwloc_obj_is_in_subtree()

+ + + + + +
- + - + - - + + - - + + @@ -360,18 +276,15 @@
int hwloc_topology_restrict static int hwloc_obj_is_in_subtree (hwloc_topology_t restrict hwloc_topology_t  topology,
hwloc_const_bitmap_t set, hwloc_obj_t obj,
unsigned long flags hwloc_obj_t subtree_root 
+
+inlinestatic
-

Restrict the topology to the given CPU set or nodeset.

-

Topology topology is modified so as to remove all objects that are not included (or partially included) in the CPU set set. All objects CPU and node sets are restricted accordingly.

-

If HWLOC_RESTRICT_FLAG_BYNODESET is passed in flags, set is considered a nodeset instead of a CPU set.

-

flags is a OR'ed set of hwloc_restrict_flags_e.

-
Note
This call may not be reverted by restricting back to a larger set. Once dropped during restriction, objects may not be brought back, except by loading another topology with hwloc_topology_load().
-
Returns
0 on success.
-
--1 with errno set to EINVAL if the input set is invalid. The topology is not modified in this case.
-
--1 with errno set to ENOMEM on failure to allocate internal data. The topology is reinitialized in this case. It should be either destroyed with hwloc_topology_destroy() or configured and loaded again.
+

Returns true if obj is inside the subtree beginning with ancestor object subtree_root.

+
Note
This function cannot work if obj and subtree_root objects do not have CPU sets (I/O or Misc objects).
@@ -380,7 +293,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00195.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00195.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00195.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00195.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Finding Objects inside a CPU set +Hardware Locality (hwloc): Kinds of object Type @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,485 +27,173 @@
- + +/* @license-end */
-
Finding Objects inside a CPU set
+
Kinds of object Type
- - - - - - - - - - - - - - - - - - + + + + + + + + + + + +

Functions

static hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 
int hwloc_get_largest_objs_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t *restrict objs, int max)
 
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, unsigned idx)
 
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, unsigned idx)
 
static unsigned hwloc_get_nbobjs_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth)
 
static int hwloc_get_nbobjs_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type)
 
static int hwloc_get_obj_index_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t obj)
 
int hwloc_obj_type_is_normal (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_io (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_memory (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_cache (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_dcache (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_icache (hwloc_obj_type_t type)
 

Detailed Description

+

Each object type is either Normal (i.e. hwloc_obj_type_is_normal() returns 1), or Memory (i.e. hwloc_obj_type_is_memory() returns 1) or I/O (i.e. hwloc_obj_type_is_io() returns 1) or Misc (i.e. equal to HWLOC_OBJ_MISC). It cannot be of more than one of these kinds.

Function Documentation

- -

◆ hwloc_get_first_largest_obj_inside_cpuset()

+ +

◆ hwloc_obj_type_is_cache()

- - - - - -
- + - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset int hwloc_obj_type_is_cache (hwloc_topology_t topology,
hwloc_const_cpuset_t set 
)
-
-inlinestatic
-
- -

Get the first largest object included in the given cpuset set.

-
Returns
the first object that is included in set and whose parent is not.
-

This is convenient for iterating over all largest objects within a CPU set by doing a loop getting the first largest object and clearing its CPU set from the remaining CPU set.

- -
-
- -

◆ hwloc_get_largest_objs_inside_cpuset()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_get_largest_objs_inside_cpuset (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
hwloc_obj_t *restrict objs,
int max 
)
-
- -

Get the set of largest objects covering exactly a given cpuset set.

-
Returns
the number of objects returned in objs.
- -
-
- -

◆ hwloc_get_nbobjs_inside_cpuset_by_depth()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
static unsigned hwloc_get_nbobjs_inside_cpuset_by_depth (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
int depth 
)
-
-inlinestatic
-
- -

Return the number of objects at depth depth included in CPU set set.

-
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-
-This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
- -
-
- -

◆ hwloc_get_nbobjs_inside_cpuset_by_type()

- -
-
- - - - - -
- - - - - - - - - + + - - - - - - - - - - - - -
static int hwloc_get_nbobjs_inside_cpuset_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type) hwloc_const_cpuset_t set,
hwloc_obj_type_t type 
)
-
-inlinestatic
-

Return the number of objects of type type included in CPU set set.

-

If no object for that type exists inside CPU set set, 0 is returned. If there are several levels with objects of that type inside CPU set set, -1 is returned.

-
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-
-This function cannot work if objects of the given type do not have CPU sets (I/O objects).
+

Check whether an object type is a CPU Cache (Data, Unified or Instruction).

+

Memory-side caches are not CPU caches.

+
Returns
1 if an object of type type is a Cache, 0 otherwise.
- -

◆ hwloc_get_next_obj_inside_cpuset_by_depth()

+ +

◆ hwloc_obj_type_is_dcache()

- - - - - -
- + - - - - - - - - - - - - - - - - - - - - - - + + - -
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth int hwloc_obj_type_is_dcache (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
int depth,
hwloc_obj_t prev 
hwloc_obj_type_t type) )
-
-inlinestatic
-

Return the next object at depth depth included in CPU set set.

-

If prev is NULL, return the first object at depth depth included in set. The next invokation should pass the previous return value in prev so as to obtain the next object in set.

-
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-
-This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
+

Check whether an object type is a CPU Data or Unified Cache.

+

Memory-side caches are not CPU caches.

+
Returns
1 if an object of type type is a CPU Data or Unified Cache, 0 otherwise.
- -

◆ hwloc_get_next_obj_inside_cpuset_by_type()

+ +

◆ hwloc_obj_type_is_icache()

- - - - - -
- + - - - - - - - - - - - + + - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type int hwloc_obj_type_is_icache (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
hwloc_obj_type_t type) hwloc_obj_type_t type,
hwloc_obj_t prev 
)
-
-inlinestatic
-

Return the next object of type type included in CPU set set.

-

If there are multiple or no depth for given type, return NULL and let the caller fallback to hwloc_get_next_obj_inside_cpuset_by_depth().

-
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-
-This function cannot work if objects of the given type do not have CPU sets (I/O or Misc objects).
+

Check whether an object type is a CPU Instruction Cache,.

+

Memory-side caches are not CPU caches.

+
Returns
1 if an object of type type is a CPU Instruction Cache, 0 otherwise.
- -

◆ hwloc_get_obj_index_inside_cpuset()

+ +

◆ hwloc_obj_type_is_io()

- - - - - -
- + - - - - - + + - - - - - - - - - - - - -
static int hwloc_get_obj_index_inside_cpuset int hwloc_obj_type_is_io (hwloc_topology_t topology,
hwloc_obj_type_t type) hwloc_const_cpuset_t set,
hwloc_obj_t obj 
)
-
-inlinestatic
-

Return the logical index among the objects included in CPU set set.

-

Consult all objects in the same level as obj and inside CPU set set in the logical order, and return the index of obj within them. If set covers the entire topology, this is the logical index of obj. Otherwise, this is similar to a logical index within the part of the topology defined by CPU set set.

-
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-
-This function cannot work if obj does not have CPU sets (I/O objects).
+

Check whether an object type is I/O.

+

I/O objects are objects attached to their parents in the I/O children list. This current includes Bridges, PCI and OS devices.

+
Returns
1 if an object of type type is a I/O object, 0 otherwise.
- -

◆ hwloc_get_obj_inside_cpuset_by_depth()

+ +

◆ hwloc_obj_type_is_memory()

- - - - - -
- + - - - - - - - - - - - + + - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_depth int hwloc_obj_type_is_memory (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
hwloc_obj_type_t type) int depth,
unsigned idx 
)
-
-inlinestatic
-

Return the (logically) idx -th object at depth depth included in CPU set set.

-
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-
-This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
+

Check whether an object type is Memory.

+

Memory objects are objects attached to their parents in the Memory children list. This current includes NUMA nodes and Memory-side caches.

+
Returns
1 if an object of type type is a Memory object, 0 otherwise.
- -

◆ hwloc_get_obj_inside_cpuset_by_type()

+ +

◆ hwloc_obj_type_is_normal()

- - - - - -
- + - - - - - - - - - - - + + - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_type int hwloc_obj_type_is_normal (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
hwloc_obj_type_t type) hwloc_obj_type_t type,
unsigned idx 
)
-
-inlinestatic
-

Return the idx -th object of type type included in CPU set set.

-

If there are multiple or no depth for given type, return NULL and let the caller fallback to hwloc_get_obj_inside_cpuset_by_depth().

-
Note
Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set).
-
-This function cannot work if objects of the given type do not have CPU sets (I/O or Misc objects).
+

Check whether an object type is Normal.

+

Normal objects are objects of the main CPU hierarchy (Machine, Package, Core, PU, CPU caches, etc.), but they are not NUMA nodes, I/O devices or Misc objects.

+

They are attached to parent as Normal children, not as Memory, I/O or Misc children.

+
Returns
1 if an object of type type is a Normal object, 0 otherwise.
@@ -514,7 +202,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00196.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00196.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00196.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00196.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Finding Objects covering at least CPU set +Hardware Locality (hwloc): Looking at Cache Objects @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,39 +27,38 @@
- + +/* @license-end */
-
Finding Objects covering at least CPU set
+
Looking at Cache Objects
- - - - - - - - + + + + + +

Functions

static hwloc_obj_t hwloc_get_child_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t parent)
 
static hwloc_obj_t hwloc_get_obj_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
 
static int hwloc_get_cache_type_depth (hwloc_topology_t topology, unsigned cachelevel, hwloc_obj_cache_type_t cachetype)
 
static hwloc_obj_t hwloc_get_cache_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 
static hwloc_obj_t hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology, hwloc_obj_t obj)
 

Detailed Description

Function Documentation

- -

◆ hwloc_get_child_covering_cpuset()

+ +

◆ hwloc_get_cache_covering_cpuset()

@@ -68,74 +67,16 @@ - + - + - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_child_covering_cpuset static hwloc_obj_t hwloc_get_cache_covering_cpuset (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_cpuset_t set,
hwloc_obj_t parent 
)
- - -inlinestatic - - -
- -

Get the child covering at least CPU set set.

-
Returns
NULL if no child matches or if set is empty.
-
Note
This function cannot work if parent does not have a CPU set (I/O or Misc objects).
- -
-
- -

◆ hwloc_get_next_obj_covering_cpuset_by_depth()

- -
-
- - - @@ -27,66 +27,66 @@
- - - - - - - - - - - - - - - - - - - - - - - - + + @@ -150,14 +91,13 @@
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth (hwloc_topology_t topology,
hwloc_const_cpuset_t set,
int depth,
hwloc_obj_t prev hwloc_const_cpuset_t set 
-

Iterate through same-depth objects covering at least CPU set set.

-

If object prev is NULL, return the first object at depth depth covering at least part of CPU set set. The next invokation should pass the previous return value in prev so as to obtain the next object covering at least another part of set.

-
Note
This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects).
+

Get the first data (or unified) cache covering a cpuset set.

+
Returns
NULL if no cache matches.
- -

◆ hwloc_get_next_obj_covering_cpuset_by_type()

+ +

◆ hwloc_get_cache_type_depth()

@@ -166,28 +106,22 @@
- + - + - - - - - - - - + + - - + + @@ -202,15 +136,18 @@
static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type static int hwloc_get_cache_type_depth (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_cpuset_t set,
hwloc_obj_type_t type, unsigned cachelevel,
hwloc_obj_t prev hwloc_obj_cache_type_t cachetype 
-

Iterate through same-type objects covering at least CPU set set.

-

If object prev is NULL, return the first object of type type covering at least part of CPU set set. The next invokation should pass the previous return value in prev so as to obtain the next object of type type covering at least another part of set.

-

If there are no or multiple depths for type type, NULL is returned. The caller may fallback to hwloc_get_next_obj_covering_cpuset_by_depth() for each depth.

-
Note
This function cannot work if objects of the given type do not have CPU sets (I/O or Misc objects).
+

Find the depth of cache objects matching cache level and type.

+

Return the depth of the topology level that contains cache objects whose attributes match cachelevel and cachetype.

+

This function is identical to calling hwloc_get_type_depth() with the corresponding type such as HWLOC_OBJ_L1ICACHE, except that it may also return a Unified cache when looking for an instruction cache.

+

If no cache level matches, HWLOC_TYPE_DEPTH_UNKNOWN is returned.

+

If cachetype is HWLOC_OBJ_CACHE_UNIFIED, the depth of the unique matching unified cache level is returned.

+

If cachetype is HWLOC_OBJ_CACHE_DATA or HWLOC_OBJ_CACHE_INSTRUCTION, either a matching cache, or a unified cache is returned.

+

If cachetype is -1, it is ignored and multiple levels may match. The function returns either the depth of a uniquely matching level or HWLOC_TYPE_DEPTH_MULTIPLE.

- -

◆ hwloc_get_obj_covering_cpuset()

+ +

◆ hwloc_get_shared_cache_covering_obj()

@@ -219,16 +156,16 @@
- + - + - - + + @@ -243,8 +180,8 @@
static hwloc_obj_t hwloc_get_obj_covering_cpuset static hwloc_obj_t hwloc_get_shared_cache_covering_obj (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_cpuset_t set hwloc_obj_t obj 
-

Get the lowest object covering at least CPU set set.

-
Returns
NULL if no object matches or if set is empty.
+

Get the first data (or unified) cache shared between an object and somebody else.

+
Returns
NULL if no cache matches or if an invalid object is given.
@@ -253,7 +190,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00197.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00197.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00197.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00197.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Looking at Ancestor and Child Objects +Hardware Locality (hwloc): Finding objects, miscellaneous helpers @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Looking at Ancestor and Child Objects
+
Finding objects, miscellaneous helpers
- - - - - - - - - - + + + + + + + + + + + +

Functions

static hwloc_obj_t hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology, int depth, hwloc_obj_t obj)
 
static hwloc_obj_t hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t obj)
 
static hwloc_obj_t hwloc_get_common_ancestor_obj (hwloc_topology_t topology, hwloc_obj_t obj1, hwloc_obj_t obj2)
 
static int hwloc_obj_is_in_subtree (hwloc_topology_t topology, hwloc_obj_t obj, hwloc_obj_t subtree_root)
 
static hwloc_obj_t hwloc_get_next_child (hwloc_topology_t topology, hwloc_obj_t parent, hwloc_obj_t prev)
 
int hwloc_bitmap_singlify_per_core (hwloc_topology_t topology, hwloc_bitmap_t cpuset, unsigned which)
 
static hwloc_obj_t hwloc_get_pu_obj_by_os_index (hwloc_topology_t topology, unsigned os_index)
 
static hwloc_obj_t hwloc_get_numanode_obj_by_os_index (hwloc_topology_t topology, unsigned os_index)
 
unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *restrict objs, unsigned max)
 
static hwloc_obj_t hwloc_get_obj_below_by_type (hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t type2, unsigned idx2)
 
static hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
 

Detailed Description

-

Be sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers.

+

Be sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers.

Function Documentation

- -

◆ hwloc_get_ancestor_obj_by_depth()

+ +

◆ hwloc_bitmap_singlify_per_core()

- - - - - -
- + - + - - + + - - + + @@ -94,44 +94,83 @@
static hwloc_obj_t hwloc_get_ancestor_obj_by_depth int hwloc_bitmap_singlify_per_core (hwloc_topology_t hwloc_topology_t  topology,
int depth, hwloc_bitmap_t cpuset,
hwloc_obj_t obj unsigned which 
-
-inlinestatic
-

Returns the ancestor object of obj at depth depth.

-
Note
depth should not be the depth of PU or NUMA objects since they are ancestors of no objects (except Misc or I/O). This function rather expects an intermediate level depth, such as the depth of Packages, Cores, or Caches.
+

Remove simultaneous multithreading PUs from a CPU set.

+

For each core in topology, if cpuset contains some PUs of that core, modify cpuset to only keep a single PU for that core.

+

which specifies which PU will be kept. PU are considered in physical index order. If 0, for each core, the function keeps the first PU that was originally set in cpuset.

+

If which is larger than the number of PUs in a core there were originally set in cpuset, no PU is kept for that core.

+
Note
PUs that are not below a Core object are ignored (for instance if the topology does not contain any Core object). None of them is removed from cpuset.
- -

◆ hwloc_get_ancestor_obj_by_type()

+ +

◆ hwloc_get_closest_objs()

- - - @@ -27,160 +27,187 @@
- + - + - - + + + + + + + + - - + + + + + + + + +
static hwloc_obj_t hwloc_get_ancestor_obj_by_type unsigned hwloc_get_closest_objs (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type, hwloc_obj_t src,
hwloc_obj_t *restrict objs,
hwloc_obj_t obj unsigned max 
)
+
+ +

Do a depth-first traversal of the topology to find and sort.

+

all objects that are at the same depth than src. Report in objs up to max physically closest ones to src.

+
Returns
the number of objects returned in objs.
+
+0 if src is an I/O object.
+
Note
This function requires the src object to have a CPU set.
+ +
+ + +

◆ hwloc_get_numanode_obj_by_os_index()

+ +
+
+ + + @@ -27,172 +27,133 @@
+ + + + + + + + + + + + @@ -146,13 +185,13 @@
static hwloc_obj_t hwloc_get_numanode_obj_by_os_index (hwloc_topology_t topology,
unsigned os_index 
-

Returns the ancestor object of obj with type type.

-
Note
type should not be HWLOC_OBJ_PU or HWLOC_OBJ_NUMANODE since these objects are ancestors of no objects (except Misc or I/O). This function rather expects an intermediate object type, such as HWLOC_OBJ_PACKAGE, HWLOC_OBJ_CORE, etc.
+

Returns the object of type HWLOC_OBJ_NUMANODE with os_index.

+

This function is useful for converting a nodeset into the NUMA node objects it contains. When retrieving the current binding (e.g. with hwloc_get_membind() with HWLOC_MEMBIND_BYNODESET), one may iterate over the bits of the resulting nodeset with hwloc_bitmap_foreach_begin(), and find the corresponding NUMA nodes with this function.

- -

◆ hwloc_get_common_ancestor_obj()

+ +

◆ hwloc_get_obj_below_array_by_type()

@@ -161,22 +200,28 @@
- + - + - - + + - - + + + + + + + + @@ -191,12 +236,17 @@
static hwloc_obj_t hwloc_get_common_ancestor_obj static hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_t obj1, int nr,
hwloc_obj_t obj2 hwloc_obj_type_ttypev,
unsigned * idxv 
-

Returns the common parent object to objects obj1 and obj2.

+

Find an object below a chain of objects specified by types and indexes.

+

This is a generalized version of hwloc_get_obj_below_by_type().

+

Arrays typev and idxv must contain nr types and indexes.

+

Start from the top system object and walk the arrays typev and idxv. For each type and logical index couple in the arrays, look under the previously found object to find the index-th object of the given type. Indexes are specified within the parent, not withing the entire system.

+

For instance, if nr is 3, typev contains NODE, PACKAGE and CORE, and idxv contains 0, 1 and 2, return the third core object below the second package below the first NUMA node.

+
Note
This function requires all these objects and the root object to have a CPU set.
- -

◆ hwloc_get_next_child()

+ +

◆ hwloc_get_obj_below_by_type()

@@ -205,22 +255,34 @@
- + - + - - + + + + + + + + + + + + + + - - + + @@ -235,15 +297,15 @@
static hwloc_obj_t hwloc_get_next_child static hwloc_obj_t hwloc_get_obj_below_by_type (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_t parent, hwloc_obj_type_t type1,
unsigned idx1,
hwloc_obj_type_t type2,
hwloc_obj_t prev unsigned idx2 
-

Return the next child.

-

Return the next child among the normal children list, then among the memory children list, then among the I/O children list, then among the Misc children list.

-

If prev is NULL, return the first child.

-

Return NULL when there is no next child.

+

Find an object below another object, both specified by types and indexes.

+

Start from the top system object and find object of type type1 and logical index idx1. Then look below this object and find another object of type type2 and logical index idx2. Indexes are specified within the parent, not withing the entire system.

+

For instance, if type1 is PACKAGE, idx1 is 2, type2 is CORE and idx2 is 3, return the fourth core object below the third package.

+
Note
This function requires these objects to have a CPU set.
- -

◆ hwloc_obj_is_in_subtree()

+ +

◆ hwloc_get_pu_obj_by_os_index()

@@ -252,22 +314,16 @@
- + - + - - - - - - - - + + @@ -282,8 +338,8 @@
static int hwloc_obj_is_in_subtree static hwloc_obj_t hwloc_get_pu_obj_by_os_index (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_t obj,
hwloc_obj_t subtree_root unsigned os_index 
-

Returns true if obj is inside the subtree beginning with ancestor object subtree_root.

-
Note
This function cannot work if obj and subtree_root objects do not have CPU sets (I/O or Misc objects).
+

Returns the object of type HWLOC_OBJ_PU with os_index.

+

This function is useful for converting a CPU set into the PU objects it contains. When retrieving the current binding (e.g. with hwloc_get_cpubind()), one may iterate over the bits of the resulting CPU set with hwloc_bitmap_foreach_begin(), and find the corresponding PUs with this function.

@@ -292,7 +348,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00198.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00198.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00198.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00198.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Kinds of object Type +Hardware Locality (hwloc): Distributing items over a topology @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Kinds of object Type
+
Distributing items over a topology
+ + + +

+Enumerations

enum  hwloc_distrib_flags_e { HWLOC_DISTRIB_FLAG_REVERSE + }
 
- - - - - - - - - - - - + +

Functions

int hwloc_obj_type_is_normal (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_io (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_memory (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_cache (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_dcache (hwloc_obj_type_t type)
 
int hwloc_obj_type_is_icache (hwloc_obj_type_t type)
 
static int hwloc_distrib (hwloc_topology_t topology, hwloc_obj_t *roots, unsigned n_roots, hwloc_cpuset_t *set, unsigned n, int until, unsigned long flags)
 

Detailed Description

-

Each object type is either Normal (i.e. hwloc_obj_type_is_normal() returns 1), or Memory (i.e. hwloc_obj_type_is_memory() returns 1) or I/O (i.e. hwloc_obj_type_is_io() returns 1) or Misc (i.e. equal to HWLOC_OBJ_MISC). It cannot be of more than one of these kinds.

-

Function Documentation

- -

◆ hwloc_obj_type_is_cache()

+

Enumeration Type Documentation

+ +

◆ hwloc_distrib_flags_e

- - - - - +
int hwloc_obj_type_is_cache (hwloc_obj_type_t type)enum hwloc_distrib_flags_e
-

Check whether an object type is a CPU Cache (Data, Unified or Instruction).

-

Memory-side caches are not CPU caches.

-
Returns
1 if an object of type type is a Cache, 0 otherwise.
+

Flags to be given to hwloc_distrib().

+ + +
Enumerator
HWLOC_DISTRIB_FLAG_REVERSE 

Distrib in reverse order, starting from the last objects.

+
- -

◆ hwloc_obj_type_is_dcache()

+

Function Documentation

+ +

◆ hwloc_distrib()

+ + + + + +
- + - - + + + + + + + -
int hwloc_obj_type_is_dcache static int hwloc_distrib (hwloc_obj_type_t type)hwloc_topology_t topology,
hwloc_obj_troots,
-
- -

Check whether an object type is a CPU Data or Unified Cache.

-

Memory-side caches are not CPU caches.

-
Returns
1 if an object of type type is a CPU Data or Unified Cache, 0 otherwise.
- -
- - -

◆ hwloc_obj_type_is_icache()

- -
-
- - - - - + + + -
int hwloc_obj_type_is_icache (hwloc_obj_type_t type) unsigned n_roots,
-
- -

Check whether an object type is a CPU Instruction Cache,.

-

Memory-side caches are not CPU caches.

-
Returns
1 if an object of type type is a CPU Instruction Cache, 0 otherwise.
- -
-
- -

◆ hwloc_obj_type_is_io()

- -
-
- - - - - + + + -
int hwloc_obj_type_is_io (hwloc_obj_type_t type) hwloc_cpuset_tset,
-
- -

Check whether an object type is I/O.

-

I/O objects are objects attached to their parents in the I/O children list. This current includes Bridges, PCI and OS devices.

-
Returns
1 if an object of type type is a I/O object, 0 otherwise.
- -
-
- -

◆ hwloc_obj_type_is_memory()

- -
-
- - - - - + + + -
int hwloc_obj_type_is_memory (hwloc_obj_type_t type) unsigned n,
-
- -

Check whether an object type is Memory.

-

Memory objects are objects attached to their parents in the Memory children list. This current includes NUMA nodes and Memory-side caches.

-
Returns
1 if an object of type type is a Memory object, 0 otherwise.
- -
-
- -

◆ hwloc_obj_type_is_normal()

- -
-
- - - - - + + + + + + + + + + + + + +
int hwloc_obj_type_is_normal (hwloc_obj_type_t type)int until,
unsigned long flags 
)
+
+inlinestatic
-

Check whether an object type is Normal.

-

Normal objects are objects of the main CPU hierarchy (Machine, Package, Core, PU, CPU caches, etc.), but they are not NUMA nodes, I/O devices or Misc objects.

-

They are attached to parent as Normal children, not as Memory, I/O or Misc children.

-
Returns
1 if an object of type type is a Normal object, 0 otherwise.
+

Distribute n items over the topology under roots.

+

Array set will be filled with n cpusets recursively distributed linearly over the topology under objects roots, down to depth until (which can be INT_MAX to distribute down to the finest level).

+

n_roots is usually 1 and roots only contains the topology root object so as to distribute over the entire topology.

+

This is typically useful when an application wants to distribute n threads over a machine, giving each of them as much private cache as possible and keeping them locally in number order.

+

The caller may typically want to also call hwloc_bitmap_singlify() before binding a thread so that it does not move at all.

+

flags should be 0 or a OR'ed set of hwloc_distrib_flags_e.

+
Note
This function requires the roots objects to have a CPU set.
+
+This function replaces the now deprecated hwloc_distribute() and hwloc_distributev() functions.
@@ -201,7 +162,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00199.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00199.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00199.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00199.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Looking at Cache Objects +Hardware Locality (hwloc): CPU and node sets of entire topologies @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Looking at Cache Objects
+
CPU and node sets of entire topologies
- - - - - - + + + + + + + + + + + +

Functions

static int hwloc_get_cache_type_depth (hwloc_topology_t topology, unsigned cachelevel, hwloc_obj_cache_type_t cachetype)
 
static hwloc_obj_t hwloc_get_cache_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 
static hwloc_obj_t hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology, hwloc_obj_t obj)
 
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset (hwloc_topology_t topology)
 
hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset (hwloc_topology_t topology)
 
hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset (hwloc_topology_t topology)
 
hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset (hwloc_topology_t topology)
 
hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset (hwloc_topology_t topology)
 
hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset (hwloc_topology_t topology)
 

Detailed Description

Function Documentation

- -

◆ hwloc_get_cache_covering_cpuset()

+ +

◆ hwloc_topology_get_allowed_cpuset()

- - - - - -
- + - - - - - - - - - - + + - -
static hwloc_obj_t hwloc_get_cache_covering_cpuset hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset (hwloc_topology_t topology,
hwloc_const_cpuset_t set 
hwloc_topology_t topology) )
-
-inlinestatic
-

Get the first data (or unified) cache covering a cpuset set.

-
Returns
NULL if no cache matches.
+

Get allowed CPU set.

+
Returns
the CPU set of allowed logical processors of the system.
+
Note
If the topology flag HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was not set, this is identical to hwloc_topology_get_topology_cpuset(), which means all PUs are allowed.
+
+If HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set, applying hwloc_bitmap_intersects() on the result of this function and on an object cpuset checks whether there are allowed PUs inside that object. Applying hwloc_bitmap_and() returns the list of these allowed PUs.
+
+The returned cpuset is not newly allocated and should thus not be changed or freed, hwloc_bitmap_dup() must be used to obtain a local copy.
- -

◆ hwloc_get_cache_type_depth()

+ +

◆ hwloc_topology_get_allowed_nodeset()

- - - - - -
- + - - - - - + + - - +
static int hwloc_get_cache_type_depth hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset (hwloc_topology_t topology,
hwloc_topology_t topology) unsigned cachelevel,
+
+ +

Get allowed node set.

+
Returns
the node set of allowed memory of the system.
+
Note
If the topology flag HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was not set, this is identical to hwloc_topology_get_topology_nodeset(), which means all NUMA nodes are allowed.
+
+If HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set, applying hwloc_bitmap_intersects() on the result of this function and on an object nodeset checks whether there are allowed NUMA nodes inside that object. Applying hwloc_bitmap_and() returns the list of these allowed NUMA nodes.
+
+The returned nodeset is not newly allocated and should thus not be changed or freed, hwloc_bitmap_dup() must be used to obtain a local copy.
+ +
+ + +

◆ hwloc_topology_get_complete_cpuset()

+ +
+
+ - + + + + - - +
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset (hwloc_topology_t topology) hwloc_obj_cache_type_t cachetype 
+
+ +

Get complete CPU set.

+
Returns
the complete CPU set of logical processors of the system.
+
Note
The returned cpuset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
+
+This is equivalent to retrieving the root object complete CPU-set.
+ +
+
+ +

◆ hwloc_topology_get_complete_nodeset()

+ +
+
+ + + + + - -
hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset (hwloc_topology_t topology) )
-
-inlinestatic
-

Find the depth of cache objects matching cache level and type.

-

Return the depth of the topology level that contains cache objects whose attributes match cachelevel and cachetype.

-

This function is identical to calling hwloc_get_type_depth() with the corresponding type such as HWLOC_OBJ_L1ICACHE, except that it may also return a Unified cache when looking for an instruction cache.

-

If no cache level matches, HWLOC_TYPE_DEPTH_UNKNOWN is returned.

-

If cachetype is HWLOC_OBJ_CACHE_UNIFIED, the depth of the unique matching unified cache level is returned.

-

If cachetype is HWLOC_OBJ_CACHE_DATA or HWLOC_OBJ_CACHE_INSTRUCTION, either a matching cache, or a unified cache is returned.

-

If cachetype is -1, it is ignored and multiple levels may match. The function returns either the depth of a uniquely matching level or HWLOC_TYPE_DEPTH_MULTIPLE.

+

Get complete node set.

+
Returns
the complete node set of memory of the system.
+
Note
The returned nodeset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
+
+This is equivalent to retrieving the root object complete nodeset.
- -

◆ hwloc_get_shared_cache_covering_obj()

+ +

◆ hwloc_topology_get_topology_cpuset()

- - - - - -
- + - - - - - + + - - +
static hwloc_obj_t hwloc_get_shared_cache_covering_obj hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset (hwloc_topology_t topology,
hwloc_topology_t topology) hwloc_obj_t obj 
+
+ +

Get topology CPU set.

+
Returns
the CPU set of logical processors of the system for which hwloc provides topology information. This is equivalent to the cpuset of the system object.
+
Note
The returned cpuset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
+
+This is equivalent to retrieving the root object CPU-set.
+ +
+ + +

◆ hwloc_topology_get_topology_nodeset()

+ +
+
+ + + + + - -
hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset (hwloc_topology_t topology) )
-
-inlinestatic
-

Get the first data (or unified) cache shared between an object and somebody else.

-
Returns
NULL if no cache matches or if an invalid object is given.
+

Get topology node set.

+
Returns
the node set of memory of the system for which hwloc provides topology information. This is equivalent to the nodeset of the system object.
+
Note
The returned nodeset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
+
+This is equivalent to retrieving the root object nodeset.
@@ -189,7 +216,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00200.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00200.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00200.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00200.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Finding objects, miscellaneous helpers +Hardware Locality (hwloc): Converting between CPU sets and node sets @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,89 +27,36 @@
- + +/* @license-end */
-
Finding objects, miscellaneous helpers
+
Converting between CPU sets and node sets
- - - - - - - - - - + + + +

Functions

static hwloc_obj_t hwloc_get_pu_obj_by_os_index (hwloc_topology_t topology, unsigned os_index)
 
static hwloc_obj_t hwloc_get_numanode_obj_by_os_index (hwloc_topology_t topology, unsigned os_index)
 
unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *restrict objs, unsigned max)
 
static hwloc_obj_t hwloc_get_obj_below_by_type (hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t type2, unsigned idx2)
 
static hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
 
static int hwloc_cpuset_to_nodeset (hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset)
 
static int hwloc_cpuset_from_nodeset (hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset)
 

Detailed Description

-

Be sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers.

Function Documentation

- -

◆ hwloc_get_closest_objs()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unsigned hwloc_get_closest_objs (hwloc_topology_t topology,
hwloc_obj_t src,
hwloc_obj_t *restrict objs,
unsigned max 
)
-
- -

Do a depth-first traversal of the topology to find and sort.

-

all objects that are at the same depth than src. Report in objs up to max physically closest ones to src.

-
Returns
the number of objects returned in objs.
-
-0 if src is an I/O object.
-
Note
This function requires the src object to have a CPU set.
- -
-
- -

◆ hwloc_get_numanode_obj_by_os_index()

+ +

◆ hwloc_cpuset_from_nodeset()

@@ -118,67 +65,22 @@ - + - + - - - - - - - - -
static hwloc_obj_t hwloc_get_numanode_obj_by_os_index static int hwloc_cpuset_from_nodeset (hwloc_topology_t hwloc_topology_t  topology,
unsigned os_index 
)
- - -inlinestatic - - -
- -

Returns the object of type HWLOC_OBJ_NUMANODE with os_index.

-

This function is useful for converting a nodeset into the NUMA node objects it contains. When retrieving the current binding (e.g. with hwloc_get_membind() with HWLOC_MEMBIND_BYNODESET), one may iterate over the bits of the resulting nodeset with hwloc_bitmap_foreach_begin(), and find the corresponding NUMA nodes with this function.

- -
-
- -

◆ hwloc_get_obj_below_array_by_type()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - + + - - + + @@ -193,17 +95,15 @@
static hwloc_obj_t hwloc_get_obj_below_array_by_type (hwloc_topology_t topology,
int nr,
hwloc_obj_type_ttypev, hwloc_cpuset_t _cpuset,
unsigned * idxv hwloc_const_nodeset_t nodeset 
-

Find an object below a chain of objects specified by types and indexes.

-

This is a generalized version of hwloc_get_obj_below_by_type().

-

Arrays typev and idxv must contain nr types and indexes.

-

Start from the top system object and walk the arrays typev and idxv. For each type and logical index couple in the arrays, look under the previously found object to find the index-th object of the given type. Indexes are specified within the parent, not withing the entire system.

-

For instance, if nr is 3, typev contains NODE, PACKAGE and CORE, and idxv contains 0, 1 and 2, return the third core object below the second package below the first NUMA node.

-
Note
This function requires all these objects and the root object to have a CPU set.
+

Convert a NUMA node set into a CPU set.

+

For each NUMA node included in the input nodeset, set the corresponding local PUs in the output _cpuset.

+

If some CPUs have no local NUMA nodes, this function never sets their indexes in the output CPU set, even if a full node set is given in input.

+

Hence the entire topology node set is converted into the set of all CPUs that have some local NUMA nodes.

- -

◆ hwloc_get_obj_below_by_type()

+ +

◆ hwloc_cpuset_to_nodeset()

@@ -212,75 +112,22 @@
- + - + - - - - - - - - - - - - - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_obj_below_by_type static int hwloc_cpuset_to_nodeset (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type1,
unsigned idx1,
hwloc_obj_type_t type2,
unsigned idx2 
)
-
-inlinestatic
-
- -

Find an object below another object, both specified by types and indexes.

-

Start from the top system object and find object of type type1 and logical index idx1. Then look below this object and find another object of type type2 and logical index idx2. Indexes are specified within the parent, not withing the entire system.

-

For instance, if type1 is PACKAGE, idx1 is 2, type2 is CORE and idx2 is 3, return the fourth core object below the third package.

-
Note
This function requires these objects to have a CPU set.
- -
-
- -

◆ hwloc_get_pu_obj_by_os_index()

- -
-
- - - @@ -27,61 +27,127 @@
- - - - - - + + - - + + @@ -295,8 +142,10 @@
static hwloc_obj_t hwloc_get_pu_obj_by_os_index (hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset,
unsigned os_index hwloc_nodeset_t nodeset 
-

Returns the object of type HWLOC_OBJ_PU with os_index.

-

This function is useful for converting a CPU set into the PU objects it contains. When retrieving the current binding (e.g. with hwloc_get_cpubind()), one may iterate over the bits of the resulting CPU set with hwloc_bitmap_foreach_begin(), and find the corresponding PUs with this function.

+

Convert a CPU set into a NUMA node set.

+

For each PU included in the input _cpuset, set the corresponding local NUMA node(s) in the output nodeset.

+

If some NUMA nodes have no CPUs at all, this function never sets their indexes in the output node set, even if a full CPU set is given in input.

+

Hence the entire topology CPU set is converted into the set of all nodes that have some local CPUs.

@@ -305,7 +154,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00201.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00201.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00201.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00201.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Distributing items over a topology +Hardware Locality (hwloc): Finding I/O objects @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Distributing items over a topology
+
Finding I/O objects
- - - -

-Enumerations

enum  hwloc_distrib_flags_e { HWLOC_DISTRIB_FLAG_REVERSE - }
 
- - + + + + + + + + + + + + + +

Functions

static int hwloc_distrib (hwloc_topology_t topology, hwloc_obj_t *roots, unsigned n_roots, hwloc_cpuset_t *set, unsigned n, int until, unsigned long flags)
 
static hwloc_obj_t hwloc_get_non_io_ancestor_obj (hwloc_topology_t topology, hwloc_obj_t ioobj)
 
static hwloc_obj_t hwloc_get_next_pcidev (hwloc_topology_t topology, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_pcidev_by_busid (hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
 
static hwloc_obj_t hwloc_get_pcidev_by_busidstring (hwloc_topology_t topology, const char *busid)
 
static hwloc_obj_t hwloc_get_next_osdev (hwloc_topology_t topology, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_bridge (hwloc_topology_t topology, hwloc_obj_t prev)
 
static int hwloc_bridge_covers_pcibus (hwloc_obj_t bridge, unsigned domain, unsigned bus)
 

Detailed Description

-

Enumeration Type Documentation

- -

◆ hwloc_distrib_flags_e

+

Function Documentation

+ +

◆ hwloc_bridge_covers_pcibus()

+ + + + + +
- + + + + + + + + + + + + + + + + + + + + +
enum hwloc_distrib_flags_estatic int hwloc_bridge_covers_pcibus (hwloc_obj_t bridge,
unsigned domain,
unsigned bus 
)
+
+inlinestatic
-

Flags to be given to hwloc_distrib().

- - + + + +

◆ hwloc_get_next_bridge()

+ +
+
+
Enumerator
HWLOC_DISTRIB_FLAG_REVERSE 

Distrib in reverse order, starting from the last objects.

-
+ + + +
+ + + + + + + + + + + + + + + + + + +
static hwloc_obj_t hwloc_get_next_bridge (hwloc_topology_t topology,
hwloc_obj_t prev 
)
+
+inlinestatic
+
+ +

Get the next bridge in the system.

+
Returns
the first bridge if prev is NULL.
-

Function Documentation

- -

◆ hwloc_distrib()

+ +

◆ hwloc_get_next_osdev()

@@ -90,46 +156,190 @@ - + - + - - + + + + + + + + +
static int hwloc_distrib static hwloc_obj_t hwloc_get_next_osdev (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_troots, hwloc_obj_t prev 
)
+ + +inlinestatic + + +
+ +

Get the next OS device in the system.

+
Returns
the first OS device if prev is NULL.
+ +
+
+ +

◆ hwloc_get_next_pcidev()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static hwloc_obj_t hwloc_get_next_pcidev (hwloc_topology_t topology,
hwloc_obj_t prev 
)
+
+inlinestatic
+
+ +

Get the next PCI device in the system.

+
Returns
the first PCI device if prev is NULL.
+ +
+
+ +

◆ hwloc_get_non_io_ancestor_obj()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static hwloc_obj_t hwloc_get_non_io_ancestor_obj (hwloc_topology_t topology,
hwloc_obj_t ioobj 
)
+
+inlinestatic
+
+ +

Get the first non-I/O ancestor object.

+

Given the I/O object ioobj, find the smallest non-I/O ancestor object. This object (normal or memory) may then be used for binding because it has non-NULL CPU and node sets and because its locality is the same as ioobj.

+
Note
The resulting object is usually a normal object but it could also be a memory object (e.g. NUMA node) in future platforms if I/O objects ever get attached to memory instead of CPUs.
+ +
+
+ +

◆ hwloc_get_pcidev_by_busid()

+ +
+
+ + + + + +
+ + + + + + - + - - + + - + - - + + + + + + + + +
static hwloc_obj_t hwloc_get_pcidev_by_busid (hwloc_topology_t topology,
unsigned n_roots, domain,
hwloc_cpuset_tset, unsigned bus,
unsigned n, dev,
int until, unsigned func 
)
+
+inlinestatic
+
+ +

Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id.

+ +
+
+ +

◆ hwloc_get_pcidev_by_busidstring()

+ +
+
+ + + @@ -27,195 +27,1775 @@
+ + + + + + - - + + @@ -144,15 +354,7 @@
static hwloc_obj_t hwloc_get_pcidev_by_busidstring (hwloc_topology_t topology,
unsigned long flags const char * busid 
-

Distribute n items over the topology under roots.

-

Array set will be filled with n cpusets recursively distributed linearly over the topology under objects roots, down to depth until (which can be INT_MAX to distribute down to the finest level).

-

n_roots is usually 1 and roots only contains the topology root object so as to distribute over the entire topology.

-

This is typically useful when an application wants to distribute n threads over a machine, giving each of them as much private cache as possible and keeping them locally in number order.

-

The caller may typically want to also call hwloc_bitmap_singlify() before binding a thread so that it does not move at all.

-

flags should be 0 or a OR'ed set of hwloc_distrib_flags_e.

-
Note
This function requires the roots objects to have a CPU set.
-
-This function replaces the now deprecated hwloc_distribute() and hwloc_distributev() functions.
+

Find the PCI device object matching the PCI bus id given as a string xxxx:yy:zz.t or yy:zz.t.

@@ -161,7 +363,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00202.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00202.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00202.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00202.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): CPU and node sets of entire topologies +Hardware Locality (hwloc): The bitmap API @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
CPU and node sets of entire topologies
+
The bitmap API
+ + + + + +

+Macros

#define hwloc_bitmap_foreach_begin(id, bitmap)
 
#define hwloc_bitmap_foreach_end()
 
+ + + + + +

+Typedefs

typedef struct hwloc_bitmap_s * hwloc_bitmap_t
 
typedef const struct hwloc_bitmap_s * hwloc_const_bitmap_t
 
- - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset (hwloc_topology_t topology)
 
hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset (hwloc_topology_t topology)
 
hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset (hwloc_topology_t topology)
 
hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset (hwloc_topology_t topology)
 
hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset (hwloc_topology_t topology)
 
hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset (hwloc_topology_t topology)
 
hwloc_bitmap_t hwloc_bitmap_alloc (void)
 
hwloc_bitmap_t hwloc_bitmap_alloc_full (void)
 
void hwloc_bitmap_free (hwloc_bitmap_t bitmap)
 
hwloc_bitmap_t hwloc_bitmap_dup (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_copy (hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
 
int hwloc_bitmap_snprintf (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_asprintf (char **strp, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_sscanf (hwloc_bitmap_t bitmap, const char *restrict string)
 
int hwloc_bitmap_list_snprintf (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_list_asprintf (char **strp, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_list_sscanf (hwloc_bitmap_t bitmap, const char *restrict string)
 
int hwloc_bitmap_taskset_snprintf (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_taskset_asprintf (char **strp, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_taskset_sscanf (hwloc_bitmap_t bitmap, const char *restrict string)
 
void hwloc_bitmap_zero (hwloc_bitmap_t bitmap)
 
void hwloc_bitmap_fill (hwloc_bitmap_t bitmap)
 
int hwloc_bitmap_only (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_allbut (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_from_ulong (hwloc_bitmap_t bitmap, unsigned long mask)
 
int hwloc_bitmap_from_ith_ulong (hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
 
int hwloc_bitmap_from_ulongs (hwloc_bitmap_t bitmap, unsigned nr, const unsigned long *masks)
 
int hwloc_bitmap_set (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_set_range (hwloc_bitmap_t bitmap, unsigned begin, int end)
 
int hwloc_bitmap_set_ith_ulong (hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
 
int hwloc_bitmap_clr (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_clr_range (hwloc_bitmap_t bitmap, unsigned begin, int end)
 
int hwloc_bitmap_singlify (hwloc_bitmap_t bitmap)
 
unsigned long hwloc_bitmap_to_ulong (hwloc_const_bitmap_t bitmap)
 
unsigned long hwloc_bitmap_to_ith_ulong (hwloc_const_bitmap_t bitmap, unsigned i)
 
int hwloc_bitmap_to_ulongs (hwloc_const_bitmap_t bitmap, unsigned nr, unsigned long *masks)
 
int hwloc_bitmap_nr_ulongs (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_isset (hwloc_const_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_iszero (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_isfull (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_first (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_next (hwloc_const_bitmap_t bitmap, int prev)
 
int hwloc_bitmap_last (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_weight (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_first_unset (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_next_unset (hwloc_const_bitmap_t bitmap, int prev)
 
int hwloc_bitmap_last_unset (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_or (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_and (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_andnot (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_xor (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_not (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap)
 
int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_compare_first (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_compare (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 

Detailed Description

+

The hwloc_bitmap_t type represents a set of integers (positive or null). A bitmap may be of infinite size (all bits are set after some point). A bitmap may even be full if all bits are set.

+

Bitmaps are used by hwloc for sets of OS processors (which may actually be hardware threads) as by hwloc_cpuset_t (a typedef for hwloc_bitmap_t), or sets of NUMA memory nodes as hwloc_nodeset_t (also a typedef for hwloc_bitmap_t). Those are used for cpuset and nodeset fields in the hwloc_obj structure, see Object Sets (hwloc_cpuset_t and hwloc_nodeset_t).

+

Both CPU and node sets are always indexed by OS physical number. However users should usually not build CPU and node sets manually (e.g. with hwloc_bitmap_set()). One should rather use existing object sets and combine them with hwloc_bitmap_or(), etc. For instance, binding the current thread on a pair of cores may be performed with:

hwloc_obj_t core1 = ... , core2 = ... ;
+ +
hwloc_bitmap_or(set, core1->cpuset, core2->cpuset);
+ + +
Note
Most functions below return an int that may be negative in case of error. The usual error case would be an internal failure to realloc/extend the storage of the bitmap (errno would be set to ENOMEM).
+
+Several examples of using the bitmap API are available under the doc/examples/ directory in the source tree. Regression tests such as tests/hwloc/hwloc_bitmap*.c also make intensive use of this API.
+

Macro Definition Documentation

+ +

◆ hwloc_bitmap_foreach_begin

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define hwloc_bitmap_foreach_begin( id,
 bitmap 
)
+
+ +

Loop macro iterating on bitmap bitmap.

+

The loop must start with hwloc_bitmap_foreach_begin() and end with hwloc_bitmap_foreach_end() followed by a terminating ';'.

+

index is the loop variable; it should be an unsigned int. The first iteration will set index to the lowest index in the bitmap. Successive iterations will iterate through, in order, all remaining indexes set in the bitmap. To be specific: each iteration will return a value for index such that hwloc_bitmap_isset(bitmap, index) is true.

+

The assert prevents the loop from being infinite if the bitmap is infinitely set.

+ +
+
+ +

◆ hwloc_bitmap_foreach_end

+ +
+
+ + + + + + + +
#define hwloc_bitmap_foreach_end()
+
+ +

End of loop macro iterating on a bitmap.

+

Needs a terminating ';'.

+
See also
hwloc_bitmap_foreach_begin()
+ +
+
+

Typedef Documentation

+ +

◆ hwloc_bitmap_t

+ +
+
+ + + + +
typedef struct hwloc_bitmap_s* hwloc_bitmap_t
+
+ +

Set of bits represented as an opaque pointer to an internal bitmap.

+ +
+
+ +

◆ hwloc_const_bitmap_t

+ +
+
+ + + + +
typedef const struct hwloc_bitmap_s* hwloc_const_bitmap_t
+
+ +

a non-modifiable hwloc_bitmap_t

+ +
+

Function Documentation

- -

◆ hwloc_topology_get_allowed_cpuset()

+ +

◆ hwloc_bitmap_allbut()

- + - - + + + + + + + + + + + +
hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset int hwloc_bitmap_allbut (hwloc_topology_t topology)hwloc_bitmap_t bitmap,
unsigned id 
)
-

Get allowed CPU set.

-
Returns
the CPU set of allowed logical processors of the system.
-
Note
If the topology flag HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was not set, this is identical to hwloc_topology_get_topology_cpuset(), which means all PUs are allowed.
-
-If HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set, applying hwloc_bitmap_intersects() on the result of this function and on an object cpuset checks whether there are allowed PUs inside that object. Applying hwloc_bitmap_and() returns the list of these allowed PUs.
-
-The returned cpuset is not newly allocated and should thus not be changed or freed, hwloc_bitmap_dup() must be used to obtain a local copy.
+

Fill the bitmap and clear the index id.

+ +
+
+ +

◆ hwloc_bitmap_alloc()

+ +
+
+ + + + + + + + +
hwloc_bitmap_t hwloc_bitmap_alloc (void )
+
+ +

Allocate a new empty bitmap.

+
Returns
A valid bitmap or NULL.
+

The bitmap should be freed by a corresponding call to hwloc_bitmap_free().

+ +
+
+ +

◆ hwloc_bitmap_alloc_full()

+ +
+
+ + + + + + + + +
hwloc_bitmap_t hwloc_bitmap_alloc_full (void )
+
+ +

Allocate a new full bitmap.

+ +
+
+ +

◆ hwloc_bitmap_and()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_and (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
+
+ +

And bitmaps bitmap1 and bitmap2 and store the result in bitmap res.

+

res can be the same as bitmap1 or bitmap2

+ +
+
+ +

◆ hwloc_bitmap_andnot()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_andnot (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
+
+ +

And bitmap bitmap1 and the negation of bitmap2 and store the result in bitmap res.

+

res can be the same as bitmap1 or bitmap2

+ +
+
+ +

◆ hwloc_bitmap_asprintf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_asprintf (char ** strp,
hwloc_const_bitmap_t bitmap 
)
+
+ +

Stringify a bitmap into a newly allocated string.

+
Returns
-1 on error.
+ +
+
+ +

◆ hwloc_bitmap_clr()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_clr (hwloc_bitmap_t bitmap,
unsigned id 
)
+
+ +

Remove index id from bitmap bitmap.

+ +
+
+ +

◆ hwloc_bitmap_clr_range()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_clr_range (hwloc_bitmap_t bitmap,
unsigned begin,
int end 
)
+
+ +

Remove indexes from begin to end in bitmap bitmap.

+

If end is -1, the range is infinite.

- -

◆ hwloc_topology_get_allowed_nodeset()

+ +

◆ hwloc_bitmap_compare()

- + - - + + + + + + + + + + + +
hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset int hwloc_bitmap_compare (hwloc_topology_t topology)hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-

Get allowed node set.

-
Returns
the node set of allowed memory of the system.
-
Note
If the topology flag HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was not set, this is identical to hwloc_topology_get_topology_nodeset(), which means all NUMA nodes are allowed.
+

Compare bitmaps bitmap1 and bitmap2 in lexicographic order.

+

Lexicographic comparison of bitmaps, starting for their highest indexes. Compare last indexes first, then second, etc. The empty bitmap is considered lower than anything.

+
Returns
-1 if bitmap1 is considered smaller than bitmap2.
-If HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set, applying hwloc_bitmap_intersects() on the result of this function and on an object nodeset checks whether there are allowed NUMA nodes inside that object. Applying hwloc_bitmap_and() returns the list of these allowed NUMA nodes.
+1 if bitmap1 is considered larger than bitmap2.
-The returned nodeset is not newly allocated and should thus not be changed or freed, hwloc_bitmap_dup() must be used to obtain a local copy.
+0 if bitmaps are equal (contrary to hwloc_bitmap_compare_first()).
+

For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110). Comparing 00101 and 01010 returns -1 too.

+
Note
This is different from the non-existing hwloc_bitmap_compare_last() which would only compare the highest index of each bitmap.
- -

◆ hwloc_topology_get_complete_cpuset()

+ +

◆ hwloc_bitmap_compare_first()

- + - - + + + + + + + + + + + +
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset int hwloc_bitmap_compare_first (hwloc_topology_t topology)hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-

Get complete CPU set.

-
Returns
the complete CPU set of logical processors of the system.
-
Note
The returned cpuset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
+

Compare bitmaps bitmap1 and bitmap2 using their lowest index.

+

A bitmap is considered smaller if its least significant bit is smaller. The empty bitmap is considered higher than anything (because its least significant bit does not exist).

+
Returns
-1 if bitmap1 is considered smaller than bitmap2.
-This is equivalent to retrieving the root object complete CPU-set.
+1 if bitmap1 is considered larger than bitmap2.
+

For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110) because least significant bit of 0011 (0001) is smaller than least significant bit of 0110 (0010). Comparing 01001 and 00110 would also return -1 for the same reason.

+
Returns
0 if bitmaps are considered equal, even if they are not strictly equal. They just need to have the same least significant bit. For instance, comparing binary bitmaps 0010 and 0110 returns 0 because they have the same least significant bit.
- -

◆ hwloc_topology_get_complete_nodeset()

+ +

◆ hwloc_bitmap_copy()

- + - - + + + + + + + + + + + +
hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset int hwloc_bitmap_copy (hwloc_topology_t topology)hwloc_bitmap_t dst,
hwloc_const_bitmap_t src 
)
-

Get complete node set.

-
Returns
the complete node set of memory of the system.
-
Note
The returned nodeset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
-
-This is equivalent to retrieving the root object complete nodeset.
+

Copy the contents of bitmap src into the already allocated bitmap dst.

- -

◆ hwloc_topology_get_topology_cpuset()

+ +

◆ hwloc_bitmap_dup()

- + - - + +
hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset hwloc_bitmap_t hwloc_bitmap_dup (hwloc_topology_t topology)hwloc_const_bitmap_t bitmap)
-

Get topology CPU set.

-
Returns
the CPU set of logical processors of the system for which hwloc provides topology information. This is equivalent to the cpuset of the system object.
-
Note
The returned cpuset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
-
-This is equivalent to retrieving the root object CPU-set.
+

Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.

+

If bitmap is NULL, NULL is returned.

- -

◆ hwloc_topology_get_topology_nodeset()

+ +

◆ hwloc_bitmap_fill()

- + - - + +
hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset void hwloc_bitmap_fill (hwloc_topology_t topology)hwloc_bitmap_t bitmap)
-

Get topology node set.

-
Returns
the node set of memory of the system for which hwloc provides topology information. This is equivalent to the nodeset of the system object.
-
Note
The returned nodeset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.
-
-This is equivalent to retrieving the root object nodeset.
+

Fill bitmap bitmap with all possible indexes (even if those objects don't exist or are otherwise unavailable)

+ +
+
+ +

◆ hwloc_bitmap_first()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_first (hwloc_const_bitmap_t bitmap)
+
+ +

Compute the first index (least significant bit) in bitmap bitmap.

+
Returns
-1 if no index is set in bitmap.
+ +
+
+ +

◆ hwloc_bitmap_first_unset()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_first_unset (hwloc_const_bitmap_t bitmap)
+
+ +

Compute the first unset index (least significant bit) in bitmap bitmap.

+
Returns
-1 if no index is unset in bitmap.
+ +
+
+ +

◆ hwloc_bitmap_free()

+ +
+
+ + + + + + + + +
void hwloc_bitmap_free (hwloc_bitmap_t bitmap)
+
+ +

Free bitmap bitmap.

+

If bitmap is NULL, no operation is performed.

+ +
+
+ +

◆ hwloc_bitmap_from_ith_ulong()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_from_ith_ulong (hwloc_bitmap_t bitmap,
unsigned i,
unsigned long mask 
)
+
+ +

Setup bitmap bitmap from unsigned long mask used as i -th subset.

+ +
+
+ +

◆ hwloc_bitmap_from_ulong()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_from_ulong (hwloc_bitmap_t bitmap,
unsigned long mask 
)
+
+ +

Setup bitmap bitmap from unsigned long mask.

+ +
+
+ +

◆ hwloc_bitmap_from_ulongs()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_from_ulongs (hwloc_bitmap_t bitmap,
unsigned nr,
const unsigned long * masks 
)
+
+ +

Setup bitmap bitmap from unsigned longs masks used as first nr subsets.

+ +
+
+ +

◆ hwloc_bitmap_intersects()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
+
+ +

Test whether bitmaps bitmap1 and bitmap2 intersects.

+
Returns
1 if bitmaps intersect, 0 otherwise.
+ +
+
+ +

◆ hwloc_bitmap_isequal()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
+
+ +

Test whether bitmap bitmap1 is equal to bitmap bitmap2.

+
Returns
1 if bitmaps are equal, 0 otherwise.
+ +
+
+ +

◆ hwloc_bitmap_isfull()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_isfull (hwloc_const_bitmap_t bitmap)
+
+ +

Test whether bitmap bitmap is completely full.

+
Returns
1 if bitmap is full, 0 otherwise.
+
Note
A full bitmap is always infinitely set.
+ +
+
+ +

◆ hwloc_bitmap_isincluded()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap,
hwloc_const_bitmap_t super_bitmap 
)
+
+ +

Test whether bitmap sub_bitmap is part of bitmap super_bitmap.

+
Returns
1 if sub_bitmap is included in super_bitmap, 0 otherwise.
+
Note
The empty bitmap is considered included in any other bitmap.
+ +
+
+ +

◆ hwloc_bitmap_isset()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_isset (hwloc_const_bitmap_t bitmap,
unsigned id 
)
+
+ +

Test whether index id is part of bitmap bitmap.

+
Returns
1 if the bit at index id is set in bitmap bitmap, 0 otherwise.
+ +
+
+ +

◆ hwloc_bitmap_iszero()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_iszero (hwloc_const_bitmap_t bitmap)
+
+ +

Test whether bitmap bitmap is empty.

+
Returns
1 if bitmap is empty, 0 otherwise.
+ +
+
+ +

◆ hwloc_bitmap_last()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_last (hwloc_const_bitmap_t bitmap)
+
+ +

Compute the last index (most significant bit) in bitmap bitmap.

+
Returns
-1 if no index is set in bitmap, or if bitmap is infinitely set.
+ +
+
+ +

◆ hwloc_bitmap_last_unset()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_last_unset (hwloc_const_bitmap_t bitmap)
+
+ +

Compute the last unset index (most significant bit) in bitmap bitmap.

+
Returns
-1 if no index is unset in bitmap, or if bitmap is infinitely set.
+ +
+
+ +

◆ hwloc_bitmap_list_asprintf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_list_asprintf (char ** strp,
hwloc_const_bitmap_t bitmap 
)
+
+ +

Stringify a bitmap into a newly allocated list string.

+
Returns
-1 on error.
+ +
+
+ +

◆ hwloc_bitmap_list_snprintf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_list_snprintf (char *restrict buf,
size_t buflen,
hwloc_const_bitmap_t bitmap 
)
+
+ +

Stringify a bitmap in the list format.

+

Lists are comma-separated indexes or ranges. Ranges are dash separated indexes. The last range may not have an ending indexes if the bitmap is infinitely set.

+

Up to buflen characters may be written in buffer buf.

+

If buflen is 0, buf may safely be NULL.

+
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
+ +
+
+ +

◆ hwloc_bitmap_list_sscanf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_list_sscanf (hwloc_bitmap_t bitmap,
const char *restrict string 
)
+
+ +

Parse a list string and stores it in bitmap bitmap.

+ +
+
+ +

◆ hwloc_bitmap_next()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_next (hwloc_const_bitmap_t bitmap,
int prev 
)
+
+ +

Compute the next index in bitmap bitmap which is after index prev.

+

If prev is -1, the first index is returned.

+
Returns
-1 if no index with higher index is set in bitmap.
+ +
+
+ +

◆ hwloc_bitmap_next_unset()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_next_unset (hwloc_const_bitmap_t bitmap,
int prev 
)
+
+ +

Compute the next unset index in bitmap bitmap which is after index prev.

+

If prev is -1, the first unset index is returned.

+
Returns
-1 if no index with higher index is unset in bitmap.
+ +
+
+ +

◆ hwloc_bitmap_not()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_not (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap 
)
+
+ +

Negate bitmap bitmap and store the result in bitmap res.

+

res can be the same as bitmap

+ +
+
+ +

◆ hwloc_bitmap_nr_ulongs()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_nr_ulongs (hwloc_const_bitmap_t bitmap)
+
+ +

Return the number of unsigned longs required for storing bitmap bitmap entirely.

+

This is the number of contiguous unsigned longs from the very first bit of the bitmap (even if unset) up to the last set bit. This is useful for knowing the nr parameter to pass to hwloc_bitmap_to_ulongs() (or which calls to hwloc_bitmap_to_ith_ulong() are needed) to entirely convert a bitmap into multiple unsigned longs.

+

When called on the output of hwloc_topology_get_topology_cpuset(), the returned number is large enough for all cpusets of the topology.

+
Returns
-1 if bitmap is infinite.
+ +
+
+ +

◆ hwloc_bitmap_only()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_only (hwloc_bitmap_t bitmap,
unsigned id 
)
+
+ +

Empty the bitmap bitmap and add bit id.

+ +
+
+ +

◆ hwloc_bitmap_or()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_or (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
+
+ +

Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.

+

res can be the same as bitmap1 or bitmap2

+ +
+
+ +

◆ hwloc_bitmap_set()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_set (hwloc_bitmap_t bitmap,
unsigned id 
)
+
+ +

Add index id in bitmap bitmap.

+ +
+
+ +

◆ hwloc_bitmap_set_ith_ulong()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_set_ith_ulong (hwloc_bitmap_t bitmap,
unsigned i,
unsigned long mask 
)
+
+ +

Replace i -th subset of bitmap bitmap with unsigned long mask.

+ +
+
+ +

◆ hwloc_bitmap_set_range()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_set_range (hwloc_bitmap_t bitmap,
unsigned begin,
int end 
)
+
+ +

Add indexes from begin to end in bitmap bitmap.

+

If end is -1, the range is infinite.

+ +
+
+ +

◆ hwloc_bitmap_singlify()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_singlify (hwloc_bitmap_t bitmap)
+
+ +

Keep a single index among those set in bitmap bitmap.

+

May be useful before binding so that the process does not have a chance of migrating between multiple logical CPUs in the original mask. Instead of running the task on any PU inside the given CPU set, the operating system scheduler will be forced to run it on a single of these PUs. It avoids a migration overhead and cache-line ping-pongs between PUs.

+
Note
This function is NOT meant to distribute multiple processes within a single CPU set. It always return the same single bit when called multiple times on the same input set. hwloc_distrib() may be used for generating CPU sets to distribute multiple tasks below a single multi-PU object.
+
+This function cannot be applied to an object set directly. It should be applied to a copy (which may be obtained with hwloc_bitmap_dup()).
+ +
+
+ +

◆ hwloc_bitmap_snprintf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_snprintf (char *restrict buf,
size_t buflen,
hwloc_const_bitmap_t bitmap 
)
+
+ +

Stringify a bitmap.

+

Up to buflen characters may be written in buffer buf.

+

If buflen is 0, buf may safely be NULL.

+
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
+ +
+
+ +

◆ hwloc_bitmap_sscanf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_sscanf (hwloc_bitmap_t bitmap,
const char *restrict string 
)
+
+ +

Parse a bitmap string and stores it in bitmap bitmap.

+ +
+
+ +

◆ hwloc_bitmap_taskset_asprintf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_taskset_asprintf (char ** strp,
hwloc_const_bitmap_t bitmap 
)
+
+ +

Stringify a bitmap into a newly allocated taskset-specific string.

+
Returns
-1 on error.
+ +
+
+ +

◆ hwloc_bitmap_taskset_snprintf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_taskset_snprintf (char *restrict buf,
size_t buflen,
hwloc_const_bitmap_t bitmap 
)
+
+ +

Stringify a bitmap in the taskset-specific format.

+

The taskset command manipulates bitmap strings that contain a single (possible very long) hexadecimal number starting with 0x.

+

Up to buflen characters may be written in buffer buf.

+

If buflen is 0, buf may safely be NULL.

+
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
+ +
+
+ +

◆ hwloc_bitmap_taskset_sscanf()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_taskset_sscanf (hwloc_bitmap_t bitmap,
const char *restrict string 
)
+
+ +

Parse a taskset-specific bitmap string and stores it in bitmap bitmap.

+ +
+
+ +

◆ hwloc_bitmap_to_ith_ulong()

+ +
+
+ + + + + + + + + + + + + + + + + + +
unsigned long hwloc_bitmap_to_ith_ulong (hwloc_const_bitmap_t bitmap,
unsigned i 
)
+
+ +

Convert the i -th subset of bitmap bitmap into unsigned long mask.

+ +
+
+ +

◆ hwloc_bitmap_to_ulong()

+ +
+
+ + + + + + + + +
unsigned long hwloc_bitmap_to_ulong (hwloc_const_bitmap_t bitmap)
+
+ +

Convert the beginning part of bitmap bitmap into unsigned long mask.

+ +
+
+ +

◆ hwloc_bitmap_to_ulongs()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_to_ulongs (hwloc_const_bitmap_t bitmap,
unsigned nr,
unsigned long * masks 
)
+
+ +

Convert the first nr subsets of bitmap bitmap into the array of nr unsigned long masks.

+

nr may be determined earlier with hwloc_bitmap_nr_ulongs().

+
Returns
0
+ +
+
+ +

◆ hwloc_bitmap_weight()

+ +
+
+ + + + + + + + +
int hwloc_bitmap_weight (hwloc_const_bitmap_t bitmap)
+
+ +

Compute the "weight" of bitmap bitmap (i.e., number of indexes that are in the bitmap).

+
Returns
the number of indexes that are in the bitmap.
+
+-1 if bitmap is infinitely set.
+ +
+
+ +

◆ hwloc_bitmap_xor()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_bitmap_xor (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
+
+ +

Xor bitmaps bitmap1 and bitmap2 and store the result in bitmap res.

+

res can be the same as bitmap1 or bitmap2

+ +
+
+ +

◆ hwloc_bitmap_zero()

+ +
+
+ + + + + + + + +
void hwloc_bitmap_zero (hwloc_bitmap_t bitmap)
+
+ +

Empty the bitmap bitmap.

+
int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)
Bind current process or thread on cpus given in physical bitmap set.
+
int hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
+
struct hwloc_bitmap_s * hwloc_bitmap_t
Set of bits represented as an opaque pointer to an internal bitmap.
Definition: bitmap.h:68
+
void hwloc_bitmap_free(hwloc_bitmap_t bitmap)
Free bitmap bitmap.
+
Structure of a topology object.
Definition: hwloc.h:384
+
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:500
+
hwloc_bitmap_t hwloc_bitmap_alloc(void)
Allocate a new empty bitmap.
+
@ HWLOC_CPUBIND_THREAD
Bind current thread of current process.
Definition: hwloc.h:1148
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00203.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00203.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00203.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00203.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Converting between CPU sets and node sets +Hardware Locality (hwloc): Exporting Topologies to XML @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,59 +27,114 @@ - + +/* @license-end */
-
Converting between CPU sets and node sets
+
Exporting Topologies to XML
+ + + +

+Enumerations

enum  hwloc_topology_export_xml_flags_e { HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 + }
 
- - - - + + + + + + + + + + + + + +

Functions

static int hwloc_cpuset_to_nodeset (hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset)
 
static int hwloc_cpuset_from_nodeset (hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset)
 
int hwloc_topology_export_xml (hwloc_topology_t topology, const char *xmlpath, unsigned long flags)
 
int hwloc_topology_export_xmlbuffer (hwloc_topology_t topology, char **xmlbuffer, int *buflen, unsigned long flags)
 
void hwloc_free_xmlbuffer (hwloc_topology_t topology, char *xmlbuffer)
 
void hwloc_topology_set_userdata_export_callback (hwloc_topology_t topology, void(*export_cb)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj))
 
int hwloc_export_obj_userdata (void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
 
int hwloc_export_obj_userdata_base64 (void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
 
void hwloc_topology_set_userdata_import_callback (hwloc_topology_t topology, void(*import_cb)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length))
 

Detailed Description

+

Enumeration Type Documentation

+ +

◆ hwloc_topology_export_xml_flags_e

+ +
+
+ +

Flags for exporting XML topologies.

+

Flags to be given as a OR'ed set to hwloc_topology_export_xml().

+ + +
Enumerator
HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 

Export XML that is loadable by hwloc v1.x. However, the export may miss some details about the topology.

+
+ +
+

Function Documentation

- -

◆ hwloc_cpuset_from_nodeset()

+ +

◆ hwloc_export_obj_userdata()

- - - - - -
- + - + + + + + + + - - + + + + + + + + - - + + + + + + + + @@ -87,44 +142,256 @@
static int hwloc_cpuset_from_nodeset int hwloc_export_obj_userdata (hwloc_topology_t void * reserved,
hwloc_topology_t  topology,
hwloc_cpuset_t _cpuset, hwloc_obj_t obj,
const char * name,
hwloc_const_nodeset_t nodeset const void * buffer,
size_t length 
-
-inlinestatic
-

Convert a NUMA node set into a CPU set and handle non-NUMA cases.

-

If the topology contains no NUMA nodes, the machine is considered as a single memory node, and the following behavior is used: If nodeset is empty, cpuset will be emptied as well. Otherwise cpuset will be entirely filled. This is useful for manipulating memory binding sets.

+

Export some object userdata to XML.

+

This function may only be called from within the export() callback passed to hwloc_topology_set_userdata_export_callback(). It may be invoked one of multiple times to export some userdata to XML. The buffer content of length length is stored with optional name name.

+

When importing this XML file, the import() callback (if set) will be called exactly as many times as hwloc_export_obj_userdata() was called during export(). It will receive the corresponding name, buffer and length arguments.

+

reserved, topology and obj must be the first three parameters that were given to the export callback.

+

Only printable characters may be exported to XML string attributes. If a non-printable character is passed in name or buffer, the function returns -1 with errno set to EINVAL.

+

If exporting binary data, the application should first encode into printable characters only (or use hwloc_export_obj_userdata_base64()). It should also take care of portability issues if the export may be reimported on a different architecture.

- -

◆ hwloc_cpuset_to_nodeset()

+ +

◆ hwloc_export_obj_userdata_base64()

- - - - - -
- + - + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + +
static int hwloc_cpuset_to_nodeset int hwloc_export_obj_userdata_base64 (hwloc_topology_t void * reserved,
hwloc_topology_t  topology,
hwloc_const_cpuset_t _cpuset, hwloc_obj_t obj,
hwloc_nodeset_t nodeset const char * name,
const void * buffer,
size_t length 
)
+
+ +

Encode and export some object userdata to XML.

+

This function is similar to hwloc_export_obj_userdata() but it encodes the input buffer into printable characters before exporting. On import, decoding is automatically performed before the data is given to the import() callback if any.

+

This function may only be called from within the export() callback passed to hwloc_topology_set_userdata_export_callback().

+

The function does not take care of portability issues if the export may be reimported on a different architecture.

+ +
+ + +

◆ hwloc_free_xmlbuffer()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void hwloc_free_xmlbuffer (hwloc_topology_t topology,
char * xmlbuffer 
)
+
+ +

Free a buffer allocated by hwloc_topology_export_xmlbuffer()

+ +
+
+ +

◆ hwloc_topology_export_xml()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_topology_export_xml (hwloc_topology_t topology,
const char * xmlpath,
unsigned long flags 
)
+
+ +

Export the topology into an XML file.

+

This file may be loaded later through hwloc_topology_set_xml().

+

By default, the latest export format is used, which means older hwloc releases (e.g. v1.x) will not be able to import it. Exporting to v1.x specific XML format is possible using flag HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 but it may miss some details about the topology. If there is any chance that the exported file may ever be imported back by a process using hwloc 1.x, one should consider detecting it at runtime and using the corresponding export format.

+

flags is a OR'ed set of hwloc_topology_export_xml_flags_e.

+
Returns
-1 if a failure occured.
+
Note
See also hwloc_topology_set_userdata_export_callback() for exporting application-specific object userdata.
+
+The topology-specific userdata pointer is ignored when exporting to XML.
+
+Only printable characters may be exported to XML string attributes. Any other character, especially any non-ASCII character, will be silently dropped.
+
+If name is "-", the XML output is sent to the standard output.
+ +
+
+ +

◆ hwloc_topology_export_xmlbuffer()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_topology_export_xmlbuffer (hwloc_topology_t topology,
char ** xmlbuffer,
int * buflen,
unsigned long flags 
)
+
+ +

Export the topology into a newly-allocated XML memory buffer.

+

xmlbuffer is allocated by the callee and should be freed with hwloc_free_xmlbuffer() later in the caller.

+

This memory buffer may be loaded later through hwloc_topology_set_xmlbuffer().

+

By default, the latest export format is used, which means older hwloc releases (e.g. v1.x) will not be able to import it. Exporting to v1.x specific XML format is possible using flag HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 but it may miss some details about the topology. If there is any chance that the exported buffer may ever be imported back by a process using hwloc 1.x, one should consider detecting it at runtime and using the corresponding export format.

+

The returned buffer ends with a \0 that is included in the returned length.

+

flags is a OR'ed set of hwloc_topology_export_xml_flags_e.

+
Returns
-1 if a failure occured.
+
Note
See also hwloc_topology_set_userdata_export_callback() for exporting application-specific object userdata.
+
+The topology-specific userdata pointer is ignored when exporting to XML.
+
+Only printable characters may be exported to XML string attributes. Any other character, especially any non-ASCII character, will be silently dropped.
+ +
+
+ +

◆ hwloc_topology_set_userdata_export_callback()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void hwloc_topology_set_userdata_export_callback (hwloc_topology_t topology,
void(*)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj) export_cb 
)
+
+ +

Set the application-specific callback for exporting object userdata.

+

The object userdata pointer is not exported to XML by default because hwloc does not know what it contains.

+

This function lets applications set export_cb to a callback function that converts this opaque userdata into an exportable string.

+

export_cb is invoked during XML export for each object whose userdata pointer is not NULL. The callback should use hwloc_export_obj_userdata() or hwloc_export_obj_userdata_base64() to actually export something to XML (possibly multiple times per object).

+

export_cb may be set to NULL if userdata should not be exported to XML.

+
Note
The topology-specific userdata pointer is ignored when exporting to XML.
+ +
+
+ +

◆ hwloc_topology_set_userdata_import_callback()

+ +
+
+ + + + + + + + + + + + @@ -132,16 +399,18 @@
void hwloc_topology_set_userdata_import_callback (hwloc_topology_t topology,
void(*)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length) import_cb 
-
-inlinestatic
-

Convert a CPU set into a NUMA node set and handle non-NUMA cases.

-

If some NUMA nodes have no CPUs at all, this function never sets their indexes in the output node set, even if a full CPU set is given in input.

-

If the topology contains no NUMA nodes, the machine is considered as a single memory node, and the following behavior is used: If cpuset is empty, nodeset will be emptied as well. Otherwise nodeset will be entirely filled.

+

Set the application-specific callback for importing userdata.

+

On XML import, userdata is ignored by default because hwloc does not know how to store it in memory.

+

This function lets applications set import_cb to a callback function that will get the XML-stored userdata and store it in the object as expected by the application.

+

import_cb is called during hwloc_topology_load() as many times as hwloc_export_obj_userdata() was called during export. The topology is not entirely setup yet. Object attributes are ready to consult, but links between objects are not.

+

import_cb may be NULL if userdata should be ignored during import.

+
Note
buffer contains length characters followed by a null byte ('\0').
+
+This function should be called before hwloc_topology_load().
+
+The topology-specific userdata pointer is ignored when importing from XML.
@@ -150,7 +419,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00204.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00204.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00204.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00204.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Finding I/O objects +Hardware Locality (hwloc): Exporting Topologies to Synthetic @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,318 +27,103 @@
- + +/* @license-end */
-
Finding I/O objects
+
Exporting Topologies to Synthetic
+ + + +

+Enumerations

enum  hwloc_topology_export_synthetic_flags_e { HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_EXTENDED_TYPES, +HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS, +HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1, +HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_IGNORE_MEMORY + }
 
- - - - - - - - - - - - - - + +

Functions

static hwloc_obj_t hwloc_get_non_io_ancestor_obj (hwloc_topology_t topology, hwloc_obj_t ioobj)
 
static hwloc_obj_t hwloc_get_next_pcidev (hwloc_topology_t topology, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_pcidev_by_busid (hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
 
static hwloc_obj_t hwloc_get_pcidev_by_busidstring (hwloc_topology_t topology, const char *busid)
 
static hwloc_obj_t hwloc_get_next_osdev (hwloc_topology_t topology, hwloc_obj_t prev)
 
static hwloc_obj_t hwloc_get_next_bridge (hwloc_topology_t topology, hwloc_obj_t prev)
 
static int hwloc_bridge_covers_pcibus (hwloc_obj_t bridge, unsigned domain, unsigned bus)
 
int hwloc_topology_export_synthetic (hwloc_topology_t topology, char *buffer, size_t buflen, unsigned long flags)
 

Detailed Description

-

Function Documentation

- -

◆ hwloc_bridge_covers_pcibus()

+

Enumeration Type Documentation

+ +

◆ hwloc_topology_export_synthetic_flags_e

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
static int hwloc_bridge_covers_pcibus (hwloc_obj_t bridge,
unsigned domain,
unsigned bus 
)
-
-inlinestatic
-
- -
-
- -

◆ hwloc_get_next_bridge()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - +
static hwloc_obj_t hwloc_get_next_bridge (hwloc_topology_t topology,
hwloc_obj_t prev 
)enum hwloc_topology_export_synthetic_flags_e
-
-inlinestatic
-

Get the next bridge in the system.

-
Returns
the first bridge if prev is NULL.
- -
-
- -

◆ hwloc_get_next_osdev()

- -
-
- - - - - +

Flags for exporting synthetic topologies.

+

Flags to be given as a OR'ed set to hwloc_topology_export_synthetic().

+
- - - - - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_next_osdev (hwloc_topology_t topology,
hwloc_obj_t prev 
)
-
-inlinestatic
+ + + +
Enumerator
HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_EXTENDED_TYPES 

Export extended types such as L2dcache as basic types such as Cache.

+

This is required if loading the synthetic description with hwloc < 1.9.

+
HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS 

Do not export level attributes.

+

Ignore level attributes such as memory/cache sizes or PU indexes. This is required if loading the synthetic description with hwloc < 1.10.

+
HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1 

Export the memory hierarchy as expected in hwloc 1.x.

+

Instead of attaching memory children to levels, export single NUMA node child as normal intermediate levels, when possible. This is required if loading the synthetic description with hwloc 1.x. However this may fail if some objects have multiple local NUMA nodes.

+
HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_IGNORE_MEMORY 

Do not export memory information.

+

Only export the actual hierarchy of normal CPU-side objects and ignore where memory is attached. This is useful for when the hierarchy of CPUs is what really matters, but it behaves as if there was a single machine-wide NUMA node.

+
-
- -

Get the next OS device in the system.

-
Returns
the first OS device if prev is NULL.
- -

◆ hwloc_get_next_pcidev()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_next_pcidev (hwloc_topology_t topology,
hwloc_obj_t prev 
)
-
-inlinestatic
-
- -

Get the next PCI device in the system.

-
Returns
the first PCI device if prev is NULL.
- -
-
- -

◆ hwloc_get_non_io_ancestor_obj()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_non_io_ancestor_obj (hwloc_topology_t topology,
hwloc_obj_t ioobj 
)
-
-inlinestatic
-
- -

Get the first non-I/O ancestor object.

-

Given the I/O object ioobj, find the smallest non-I/O ancestor object. This object (normal or memory) may then be used for binding because it has non-NULL CPU and node sets and because its locality is the same as ioobj.

-
Note
The resulting object is usually a normal object but it could also be a memory object (e.g. NUMA node) in future platforms if I/O objects ever get attached to memory instead of CPUs.
- -
-
- -

◆ hwloc_get_pcidev_by_busid()

+

Function Documentation

+ +

◆ hwloc_topology_export_synthetic()

- - - - - -
- + - + - - - - - - - - + + - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_get_pcidev_by_busid int hwloc_topology_export_synthetic (hwloc_topology_t hwloc_topology_t  topology,
unsigned domain,
unsigned bus, char * buffer,
unsigned dev,
unsigned func 
)
-
-inlinestatic
-
- -

Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id.

- -
-
- -

◆ hwloc_get_pcidev_by_busidstring()

- -
-
- - - - - -
- - - - - - + + - - + + @@ -346,14 +131,18 @@
static hwloc_obj_t hwloc_get_pcidev_by_busidstring (hwloc_topology_t topology, size_t buflen,
const char * busid unsigned long flags 
-
-inlinestatic
-

Find the PCI device object matching the PCI bus id given as a string xxxx:yy:zz.t or yy:zz.t.

+

Export the topology as a synthetic string.

+

At most buflen characters will be written in buffer, including the terminating \0.

+

This exported string may be given back to hwloc_topology_set_synthetic().

+

flags is a OR'ed set of hwloc_topology_export_synthetic_flags_e.

+
Returns
The number of characters that were written, not including the terminating \0.
+
+-1 if the topology could not be exported, for instance if it is not symmetric.
+
Note
I/O and Misc children are ignored, the synthetic string only describes normal children.
+
+A 1024-byte buffer should be large enough for exporting topologies in the vast majority of cases.
@@ -362,7 +151,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00205.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00205.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00205.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00205.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): The bitmap API +Hardware Locality (hwloc): Retrieve distances between objects @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,1276 +27,129 @@
- + +/* @license-end */
-
The bitmap API
+
Retrieve distances between objects
- - - - - + + +

-Macros

#define hwloc_bitmap_foreach_begin(id, bitmap)
 
#define hwloc_bitmap_foreach_end()
 

+Data Structures

struct  hwloc_distances_s
 
- - - - - + + +

-Typedefs

typedef struct hwloc_bitmap_s * hwloc_bitmap_t
 
typedef const struct hwloc_bitmap_s * hwloc_const_bitmap_t
 

+Enumerations

enum  hwloc_distances_kind_e {
+  HWLOC_DISTANCES_KIND_FROM_OS, +HWLOC_DISTANCES_KIND_FROM_USER, +HWLOC_DISTANCES_KIND_MEANS_LATENCY, +HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH, +
+  HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES +
+ }
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +

Functions

hwloc_bitmap_t hwloc_bitmap_alloc (void)
 
hwloc_bitmap_t hwloc_bitmap_alloc_full (void)
 
void hwloc_bitmap_free (hwloc_bitmap_t bitmap)
 
hwloc_bitmap_t hwloc_bitmap_dup (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_copy (hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
 
int hwloc_bitmap_snprintf (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_asprintf (char **strp, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_sscanf (hwloc_bitmap_t bitmap, const char *restrict string)
 
int hwloc_bitmap_list_snprintf (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_list_asprintf (char **strp, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_list_sscanf (hwloc_bitmap_t bitmap, const char *restrict string)
 
int hwloc_bitmap_taskset_snprintf (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_taskset_asprintf (char **strp, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_taskset_sscanf (hwloc_bitmap_t bitmap, const char *restrict string)
 
void hwloc_bitmap_zero (hwloc_bitmap_t bitmap)
 
void hwloc_bitmap_fill (hwloc_bitmap_t bitmap)
 
int hwloc_bitmap_only (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_allbut (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_from_ulong (hwloc_bitmap_t bitmap, unsigned long mask)
 
int hwloc_bitmap_from_ith_ulong (hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
 
int hwloc_bitmap_from_ulongs (hwloc_bitmap_t bitmap, unsigned nr, const unsigned long *masks)
 
int hwloc_bitmap_set (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_set_range (hwloc_bitmap_t bitmap, unsigned begin, int end)
 
int hwloc_bitmap_set_ith_ulong (hwloc_bitmap_t bitmap, unsigned i, unsigned long mask)
 
int hwloc_bitmap_clr (hwloc_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_clr_range (hwloc_bitmap_t bitmap, unsigned begin, int end)
 
int hwloc_bitmap_singlify (hwloc_bitmap_t bitmap)
 
unsigned long hwloc_bitmap_to_ulong (hwloc_const_bitmap_t bitmap)
 
unsigned long hwloc_bitmap_to_ith_ulong (hwloc_const_bitmap_t bitmap, unsigned i)
 
int hwloc_bitmap_to_ulongs (hwloc_const_bitmap_t bitmap, unsigned nr, unsigned long *masks)
 
int hwloc_bitmap_nr_ulongs (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_isset (hwloc_const_bitmap_t bitmap, unsigned id)
 
int hwloc_bitmap_iszero (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_isfull (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_first (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_next (hwloc_const_bitmap_t bitmap, int prev)
 
int hwloc_bitmap_last (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_weight (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_first_unset (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_next_unset (hwloc_const_bitmap_t bitmap, int prev)
 
int hwloc_bitmap_last_unset (hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_or (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_and (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_andnot (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_xor (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_not (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap)
 
int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap)
 
int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_compare_first (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_bitmap_compare (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
 
int hwloc_distances_get (hwloc_topology_t topology, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
 
int hwloc_distances_get_by_depth (hwloc_topology_t topology, int depth, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
 
int hwloc_distances_get_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
 
int hwloc_distances_get_by_name (hwloc_topology_t topology, const char *name, unsigned *nr, struct hwloc_distances_s **distances, unsigned long flags)
 
const char * hwloc_distances_get_name (hwloc_topology_t topology, struct hwloc_distances_s *distances)
 
void hwloc_distances_release (hwloc_topology_t topology, struct hwloc_distances_s *distances)
 

Detailed Description

-

The hwloc_bitmap_t type represents a set of integers (positive or null). A bitmap may be of infinite size (all bits are set after some point). A bitmap may even be full if all bits are set.

-

Bitmaps are used by hwloc for sets of OS processors (which may actually be hardware threads) as by hwloc_cpuset_t (a typedef for hwloc_bitmap_t), or sets of NUMA memory nodes as hwloc_nodeset_t (also a typedef for hwloc_bitmap_t). Those are used for cpuset and nodeset fields in the hwloc_obj structure, see Object Sets (hwloc_cpuset_t and hwloc_nodeset_t).

-

Both CPU and node sets are always indexed by OS physical number. However users should usually not build CPU and node sets manually (e.g. with hwloc_bitmap_set()). One should rather use existing object sets and combine them with hwloc_bitmap_or(), etc. For instance, binding the current thread on a pair of cores may be performed with:

hwloc_obj_t core1 = ... , core2 = ... ;
hwloc_bitmap_or(set, core1->cpuset, core2->cpuset);
Note
Most functions below return an int that may be negative in case of error. The usual error case would be an internal failure to realloc/extend the storage of the bitmap (errno would be set to ENOMEM).
-
-Several examples of using the bitmap API are available under the doc/examples/ directory in the source tree. Regression tests such as tests/hwloc/hwloc_bitmap*.c also make intensive use of this API.
-

Macro Definition Documentation

- -

◆ hwloc_bitmap_foreach_begin

+

Enumeration Type Documentation

+ +

◆ hwloc_distances_kind_e

- - - - - - - - - - - - - - - - -
#define hwloc_bitmap_foreach_begin( id,
 bitmap 
)
-
- -

Loop macro iterating on bitmap bitmap.

-

The loop must start with hwloc_bitmap_foreach_begin() and end with hwloc_bitmap_foreach_end() followed by a terminating ';'.

-

index is the loop variable; it should be an unsigned int. The first iteration will set index to the lowest index in the bitmap. Successive iterations will iterate through, in order, all remaining indexes set in the bitmap. To be specific: each iteration will return a value for index such that hwloc_bitmap_isset(bitmap, index) is true.

-

The assert prevents the loop from being infinite if the bitmap is infinitely set.

- -
-
- -

◆ hwloc_bitmap_foreach_end

- -
-
- - - - - - - -
#define hwloc_bitmap_foreach_end()
-
- -

End of loop macro iterating on a bitmap.

-

Needs a terminating ';'.

-
See also
hwloc_bitmap_foreach_begin()
- -
-
-

Typedef Documentation

- -

◆ hwloc_bitmap_t

- -
-
- - - - -
typedef struct hwloc_bitmap_s* hwloc_bitmap_t
-
- -

Set of bits represented as an opaque pointer to an internal bitmap.

- -
-
- -

◆ hwloc_const_bitmap_t

- -
-
- - - - -
typedef const struct hwloc_bitmap_s* hwloc_const_bitmap_t
-
- -

a non-modifiable hwloc_bitmap_t

- -
-
-

Function Documentation

- -

◆ hwloc_bitmap_allbut()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_allbut (hwloc_bitmap_t bitmap,
unsigned id 
)
-
- -

Fill the bitmap and clear the index id.

- -
-
- -

◆ hwloc_bitmap_alloc()

- -
-
- - - - - - - - -
hwloc_bitmap_t hwloc_bitmap_alloc (void )
-
- -

Allocate a new empty bitmap.

-
Returns
A valid bitmap or NULL.
-

The bitmap should be freed by a corresponding call to hwloc_bitmap_free().

- -
-
- -

◆ hwloc_bitmap_alloc_full()

- -
-
- - - - - - - - -
hwloc_bitmap_t hwloc_bitmap_alloc_full (void )
-
- -

Allocate a new full bitmap.

- -
-
- -

◆ hwloc_bitmap_and()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_and (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-
- -

And bitmaps bitmap1 and bitmap2 and store the result in bitmap res.

-

res can be the same as bitmap1 or bitmap2

- -
-
- -

◆ hwloc_bitmap_andnot()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_andnot (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-
- -

And bitmap bitmap1 and the negation of bitmap2 and store the result in bitmap res.

-

res can be the same as bitmap1 or bitmap2

- -
-
- -

◆ hwloc_bitmap_asprintf()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_asprintf (char ** strp,
hwloc_const_bitmap_t bitmap 
)
-
- -

Stringify a bitmap into a newly allocated string.

-
Returns
-1 on error.
- -
-
- -

◆ hwloc_bitmap_clr()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_clr (hwloc_bitmap_t bitmap,
unsigned id 
)
-
- -

Remove index id from bitmap bitmap.

- -
-
- -

◆ hwloc_bitmap_clr_range()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_clr_range (hwloc_bitmap_t bitmap,
unsigned begin,
int end 
)
-
- -

Remove indexes from begin to end in bitmap bitmap.

-

If end is -1, the range is infinite.

- -
-
- -

◆ hwloc_bitmap_compare()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_compare (hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-
- -

Compare bitmaps bitmap1 and bitmap2 in lexicographic order.

-

Lexicographic comparison of bitmaps, starting for their highest indexes. Compare last indexes first, then second, etc. The empty bitmap is considered lower than anything.

-
Returns
-1 if bitmap1 is considered smaller than bitmap2.
-
-1 if bitmap1 is considered larger than bitmap2.
-
-0 if bitmaps are equal (contrary to hwloc_bitmap_compare_first()).
-

For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110). Comparing 00101 and 01010 returns -1 too.

-
Note
This is different from the non-existing hwloc_bitmap_compare_last() which would only compare the highest index of each bitmap.
- -
-
- -

◆ hwloc_bitmap_compare_first()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_compare_first (hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-
- -

Compare bitmaps bitmap1 and bitmap2 using their lowest index.

-

A bitmap is considered smaller if its least significant bit is smaller. The empty bitmap is considered higher than anything (because its least significant bit does not exist).

-
Returns
-1 if bitmap1 is considered smaller than bitmap2.
-
-1 if bitmap1 is considered larger than bitmap2.
-

For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110) because least significant bit of 0011 (0001) is smaller than least significant bit of 0110 (0010). Comparing 01001 and 00110 would also return -1 for the same reason.

-
Returns
0 if bitmaps are considered equal, even if they are not strictly equal. They just need to have the same least significant bit. For instance, comparing binary bitmaps 0010 and 0110 returns 0 because they have the same least significant bit.
- -
-
- -

◆ hwloc_bitmap_copy()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_copy (hwloc_bitmap_t dst,
hwloc_const_bitmap_t src 
)
-
- -

Copy the contents of bitmap src into the already allocated bitmap dst.

- -
-
- -

◆ hwloc_bitmap_dup()

- -
-
- - - - - - - - -
hwloc_bitmap_t hwloc_bitmap_dup (hwloc_const_bitmap_t bitmap)
-
- -

Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.

-

If bitmap is NULL, NULL is returned.

- -
-
- -

◆ hwloc_bitmap_fill()

- -
-
- - - - - - - - -
void hwloc_bitmap_fill (hwloc_bitmap_t bitmap)
-
- -

Fill bitmap bitmap with all possible indexes (even if those objects don't exist or are otherwise unavailable)

- -
-
- -

◆ hwloc_bitmap_first()

- -
-
- - - - - - - - -
int hwloc_bitmap_first (hwloc_const_bitmap_t bitmap)
-
- -

Compute the first index (least significant bit) in bitmap bitmap.

-
Returns
-1 if no index is set in bitmap.
- -
-
- -

◆ hwloc_bitmap_first_unset()

- -
-
- - - - - - - - -
int hwloc_bitmap_first_unset (hwloc_const_bitmap_t bitmap)
-
- -

Compute the first unset index (least significant bit) in bitmap bitmap.

-
Returns
-1 if no index is unset in bitmap.
- -
-
- -

◆ hwloc_bitmap_free()

- -
-
- - - - - - - - -
void hwloc_bitmap_free (hwloc_bitmap_t bitmap)
-
- -

Free bitmap bitmap.

-

If bitmap is NULL, no operation is performed.

- -
-
- -

◆ hwloc_bitmap_from_ith_ulong()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_from_ith_ulong (hwloc_bitmap_t bitmap,
unsigned i,
unsigned long mask 
)
-
- -

Setup bitmap bitmap from unsigned long mask used as i -th subset.

- -
-
- -

◆ hwloc_bitmap_from_ulong()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_from_ulong (hwloc_bitmap_t bitmap,
unsigned long mask 
)
-
- -

Setup bitmap bitmap from unsigned long mask.

- -
-
- -

◆ hwloc_bitmap_from_ulongs()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_from_ulongs (hwloc_bitmap_t bitmap,
unsigned nr,
const unsigned long * masks 
)
-
- -

Setup bitmap bitmap from unsigned longs masks used as first nr subsets.

- -
-
- -

◆ hwloc_bitmap_intersects()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-
- -

Test whether bitmaps bitmap1 and bitmap2 intersects.

-
Returns
1 if bitmaps intersect, 0 otherwise.
- -
-
- -

◆ hwloc_bitmap_isequal()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1,
hwloc_const_bitmap_t bitmap2 
)
-
- -

Test whether bitmap bitmap1 is equal to bitmap bitmap2.

-
Returns
1 if bitmaps are equal, 0 otherwise.
- -
-
- -

◆ hwloc_bitmap_isfull()

- -
-
- - - - - - - - -
int hwloc_bitmap_isfull (hwloc_const_bitmap_t bitmap)
-
- -

Test whether bitmap bitmap is completely full.

-
Returns
1 if bitmap is full, 0 otherwise.
-
Note
A full bitmap is always infinitely set.
- -
-
- -

◆ hwloc_bitmap_isincluded()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap,
hwloc_const_bitmap_t super_bitmap 
)
-
- -

Test whether bitmap sub_bitmap is part of bitmap super_bitmap.

-
Returns
1 if sub_bitmap is included in super_bitmap, 0 otherwise.
-
Note
The empty bitmap is considered included in any other bitmap.
- -
-
- -

◆ hwloc_bitmap_isset()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_isset (hwloc_const_bitmap_t bitmap,
unsigned id 
)
-
- -

Test whether index id is part of bitmap bitmap.

-
Returns
1 if the bit at index id is set in bitmap bitmap, 0 otherwise.
- -
-
- -

◆ hwloc_bitmap_iszero()

- -
-
- - - - - - - - -
int hwloc_bitmap_iszero (hwloc_const_bitmap_t bitmap)
-
- -

Test whether bitmap bitmap is empty.

-
Returns
1 if bitmap is empty, 0 otherwise.
- -
-
- -

◆ hwloc_bitmap_last()

- -
-
- - - - - - - - -
int hwloc_bitmap_last (hwloc_const_bitmap_t bitmap)
-
- -

Compute the last index (most significant bit) in bitmap bitmap.

-
Returns
-1 if no index is set in bitmap, or if bitmap is infinitely set.
- -
-
- -

◆ hwloc_bitmap_last_unset()

- -
-
- - - - - - - - -
int hwloc_bitmap_last_unset (hwloc_const_bitmap_t bitmap)
-
- -

Compute the last unset index (most significant bit) in bitmap bitmap.

-
Returns
-1 if no index is unset in bitmap, or if bitmap is infinitely set.
- -
-
- -

◆ hwloc_bitmap_list_asprintf()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_list_asprintf (char ** strp,
hwloc_const_bitmap_t bitmap 
)
-
- -

Stringify a bitmap into a newly allocated list string.

-
Returns
-1 on error.
- -
-
- -

◆ hwloc_bitmap_list_snprintf()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_list_snprintf (char *restrict buf,
size_t buflen,
hwloc_const_bitmap_t bitmap 
)
-
- -

Stringify a bitmap in the list format.

-

Lists are comma-separated indexes or ranges. Ranges are dash separated indexes. The last range may not have an ending indexes if the bitmap is infinitely set.

-

Up to buflen characters may be written in buffer buf.

-

If buflen is 0, buf may safely be NULL.

-
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
- -
-
- -

◆ hwloc_bitmap_list_sscanf()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_list_sscanf (hwloc_bitmap_t bitmap,
const char *restrict string 
)
-
- -

Parse a list string and stores it in bitmap bitmap.

- -
-
- -

◆ hwloc_bitmap_next()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_bitmap_next (hwloc_const_bitmap_t bitmap,
int prev 
)
-
- -

Compute the next index in bitmap bitmap which is after index prev.

-

If prev is -1, the first index is returned.

-
Returns
-1 if no index with higher index is set in bitmap.
- -
-
- -

◆ hwloc_bitmap_next_unset()

- -
-
- - - - - - - - - - - - - - - - - +
int hwloc_bitmap_next_unset (hwloc_const_bitmap_t bitmap,
int prev 
)enum hwloc_distances_kind_e
-

Compute the next unset index in bitmap bitmap which is after index prev.

-

If prev is -1, the first unset index is returned.

-
Returns
-1 if no index with higher index is unset in bitmap.
+

Kinds of distance matrices.

+

The kind attribute of struct hwloc_distances_s is a OR'ed set of kinds.

+

A kind of format HWLOC_DISTANCES_KIND_FROM_* specifies where the distance information comes from, if known.

+

A kind of format HWLOC_DISTANCES_KIND_MEANS_* specifies whether values are latencies or bandwidths, if applicable.

+ + + + + + +
Enumerator
HWLOC_DISTANCES_KIND_FROM_OS 

These distances were obtained from the operating system or hardware.

+
HWLOC_DISTANCES_KIND_FROM_USER 

These distances were provided by the user.

+
HWLOC_DISTANCES_KIND_MEANS_LATENCY 

Distance values are similar to latencies between objects. Values are smaller for closer objects, hence minimal on the diagonal of the matrix (distance between an object and itself). It could also be the number of network hops between objects, etc.

+
HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH 

Distance values are similar to bandwidths between objects. Values are higher for closer objects, hence maximal on the diagonal of the matrix (distance between an object and itself). Such values are currently ignored for distance-based grouping.

+
HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES 

This distances structure covers objects of different types.

+
- -

◆ hwloc_bitmap_not()

+

Function Documentation

+ +

◆ hwloc_distances_get()

- + - - + + - - - - - - - - -
int hwloc_bitmap_not int hwloc_distances_get (hwloc_bitmap_t res, hwloc_topology_t topology,
hwloc_const_bitmap_t bitmap 
)
-
- -

Negate bitmap bitmap and store the result in bitmap res.

-

res can be the same as bitmap

- -
-
- -

◆ hwloc_bitmap_nr_ulongs()

- -
-
- - - - - - - - -
int hwloc_bitmap_nr_ulongs (hwloc_const_bitmap_t bitmap)
-
- -

Return the number of unsigned longs required for storing bitmap bitmap entirely.

-

This is the number of contiguous unsigned longs from the very first bit of the bitmap (even if unset) up to the last set bit. This is useful for knowing the nr parameter to pass to hwloc_bitmap_to_ulongs() (or which calls to hwloc_bitmap_to_ith_ulong() are needed) to entirely convert a bitmap into multiple unsigned longs.

-

When called on the output of hwloc_topology_get_topology_cpuset(), the returned number is large enough for all cpusets of the topology.

-
Returns
-1 if bitmap is infinite.
- -
-
- -

◆ hwloc_bitmap_only()

- -
-
- - - - - - + + - - - - - - - - -
int hwloc_bitmap_only (hwloc_bitmap_t bitmap, unsigned * nr,
unsigned id 
)
-
- -

Empty the bitmap bitmap and add bit id.

- -
-
- -

◆ hwloc_bitmap_or()

- -
-
- - - - - - + + - - + + - - + + @@ -1306,100 +159,56 @@
int hwloc_bitmap_or (hwloc_bitmap_t res, struct hwloc_distances_s ** distances,
hwloc_const_bitmap_t bitmap1, unsigned long kind,
hwloc_const_bitmap_t bitmap2 unsigned long flags 
-

Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.

-

res can be the same as bitmap1 or bitmap2

+

Retrieve distance matrices.

+

Retrieve distance matrices from the topology into the distances array.

+

flags is currently unused, should be 0.

+

kind serves as a filter. If 0, all distance matrices are returned. If it contains some HWLOC_DISTANCES_KIND_FROM_*, only distance matrices whose kind matches one of these are returned. If it contains some HWLOC_DISTANCES_KIND_MEANS_*, only distance matrices whose kind matches one of these are returned.

+

On input, nr points to the number of distance matrices that may be stored in distances. On output, nr points to the number of distance matrices that were actually found, even if some of them couldn't be stored in distances. Distance matrices that couldn't be stored are ignored, but the function still returns success (0). The caller may find out by comparing the value pointed by nr before and after the function call.

+

Each distance matrix returned in the distances array should be released by the caller using hwloc_distances_release().

- -

◆ hwloc_bitmap_set()

+ +

◆ hwloc_distances_get_by_depth()

- + - - + + - - - - - - - - -
int hwloc_bitmap_set int hwloc_distances_get_by_depth (hwloc_bitmap_t bitmap, hwloc_topology_t topology,
unsigned id 
)
-
- -

Add index id in bitmap bitmap.

- -
-
- -

◆ hwloc_bitmap_set_ith_ulong()

- -
-
- - - - - - + + - - + + - - - - - - - - -
int hwloc_bitmap_set_ith_ulong (hwloc_bitmap_t bitmap, int depth,
unsigned i, unsigned * nr,
unsigned long mask 
)
-
- -

Replace i -th subset of bitmap bitmap with unsigned long mask.

- -
-
- -

◆ hwloc_bitmap_set_range()

- -
-
- - - - - - + + - - + + - - + + @@ -1409,121 +218,46 @@
int hwloc_bitmap_set_range (hwloc_bitmap_t bitmap, struct hwloc_distances_s ** distances,
unsigned begin, unsigned long kind,
int end unsigned long flags 
-

Add indexes from begin to end in bitmap bitmap.

-

If end is -1, the range is infinite.

- -
-
- -

◆ hwloc_bitmap_singlify()

- -
-
- - - - - - - - -
int hwloc_bitmap_singlify (hwloc_bitmap_t bitmap)
-
- -

Keep a single index among those set in bitmap bitmap.

-

May be useful before binding so that the process does not have a chance of migrating between multiple logical CPUs in the original mask. Instead of running the task on any PU inside the given CPU set, the operating system scheduler will be forced to run it on a single of these PUs. It avoids a migration overhead and cache-line ping-pongs between PUs.

-
Note
This function is NOT meant to distribute multiple processes within a single CPU set. It always return the same single bit when called multiple times on the same input set. hwloc_distrib() may be used for generating CPU sets to distribute multiple tasks below a single multi-PU object.
-
-This function cannot be applied to an object set directly. It should be applied to a copy (which may be obtained with hwloc_bitmap_dup()).
+

Retrieve distance matrices for object at a specific depth in the topology.

+

Identical to hwloc_distances_get() with the additional depth filter.

- -

◆ hwloc_bitmap_snprintf()

+ +

◆ hwloc_distances_get_by_name()

- + - - + + - - + + - - - - - - - - -
int hwloc_bitmap_snprintf int hwloc_distances_get_by_name (char *restrict buf, hwloc_topology_t topology,
size_t buflen, const char * name,
hwloc_const_bitmap_t bitmap 
)
-
- -

Stringify a bitmap.

-

Up to buflen characters may be written in buffer buf.

-

If buflen is 0, buf may safely be NULL.

-
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
- -
-
- -

◆ hwloc_bitmap_sscanf()

- -
-
- - - - - - + + - - - - - - - - -
int hwloc_bitmap_sscanf (hwloc_bitmap_t bitmap, unsigned * nr,
const char *restrict string 
)
-
- -

Parse a bitmap string and stores it in bitmap bitmap.

- -
-
- -

◆ hwloc_bitmap_taskset_asprintf()

- -
-
- - - - - - + + - - + + @@ -1533,98 +267,52 @@
int hwloc_bitmap_taskset_asprintf (char ** strp, struct hwloc_distances_s ** distances,
hwloc_const_bitmap_t bitmap unsigned long flags 
-

Stringify a bitmap into a newly allocated taskset-specific string.

-
Returns
-1 on error.
+

Retrieve a distance matrix with the given name.

+

Usually only one distances structure may match a given name.

- -

◆ hwloc_bitmap_taskset_snprintf()

+ +

◆ hwloc_distances_get_by_type()

- + - - + + - - + + - - - - - - - - -
int hwloc_bitmap_taskset_snprintf int hwloc_distances_get_by_type (char *restrict buf, hwloc_topology_t topology,
size_t buflen, hwloc_obj_type_t type,
hwloc_const_bitmap_t bitmap 
)
-
- -

Stringify a bitmap in the taskset-specific format.

-

The taskset command manipulates bitmap strings that contain a single (possible very long) hexadecimal number starting with 0x.

-

Up to buflen characters may be written in buffer buf.

-

If buflen is 0, buf may safely be NULL.

-
Returns
the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).
- -
-
- -

◆ hwloc_bitmap_taskset_sscanf()

- -
-
- - - - - - + + - - + + + - - - -
int hwloc_bitmap_taskset_sscanf (hwloc_bitmap_t bitmap, unsigned * nr,
const char *restrict string struct hwloc_distances_s ** distances,
)
-
- -

Parse a taskset-specific bitmap string and stores it in bitmap bitmap.

- -
-
- -

◆ hwloc_bitmap_to_ith_ulong()

- -
-
- - - - - - + + - - + + @@ -1634,53 +322,28 @@
unsigned long hwloc_bitmap_to_ith_ulong (hwloc_const_bitmap_t bitmap, unsigned long kind,
unsigned i unsigned long flags 
-

Convert the i -th subset of bitmap bitmap into unsigned long mask.

- -
-
- -

◆ hwloc_bitmap_to_ulong()

- -
-
- - - - - - - - -
unsigned long hwloc_bitmap_to_ulong (hwloc_const_bitmap_t bitmap)
-
- -

Convert the beginning part of bitmap bitmap into unsigned long mask.

+

Retrieve distance matrices for object of a specific type.

+

Identical to hwloc_distances_get() with the additional type filter.

- -

◆ hwloc_bitmap_to_ulongs()

+ +

◆ hwloc_distances_get_name()

- + - - - - - - - - + + - - + + @@ -1690,58 +353,28 @@
int hwloc_bitmap_to_ulongs const char* hwloc_distances_get_name (hwloc_const_bitmap_t bitmap,
unsigned nr, hwloc_topology_t topology,
unsigned long * masks struct hwloc_distances_sdistances 
-

Convert the first nr subsets of bitmap bitmap into the array of nr unsigned long masks.

-

nr may be determined earlier with hwloc_bitmap_nr_ulongs().

-
Returns
0
+

Get a description of what a distances structure contains.

+

For instance "NUMALatency" for hardware-provided NUMA distances (ACPI SLIT), or NULL if unknown.

- -

◆ hwloc_bitmap_weight()

+ +

◆ hwloc_distances_release()

- + - - - - -
int hwloc_bitmap_weight void hwloc_distances_release (hwloc_const_bitmap_t bitmap)
-
- -

Compute the "weight" of bitmap bitmap (i.e., number of indexes that are in the bitmap).

-
Returns
the number of indexes that are in the bitmap.
-
--1 if bitmap is infinitely set.
- -
-
- -

◆ hwloc_bitmap_xor()

- -
-
- - - - - - - - - - - - + + - - + + @@ -1751,28 +384,8 @@
int hwloc_bitmap_xor (hwloc_bitmap_t res,
hwloc_const_bitmap_t bitmap1, hwloc_topology_t topology,
hwloc_const_bitmap_t bitmap2 struct hwloc_distances_sdistances 
-

Xor bitmaps bitmap1 and bitmap2 and store the result in bitmap res.

-

res can be the same as bitmap1 or bitmap2

- -
-
- -

◆ hwloc_bitmap_zero()

- -
-
- - - - - - - - -
void hwloc_bitmap_zero (hwloc_bitmap_t bitmap)
-
- -

Empty the bitmap bitmap.

+

Release a distance matrix structure previously returned by hwloc_distances_get().

+
Note
This function is not required if the structure is removed with hwloc_distances_release_remove().
@@ -1781,7 +394,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00206.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00206.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00206.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00206.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Exporting Topologies to XML +Hardware Locality (hwloc): Helpers for consulting distance matrices @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,205 +27,54 @@
- + +/* @license-end */
-
Exporting Topologies to XML
+
Helpers for consulting distance matrices
- - - -

-Enumerations

enum  hwloc_topology_export_xml_flags_e { HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 - }
 
- - - - - - - - - - - - - - + + + +

Functions

int hwloc_topology_export_xml (hwloc_topology_t topology, const char *xmlpath, unsigned long flags)
 
int hwloc_topology_export_xmlbuffer (hwloc_topology_t topology, char **xmlbuffer, int *buflen, unsigned long flags)
 
void hwloc_free_xmlbuffer (hwloc_topology_t topology, char *xmlbuffer)
 
void hwloc_topology_set_userdata_export_callback (hwloc_topology_t topology, void(*export_cb)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj))
 
int hwloc_export_obj_userdata (void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
 
int hwloc_export_obj_userdata_base64 (void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)
 
void hwloc_topology_set_userdata_import_callback (hwloc_topology_t topology, void(*import_cb)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length))
 
static int hwloc_distances_obj_index (struct hwloc_distances_s *distances, hwloc_obj_t obj)
 
static int hwloc_distances_obj_pair_values (struct hwloc_distances_s *distances, hwloc_obj_t obj1, hwloc_obj_t obj2, hwloc_uint64_t *value1to2, hwloc_uint64_t *value2to1)
 

Detailed Description

-

Enumeration Type Documentation

- -

◆ hwloc_topology_export_xml_flags_e

- -
-
- -

Flags for exporting XML topologies.

-

Flags to be given as a OR'ed set to hwloc_topology_export_xml().

- - -
Enumerator
HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 

Export XML that is loadable by hwloc v1.x. However, the export may miss some details about the topology.

-
- -
-

Function Documentation

- -

◆ hwloc_export_obj_userdata()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_export_obj_userdata (void * reserved,
hwloc_topology_t topology,
hwloc_obj_t obj,
const char * name,
const void * buffer,
size_t length 
)
-
- -

Export some object userdata to XML.

-

This function may only be called from within the export() callback passed to hwloc_topology_set_userdata_export_callback(). It may be invoked one of multiple times to export some userdata to XML. The buffer content of length length is stored with optional name name.

-

When importing this XML file, the import() callback (if set) will be called exactly as many times as hwloc_export_obj_userdata() was called during export(). It will receive the corresponding name, buffer and length arguments.

-

reserved, topology and obj must be the first three parameters that were given to the export callback.

-

Only printable characters may be exported to XML string attributes. If a non-printable character is passed in name or buffer, the function returns -1 with errno set to EINVAL.

-

If exporting binary data, the application should first encode into printable characters only (or use hwloc_export_obj_userdata_base64()). It should also take care of portability issues if the export may be reimported on a different architecture.

- -
-
- -

◆ hwloc_export_obj_userdata_base64()

+ +

◆ hwloc_distances_obj_index()

+ + + + + +
- + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - -
int hwloc_export_obj_userdata_base64 static int hwloc_distances_obj_index (void * reserved,
hwloc_topology_t topology,
hwloc_obj_t obj,
const char * name,
const void * buffer, struct hwloc_distances_sdistances,
size_t length 
)
-
- -

Encode and export some object userdata to XML.

-

This function is similar to hwloc_export_obj_userdata() but it encodes the input buffer into printable characters before exporting. On import, decoding is automatically performed before the data is given to the import() callback if any.

-

This function may only be called from within the export() callback passed to hwloc_topology_set_userdata_export_callback().

-

The function does not take care of portability issues if the export may be reimported on a different architecture.

- -
- - -

◆ hwloc_free_xmlbuffer()

- -
-
- - - - - - - - - - - - + + @@ -233,164 +82,56 @@
void hwloc_free_xmlbuffer (hwloc_topology_t topology,
char * xmlbuffer hwloc_obj_t obj 
+
+inlinestatic
-

Free a buffer allocated by hwloc_topology_export_xmlbuffer()

+

Find the index of an object in a distances structure.

+
Returns
-1 if object obj is not involved in structure distances.
- -

◆ hwloc_topology_export_xml()

+ +

◆ hwloc_distances_obj_pair_values()

+ + + + + +
- + - - - - - - - - + + - - - - - - - - -
int hwloc_topology_export_xml static int hwloc_distances_obj_pair_values (hwloc_topology_t topology,
const char * xmlpath, struct hwloc_distances_sdistances,
unsigned long flags 
)
-
- -

Export the topology into an XML file.

-

This file may be loaded later through hwloc_topology_set_xml().

-

By default, the latest export format is used, which means older hwloc releases (e.g. v1.x) will not be able to import it. Exporting to v1.x specific XML format is possible using flag HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 but it may miss some details about the topology. If there is any chance that the exported file may ever be imported back by a process using hwloc 1.x, one should consider detecting it at runtime and using the corresponding export format.

-

flags is a OR'ed set of hwloc_topology_export_xml_flags_e.

-
Returns
-1 if a failure occured.
-
Note
See also hwloc_topology_set_userdata_export_callback() for exporting application-specific object userdata.
-
-The topology-specific userdata pointer is ignored when exporting to XML.
-
-Only printable characters may be exported to XML string attributes. Any other character, especially any non-ASCII character, will be silently dropped.
-
-If name is "-", the XML output is sent to the standard output.
- -
- - -

◆ hwloc_topology_export_xmlbuffer()

- -
-
- - - - - - + + - - + + - - + + - - - - - - - - -
int hwloc_topology_export_xmlbuffer (hwloc_topology_t topology, hwloc_obj_t obj1,
char ** xmlbuffer, hwloc_obj_t obj2,
int * buflen, hwloc_uint64_t * value1to2,
unsigned long flags 
)
-
- -

Export the topology into a newly-allocated XML memory buffer.

-

xmlbuffer is allocated by the callee and should be freed with hwloc_free_xmlbuffer() later in the caller.

-

This memory buffer may be loaded later through hwloc_topology_set_xmlbuffer().

-

By default, the latest export format is used, which means older hwloc releases (e.g. v1.x) will not be able to import it. Exporting to v1.x specific XML format is possible using flag HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 but it may miss some details about the topology. If there is any chance that the exported buffer may ever be imported back by a process using hwloc 1.x, one should consider detecting it at runtime and using the corresponding export format.

-

The returned buffer ends with a \0 that is included in the returned length.

-

flags is a OR'ed set of hwloc_topology_export_xml_flags_e.

-
Returns
-1 if a failure occured.
-
Note
See also hwloc_topology_set_userdata_export_callback() for exporting application-specific object userdata.
-
-The topology-specific userdata pointer is ignored when exporting to XML.
-
-Only printable characters may be exported to XML string attributes. Any other character, especially any non-ASCII character, will be silently dropped.
- -
-
- -

◆ hwloc_topology_set_userdata_export_callback()

- -
-
- - - - - - - - - - - - - - - - - - -
void hwloc_topology_set_userdata_export_callback (hwloc_topology_t topology,
void(*)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj) export_cb 
)
-
- -

Set the application-specific callback for exporting object userdata.

-

The object userdata pointer is not exported to XML by default because hwloc does not know what it contains.

-

This function lets applications set export_cb to a callback function that converts this opaque userdata into an exportable string.

-

export_cb is invoked during XML export for each object whose userdata pointer is not NULL. The callback should use hwloc_export_obj_userdata() or hwloc_export_obj_userdata_base64() to actually export something to XML (possibly multiple times per object).

-

export_cb may be set to NULL if userdata should not be exported to XML.

-
Note
The topology-specific userdata pointer is ignored when exporting to XML.
- -
-
- -

◆ hwloc_topology_set_userdata_import_callback()

- -
-
- - - - - - - - - - - - + + @@ -398,18 +139,16 @@
void hwloc_topology_set_userdata_import_callback (hwloc_topology_t topology,
void(*)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length) import_cb hwloc_uint64_t * value2to1 
+
+inlinestatic
-

Set the application-specific callback for importing userdata.

-

On XML import, userdata is ignored by default because hwloc does not know how to store it in memory.

-

This function lets applications set import_cb to a callback function that will get the XML-stored userdata and store it in the object as expected by the application.

-

import_cb is called during hwloc_topology_load() as many times as hwloc_export_obj_userdata() was called during export. The topology is not entirely setup yet. Object attributes are ready to consult, but links between objects are not.

-

import_cb may be NULL if userdata should be ignored during import.

-
Note
buffer contains length characters followed by a null byte ('\0').
-
-This function should be called before hwloc_topology_load().
-
-The topology-specific userdata pointer is ignored when importing from XML.
+

Find the values between two objects in a distance matrices.

+

The distance from obj1 to obj2 is stored in the value pointed by value1to2 and reciprocally.

+
Returns
-1 if object obj1 or obj2 is not involved in structure distances.
@@ -418,7 +157,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00207.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00207.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00207.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00207.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Exporting Topologies to Synthetic +Hardware Locality (hwloc): Add or remove distances between objects @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
@@ -42,81 +43,90 @@ Enumerations | Functions
-
Exporting Topologies to Synthetic
+
Add or remove distances between objects
- - +

Enumerations

enum  hwloc_topology_export_synthetic_flags_e { HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_EXTENDED_TYPES, -HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS, -HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1, -HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_IGNORE_MEMORY +
enum  hwloc_distances_add_flag_e { HWLOC_DISTANCES_ADD_FLAG_GROUP, +HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE }
 
 
- - + + + + + + + + + +

Functions

int hwloc_topology_export_synthetic (hwloc_topology_t topology, char *buffer, size_t buflen, unsigned long flags)
 
int hwloc_distances_add (hwloc_topology_t topology, unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values, unsigned long kind, unsigned long flags)
 
int hwloc_distances_remove (hwloc_topology_t topology)
 
int hwloc_distances_remove_by_depth (hwloc_topology_t topology, int depth)
 
static int hwloc_distances_remove_by_type (hwloc_topology_t topology, hwloc_obj_type_t type)
 
int hwloc_distances_release_remove (hwloc_topology_t topology, struct hwloc_distances_s *distances)
 

Detailed Description

Enumeration Type Documentation

- -

◆ hwloc_topology_export_synthetic_flags_e

+ +

◆ hwloc_distances_add_flag_e

-

Flags for exporting synthetic topologies.

-

Flags to be given as a OR'ed set to hwloc_topology_export_synthetic().

+

Flags for adding a new distances to a topology.

- - - -
Enumerator
HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_EXTENDED_TYPES 

Export extended types such as L2dcache as basic types such as Cache.

-

This is required if loading the synthetic description with hwloc < 1.9.

+
Enumerator
HWLOC_DISTANCES_ADD_FLAG_GROUP 

Try to group objects based on the newly provided distance information.

HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS 

Do not export level attributes.

-

Ignore level attributes such as memory/cache sizes or PU indexes. This is required if loading the synthetic description with hwloc < 1.10.

-
HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1 

Export the memory hierarchy as expected in hwloc 1.x.

-

Instead of attaching memory children to levels, export single NUMA node child as normal intermediate levels, when possible. This is required if loading the synthetic description with hwloc 1.x. However this may fail if some objects have multiple local NUMA nodes.

-
HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_IGNORE_MEMORY 

Do not export memory information.

-

Only export the actual hierarchy of normal CPU-side objects and ignore where memory is attached. This is useful for when the hierarchy of CPUs is what really matters, but it behaves as if there was a single machine-wide NUMA node.

+
HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE 

If grouping, consider the distance values as inaccurate and relax the comparisons during the grouping algorithms. The actual accuracy may be modified through the HWLOC_GROUPING_ACCURACY environment variable (see Environment Variables).

Function Documentation

- -

◆ hwloc_topology_export_synthetic()

+ +

◆ hwloc_distances_add()

- + - + - - + + + + + + + + - - + + + + + + + + @@ -132,16 +142,133 @@
int hwloc_topology_export_synthetic int hwloc_distances_add (hwloc_topology_t hwloc_topology_t  topology,
char * buffer, unsigned nbobjs,
hwloc_obj_tobjs,
size_t buflen, hwloc_uint64_t * values,
unsigned long kind,
-

Export the topology as a synthetic string.

-

At most buflen characters will be written in buffer, including the terminating \0.

-

This exported string may be given back to hwloc_topology_set_synthetic().

-

flags is a OR'ed set of hwloc_topology_export_synthetic_flags_e.

-
Returns
The number of characters that were written, not including the terminating \0.
-
--1 if the topology could not be exported, for instance if it is not symmetric.
-
Note
I/O and Misc children are ignored, the synthetic string only describes normal children.
-
-A 1024-byte buffer should be large enough for exporting topologies in the vast majority of cases.
+

Provide a new distance matrix.

+

Provide the matrix of distances between a set of objects given by nbobjs and the objs array. nbobjs must be at least 2. The distances are stored as a one-dimension array in values. The distance from object i to object j is in slot i*nbobjs+j.

+

kind specifies the kind of distance as a OR'ed set of hwloc_distances_kind_e. Kind HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES will be automatically added if objects of different types are given.

+

flags configures the behavior of the function using an optional OR'ed set of hwloc_distances_add_flag_e.

+ +
+
+ +

◆ hwloc_distances_release_remove()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_distances_release_remove (hwloc_topology_t topology,
struct hwloc_distances_sdistances 
)
+
+ +

Release and remove the given distance matrice from the topology.

+

This function includes a call to hwloc_distances_release().

+ +
+
+ +

◆ hwloc_distances_remove()

+ +
+
+ + + + + + + + +
int hwloc_distances_remove (hwloc_topology_t topology)
+
+ +

Remove all distance matrices from a topology.

+

Remove all distance matrices, either provided by the user or gathered through the OS.

+

If these distances were used to group objects, these additional Group objects are not removed from the topology.

+ +
+
+ +

◆ hwloc_distances_remove_by_depth()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int hwloc_distances_remove_by_depth (hwloc_topology_t topology,
int depth 
)
+
+ +

Remove distance matrices for objects at a specific depth in the topology.

+

Identical to hwloc_distances_remove() but only applies to one level of the topology.

+ +
+
+ +

◆ hwloc_distances_remove_by_type()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int hwloc_distances_remove_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type 
)
+
+inlinestatic
+
+ +

Remove distance matrices for objects of a specific type in the topology.

+

Identical to hwloc_distances_remove() but only applies to one level of the topology.

@@ -150,7 +277,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00208.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00208.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00208.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00208.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Retrieve distances between objects +Hardware Locality (hwloc): Linux-specific helpers @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,128 +27,62 @@
- + +/* @license-end */
-
Retrieve distances between objects
+
Linux-specific helpers
- - - -

-Data Structures

struct  hwloc_distances_s
 
- - - -

-Enumerations

enum  hwloc_distances_kind_e {
-  HWLOC_DISTANCES_KIND_FROM_OS, -HWLOC_DISTANCES_KIND_FROM_USER, -HWLOC_DISTANCES_KIND_MEANS_LATENCY, -HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH, -
-  HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES -
- }
 
- - - - - - - - - - - - + + + + + + + +

Functions

int hwloc_distances_get (hwloc_topology_t topology, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
 
int hwloc_distances_get_by_depth (hwloc_topology_t topology, int depth, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
 
int hwloc_distances_get_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags)
 
int hwloc_distances_get_by_name (hwloc_topology_t topology, const char *name, unsigned *nr, struct hwloc_distances_s **distances, unsigned long flags)
 
const char * hwloc_distances_get_name (hwloc_topology_t topology, struct hwloc_distances_s *distances)
 
void hwloc_distances_release (hwloc_topology_t topology, struct hwloc_distances_s *distances)
 
int hwloc_linux_set_tid_cpubind (hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set)
 
int hwloc_linux_get_tid_cpubind (hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set)
 
int hwloc_linux_get_tid_last_cpu_location (hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set)
 
int hwloc_linux_read_path_as_cpumask (const char *path, hwloc_bitmap_t set)
 

Detailed Description

-

Enumeration Type Documentation

- -

◆ hwloc_distances_kind_e

- -
-
- - - - -
enum hwloc_distances_kind_e
-
- -

Kinds of distance matrices.

-

The kind attribute of struct hwloc_distances_s is a OR'ed set of kinds.

-

A kind of format HWLOC_DISTANCES_KIND_FROM_* specifies where the distance information comes from, if known.

-

A kind of format HWLOC_DISTANCES_KIND_MEANS_* specifies whether values are latencies or bandwidths, if applicable.

- - - - - - -
Enumerator
HWLOC_DISTANCES_KIND_FROM_OS 

These distances were obtained from the operating system or hardware.

-
HWLOC_DISTANCES_KIND_FROM_USER 

These distances were provided by the user.

-
HWLOC_DISTANCES_KIND_MEANS_LATENCY 

Distance values are similar to latencies between objects. Values are smaller for closer objects, hence minimal on the diagonal of the matrix (distance between an object and itself). It could also be the number of network hops between objects, etc.

-
HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH 

Distance values are similar to bandwidths between objects. Values are higher for closer objects, hence maximal on the diagonal of the matrix (distance between an object and itself). Such values are currently ignored for distance-based grouping.

-
HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES 

This distances structure covers objects of different types.

-
- -
-
+

This includes helpers for manipulating Linux kernel cpumap files, and hwloc equivalents of the Linux sched_setaffinity and sched_getaffinity system calls.

Function Documentation

- -

◆ hwloc_distances_get()

+ +

◆ hwloc_linux_get_tid_cpubind()

- + - + - - + + - - - - - - - - - - - - - - + + @@ -158,56 +92,35 @@
int hwloc_distances_get int hwloc_linux_get_tid_cpubind (hwloc_topology_t hwloc_topology_t  topology,
unsigned * nr, pid_t tid,
struct hwloc_distances_s ** distances,
unsigned long kind,
unsigned long flags hwloc_cpuset_t set 
-

Retrieve distance matrices.

-

Retrieve distance matrices from the topology into the distances array.

-

flags is currently unused, should be 0.

-

kind serves as a filter. If 0, all distance matrices are returned. If it contains some HWLOC_DISTANCES_KIND_FROM_*, only distance matrices whose kind matches one of these are returned. If it contains some HWLOC_DISTANCES_KIND_MEANS_*, only distance matrices whose kind matches one of these are returned.

-

On input, nr points to the number of distance matrices that may be stored in distances. On output, nr points to the number of distance matrices that were actually found, even if some of them couldn't be stored in distances. Distance matrices that couldn't be stored are ignored, but the function still returns success (0). The caller may find out by comparing the value pointed by nr before and after the function call.

-

Each distance matrix returned in the distances array should be released by the caller using hwloc_distances_release().

+

Get the current binding of thread tid.

+

The behavior is exactly the same as the Linux sched_getaffinity system call, but uses a hwloc cpuset.

+
Note
This is equivalent to calling hwloc_get_proc_cpubind() with HWLOC_CPUBIND_THREAD as flags.
- -

◆ hwloc_distances_get_by_depth()

+ +

◆ hwloc_linux_get_tid_last_cpu_location()

- + - + - - - - - - - - - - - - - - - - - - - - + + - - + + @@ -217,101 +130,28 @@
int hwloc_distances_get_by_depth int hwloc_linux_get_tid_last_cpu_location (hwloc_topology_t hwloc_topology_t  topology,
int depth,
unsigned * nr,
struct hwloc_distances_s ** distances,
unsigned long kind, pid_t tid,
unsigned long flags hwloc_bitmap_t set 
-

Retrieve distance matrices for object at a specific depth in the topology.

-

Identical to hwloc_distances_get() with the additional depth filter.

+

Get the last physical CPU where thread tid ran.

+
Note
This is equivalent to calling hwloc_get_proc_last_cpu_location() with HWLOC_CPUBIND_THREAD as flags.
- -

◆ hwloc_distances_get_by_name()

+ +

◆ hwloc_linux_read_path_as_cpumask()

- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_distances_get_by_name int hwloc_linux_read_path_as_cpumask (hwloc_topology_t topology,
const char * name,
unsigned * nr,
struct hwloc_distances_s ** distances,
unsigned long flags 
)
-
- -

Retrieve a distance matrix with the given name.

-

Usually only one distances structure may match a given name.

- -
-
- -

◆ hwloc_distances_get_by_type()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + @@ -321,59 +161,35 @@
int hwloc_distances_get_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type,
unsigned * nr,
struct hwloc_distances_s ** distances,
unsigned long kind, path,
unsigned long flags hwloc_bitmap_t set 
-

Retrieve distance matrices for object of a specific type.

-

Identical to hwloc_distances_get() with the additional type filter.

+

Convert a linux kernel cpumask file path into a hwloc bitmap set.

+

Might be used when reading CPU set from sysfs attributes such as topology and caches for processors, or local_cpus for devices.

+
Note
This function ignores the HWLOC_FSROOT environment variable.
- -

◆ hwloc_distances_get_name()

+ +

◆ hwloc_linux_set_tid_cpubind()

- + - + - - - - - - - - -
const char* hwloc_distances_get_name int hwloc_linux_set_tid_cpubind (hwloc_topology_t hwloc_topology_t  topology,
struct hwloc_distances_sdistances 
)
-
- -

Get a description of what a distances structure contains.

-

For instance "NUMALatency" for hardware-provided NUMA distances (ACPI SLIT), or NULL if unknown.

- -
-
- -

◆ hwloc_distances_release()

- -
-
- - - - - - + + - - + + @@ -383,8 +199,9 @@
void hwloc_distances_release (hwloc_topology_t topology, pid_t tid,
struct hwloc_distances_sdistances hwloc_const_cpuset_t set 
-

Release a distance matrix structure previously returned by hwloc_distances_get().

-
Note
This function is not required if the structure is removed with hwloc_distances_release_remove().
+

Bind a thread tid on cpus given in cpuset set.

+

The behavior is exactly the same as the Linux sched_setaffinity system call, but uses a hwloc cpuset.

+
Note
This is equivalent to calling hwloc_set_proc_cpubind() with HWLOC_CPUBIND_THREAD as flags.
@@ -393,7 +210,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00209.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00209.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00209.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00209.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Helpers for consulting distance matrices +Hardware Locality (hwloc): Interoperability with Linux libnuma unsigned long masks @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,35 +27,44 @@
- + +/* @license-end */
-
Helpers for consulting distance matrices
+
Interoperability with Linux libnuma unsigned long masks
- - - - + + + + + + + +

Functions

static int hwloc_distances_obj_index (struct hwloc_distances_s *distances, hwloc_obj_t obj)
 
static int hwloc_distances_obj_pair_values (struct hwloc_distances_s *distances, hwloc_obj_t obj1, hwloc_obj_t obj2, hwloc_uint64_t *value1to2, hwloc_uint64_t *value2to1)
 
static int hwloc_cpuset_to_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, unsigned long *mask, unsigned long *maxnode)
 
static int hwloc_nodeset_to_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, unsigned long *mask, unsigned long *maxnode)
 
static int hwloc_cpuset_from_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const unsigned long *mask, unsigned long maxnode)
 
static int hwloc_nodeset_from_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const unsigned long *mask, unsigned long maxnode)
 

Detailed Description

+

This interface helps converting between Linux libnuma unsigned long masks and hwloc cpusets and nodesets.

+
Note
Topology topology must match the current machine.
+
+The behavior of libnuma is undefined if the kernel is not NUMA-aware. (when CONFIG_NUMA is not set in the kernel configuration). This helper and libnuma may thus not be strictly compatible in this case, which may be detected by checking whether numa_available() returns -1.

Function Documentation

- -

◆ hwloc_distances_obj_index()

+ +

◆ hwloc_cpuset_from_linux_libnuma_ulongs()

@@ -64,16 +73,80 @@ - + - - + + - - + + + + + + + + + + + + + + + + + + + + +
static int hwloc_distances_obj_index static int hwloc_cpuset_from_linux_libnuma_ulongs (struct hwloc_distances_sdistances, hwloc_topology_t topology,
hwloc_obj_t obj hwloc_cpuset_t cpuset,
const unsigned long * mask,
unsigned long maxnode 
)
+ + +inlinestatic + + +
+ +

Convert the array of unsigned long mask into hwloc CPU set.

+

mask is a array of unsigned long that will be read. maxnode contains the maximal node number that may be read in mask.

+

This function may be used after calling get_mempolicy or any other function that takes an array of unsigned long as output parameter (and possibly a maximal node number as input parameter).

+ +
+
+ +

◆ hwloc_cpuset_to_linux_libnuma_ulongs()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + @@ -88,13 +161,14 @@
static int hwloc_cpuset_to_linux_libnuma_ulongs (hwloc_topology_t topology,
hwloc_const_cpuset_t cpuset,
unsigned long * mask,
unsigned long * maxnode 
-

Find the index of an object in a distances structure.

-
Returns
-1 if object obj is not involved in structure distances.
+

Convert hwloc CPU set cpuset into the array of unsigned long mask.

+

mask is the array of unsigned long that will be filled. maxnode contains the maximal node number that may be stored in mask. maxnode will be set to the maximal node number that was found, plus one.

+

This function may be used before calling set_mempolicy, mbind, migrate_pages or any other function that takes an array of unsigned long and a maximal node number as input parameter.

- -

◆ hwloc_distances_obj_pair_values()

+ +

◆ hwloc_nodeset_from_linux_libnuma_ulongs()

@@ -103,34 +177,80 @@
- + - - + + + + + + + + - - + + + + + + + + + + + + + + +
static int hwloc_distances_obj_pair_values static int hwloc_nodeset_from_linux_libnuma_ulongs (struct hwloc_distances_sdistances, hwloc_topology_t topology,
hwloc_nodeset_t nodeset,
hwloc_obj_t obj1, const unsigned long * mask,
unsigned long maxnode 
)
+
+inlinestatic
+
+ +

Convert the array of unsigned long mask into hwloc NUMA node set.

+

mask is a array of unsigned long that will be read. maxnode contains the maximal node number that may be read in mask.

+

This function may be used after calling get_mempolicy or any other function that takes an array of unsigned long as output parameter (and possibly a maximal node number as input parameter).

+ +
+
+ +

◆ hwloc_nodeset_to_linux_libnuma_ulongs()

+ +
+
+ + + @@ -27,111 +27,68 @@
+ + + + + + - - + + - - + + - - + + @@ -145,9 +265,9 @@
static int hwloc_nodeset_to_linux_libnuma_ulongs (hwloc_topology_t topology,
hwloc_obj_t obj2, hwloc_const_nodeset_t nodeset,
hwloc_uint64_t * value1to2, unsigned long * mask,
hwloc_uint64_t * value2to1 unsigned long * maxnode 
-

Find the values between two objects in a distance matrices.

-

The distance from obj1 to obj2 is stored in the value pointed by value1to2 and reciprocally.

-
Returns
-1 if object obj1 or obj2 is not involved in structure distances.
+

Convert hwloc NUMA node set nodeset into the array of unsigned long mask.

+

mask is the array of unsigned long that will be filled. maxnode contains the maximal node number that may be stored in mask. maxnode will be set to the maximal node number that was found, plus one.

+

This function may be used before calling set_mempolicy, mbind, migrate_pages or any other function that takes an array of unsigned long and a maximal node number as input parameter.

@@ -156,7 +276,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00210.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00210.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00210.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00210.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Add or remove distances between objects +Hardware Locality (hwloc): Interoperability with Linux libnuma bitmask @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Add or remove distances between objects
+
Interoperability with Linux libnuma bitmask
- - - -

-Enumerations

enum  hwloc_distances_add_flag_e { HWLOC_DISTANCES_ADD_FLAG_GROUP, -HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE - }
 
- - - - - - - - - - + + + + + + + +

Functions

int hwloc_distances_add (hwloc_topology_t topology, unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values, unsigned long kind, unsigned long flags)
 
int hwloc_distances_remove (hwloc_topology_t topology)
 
int hwloc_distances_remove_by_depth (hwloc_topology_t topology, int depth)
 
static int hwloc_distances_remove_by_type (hwloc_topology_t topology, hwloc_obj_type_t type)
 
int hwloc_distances_release_remove (hwloc_topology_t topology, struct hwloc_distances_s *distances)
 
static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset)
 
static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset)
 
static int hwloc_cpuset_from_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const struct bitmask *bitmask)
 
static int hwloc_nodeset_from_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const struct bitmask *bitmask)
 

Detailed Description

-

Enumeration Type Documentation

- -

◆ hwloc_distances_add_flag_e

- -
-
- - - - -
enum hwloc_distances_add_flag_e
-
- -

Flags for adding a new distances to a topology.

- - - -
Enumerator
HWLOC_DISTANCES_ADD_FLAG_GROUP 

Try to group objects based on the newly provided distance information.

-
HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE 

If grouping, consider the distance values as inaccurate and relax the comparisons during the grouping algorithms. The actual accuracy may be modified through the HWLOC_GROUPING_ACCURACY environment variable (see Environment Variables).

-
- -
-
+

This interface helps converting between Linux libnuma bitmasks and hwloc cpusets and nodesets.

+
Note
Topology topology must match the current machine.
+
+The behavior of libnuma is undefined if the kernel is not NUMA-aware. (when CONFIG_NUMA is not set in the kernel configuration). This helper and libnuma may thus not be strictly compatible in this case, which may be detected by checking whether numa_available() returns -1.

Function Documentation

- -

◆ hwloc_distances_add()

+ +

◆ hwloc_cpuset_from_linux_libnuma_bitmask()

+ + + + + +
- + - + - - + + - - - - - - - - - - - - - - - - - - - - + + @@ -139,32 +96,38 @@
int hwloc_distances_add static int hwloc_cpuset_from_linux_libnuma_bitmask (hwloc_topology_t hwloc_topology_t  topology,
unsigned nbobjs, hwloc_cpuset_t cpuset,
hwloc_obj_tobjs,
hwloc_uint64_t * values,
unsigned long kind,
unsigned long flags const struct bitmask * bitmask 
+
+inlinestatic
-

Provide a new distance matrix.

-

Provide the matrix of distances between a set of objects given by nbobjs and the objs array. nbobjs must be at least 2. The distances are stored as a one-dimension array in values. The distance from object i to object j is in slot i*nbobjs+j.

-

kind specifies the kind of distance as a OR'ed set of hwloc_distances_kind_e. Kind HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES will be automatically added if objects of different types are given.

-

flags configures the behavior of the function using an optional OR'ed set of hwloc_distances_add_flag_e.

+

Convert libnuma bitmask bitmask into hwloc CPU set cpuset.

+

This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter.

- -

◆ hwloc_distances_release_remove()

+ +

◆ hwloc_cpuset_to_linux_libnuma_bitmask()

+ + + + + +
- + - + - - + + @@ -172,52 +135,46 @@
int hwloc_distances_release_remove static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask (hwloc_topology_t hwloc_topology_t  topology,
struct hwloc_distances_sdistances hwloc_const_cpuset_t cpuset 
+
+inlinestatic
-

Release and remove the given distance matrice from the topology.

-

This function includes a call to hwloc_distances_release().

+

Convert hwloc CPU set cpuset into the returned libnuma bitmask.

+

The returned bitmask should later be freed with numa_bitmask_free.

+

This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter.

+
Returns
newly allocated struct bitmask.
- -

◆ hwloc_distances_remove()

+ +

◆ hwloc_nodeset_from_linux_libnuma_bitmask()

+ + + + + +
- + - - - + + -
int hwloc_distances_remove static int hwloc_nodeset_from_linux_libnuma_bitmask (hwloc_topology_t topology)hwloc_topology_t topology,
-
- -

Remove all distance matrices from a topology.

-

Remove all distance matrices, either provided by the user or gathered through the OS.

-

If these distances were used to group objects, these additional Group objects are not removed from the topology.

- -
- - -

◆ hwloc_distances_remove_by_depth()

- -
-
- - - - - + + + + - - + + @@ -225,15 +182,20 @@
int hwloc_distances_remove_by_depth (hwloc_topology_t topology, hwloc_nodeset_t nodeset,
int depth const struct bitmask * bitmask 
+
+inlinestatic
-

Remove distance matrices for objects at a specific depth in the topology.

-

Identical to hwloc_distances_remove() but only applies to one level of the topology.

+

Convert libnuma bitmask bitmask into hwloc NUMA node set nodeset.

+

This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter.

- -

◆ hwloc_distances_remove_by_type()

+ +

◆ hwloc_nodeset_to_linux_libnuma_bitmask()

@@ -242,16 +204,16 @@ - + - + - - + + @@ -266,8 +228,10 @@
static int hwloc_distances_remove_by_type static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask (hwloc_topology_t hwloc_topology_t  topology,
hwloc_obj_type_t type hwloc_const_nodeset_t nodeset 
-

Remove distance matrices for objects of a specific type in the topology.

-

Identical to hwloc_distances_remove() but only applies to one level of the topology.

+

Convert hwloc NUMA node set nodeset into the returned libnuma bitmask.

+

The returned bitmask should later be freed with numa_bitmask_free.

+

This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter.

+
Returns
newly allocated struct bitmask.
@@ -276,7 +240,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00211.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00211.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00211.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00211.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Linux-specific helpers +Hardware Locality (hwloc): Interoperability with glibc sched affinity @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,99 +27,68 @@
- + +/* @license-end */
-
Linux-specific helpers
+
Interoperability with glibc sched affinity
- - - - - - - - + + + +

Functions

int hwloc_linux_set_tid_cpubind (hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set)
 
int hwloc_linux_get_tid_cpubind (hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set)
 
int hwloc_linux_get_tid_last_cpu_location (hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set)
 
int hwloc_linux_read_path_as_cpumask (const char *path, hwloc_bitmap_t set)
 
static int hwloc_cpuset_to_glibc_sched_affinity (hwloc_topology_t topology, hwloc_const_cpuset_t hwlocset, cpu_set_t *schedset, size_t schedsetsize)
 
static int hwloc_cpuset_from_glibc_sched_affinity (hwloc_topology_t topology, hwloc_cpuset_t hwlocset, const cpu_set_t *schedset, size_t schedsetsize)
 

Detailed Description

-

This includes helpers for manipulating Linux kernel cpumap files, and hwloc equivalents of the Linux sched_setaffinity and sched_getaffinity system calls.

+

This interface offers ways to convert between hwloc cpusets and glibc cpusets such as those manipulated by sched_getaffinity() or pthread_attr_setaffinity_np().

+
Note
Topology topology must match the current machine.

Function Documentation

- -

◆ hwloc_linux_get_tid_cpubind()

+ +

◆ hwloc_cpuset_from_glibc_sched_affinity()

+ + + + + +
- + - + - - + + - - - - - - - - -
int hwloc_linux_get_tid_cpubind static int hwloc_cpuset_from_glibc_sched_affinity (hwloc_topology_t hwloc_topology_t  topology,
pid_t tid, hwloc_cpuset_t hwlocset,
hwloc_cpuset_t set 
)
-
- -

Get the current binding of thread tid.

-

The behavior is exactly the same as the Linux sched_getaffinity system call, but uses a hwloc cpuset.

-
Note
This is equivalent to calling hwloc_get_proc_cpubind() with HWLOC_CPUBIND_THREAD as flags.
- -
- - -

◆ hwloc_linux_get_tid_last_cpu_location()

- -
-
- - - - - - - - - - - - + + - - + + @@ -127,68 +96,51 @@
int hwloc_linux_get_tid_last_cpu_location (hwloc_topology_t topology,
pid_t tid, const cpu_set_t * schedset,
hwloc_bitmap_t set size_t schedsetsize 
+
+inlinestatic
-

Get the last physical CPU where thread tid ran.

-
Note
This is equivalent to calling hwloc_get_proc_last_cpu_location() with HWLOC_CPUBIND_THREAD as flags.
+

Convert glibc sched affinity CPU set schedset into hwloc CPU set.

+

This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter.

+

schedsetsize should be sizeof(cpu_set_t) unless schedset was dynamically allocated with CPU_ALLOC

- -

◆ hwloc_linux_read_path_as_cpumask()

+ +

◆ hwloc_cpuset_to_glibc_sched_affinity()

+ + + + + +
- + - - + + - - - - - - - - -
int hwloc_linux_read_path_as_cpumask static int hwloc_cpuset_to_glibc_sched_affinity (const char * path, hwloc_topology_t topology,
hwloc_bitmap_t set 
)
-
- -

Convert a linux kernel cpumask file path into a hwloc bitmap set.

-

Might be used when reading CPU set from sysfs attributes such as topology and caches for processors, or local_cpus for devices.

-
Note
This function ignores the HWLOC_FSROOT environment variable.
- -
- - -

◆ hwloc_linux_set_tid_cpubind()

- -
-
- - - - - - + + - - + + - - + + @@ -196,11 +148,16 @@
int hwloc_linux_set_tid_cpubind (hwloc_topology_t topology, hwloc_const_cpuset_t hwlocset,
pid_t tid, cpu_set_t * schedset,
hwloc_const_cpuset_t set size_t schedsetsize 
+
+inlinestatic
-

Bind a thread tid on cpus given in cpuset set.

-

The behavior is exactly the same as the Linux sched_setaffinity system call, but uses a hwloc cpuset.

-
Note
This is equivalent to calling hwloc_set_proc_cpubind() with HWLOC_CPUBIND_THREAD as flags.
+

Convert hwloc CPU set toposet into glibc sched affinity CPU set schedset.

+

This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter.

+

schedsetsize should be sizeof(cpu_set_t) unless schedset was dynamically allocated with CPU_ALLOC

@@ -209,7 +166,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00212.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00212.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00212.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00212.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with Linux libnuma unsigned long masks +Hardware Locality (hwloc): Interoperability with OpenCL @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,43 +27,42 @@
- + +/* @license-end */
-
Interoperability with Linux libnuma unsigned long masks
+
Interoperability with OpenCL
- - - - - - - - + + + + + + + +

Functions

static int hwloc_cpuset_to_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, unsigned long *mask, unsigned long *maxnode)
 
static int hwloc_nodeset_to_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, unsigned long *mask, unsigned long *maxnode)
 
static int hwloc_cpuset_from_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const unsigned long *mask, unsigned long maxnode)
 
static int hwloc_nodeset_from_linux_libnuma_ulongs (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const unsigned long *mask, unsigned long maxnode)
 
static int hwloc_opencl_get_device_pci_busid (cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)
 
static int hwloc_opencl_get_device_cpuset (hwloc_topology_t topology, cl_device_id device, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_opencl_get_device_osdev_by_index (hwloc_topology_t topology, unsigned platform_index, unsigned device_index)
 
static hwloc_obj_t hwloc_opencl_get_device_osdev (hwloc_topology_t topology, cl_device_id device)
 

Detailed Description

-

This interface helps converting between Linux libnuma unsigned long masks and hwloc cpusets and nodesets.

-
Note
Topology topology must match the current machine.
-
-The behavior of libnuma is undefined if the kernel is not NUMA-aware. (when CONFIG_NUMA is not set in the kernel configuration). This helper and libnuma may thus not be strictly compatible in this case, which may be detected by checking whether numa_available() returns -1.
+

This interface offers ways to retrieve topology information about OpenCL devices.

+

Only AMD and NVIDIA OpenCL implementations currently offer useful locality information about their devices.

Function Documentation

- -

◆ hwloc_cpuset_from_linux_libnuma_ulongs()

+ +

◆ hwloc_opencl_get_device_cpuset()

@@ -72,28 +71,22 @@ - + - + - - - - - - - - + + - - + + @@ -108,14 +101,16 @@
static int hwloc_cpuset_from_linux_libnuma_ulongs static int hwloc_opencl_get_device_cpuset (hwloc_topology_t hwloc_topology_t  topology,
hwloc_cpuset_t cpuset,
const unsigned long * mask, cl_device_id device,
unsigned long maxnode hwloc_cpuset_t set 
-

Convert the array of unsigned long mask into hwloc CPU set.

-

mask is a array of unsigned long that will be read. maxnode contains the maximal node number that may be read in mask.

-

This function may be used after calling get_mempolicy or any other function that takes an array of unsigned long as output parameter (and possibly a maximal node number as input parameter).

+

Get the CPU set of logical processors that are physically close to OpenCL device device.

+

Return the CPU set describing the locality of the OpenCL device device.

+

Topology topology and device device must match the local machine. I/O devices detection and the OpenCL component are not needed in the topology.

+

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_opencl_get_device_osdev() and hwloc_opencl_get_device_osdev_by_index().

+

This function is currently only implemented in a meaningful way for Linux with the AMD or NVIDIA OpenCL implementation; other systems will simply get a full cpuset.

- -

◆ hwloc_cpuset_to_linux_libnuma_ulongs()

+ +

◆ hwloc_opencl_get_device_osdev()

@@ -124,28 +119,16 @@ - + - + - - - - - - - - - - - - - - + + @@ -160,14 +143,18 @@
static int hwloc_cpuset_to_linux_libnuma_ulongs static hwloc_obj_t hwloc_opencl_get_device_osdev (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_cpuset_t cpuset,
unsigned long * mask,
unsigned long * maxnode cl_device_id device 
-

Convert hwloc CPU set cpuset into the array of unsigned long mask.

-

mask is the array of unsigned long that will be filled. maxnode contains the maximal node number that may be stored in mask. maxnode will be set to the maximal node number that was found, plus one.

-

This function may be used before calling set_mempolicy, mbind, migrate_pages or any other function that takes an array of unsigned long and a maximal node number as input parameter.

+

Get the hwloc OS device object corresponding to OpenCL device deviceX.

+

Use OpenCL device attributes to find the corresponding hwloc OS device object. Return NULL if there is none or if useful attributes are not available.

+

This function currently only works on AMD and NVIDIA OpenCL devices that support relevant OpenCL extensions. hwloc_opencl_get_device_osdev_by_index() should be preferred whenever possible, i.e. when platform and device index are known.

+

Topology topology and device device must match the local machine. I/O devices detection and the OpenCL component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_opencl_get_device_cpuset().

+
Note
This function cannot work if PCI devices are filtered out.
+
+The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
- -

◆ hwloc_nodeset_from_linux_libnuma_ulongs()

+ +

◆ hwloc_opencl_get_device_osdev_by_index()

@@ -176,28 +163,22 @@ - + - + - - - - - - - - + + - - + + @@ -212,14 +193,15 @@
static int hwloc_nodeset_from_linux_libnuma_ulongs static hwloc_obj_t hwloc_opencl_get_device_osdev_by_index (hwloc_topology_t hwloc_topology_t  topology,
hwloc_nodeset_t nodeset,
const unsigned long * mask, unsigned platform_index,
unsigned long maxnode unsigned device_index 
-

Convert the array of unsigned long mask into hwloc NUMA node set.

-

mask is a array of unsigned long that will be read. maxnode contains the maximal node number that may be read in mask.

-

This function may be used after calling get_mempolicy or any other function that takes an array of unsigned long as output parameter (and possibly a maximal node number as input parameter).

+

Get the hwloc OS device object corresponding to the OpenCL device for the given indexes.

+

Return the OS device object describing the OpenCL device whose platform index is platform_index, and whose device index within this platform if device_index. Return NULL if there is none.

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the OpenCL component must be enabled in the topology.

+
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
- -

◆ hwloc_nodeset_to_linux_libnuma_ulongs()

+ +

◆ hwloc_opencl_get_device_pci_busid()

@@ -228,28 +210,34 @@ - + - - + + + + + + + + - - + + - - + + - - + + @@ -264,9 +252,8 @@
static int hwloc_nodeset_to_linux_libnuma_ulongs static int hwloc_opencl_get_device_pci_busid (hwloc_topology_t topology, cl_device_id device,
unsigned * domain,
hwloc_const_nodeset_t nodeset, unsigned * bus,
unsigned long * mask, unsigned * dev,
unsigned long * maxnode unsigned * func 
-

Convert hwloc NUMA node set nodeset into the array of unsigned long mask.

-

mask is the array of unsigned long that will be filled. maxnode contains the maximal node number that may be stored in mask. maxnode will be set to the maximal node number that was found, plus one.

-

This function may be used before calling set_mempolicy, mbind, migrate_pages or any other function that takes an array of unsigned long and a maximal node number as input parameter.

+

Return the domain, bus and device IDs of the OpenCL device device.

+

Device device must match the local machine.

@@ -275,7 +262,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00213.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00213.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00213.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00213.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with Linux libnuma bitmask +Hardware Locality (hwloc): Interoperability with the CUDA Driver API @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,43 +27,43 @@
- + +/* @license-end */
-
Interoperability with Linux libnuma bitmask
+
Interoperability with the CUDA Driver API
- - - - - - - - + + + + + + + + + +

Functions

static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset)
 
static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset)
 
static int hwloc_cpuset_from_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const struct bitmask *bitmask)
 
static int hwloc_nodeset_from_linux_libnuma_bitmask (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const struct bitmask *bitmask)
 
static int hwloc_cuda_get_device_pci_ids (hwloc_topology_t topology, CUdevice cudevice, int *domain, int *bus, int *dev)
 
static int hwloc_cuda_get_device_cpuset (hwloc_topology_t topology, CUdevice cudevice, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_cuda_get_device_pcidev (hwloc_topology_t topology, CUdevice cudevice)
 
static hwloc_obj_t hwloc_cuda_get_device_osdev (hwloc_topology_t topology, CUdevice cudevice)
 
static hwloc_obj_t hwloc_cuda_get_device_osdev_by_index (hwloc_topology_t topology, unsigned idx)
 

Detailed Description

-

This interface helps converting between Linux libnuma bitmasks and hwloc cpusets and nodesets.

-
Note
Topology topology must match the current machine.
-
-The behavior of libnuma is undefined if the kernel is not NUMA-aware. (when CONFIG_NUMA is not set in the kernel configuration). This helper and libnuma may thus not be strictly compatible in this case, which may be detected by checking whether numa_available() returns -1.
+

This interface offers ways to retrieve topology information about CUDA devices when using the CUDA Driver API.

Function Documentation

- -

◆ hwloc_cpuset_from_linux_libnuma_bitmask()

+ +

◆ hwloc_cuda_get_device_cpuset()

@@ -72,22 +72,64 @@ - + - + - - + + + + + + + + + + + + + + +
static int hwloc_cpuset_from_linux_libnuma_bitmask static int hwloc_cuda_get_device_cpuset (hwloc_topology_t hwloc_topology_t  topology,
hwloc_cpuset_t cpuset, CUdevice cudevice,
hwloc_cpuset_t set 
)
+ + +inlinestatic + + +
+ +

Get the CPU set of logical processors that are physically close to device cudevice.

+

Return the CPU set describing the locality of the CUDA device cudevice.

+

Topology topology and device cudevice must match the local machine. I/O devices detection and the CUDA component are not needed in the topology.

+

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_cuda_get_device_osdev() and hwloc_cuda_get_device_osdev_by_index().

+

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

+ +
+
+ +

◆ hwloc_cuda_get_device_osdev()

+ +
+
+ + + +inlinestatic
+ + + + + + - - + + @@ -102,13 +144,17 @@
static hwloc_obj_t hwloc_cuda_get_device_osdev (hwloc_topology_t topology,
const struct bitmask * bitmask CUdevice cudevice 
-

Convert libnuma bitmask bitmask into hwloc CPU set cpuset.

-

This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter.

+

Get the hwloc OS device object corresponding to CUDA device cudevice.

+

Return the hwloc OS device object that describes the given CUDA device cudevice. Return NULL if there is none.

+

Topology topology and device cudevice must match the local machine. I/O devices detection and the CUDA component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_cuda_get_device_cpuset().

+
Note
This function cannot work if PCI devices are filtered out.
+
+The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
- -

◆ hwloc_cpuset_to_linux_libnuma_bitmask()

+ +

◆ hwloc_cuda_get_device_osdev_by_index()

@@ -117,16 +163,16 @@
- + - + - - + + @@ -136,20 +182,22 @@
static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask static hwloc_obj_t hwloc_cuda_get_device_osdev_by_index (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_cpuset_t cpuset unsigned idx 
-static
-

Convert hwloc CPU set cpuset into the returned libnuma bitmask.

-

The returned bitmask should later be freed with numa_bitmask_free.

-

This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter.

-
Returns
newly allocated struct bitmask.
+

Get the hwloc OS device object corresponding to the CUDA device whose index is idx.

+

Return the OS device object describing the CUDA device whose index is idx. Return NULL if there is none.

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the CUDA component must be enabled in the topology.

+
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
+
+This function is identical to hwloc_cudart_get_device_osdev_by_index().
- -

◆ hwloc_nodeset_from_linux_libnuma_bitmask()

+ +

◆ hwloc_cuda_get_device_pci_ids()

@@ -158,22 +206,34 @@ - + - + - - + + - - + + + + + + + + + + + + + + @@ -188,13 +248,13 @@
static int hwloc_nodeset_from_linux_libnuma_bitmask static int hwloc_cuda_get_device_pci_ids (hwloc_topology_t hwloc_topology_t  topology,
hwloc_nodeset_t nodeset, CUdevice cudevice,
const struct bitmask * bitmask int * domain,
int * bus,
int * dev 
-

Convert libnuma bitmask bitmask into hwloc NUMA node set nodeset.

-

This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter.

+

Return the domain, bus and device IDs of the CUDA device cudevice.

+

Device cudevice must match the local machine.

- -

◆ hwloc_nodeset_to_linux_libnuma_bitmask()

+ +

◆ hwloc_cuda_get_device_pcidev()

@@ -203,16 +263,16 @@ - + - + - - + + @@ -222,15 +282,14 @@
static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask static hwloc_obj_t hwloc_cuda_get_device_pcidev (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_nodeset_t nodeset CUdevice cudevice 
-static +inlinestatic
-

Convert hwloc NUMA node set nodeset into the returned libnuma bitmask.

-

The returned bitmask should later be freed with numa_bitmask_free.

-

This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter.

-
Returns
newly allocated struct bitmask.
+

Get the hwloc PCI device object corresponding to the CUDA device cudevice.

+

Return the PCI device object describing the CUDA device cudevice. Return NULL if there is none.

+

Topology topology and device cudevice must match the local machine. I/O devices detection must be enabled in topology topology. The CUDA component is not needed in the topology.

@@ -239,7 +298,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00214.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00214.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00214.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00214.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with glibc sched affinity +Hardware Locality (hwloc): Interoperability with the CUDA Runtime API @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,37 +27,41 @@
- + +/* @license-end */
-
Interoperability with glibc sched affinity
+
Interoperability with the CUDA Runtime API
- - - - + + + + + + + +

Functions

static int hwloc_cpuset_to_glibc_sched_affinity (hwloc_topology_t topology, hwloc_const_cpuset_t hwlocset, cpu_set_t *schedset, size_t schedsetsize)
 
static int hwloc_cpuset_from_glibc_sched_affinity (hwloc_topology_t topology, hwloc_cpuset_t hwlocset, const cpu_set_t *schedset, size_t schedsetsize)
 
static int hwloc_cudart_get_device_pci_ids (hwloc_topology_t topology, int idx, int *domain, int *bus, int *dev)
 
static int hwloc_cudart_get_device_cpuset (hwloc_topology_t topology, int idx, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_cudart_get_device_pcidev (hwloc_topology_t topology, int idx)
 
static hwloc_obj_t hwloc_cudart_get_device_osdev_by_index (hwloc_topology_t topology, unsigned idx)
 

Detailed Description

-

This interface offers ways to convert between hwloc cpusets and glibc cpusets such as those manipulated by sched_getaffinity() or pthread_attr_setaffinity_np().

-
Note
Topology topology must match the current machine.
+

This interface offers ways to retrieve topology information about CUDA devices when using the CUDA Runtime API.

Function Documentation

- -

◆ hwloc_cpuset_from_glibc_sched_affinity()

+ +

◆ hwloc_cudart_get_device_cpuset()

@@ -66,28 +70,64 @@ - + - + - - + + - - + + + + + + + + +
static int hwloc_cpuset_from_glibc_sched_affinity static int hwloc_cudart_get_device_cpuset (hwloc_topology_t hwloc_topology_t  topology,
hwloc_cpuset_t hwlocset, int idx,
const cpu_set_t * schedset, hwloc_cpuset_t set 
)
+ + +inlinestatic + + +
+ +

Get the CPU set of logical processors that are physically close to device idx.

+

Return the CPU set describing the locality of the CUDA device whose index is idx.

+

Topology topology and device idx must match the local machine. I/O devices detection and the CUDA component are not needed in the topology.

+

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_cudart_get_device_osdev_by_index().

+

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

+ +
+
+ +

◆ hwloc_cudart_get_device_osdev_by_index()

+ +
+
+ + + + + +
+ + + + + + - - + + @@ -102,14 +142,17 @@
static hwloc_obj_t hwloc_cudart_get_device_osdev_by_index (hwloc_topology_t topology,
size_t schedsetsize unsigned idx 
-

Convert glibc sched affinity CPU set schedset into hwloc CPU set.

-

This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter.

-

schedsetsize should be sizeof(cpu_set_t) unless schedset was dynamically allocated with CPU_ALLOC

+

Get the hwloc OS device object corresponding to the CUDA device whose index is idx.

+

Return the OS device object describing the CUDA device whose index is idx. Return NULL if there is none.

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the CUDA component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_cudart_get_device_cpuset().

+
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
+
+This function is identical to hwloc_cuda_get_device_osdev_by_index().
- -

◆ hwloc_cpuset_to_glibc_sched_affinity()

+ +

◆ hwloc_cudart_get_device_pci_ids()

@@ -118,28 +161,73 @@
- + - + - - + + + + + + + + - - + + + + + + + + + + + + + + +
static int hwloc_cpuset_to_glibc_sched_affinity static int hwloc_cudart_get_device_pci_ids (hwloc_topology_t hwloc_topology_t  topology,
hwloc_const_cpuset_t hwlocset, int idx,
int * domain,
cpu_set_t * schedset, int * bus,
int * dev 
)
+
+inlinestatic
+
+ +

Return the domain, bus and device IDs of the CUDA device whose index is idx.

+

Device index idx must match the local machine.

+ +
+
+ +

◆ hwloc_cudart_get_device_pcidev()

+ +
+
+ + + @@ -27,41 +27,39 @@
+ + + + + + - - + + @@ -154,9 +242,9 @@
static hwloc_obj_t hwloc_cudart_get_device_pcidev (hwloc_topology_t topology,
size_t schedsetsize int idx 
-

Convert hwloc CPU set toposet into glibc sched affinity CPU set schedset.

-

This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter.

-

schedsetsize should be sizeof(cpu_set_t) unless schedset was dynamically allocated with CPU_ALLOC

+

Get the hwloc PCI device object corresponding to the CUDA device whose index is idx.

+

Return the PCI device object describing the CUDA device whose index is idx. Return NULL if there is none.

+

Topology topology and device idx must match the local machine. I/O devices detection must be enabled in topology topology. The CUDA component is not needed in the topology.

@@ -165,7 +253,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00215.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00215.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00215.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00215.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with OpenCL +Hardware Locality (hwloc): Interoperability with the NVIDIA Management Library @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Interoperability with OpenCL
+
Interoperability with the NVIDIA Management Library
- - - - - - - - + + + + + +

Functions

static int hwloc_opencl_get_device_pci_busid (cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)
 
static int hwloc_opencl_get_device_cpuset (hwloc_topology_t topology, cl_device_id device, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_opencl_get_device_osdev_by_index (hwloc_topology_t topology, unsigned platform_index, unsigned device_index)
 
static hwloc_obj_t hwloc_opencl_get_device_osdev (hwloc_topology_t topology, cl_device_id device)
 
static int hwloc_nvml_get_device_cpuset (hwloc_topology_t topology, nvmlDevice_t device, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_nvml_get_device_osdev_by_index (hwloc_topology_t topology, unsigned idx)
 
static hwloc_obj_t hwloc_nvml_get_device_osdev (hwloc_topology_t topology, nvmlDevice_t device)
 

Detailed Description

-

This interface offers ways to retrieve topology information about OpenCL devices.

-

Only AMD and NVIDIA OpenCL implementations currently offer useful locality information about their devices.

+

This interface offers ways to retrieve topology information about devices managed by the NVIDIA Management Library (NVML).

Function Documentation

- -

◆ hwloc_opencl_get_device_cpuset()

+ +

◆ hwloc_nvml_get_device_cpuset()

@@ -70,21 +68,21 @@ - + - + - + - + @@ -100,16 +98,16 @@
static int hwloc_opencl_get_device_cpuset static int hwloc_nvml_get_device_cpuset (hwloc_topology_t hwloc_topology_t  topology,
cl_device_id nvmlDevice_t  device,
hwloc_cpuset_t hwloc_cpuset_t  set 
-

Get the CPU set of logical processors that are physically close to OpenCL device device.

-

Return the CPU set describing the locality of the OpenCL device device.

-

Topology topology and device device must match the local machine. I/O devices detection and the OpenCL component are not needed in the topology.

-

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_opencl_get_device_osdev() and hwloc_opencl_get_device_osdev_by_index().

-

This function is currently only implemented in a meaningful way for Linux with the AMD or NVIDIA OpenCL implementation; other systems will simply get a full cpuset.

+

Get the CPU set of logical processors that are physically close to NVML device device.

+

Return the CPU set describing the locality of the NVML device device.

+

Topology topology and device device must match the local machine. I/O devices detection and the NVML component are not needed in the topology.

+

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_nvml_get_device_osdev() and hwloc_nvml_get_device_osdev_by_index().

+

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

- -

◆ hwloc_opencl_get_device_osdev()

+ +

◆ hwloc_nvml_get_device_osdev()

@@ -118,15 +116,15 @@ - + - + - + @@ -142,18 +140,15 @@
static hwloc_obj_t hwloc_opencl_get_device_osdev static hwloc_obj_t hwloc_nvml_get_device_osdev (hwloc_topology_t hwloc_topology_t  topology,
cl_device_id nvmlDevice_t  device 
-

Get the hwloc OS device object corresponding to OpenCL device deviceX.

-

Use OpenCL device attributes to find the corresponding hwloc OS device object. Return NULL if there is none or if useful attributes are not available.

-

This function currently only works on AMD and NVIDIA OpenCL devices that support relevant OpenCL extensions. hwloc_opencl_get_device_osdev_by_index() should be preferred whenever possible, i.e. when platform and device index are known.

-

Topology topology and device device must match the local machine. I/O devices detection and the OpenCL component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_opencl_get_device_cpuset().

-
Note
This function cannot work if PCI devices are filtered out.
-
-The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
+

Get the hwloc OS device object corresponding to NVML device device.

+

Return the hwloc OS device object that describes the given NVML device device. Return NULL if there is none.

+

Topology topology and device device must match the local machine. I/O devices detection and the NVML component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_nvml_get_device_cpuset().

+
Note
The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
- -

◆ hwloc_opencl_get_device_osdev_by_index()

+ +

◆ hwloc_nvml_get_device_osdev_by_index()

@@ -162,22 +157,16 @@ - + - + - - - - - - - + @@ -192,76 +181,19 @@
static hwloc_obj_t hwloc_opencl_get_device_osdev_by_index static hwloc_obj_t hwloc_nvml_get_device_osdev_by_index (hwloc_topology_t hwloc_topology_t  topology,
unsigned platform_index,
unsigned device_index idx 
-

Get the hwloc OS device object corresponding to the OpenCL device for the given indexes.

-

Return the OS device object describing the OpenCL device whose platform index is platform_index, and whose device index within this platform if device_index. Return NULL if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the OpenCL component must be enabled in the topology.

+

Get the hwloc OS device object corresponding to the NVML device whose index is idx.

+

Return the OS device object describing the NVML device whose index is idx. Returns NULL if there is none.

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the NVML component must be enabled in the topology.

Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
- -

◆ hwloc_opencl_get_device_pci_busid()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static int hwloc_opencl_get_device_pci_busid (cl_device_id device,
unsigned * domain,
unsigned * bus,
unsigned * dev,
unsigned * func 
)
-
-inlinestatic
-
- -

Return the domain, bus and device IDs of the OpenCL device device.

-

Device device must match the local machine.

- -
-
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00216.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00216.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00216.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00216.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with the CUDA Driver API +Hardware Locality (hwloc): Interoperability with OpenGL displays @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,42 +27,40 @@ - + +/* @license-end */
-
Interoperability with the CUDA Driver API
+
Interoperability with OpenGL displays
- - - - - - - - - - + + + + + +

Functions

static int hwloc_cuda_get_device_pci_ids (hwloc_topology_t topology, CUdevice cudevice, int *domain, int *bus, int *dev)
 
static int hwloc_cuda_get_device_cpuset (hwloc_topology_t topology, CUdevice cudevice, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_cuda_get_device_pcidev (hwloc_topology_t topology, CUdevice cudevice)
 
static hwloc_obj_t hwloc_cuda_get_device_osdev (hwloc_topology_t topology, CUdevice cudevice)
 
static hwloc_obj_t hwloc_cuda_get_device_osdev_by_index (hwloc_topology_t topology, unsigned idx)
 
static hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device (hwloc_topology_t topology, unsigned port, unsigned device)
 
static hwloc_obj_t hwloc_gl_get_display_osdev_by_name (hwloc_topology_t topology, const char *name)
 
static int hwloc_gl_get_display_by_osdev (hwloc_topology_t topology, hwloc_obj_t osdev, unsigned *port, unsigned *device)
 

Detailed Description

-

This interface offers ways to retrieve topology information about CUDA devices when using the CUDA Driver API.

+

This interface offers ways to retrieve topology information about OpenGL displays.

+

Only the NVIDIA display locality information is currently available, using the NV-CONTROL X11 extension and the NVCtrl library.

Function Documentation

- -

◆ hwloc_cuda_get_device_cpuset()

+ +

◆ hwloc_gl_get_display_by_osdev()

@@ -71,64 +69,28 @@ - + - + - - + + - - - - - - - - -
static int hwloc_cuda_get_device_cpuset static int hwloc_gl_get_display_by_osdev (hwloc_topology_t hwloc_topology_t  topology,
CUdevice cudevice, hwloc_obj_t osdev,
hwloc_cpuset_t set 
)
- - -inlinestatic - - -
- -

Get the CPU set of logical processors that are physically close to device cudevice.

-

Return the CPU set describing the locality of the CUDA device cudevice.

-

Topology topology and device cudevice must match the local machine. I/O devices detection and the CUDA component are not needed in the topology.

-

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_cuda_get_device_osdev() and hwloc_cuda_get_device_osdev_by_index().

-

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

- -
-
- -

◆ hwloc_cuda_get_device_osdev()

- -
-
- - - - - -
- - - - - - + + - - + + @@ -143,17 +105,14 @@
static hwloc_obj_t hwloc_cuda_get_device_osdev (hwloc_topology_t topology, unsigned * port,
CUdevice cudevice unsigned * device 
-

Get the hwloc OS device object corresponding to CUDA device cudevice.

-

Return the hwloc OS device object that describes the given CUDA device cudevice. Return NULL if there is none.

-

Topology topology and device cudevice must match the local machine. I/O devices detection and the CUDA component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_cuda_get_device_cpuset().

-
Note
This function cannot work if PCI devices are filtered out.
-
-The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
+

Get the OpenGL display port and device corresponding to the given hwloc OS object.

+

Return the OpenGL display port (server) in port and device (screen) in screen that correspond to the given hwloc OS device object. Return -1 if there is none.

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the GL component must be enabled in the topology.

- -

◆ hwloc_cuda_get_device_osdev_by_index()

+ +

◆ hwloc_gl_get_display_osdev_by_name()

@@ -162,16 +121,16 @@
- + - + - - + + @@ -186,17 +145,15 @@
static hwloc_obj_t hwloc_cuda_get_device_osdev_by_index static hwloc_obj_t hwloc_gl_get_display_osdev_by_name (hwloc_topology_t hwloc_topology_t  topology,
unsigned idx const char * name 
-

Get the hwloc OS device object corresponding to the CUDA device whose index is idx.

-

Return the OS device object describing the CUDA device whose index is idx. Return NULL if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the CUDA component must be enabled in the topology.

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
-
-This function is identical to hwloc_cudart_get_device_osdev_by_index().
+

Get the hwloc OS device object corresponding to the OpenGL display given by name.

+

Return the OS device object describing the OpenGL display whose name is name, built as ":port.device" such as ":0.0" . Return NULL if there is none.

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the GL component must be enabled in the topology.

+
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
- -

◆ hwloc_cuda_get_device_pci_ids()

+ +

◆ hwloc_gl_get_display_osdev_by_port_device()

@@ -205,73 +162,22 @@
- + - + - - - - - - - - - - - - - - - - - - - - - - - - - - -
static int hwloc_cuda_get_device_pci_ids static hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device (hwloc_topology_t hwloc_topology_t  topology,
CUdevice cudevice,
int * domain,
int * bus,
int * dev 
)
-
-inlinestatic
-
- -

Return the domain, bus and device IDs of the CUDA device cudevice.

-

Device cudevice must match the local machine.

- -
-
- -

◆ hwloc_cuda_get_device_pcidev()

- -
-
- - - @@ -27,40 +27,39 @@
- - - - - - + + - - + + @@ -286,9 +192,10 @@
static hwloc_obj_t hwloc_cuda_get_device_pcidev (hwloc_topology_t topology, unsigned port,
CUdevice cudevice unsigned device 
-

Get the hwloc PCI device object corresponding to the CUDA device cudevice.

-

Return the PCI device object describing the CUDA device cudevice. Return NULL if there is none.

-

Topology topology and device cudevice must match the local machine. I/O devices detection must be enabled in topology topology. The CUDA component is not needed in the topology.

+

Get the hwloc OS device object corresponding to the OpenGL display given by port and device index.

+

Return the OS device object describing the OpenGL display whose port (server) is port and device (screen) is device. Return NULL if there is none.

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the GL component must be enabled in the topology.

+
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
@@ -297,7 +204,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00217.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00217.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00217.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00217.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with the CUDA Runtime API +Hardware Locality (hwloc): Interoperability with OpenFabrics @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Interoperability with the CUDA Runtime API
+
Interoperability with OpenFabrics
- - - - - - - - + + + + + +

Functions

static int hwloc_cudart_get_device_pci_ids (hwloc_topology_t topology, int idx, int *domain, int *bus, int *dev)
 
static int hwloc_cudart_get_device_cpuset (hwloc_topology_t topology, int idx, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_cudart_get_device_pcidev (hwloc_topology_t topology, int idx)
 
static hwloc_obj_t hwloc_cudart_get_device_osdev_by_index (hwloc_topology_t topology, unsigned idx)
 
static int hwloc_ibv_get_device_cpuset (hwloc_topology_t topology, struct ibv_device *ibdev, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_ibv_get_device_osdev_by_name (hwloc_topology_t topology, const char *ibname)
 
static hwloc_obj_t hwloc_ibv_get_device_osdev (hwloc_topology_t topology, struct ibv_device *ibdev)
 

Detailed Description

-

This interface offers ways to retrieve topology information about CUDA devices when using the CUDA Runtime API.

+

This interface offers ways to retrieve topology information about OpenFabrics devices (InfiniBand, Omni-Path, usNIC, etc).

Function Documentation

- -

◆ hwloc_cudart_get_device_cpuset()

+ +

◆ hwloc_ibv_get_device_cpuset()

@@ -69,21 +68,21 @@ - + - + - - + + - + @@ -99,16 +98,16 @@
static int hwloc_cudart_get_device_cpuset static int hwloc_ibv_get_device_cpuset (hwloc_topology_t hwloc_topology_t  topology,
int idx, struct ibv_device * ibdev,
hwloc_cpuset_t hwloc_cpuset_t  set 
-

Get the CPU set of logical processors that are physically close to device idx.

-

Return the CPU set describing the locality of the CUDA device whose index is idx.

-

Topology topology and device idx must match the local machine. I/O devices detection and the CUDA component are not needed in the topology.

-

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_cudart_get_device_osdev_by_index().

+

Get the CPU set of logical processors that are physically close to device ibdev.

+

Return the CPU set describing the locality of the OpenFabrics device ibdev (InfiniBand, etc).

+

Topology topology and device ibdev must match the local machine. I/O devices detection is not needed in the topology.

+

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_ibv_get_device_osdev() and hwloc_ibv_get_device_osdev_by_name().

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

- -

◆ hwloc_cudart_get_device_osdev_by_index()

+ +

◆ hwloc_ibv_get_device_osdev()

@@ -117,16 +116,16 @@ - + - + - - + + @@ -141,17 +140,15 @@
static hwloc_obj_t hwloc_cudart_get_device_osdev_by_index static hwloc_obj_t hwloc_ibv_get_device_osdev (hwloc_topology_t hwloc_topology_t  topology,
unsigned idx struct ibv_device * ibdev 
-

Get the hwloc OS device object corresponding to the CUDA device whose index is idx.

-

Return the OS device object describing the CUDA device whose index is idx. Return NULL if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the CUDA component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_cudart_get_device_cpuset().

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
-
-This function is identical to hwloc_cuda_get_device_osdev_by_index().
+

Get the hwloc OS device object corresponding to the OpenFabrics device ibdev.

+

Return the OS device object describing the OpenFabrics device ibdev (InfiniBand, etc). Returns NULL if there is none.

+

Topology topology and device ibdev must match the local machine. I/O devices detection must be enabled in the topology. If not, the locality of the object may still be found using hwloc_ibv_get_device_cpuset().

+
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object.
- -

◆ hwloc_cudart_get_device_pci_ids()

+ +

◆ hwloc_ibv_get_device_osdev_by_name()

@@ -160,73 +157,16 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - -
static int hwloc_cudart_get_device_pci_ids static hwloc_obj_t hwloc_ibv_get_device_osdev_by_name (hwloc_topology_t hwloc_topology_t  topology,
int idx,
int * domain,
int * bus,
int * dev 
)
- - -inlinestatic - - -
- -

Return the domain, bus and device IDs of the CUDA device whose index is idx.

-

Device index idx must match the local machine.

- -
-
- -

◆ hwloc_cudart_get_device_pcidev()

- -
-
- - - @@ -27,62 +27,222 @@
- - - - - - - - - - - - + + @@ -241,9 +181,10 @@
static hwloc_obj_t hwloc_cudart_get_device_pcidev (hwloc_topology_t topology,
int idx const char * ibname 
-

Get the hwloc PCI device object corresponding to the CUDA device whose index is idx.

-

Return the PCI device object describing the CUDA device whose index is idx. Return NULL if there is none.

-

Topology topology and device idx must match the local machine. I/O devices detection must be enabled in topology topology. The CUDA component is not needed in the topology.

+

Get the hwloc OS device object corresponding to the OpenFabrics device named ibname.

+

Return the OS device object describing the OpenFabrics device (InfiniBand, Omni-Path, usNIC, etc) whose name is ibname (mlx5_0, hfi1_0, usnic_0, qib0, etc). Returns NULL if there is none. The name ibname is usually obtained from ibv_get_device_name().

+

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection must be enabled in the topology.

+
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object.
@@ -252,7 +193,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00218.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00218.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00218.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00218.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with the NVIDIA Management Library +Hardware Locality (hwloc): Topology differences @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
- + +/* @license-end */
-
Interoperability with the NVIDIA Management Library
+
Topology differences
+ + + + + +

+Data Structures

union  hwloc_topology_diff_obj_attr_u
 
union  hwloc_topology_diff_u
 
+ + + + + + + +

+Typedefs

typedef enum hwloc_topology_diff_obj_attr_type_e hwloc_topology_diff_obj_attr_type_t
 
typedef enum hwloc_topology_diff_type_e hwloc_topology_diff_type_t
 
typedef union hwloc_topology_diff_uhwloc_topology_diff_t
 
+ + + + + + + +

+Enumerations

enum  hwloc_topology_diff_obj_attr_type_e { HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE, +HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME, +HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO + }
 
enum  hwloc_topology_diff_type_e { HWLOC_TOPOLOGY_DIFF_OBJ_ATTR, +HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX + }
 
enum  hwloc_topology_diff_apply_flags_e { HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE + }
 
- - - - - - + + + + + + + + + + + + + +

Functions

static int hwloc_nvml_get_device_cpuset (hwloc_topology_t topology, nvmlDevice_t device, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_nvml_get_device_osdev_by_index (hwloc_topology_t topology, unsigned idx)
 
static hwloc_obj_t hwloc_nvml_get_device_osdev (hwloc_topology_t topology, nvmlDevice_t device)
 
int hwloc_topology_diff_build (hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff)
 
int hwloc_topology_diff_apply (hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags)
 
int hwloc_topology_diff_destroy (hwloc_topology_diff_t diff)
 
int hwloc_topology_diff_load_xml (const char *xmlpath, hwloc_topology_diff_t *diff, char **refname)
 
int hwloc_topology_diff_export_xml (hwloc_topology_diff_t diff, const char *refname, const char *xmlpath)
 
int hwloc_topology_diff_load_xmlbuffer (const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname)
 
int hwloc_topology_diff_export_xmlbuffer (hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen)
 

Detailed Description

-

This interface offers ways to retrieve topology information about devices managed by the NVIDIA Management Library (NVML).

+

Applications that manipulate many similar topologies, for instance one for each node of a homogeneous cluster, may want to compress topologies to reduce the memory footprint.

+

This file offers a way to manipulate the difference between topologies and export/import it to/from XML. Compression may therefore be achieved by storing one topology entirely while the others are only described by their differences with the former. The actual topology can be reconstructed when actually needed by applying the precomputed difference to the reference topology.

+

This interface targets very similar nodes. Only very simple differences between topologies are actually supported, for instance a change in the memory size, the name of the object, or some info attribute. More complex differences such as adding or removing objects cannot be represented in the difference structures and therefore return errors. Differences between object sets or topology-wide allowed sets, cannot be represented either.

+

It means that there is no need to apply the difference when looking at the tree organization (how many levels, how many objects per level, what kind of objects, CPU and node sets, etc) and when binding to objects. However the difference must be applied when looking at object attributes such as the name, the memory size or info attributes.

+

Typedef Documentation

+ +

◆ hwloc_topology_diff_obj_attr_type_t

+ +
+
+ +

Type of one object attribute difference.

+ +
+
+ +

◆ hwloc_topology_diff_t

+ +
+
+ + + + +
typedef union hwloc_topology_diff_u * hwloc_topology_diff_t
+
+ +

One element of a difference list between two topologies.

+ +
+
+ +

◆ hwloc_topology_diff_type_t

+ +
+
+ +

Type of one element of a difference list.

+ +
+
+

Enumeration Type Documentation

+ +

◆ hwloc_topology_diff_apply_flags_e

+ +
+
+ +

Flags to be given to hwloc_topology_diff_apply().

+ + +
Enumerator
HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE 

Apply topology diff in reverse direction.

+
+ +
+
+ +

◆ hwloc_topology_diff_obj_attr_type_e

+ +
+
+ +

Type of one object attribute difference.

+ + + + +
Enumerator
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE 

The object local memory is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s (and the index field is ignored).

+
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME 

The object name is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s (and the name field is ignored).

+
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO 

the value of an info attribute is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s.

+
+ +
+
+ +

◆ hwloc_topology_diff_type_e

+ +
+
+ + + + +
enum hwloc_topology_diff_type_e
+
+ +

Type of one element of a difference list.

+ + + +
Enumerator
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR 

An object attribute was changed. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_s.

+
HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX 

The difference is too complex, it cannot be represented. The difference below this object has not been checked. hwloc_topology_diff_build() will return 1.

+

The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_too_complex_s.

+
+ +
+

Function Documentation

- -

◆ hwloc_nvml_get_device_cpuset()

+ +

◆ hwloc_topology_diff_apply()

- - - - - -
- + - + - - + + - - + + @@ -90,41 +250,47 @@
static int hwloc_nvml_get_device_cpuset int hwloc_topology_diff_apply (hwloc_topology_t hwloc_topology_t  topology,
nvmlDevice_t device, hwloc_topology_diff_t diff,
hwloc_cpuset_t set unsigned long flags 
-
-inlinestatic
-

Get the CPU set of logical processors that are physically close to NVML device device.

-

Return the CPU set describing the locality of the NVML device device.

-

Topology topology and device device must match the local machine. I/O devices detection and the NVML component are not needed in the topology.

-

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_nvml_get_device_osdev() and hwloc_nvml_get_device_osdev_by_index().

-

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

+

Apply a topology diff to an existing topology.

+

flags is an OR'ed set of hwloc_topology_diff_apply_flags_e.

+

The new topology is modified in place. hwloc_topology_dup() may be used to duplicate it before patching.

+

If the difference cannot be applied entirely, all previous applied elements are unapplied before returning.

+
Returns
0 on success.
+
+-N if applying the difference failed while trying to apply the N-th part of the difference. For instance -1 is returned if the very first difference element could not be applied.
- -

◆ hwloc_nvml_get_device_osdev()

+ +

◆ hwloc_topology_diff_build()

- - - - - -
- + - + - - + + + + + + + + + + + + + + @@ -132,40 +298,197 @@
static hwloc_obj_t hwloc_nvml_get_device_osdev int hwloc_topology_diff_build (hwloc_topology_t hwloc_topology_t  topology,
nvmlDevice_t device hwloc_topology_t newtopology,
unsigned long flags,
hwloc_topology_diff_tdiff 
-
-inlinestatic
-

Get the hwloc OS device object corresponding to NVML device device.

-

Return the hwloc OS device object that describes the given NVML device device. Return NULL if there is none.

-

Topology topology and device device must match the local machine. I/O devices detection and the NVML component must be enabled in the topology. If not, the locality of the object may still be found using hwloc_nvml_get_device_cpuset().

-
Note
The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out).
+

Compute the difference between 2 topologies.

+

The difference is stored as a list of hwloc_topology_diff_t entries starting at diff. It is computed by doing a depth-first traversal of both topology trees simultaneously.

+

If the difference between 2 objects is too complex to be represented (for instance if some objects have different types, or different numbers of children), a special diff entry of type HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX is queued. The computation of the diff does not continue below these objects. So each such diff entry means that the difference between two subtrees could not be computed.

+
Returns
0 if the difference can be represented properly.
+
+0 with diff pointing to NULL if there is no difference between the topologies.
+
+1 if the difference is too complex (see above). Some entries in the list will be of type HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX.
+
+-1 on any other error.
+
Note
flags is currently not used. It should be 0.
+
+The output diff has to be freed with hwloc_topology_diff_destroy().
+
+The output diff can only be exported to XML or passed to hwloc_topology_diff_apply() if 0 was returned, i.e. if no entry of type HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX is listed.
+
+The output diff may be modified by removing some entries from the list. The removed entries should be freed by passing them to to hwloc_topology_diff_destroy() (possible as another list).
- -

◆ hwloc_nvml_get_device_osdev_by_index()

+ +

◆ hwloc_topology_diff_destroy()

- - - - - -
- + - - + + + + +
static hwloc_obj_t hwloc_nvml_get_device_osdev_by_index int hwloc_topology_diff_destroy (hwloc_topology_t topology, hwloc_topology_diff_t diff)
+
+ +

Destroy a list of topology differences.

+ +
+ + +

◆ hwloc_topology_diff_export_xml()

+ +
+
+ + + + + + - - + + + + + + + + + + + + + + +
int hwloc_topology_diff_export_xml (hwloc_topology_diff_t diff,
unsigned idx const char * refname,
const char * xmlpath 
)
+
+ +

Export a list of topology differences to a XML file.

+

If not NULL, refname defines an identifier string for the reference topology which was used as a base when computing this difference. This identifier is usually the name of the other XML file that contains the reference topology. This attribute is given back when reading the diff from XML.

+ +
+
+ +

◆ hwloc_topology_diff_export_xmlbuffer()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_topology_diff_export_xmlbuffer (hwloc_topology_diff_t diff,
const char * refname,
char ** xmlbuffer,
int * buflen 
)
+
+ +

Export a list of topology differences to a XML buffer.

+

If not NULL, refname defines an identifier string for the reference topology which was used as a base when computing this difference. This identifier is usually the name of the other XML file that contains the reference topology. This attribute is given back when reading the diff from XML.

+

The returned buffer ends with a \0 that is included in the returned length.

+
Note
The XML buffer should later be freed with hwloc_free_xmlbuffer().
+ +
+
+ +

◆ hwloc_topology_diff_load_xml()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int hwloc_topology_diff_load_xml (const char * xmlpath,
hwloc_topology_diff_tdiff,
char ** refname 
)
+
+ +

Load a list of topology differences from a XML file.

+

If not NULL, refname will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file. This identifier is usually the name of the other XML file that contains the reference topology.

+
Note
the pointer returned in refname should later be freed by the caller.
+ +
+
+ +

◆ hwloc_topology_diff_load_xmlbuffer()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + @@ -173,17 +496,11 @@
int hwloc_topology_diff_load_xmlbuffer (const char * xmlbuffer,
int buflen,
hwloc_topology_diff_tdiff,
char ** refname 
-
-inlinestatic
-

Get the hwloc OS device object corresponding to the NVML device whose index is idx.

-

Return the OS device object describing the NVML device whose index is idx. Returns NULL if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the NVML component must be enabled in the topology.

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
+

Load a list of topology differences from a XML buffer.

+

If not NULL, refname will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file. This identifier is usually the name of the other XML file that contains the reference topology.

+
Note
the pointer returned in refname should later be freed by the caller.
@@ -192,7 +509,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00219.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00219.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00219.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00219.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with OpenGL displays +Hardware Locality (hwloc): Sharing topologies between processes @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,69 +27,82 @@
- + +/* @license-end */
-
Interoperability with OpenGL displays
+
Sharing topologies between processes
- - - - - - + + + + + +

Functions

static hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device (hwloc_topology_t topology, unsigned port, unsigned device)
 
static hwloc_obj_t hwloc_gl_get_display_osdev_by_name (hwloc_topology_t topology, const char *name)
 
static int hwloc_gl_get_display_by_osdev (hwloc_topology_t topology, hwloc_obj_t osdev, unsigned *port, unsigned *device)
 
int hwloc_shmem_topology_get_length (hwloc_topology_t topology, size_t *lengthp, unsigned long flags)
 
int hwloc_shmem_topology_write (hwloc_topology_t topology, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
 
int hwloc_shmem_topology_adopt (hwloc_topology_t *topologyp, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
 

Detailed Description

-

This interface offers ways to retrieve topology information about OpenGL displays.

-

Only the NVIDIA display locality information is currently available, using the NV-CONTROL X11 extension and the NVCtrl library.

+

These functions are used to share a topology between processes by duplicating it into a file-backed shared-memory buffer.

+

The master process must first get the required shared-memory size for storing this topology with hwloc_shmem_topology_get_length().

+

Then it must find a virtual memory area of that size that is available in all processes (identical virtual addresses in all processes). On Linux, this can be done by comparing holes found in /proc/<pid>/maps for each process.

+

Once found, it must open a destination file for storing the buffer, and pass it to hwloc_shmem_topology_write() together with virtual memory address and length obtained above.

+

Other processes may then adopt this shared topology by opening the same file and passing it to hwloc_shmem_topology_adopt() with the exact same virtual memory address and length.

Function Documentation

- -

◆ hwloc_gl_get_display_by_osdev()

+ +

◆ hwloc_shmem_topology_adopt()

- - - - - -
- + - - + + + + + + + + + + + + + + - - + + - - + + - - + + @@ -97,39 +110,50 @@
static int hwloc_gl_get_display_by_osdev int hwloc_shmem_topology_adopt (hwloc_topology_t topology, hwloc_topology_ttopologyp,
int fd,
hwloc_uint64_t fileoffset,
hwloc_obj_t osdev, void * mmap_address,
unsigned * port, size_t length,
unsigned * device unsigned long flags 
-
-inlinestatic
-

Get the OpenGL display port and device corresponding to the given hwloc OS object.

-

Return the OpenGL display port (server) in port and device (screen) in screen that correspond to the given hwloc OS device object. Return -1 if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the GL component must be enabled in the topology.

+

Adopt a shared memory topology stored in a file.

+

Map a file in virtual memory and adopt the topology that was previously stored there with hwloc_shmem_topology_write().

+

The returned adopted topology in topologyp can be used just like any topology. And it must be destroyed with hwloc_topology_destroy() as usual.

+

However the topology is read-only. For instance, it cannot be modified with hwloc_topology_restrict() and object userdata pointers cannot be changed.

+

The segment of the file pointed by descriptor fd, starting at offset fileoffset, and of length length (in bytes), will be mapped at virtual address mmap_address.

+

The file pointed by descriptor fd, the offset fileoffset, the requested mapping virtual address mmap_address and the length length must be identical to what was given to hwloc_shmem_topology_write() earlier.

+
Note
Flags flags are currently unused, must be 0.
+
+The object userdata pointer should not be used unless the process that created the shared topology also placed userdata-pointed buffers in shared memory.
+
+This function takes care of calling hwloc_topology_abi_check().
+
Returns
-1 with errno set to EBUSY if the virtual memory mapping defined by mmap_address and length isn't available in the process.
+
+-1 with errno set to EINVAL if fileoffset, mmap_address or length aren't page-aligned, or do not match what was given to hwloc_shmem_topology_write() earlier.
+
+-1 with errno set to EINVAL if the layout of the topology structure is different between the writer process and the adopter process.
- -

◆ hwloc_gl_get_display_osdev_by_name()

+ +

◆ hwloc_shmem_topology_get_length()

- - - - - -
- + - + - - + + + + + + + + @@ -137,46 +161,55 @@
static hwloc_obj_t hwloc_gl_get_display_osdev_by_name int hwloc_shmem_topology_get_length (hwloc_topology_t hwloc_topology_t  topology,
const char * name size_t * lengthp,
unsigned long flags 
-
-inlinestatic
-

Get the hwloc OS device object corresponding to the OpenGL display given by name.

-

Return the OS device object describing the OpenGL display whose name is name, built as ":port.device" such as ":0.0" . Return NULL if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the GL component must be enabled in the topology.

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
+

Get the required shared memory length for storing a topology.

+

This length (in bytes) must be used in hwloc_shmem_topology_write() and hwloc_shmem_topology_adopt() later.

+
Note
Flags flags are currently unused, must be 0.
- -

◆ hwloc_gl_get_display_osdev_by_port_device()

+ +

◆ hwloc_shmem_topology_write()

- - - - - -
- + - + - - + + + + + + + + - - + + + + + + + + + + + + + + @@ -184,17 +217,18 @@
static hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device int hwloc_shmem_topology_write (hwloc_topology_t hwloc_topology_t  topology,
unsigned port, int fd,
hwloc_uint64_t fileoffset,
unsigned device void * mmap_address,
size_t length,
unsigned long flags 
-
-inlinestatic
-

Get the hwloc OS device object corresponding to the OpenGL display given by port and device index.

-

Return the OS device object describing the OpenGL display whose port (server) is port and device (screen) is device. Return NULL if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the GL component must be enabled in the topology.

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).
+

Duplicate a topology to a shared memory file.

+

Temporarily map a file in virtual memory and duplicate the topology topology by allocating duplicates in there.

+

The segment of the file pointed by descriptor fd, starting at offset fileoffset, and of length length (in bytes), will be temporarily mapped at virtual address mmap_address during the duplication.

+

The mapping length length must have been previously obtained with hwloc_shmem_topology_get_length() and the topology must not have been modified in the meantime.

+
Note
Flags flags are currently unused, must be 0.
+
+The object userdata pointer is duplicated but the pointed buffer is not. However the caller may also allocate it manually in shared memory to share it as well.
+
Returns
-1 with errno set to EBUSY if the virtual memory mapping defined by mmap_address and length isn't available in the process.
+
+-1 with errno set to EINVAL if fileoffset, mmap_address or length aren't page-aligned.
@@ -203,7 +237,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00220.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00220.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00220.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00220.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with Intel Xeon Phi (MIC) +Hardware Locality (hwloc): Components and Plugins: Discovery components @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,129 +27,37 @@
- + +/* @license-end */
-
Interoperability with Intel Xeon Phi (MIC)
+
Components and Plugins: Discovery components
- - - - - + + +

-Functions

static int hwloc_intel_mic_get_device_cpuset (hwloc_topology_t topology, int idx, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_intel_mic_get_device_osdev_by_index (hwloc_topology_t topology, unsigned idx)
 

+Data Structures

struct  hwloc_disc_component
 

Detailed Description

-

This interface offers ways to retrieve topology information about Intel Xeon Phi (MIC) devices.

-

Function Documentation

- -

◆ hwloc_intel_mic_get_device_cpuset()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
static int hwloc_intel_mic_get_device_cpuset (hwloc_topology_t topology,
int idx,
hwloc_cpuset_t set 
)
-
-inlinestatic
-
- -

Get the CPU set of logical processors that are physically close to MIC device whose index is idx.

-

Return the CPU set describing the locality of the MIC device whose index is idx.

-

Topology topology and device index idx must match the local machine. I/O devices detection is not needed in the topology.

-

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_intel_mic_get_device_osdev_by_index().

-

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

- -
-
- -

◆ hwloc_intel_mic_get_device_osdev_by_index()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
static hwloc_obj_t hwloc_intel_mic_get_device_osdev_by_index (hwloc_topology_t topology,
unsigned idx 
)
-
-inlinestatic
-
- -

Get the hwloc OS device object corresponding to the MIC device for the given index.

-

Return the OS device object describing the MIC device whose index is idx. Return NULL if there is none.

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection must be enabled in the topology.

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object.
- -
-
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00221.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00221.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00221.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00221.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability with OpenFabrics +Hardware Locality (hwloc): Components and Plugins: Discovery backends @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,104 +27,157 @@ - + +/* @license-end */
-
Interoperability with OpenFabrics
+
Components and Plugins: Discovery backends
+ + + + + +

+Data Structures

struct  hwloc_disc_status
 
struct  hwloc_backend
 
+ + + +

+Typedefs

typedef enum hwloc_disc_phase_e hwloc_disc_phase_t
 
+ + + + + +

+Enumerations

enum  hwloc_disc_phase_e {
+  HWLOC_DISC_PHASE_GLOBAL, +HWLOC_DISC_PHASE_CPU, +HWLOC_DISC_PHASE_MEMORY, +HWLOC_DISC_PHASE_PCI, +
+  HWLOC_DISC_PHASE_IO, +HWLOC_DISC_PHASE_MISC, +HWLOC_DISC_PHASE_ANNOTATE, +HWLOC_DISC_PHASE_TWEAK +
+ }
 
enum  hwloc_disc_status_flag_e { HWLOC_DISC_STATUS_FLAG_GOT_ALLOWED_RESOURCES + }
 
- - - - - - + + + +

Functions

static int hwloc_ibv_get_device_cpuset (hwloc_topology_t topology, struct ibv_device *ibdev, hwloc_cpuset_t set)
 
static hwloc_obj_t hwloc_ibv_get_device_osdev_by_name (hwloc_topology_t topology, const char *ibname)
 
static hwloc_obj_t hwloc_ibv_get_device_osdev (hwloc_topology_t topology, struct ibv_device *ibdev)
 
struct hwloc_backendhwloc_backend_alloc (struct hwloc_topology *topology, struct hwloc_disc_component *component)
 
int hwloc_backend_enable (struct hwloc_backend *backend)
 

Detailed Description

-

This interface offers ways to retrieve topology information about OpenFabrics devices (InfiniBand, Omni-Path, usNIC, etc).

-

Function Documentation

- -

◆ hwloc_ibv_get_device_cpuset()

+

Typedef Documentation

+ +

◆ hwloc_disc_phase_t

- - - - - -
- - - - - - - - - - + +
static int hwloc_ibv_get_device_cpuset (hwloc_topology_t topology,
struct ibv_device * ibdev, typedef enum hwloc_disc_phase_e hwloc_disc_phase_t
+
+ +

Discovery phase.

+ +
+ +

Enumeration Type Documentation

+ +

◆ hwloc_disc_phase_e

+ +
+
+ - - - - + +
hwloc_cpuset_t set enum hwloc_disc_phase_e
+
+ +

Discovery phase.

+ + + + + + + + + +
Enumerator
HWLOC_DISC_PHASE_GLOBAL 

xml or synthetic, platform-specific components such as bgq. Discovers everything including CPU, memory, I/O and everything else. A component with a Global phase usually excludes all other phases.

+
HWLOC_DISC_PHASE_CPU 

CPU discovery.

+
HWLOC_DISC_PHASE_MEMORY 

Attach memory to existing CPU objects.

+
HWLOC_DISC_PHASE_PCI 

Attach PCI devices and bridges to existing CPU objects.

+
HWLOC_DISC_PHASE_IO 

I/O discovery that requires PCI devices (OS devices such as OpenCL, CUDA, etc.).

+
HWLOC_DISC_PHASE_MISC 

Misc objects that gets added below anything else.

+
HWLOC_DISC_PHASE_ANNOTATE 

Annotating existing objects, adding distances, etc.

+
HWLOC_DISC_PHASE_TWEAK 

Final tweaks to a ready-to-use topology. This phase runs once the topology is loaded, before it is returned to the topology. Hence it may only use the main hwloc API for modifying the topology, for instance by restricting it, adding info attributes, etc.

+
+ +
+
+ +

◆ hwloc_disc_status_flag_e

+ +
+
+ - - - +
)enum hwloc_disc_status_flag_e
-
-inlinestatic
-

Get the CPU set of logical processors that are physically close to device ibdev.

-

Return the CPU set describing the locality of the OpenFabrics device ibdev (InfiniBand, etc).

-

Topology topology and device ibdev must match the local machine. I/O devices detection is not needed in the topology.

-

The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see hwloc_ibv_get_device_osdev() and hwloc_ibv_get_device_osdev_by_name().

-

This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset.

+

Discovery status flags.

+ + +
Enumerator
HWLOC_DISC_STATUS_FLAG_GOT_ALLOWED_RESOURCES 

The sets of allowed resources were already retrieved.

+
- -

◆ hwloc_ibv_get_device_osdev()

+

Function Documentation

+ +

◆ hwloc_backend_alloc()

- - - - - -
- + - + - - + + @@ -132,58 +185,29 @@
static hwloc_obj_t hwloc_ibv_get_device_osdev struct hwloc_backend* hwloc_backend_alloc (hwloc_topology_t struct hwloc_topology *  topology,
struct ibv_device * ibdev struct hwloc_disc_componentcomponent 
-
-inlinestatic
-

Get the hwloc OS device object corresponding to the OpenFabrics device ibdev.

-

Return the OS device object describing the OpenFabrics device ibdev (InfiniBand, etc). Returns NULL if there is none.

-

Topology topology and device ibdev must match the local machine. I/O devices detection must be enabled in the topology. If not, the locality of the object may still be found using hwloc_ibv_get_device_cpuset().

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object.
+

Allocate a backend structure, set good default values, initialize backend->component and topology, etc. The caller will then modify whatever needed, and call hwloc_backend_enable().

- -

◆ hwloc_ibv_get_device_osdev_by_name()

+ +

◆ hwloc_backend_enable()

- - - - - -
- + - - - - - - - - - - + + - -
static hwloc_obj_t hwloc_ibv_get_device_osdev_by_name int hwloc_backend_enable (hwloc_topology_t topology,
const char * ibname 
struct hwloc_backendbackend) )
-
-inlinestatic
-

Get the hwloc OS device object corresponding to the OpenFabrics device named ibname.

-

Return the OS device object describing the OpenFabrics device (InfiniBand, Omni-Path, usNIC, etc) whose name is ibname (mlx5_0, hfi1_0, usnic_0, qib0, etc). Returns NULL if there is none. The name ibname is usually obtained from ibv_get_device_name().

-

The topology topology does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection must be enabled in the topology.

-
Note
The corresponding PCI device object can be obtained by looking at the OS device parent object.
+

Enable a previously allocated and setup backend.

@@ -192,7 +216,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00222.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00222.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00222.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00222.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Topology differences +Hardware Locality (hwloc): Components and Plugins: Generic components @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,488 +27,91 @@
- + +/* @license-end */
-
Topology differences
+
Components and Plugins: Generic components
- - - +

Data Structures

union  hwloc_topology_diff_obj_attr_u
 
union  hwloc_topology_diff_u
struct  hwloc_component
 
- - - - - - + +

Typedefs

typedef enum hwloc_topology_diff_obj_attr_type_e hwloc_topology_diff_obj_attr_type_t
 
typedef enum hwloc_topology_diff_type_e hwloc_topology_diff_type_t
 
typedef union hwloc_topology_diff_uhwloc_topology_diff_t
 
typedef enum hwloc_component_type_e hwloc_component_type_t
 
- - - - - - -

Enumerations

enum  hwloc_topology_diff_obj_attr_type_e { HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE, -HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME, -HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO - }
 
enum  hwloc_topology_diff_type_e { HWLOC_TOPOLOGY_DIFF_OBJ_ATTR, -HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX - }
 
enum  hwloc_topology_diff_apply_flags_e { HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE +
enum  hwloc_component_type_e { HWLOC_COMPONENT_TYPE_DISC, +HWLOC_COMPONENT_TYPE_XML }
 
- - - - - - - - - - - - - - - +

-Functions

int hwloc_topology_diff_build (hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff)
 
int hwloc_topology_diff_apply (hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags)
 
int hwloc_topology_diff_destroy (hwloc_topology_diff_t diff)
 
int hwloc_topology_diff_load_xml (const char *xmlpath, hwloc_topology_diff_t *diff, char **refname)
 
int hwloc_topology_diff_export_xml (hwloc_topology_diff_t diff, const char *refname, const char *xmlpath)
 
int hwloc_topology_diff_load_xmlbuffer (const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname)
 
int hwloc_topology_diff_export_xmlbuffer (hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen)
 
 

Detailed Description

-

Applications that manipulate many similar topologies, for instance one for each node of a homogeneous cluster, may want to compress topologies to reduce the memory footprint.

-

This file offers a way to manipulate the difference between topologies and export/import it to/from XML. Compression may therefore be achieved by storing one topology entirely while the others are only described by their differences with the former. The actual topology can be reconstructed when actually needed by applying the precomputed difference to the reference topology.

-

This interface targets very similar nodes. Only very simple differences between topologies are actually supported, for instance a change in the memory size, the name of the object, or some info attribute. More complex differences such as adding or removing objects cannot be represented in the difference structures and therefore return errors. Differences between object sets or topology-wide allowed sets, cannot be represented either.

-

It means that there is no need to apply the difference when looking at the tree organization (how many levels, how many objects per level, what kind of objects, CPU and node sets, etc) and when binding to objects. However the difference must be applied when looking at object attributes such as the name, the memory size or info attributes.

Typedef Documentation

- -

◆ hwloc_topology_diff_obj_attr_type_t

- -
-
- -

Type of one object attribute difference.

- -
-
- -

◆ hwloc_topology_diff_t

+ +

◆ hwloc_component_type_t

-

One element of a difference list between two topologies.

- -
-
- -

◆ hwloc_topology_diff_type_t

- -
-
- -

Type of one element of a difference list.

+

Generic component type.

Enumeration Type Documentation

- -

◆ hwloc_topology_diff_apply_flags_e

+ +

◆ hwloc_component_type_e

-

Flags to be given to hwloc_topology_diff_apply().

+

Generic component type.

- -
Enumerator
HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE 

Apply topology diff in reverse direction.

+
Enumerator
HWLOC_COMPONENT_TYPE_DISC 

The data field must point to a struct hwloc_disc_component.

- -
-
- -

◆ hwloc_topology_diff_obj_attr_type_e

- -
-
- -

Type of one object attribute difference.

- - - -
Enumerator
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE 

The object local memory is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s (and the index field is ignored).

-
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME 

The object name is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s (and the name field is ignored).

-
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO 

the value of an info attribute is modified. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s.

+
HWLOC_COMPONENT_TYPE_XML 

The data field must point to a struct hwloc_xml_component.

- -

◆ hwloc_topology_diff_type_e

- -
-
- - - - -
enum hwloc_topology_diff_type_e
-
- -

Type of one element of a difference list.

- - - -
Enumerator
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR 

An object attribute was changed. The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_s.

-
HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX 

The difference is too complex, it cannot be represented. The difference below this object has not been checked. hwloc_topology_diff_build() will return 1.

-

The union is a hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_too_complex_s.

-
- -
-
-

Function Documentation

- -

◆ hwloc_topology_diff_apply()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_topology_diff_apply (hwloc_topology_t topology,
hwloc_topology_diff_t diff,
unsigned long flags 
)
-
- -

Apply a topology diff to an existing topology.

-

flags is an OR'ed set of hwloc_topology_diff_apply_flags_e.

-

The new topology is modified in place. hwloc_topology_dup() may be used to duplicate it before patching.

-

If the difference cannot be applied entirely, all previous applied elements are unapplied before returning.

-
Returns
0 on success.
-
--N if applying the difference failed while trying to apply the N-th part of the difference. For instance -1 is returned if the very first difference element could not be applied.
- -
-
- -

◆ hwloc_topology_diff_build()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_topology_diff_build (hwloc_topology_t topology,
hwloc_topology_t newtopology,
unsigned long flags,
hwloc_topology_diff_tdiff 
)
-
- -

Compute the difference between 2 topologies.

-

The difference is stored as a list of hwloc_topology_diff_t entries starting at diff. It is computed by doing a depth-first traversal of both topology trees simultaneously.

-

If the difference between 2 objects is too complex to be represented (for instance if some objects have different types, or different numbers of children), a special diff entry of type HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX is queued. The computation of the diff does not continue below these objects. So each such diff entry means that the difference between two subtrees could not be computed.

-
Returns
0 if the difference can be represented properly.
-
-0 with diff pointing to NULL if there is no difference between the topologies.
-
-1 if the difference is too complex (see above). Some entries in the list will be of type HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX.
-
--1 on any other error.
-
Note
flags is currently not used. It should be 0.
-
-The output diff has to be freed with hwloc_topology_diff_destroy().
-
-The output diff can only be exported to XML or passed to hwloc_topology_diff_apply() if 0 was returned, i.e. if no entry of type HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX is listed.
-
-The output diff may be modified by removing some entries from the list. The removed entries should be freed by passing them to to hwloc_topology_diff_destroy() (possible as another list).
- -
-
- -

◆ hwloc_topology_diff_destroy()

- -
-
- - - - - - - - -
int hwloc_topology_diff_destroy (hwloc_topology_diff_t diff)
-
- -

Destroy a list of topology differences.

- -
-
- -

◆ hwloc_topology_diff_export_xml()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_topology_diff_export_xml (hwloc_topology_diff_t diff,
const char * refname,
const char * xmlpath 
)
-
- -

Export a list of topology differences to a XML file.

-

If not NULL, refname defines an identifier string for the reference topology which was used as a base when computing this difference. This identifier is usually the name of the other XML file that contains the reference topology. This attribute is given back when reading the diff from XML.

- -
-
- -

◆ hwloc_topology_diff_export_xmlbuffer()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_topology_diff_export_xmlbuffer (hwloc_topology_diff_t diff,
const char * refname,
char ** xmlbuffer,
int * buflen 
)
-
- -

Export a list of topology differences to a XML buffer.

-

If not NULL, refname defines an identifier string for the reference topology which was used as a base when computing this difference. This identifier is usually the name of the other XML file that contains the reference topology. This attribute is given back when reading the diff from XML.

-

The returned buffer ends with a \0 that is included in the returned length.

-
Note
The XML buffer should later be freed with hwloc_free_xmlbuffer().
- -
-
- -

◆ hwloc_topology_diff_load_xml()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_topology_diff_load_xml (const char * xmlpath,
hwloc_topology_diff_tdiff,
char ** refname 
)
-
- -

Load a list of topology differences from a XML file.

-

If not NULL, refname will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file. This identifier is usually the name of the other XML file that contains the reference topology.

-
Note
the pointer returned in refname should later be freed by the caller.
- -
-
- -

◆ hwloc_topology_diff_load_xmlbuffer()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_topology_diff_load_xmlbuffer (const char * xmlbuffer,
int buflen,
hwloc_topology_diff_tdiff,
char ** refname 
)
-
- -

Load a list of topology differences from a XML buffer.

-

If not NULL, refname will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file. This identifier is usually the name of the other XML file that contains the reference topology.

-
Note
the pointer returned in refname should later be freed by the caller.
- -
-
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00223.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00223.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00223.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00223.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Sharing topologies between processes +Hardware Locality (hwloc): Components and Plugins: Core functions to be used by components @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,81 +27,137 @@ - + +/* @license-end */
-
Sharing topologies between processes
+
Components and Plugins: Core functions to be used by components
+ + + +

+Typedefs

typedef void(* hwloc_report_error_t) (const char *msg, int line)
 
- - - - - - + + + + + + + + + + + + + + + + + +

Functions

int hwloc_shmem_topology_get_length (hwloc_topology_t topology, size_t *lengthp, unsigned long flags)
 
int hwloc_shmem_topology_write (hwloc_topology_t topology, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
 
int hwloc_shmem_topology_adopt (hwloc_topology_t *topologyp, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags)
 
struct hwloc_objhwloc_insert_object_by_cpuset (struct hwloc_topology *topology, hwloc_obj_t obj)
 
void hwloc_report_os_error (const char *msg, int line)
 
int hwloc_hide_errors (void)
 
struct hwloc_objhwloc__insert_object_by_cpuset (struct hwloc_topology *topology, hwloc_obj_t root, hwloc_obj_t obj, hwloc_report_error_t report_error)
 
void hwloc_insert_object_by_parent (struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj)
 
hwloc_obj_t hwloc_alloc_setup_object (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned os_index)
 
int hwloc_obj_add_children_sets (hwloc_obj_t obj)
 
int hwloc_topology_reconnect (hwloc_topology_t topology, unsigned long flags)
 
static int hwloc_plugin_check_namespace (const char *pluginname, const char *symbol)
 

Detailed Description

-

These functions are used to share a topology between processes by duplicating it into a file-backed shared-memory buffer.

-

The master process must first get the required shared-memory size for storing this topology with hwloc_shmem_topology_get_length().

-

Then it must find a virtual memory area of that size that is available in all processes (identical virtual addresses in all processes). On Linux, this can be done by comparing holes found in /proc/<pid>/maps for each process.

-

Once found, it must open a destination file for storing the buffer, and pass it to hwloc_shmem_topology_write() together with virtual memory address and length obtained above.

-

Other processes may then adopt this shared topology by opening the same file and passing it to hwloc_shmem_topology_adopt() with the exact same virtual memory address and length.

+

Typedef Documentation

+ +

◆ hwloc_report_error_t

+ +
+
+ + + + +
typedef void(* hwloc_report_error_t) (const char *msg, int line)
+
+ +

Type of error callbacks during object insertion.

+ +
+

Function Documentation

- -

◆ hwloc_shmem_topology_adopt()

+ +

◆ hwloc__insert_object_by_cpuset()

- + - - + + - - + + - - + + - - + + + + + + + + +
int hwloc_shmem_topology_adopt struct hwloc_obj* hwloc__insert_object_by_cpuset (hwloc_topology_ttopologyp, struct hwloc_topology * topology,
int fd, hwloc_obj_t root,
hwloc_uint64_t fileoffset, hwloc_obj_t obj,
void * mmap_address, hwloc_report_error_t report_error 
)
+
+ +

Add an object to the topology and specify which error callback to use.

+

This function is similar to hwloc_insert_object_by_cpuset() but it allows specifying where to start insertion from (if root is NULL, the topology root object is used), and specifying the error callback.

+ +
+
+ +

◆ hwloc_alloc_setup_object()

+ +
+
+ + + + + + - - + + - - + + @@ -111,48 +167,48 @@
hwloc_obj_t hwloc_alloc_setup_object (hwloc_topology_t topology,
size_t length, hwloc_obj_type_t type,
unsigned long flags unsigned os_index 
-

Adopt a shared memory topology stored in a file.

-

Map a file in virtual memory and adopt the topology that was previously stored there with hwloc_shmem_topology_write().

-

The returned adopted topology in topologyp can be used just like any topology. And it must be destroyed with hwloc_topology_destroy() as usual.

-

However the topology is read-only. For instance, it cannot be modified with hwloc_topology_restrict() and object userdata pointers cannot be changed.

-

The segment of the file pointed by descriptor fd, starting at offset fileoffset, and of length length (in bytes), will be mapped at virtual address mmap_address.

-

The file pointed by descriptor fd, the offset fileoffset, the requested mapping virtual address mmap_address and the length length must be identical to what was given to hwloc_shmem_topology_write() earlier.

-
Note
Flags flags are currently unused, must be 0.
-
-The object userdata pointer should not be used unless the process that created the shared topology also placed userdata-pointed buffers in shared memory.
-
-This function takes care of calling hwloc_topology_abi_check().
-
Returns
-1 with errno set to EBUSY if the virtual memory mapping defined by mmap_address and length isn't available in the process.
-
--1 with errno set to EINVAL if fileoffset, mmap_address or length aren't page-aligned, or do not match what was given to hwloc_shmem_topology_write() earlier.
-
--1 with errno set to EINVAL if the layout of the topology structure is different between the writer process and the adopter process.
+

Allocate and initialize an object of the given type and physical index.

+

If os_index is unknown or irrelevant, use HWLOC_UNKNOWN_INDEX.

- -

◆ hwloc_shmem_topology_get_length()

+ +

◆ hwloc_hide_errors()

- + - - + + + +
int hwloc_shmem_topology_get_length int hwloc_hide_errors (hwloc_topology_t topology, void )
+
+ +

Check whether insertion errors are hidden.

+ +
+
+ +

◆ hwloc_insert_object_by_cpuset()

+ +
+
+ - - - - + + + + - - + + @@ -162,47 +218,170 @@
size_t * lengthp, struct hwloc_obj* hwloc_insert_object_by_cpuset (struct hwloc_topology * topology,
unsigned long flags hwloc_obj_t obj 
-

Get the required shared memory length for storing a topology.

-

This length (in bytes) must be used in hwloc_shmem_topology_write() and hwloc_shmem_topology_adopt() later.

-
Note
Flags flags are currently unused, must be 0.
+

Add an object to the topology.

+

It is sorted along the tree of other objects according to the inclusion of cpusets, to eventually be added as a child of the smallest object including this object.

+

If the cpuset is empty, the type of the object (and maybe some attributes) must be enough to find where to insert the object. This is especially true for NUMA nodes with memory and no CPUs.

+

The given object should not have children.

+

This shall only be called before levels are built.

+

In case of error, hwloc_report_os_error() is called.

+

The caller should check whether the object type is filtered-out before calling this function.

+

The topology cpuset/nodesets will be enlarged to include the object sets.

+

Returns the object on success. Returns NULL and frees obj on error. Returns another object and frees obj if it was merged with an identical pre-existing object.

- -

◆ hwloc_shmem_topology_write()

+ +

◆ hwloc_insert_object_by_parent()

- + - + - - + + - - + + + + + + + + +
int hwloc_shmem_topology_write void hwloc_insert_object_by_parent (hwloc_topology_t struct hwloc_topology *  topology,
int fd, hwloc_obj_t parent,
hwloc_uint64_t fileoffset, hwloc_obj_t obj 
)
+
+ +

Insert an object somewhere in the topology.

+

It is added as the last child of the given parent. The cpuset is completely ignored, so strange objects such as I/O devices should preferably be inserted with this.

+

When used for "normal" children with cpusets (when importing from XML when duplicating a topology), the caller should make sure that:

    +
  • children are inserted in order,
  • +
  • children cpusets do not intersect.
  • +
+

The given object may have normal, I/O or Misc children, as long as they are in order as well. These children must have valid parent and next_sibling pointers.

+

The caller should check whether the object type is filtered-out before calling this function.

+ +
+
+ +

◆ hwloc_obj_add_children_sets()

+ +
+
+ + + + + + + + +
int hwloc_obj_add_children_sets (hwloc_obj_t obj)
+
+ +

Setup object cpusets/nodesets by OR'ing its children.

+

Used when adding an object late in the topology. Will update the new object by OR'ing all its new children sets.

+

Used when PCI backend adds a hostbridge parent, when distances add a new Group, etc.

+ +
+
+ +

◆ hwloc_plugin_check_namespace()

+ +
+
+ + + + + +
+ + + + + + - - + + + + + + + + +
static int hwloc_plugin_check_namespace (const char * pluginname,
void * mmap_address, const char * symbol 
)
+
+inlinestatic
+
+ +

Make sure that plugins can lookup core symbols.

+

This is a sanity check to avoid lazy-lookup failures when libhwloc is loaded within a plugin, and later tries to load its own plugins. This may fail (and abort the program) if libhwloc symbols are in a private namespace.

+
Returns
0 on success.
+
+-1 if the plugin cannot be successfully loaded. The caller plugin init() callback should return a negative error code as well.
+

Plugins should call this function in their init() callback to avoid later crashes if lazy symbol resolution is used by the upper layer that loaded hwloc (e.g. OpenCL implementations using dlopen with RTLD_LAZY).

+
Note
The build system must define HWLOC_INSIDE_PLUGIN if and only if building the caller as a plugin.
+
+This function should remain inline so plugins can call it even when they cannot find libhwloc symbols.
+ +
+
+ +

◆ hwloc_report_os_error()

+ +
+
+ + + + + + - - + + + + + + + + +
void hwloc_report_os_error (const char * msg,
size_t length, int line 
)
+
+ +

Report an insertion error from a backend.

+ +
+
+ +

◆ hwloc_topology_reconnect()

+ +
+
+ + + + + + @@ -218,16 +397,9 @@
int hwloc_topology_reconnect (hwloc_topology_t topology,
-

Duplicate a topology to a shared memory file.

-

Temporarily map a file in virtual memory and duplicate the topology topology by allocating duplicates in there.

-

The segment of the file pointed by descriptor fd, starting at offset fileoffset, and of length length (in bytes), will be temporarily mapped at virtual address mmap_address during the duplication.

-

The mapping length length must have been previously obtained with hwloc_shmem_topology_get_length() and the topology must not have been modified in the meantime.

-
Note
Flags flags are currently unused, must be 0.
-
-The object userdata pointer is duplicated but the pointed buffer is not. However the caller may also allocate it manually in shared memory to share it as well.
-
Returns
-1 with errno set to EBUSY if the virtual memory mapping defined by mmap_address and length isn't available in the process.
-
--1 with errno set to EINVAL if fileoffset, mmap_address or length aren't page-aligned.
+

Request a reconnection of children and levels in the topology.

+

May be used by backends during discovery if they need arrays or lists of object within levels or children to be fully connected.

+

flags is currently unused, must 0.

@@ -236,7 +408,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00224.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00224.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00224.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00224.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Components and Plugins: Discovery components +Hardware Locality (hwloc): Components and Plugins: Filtering objects @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,36 +27,181 @@
- + +/* @license-end */
-
Components and Plugins: Discovery components
+
Components and Plugins: Filtering objects
- - - + + + + + + + + +

-Data Structures

struct  hwloc_disc_component
 

+Functions

static int hwloc_filter_check_pcidev_subtype_important (unsigned classid)
 
static int hwloc_filter_check_osdev_subtype_important (hwloc_obj_osdev_type_t subtype)
 
static int hwloc_filter_check_keep_object_type (hwloc_topology_t topology, hwloc_obj_type_t type)
 
static int hwloc_filter_check_keep_object (hwloc_topology_t topology, hwloc_obj_t obj)
 

Detailed Description

+

Function Documentation

+ +

◆ hwloc_filter_check_keep_object()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int hwloc_filter_check_keep_object (hwloc_topology_t topology,
hwloc_obj_t obj 
)
+
+inlinestatic
+
+ +

Check whether the given object should be filtered-out.

+
Returns
1 if the object type should be kept, 0 otherwise.
+ +
+
+ +

◆ hwloc_filter_check_keep_object_type()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static int hwloc_filter_check_keep_object_type (hwloc_topology_t topology,
hwloc_obj_type_t type 
)
+
+inlinestatic
+
+ +

Check whether a non-I/O object type should be filtered-out.

+

Cannot be used for I/O objects.

+
Returns
1 if the object type should be kept, 0 otherwise.
+ +
+
+ +

◆ hwloc_filter_check_osdev_subtype_important()

+ +
+
+ + + + + +
+ + + + + + + + +
static int hwloc_filter_check_osdev_subtype_important (hwloc_obj_osdev_type_t subtype)
+
+inlinestatic
+
+ +

Check whether the given OS device subtype is important.

+
Returns
1 if important, 0 otherwise.
+ +
+
+ +

◆ hwloc_filter_check_pcidev_subtype_important()

+ +
+
+ + + + + +
+ + + + + + + + +
static int hwloc_filter_check_pcidev_subtype_important (unsigned classid)
+
+inlinestatic
+
+ +

Check whether the given PCI device classid is important.

+
Returns
1 if important, 0 otherwise.
+ +
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00225.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00225.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00225.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00225.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Components and Plugins: Discovery backends +Hardware Locality (hwloc): Components and Plugins: helpers for PCI discovery @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,147 +27,211 @@ - + +/* @license-end */
-
Components and Plugins: Discovery backends
+
Components and Plugins: helpers for PCI discovery
- - - - - -

-Data Structures

struct  hwloc_disc_status
 
struct  hwloc_backend
 
- - - -

-Typedefs

typedef enum hwloc_disc_phase_e hwloc_disc_phase_t
 
- - - - - -

-Enumerations

enum  hwloc_disc_phase_e {
-  HWLOC_DISC_PHASE_GLOBAL, -HWLOC_DISC_PHASE_CPU, -HWLOC_DISC_PHASE_MEMORY, -HWLOC_DISC_PHASE_PCI, -
-  HWLOC_DISC_PHASE_IO, -HWLOC_DISC_PHASE_MISC, -HWLOC_DISC_PHASE_ANNOTATE, -HWLOC_DISC_PHASE_TWEAK -
- }
 
enum  hwloc_disc_status_flag_e { HWLOC_DISC_STATUS_FLAG_GOT_ALLOWED_RESOURCES - }
 
- - - - + + + + + + + + + + + +

Functions

struct hwloc_backendhwloc_backend_alloc (struct hwloc_topology *topology, struct hwloc_disc_component *component)
 
int hwloc_backend_enable (struct hwloc_backend *backend)
 
unsigned hwloc_pcidisc_find_cap (const unsigned char *config, unsigned cap)
 
int hwloc_pcidisc_find_linkspeed (const unsigned char *config, unsigned offset, float *linkspeed)
 
hwloc_obj_type_t hwloc_pcidisc_check_bridge_type (unsigned device_class, const unsigned char *config)
 
int hwloc_pcidisc_find_bridge_buses (unsigned domain, unsigned bus, unsigned dev, unsigned func, unsigned *secondary_busp, unsigned *subordinate_busp, const unsigned char *config)
 
void hwloc_pcidisc_tree_insert_by_busid (struct hwloc_obj **treep, struct hwloc_obj *obj)
 
int hwloc_pcidisc_tree_attach (struct hwloc_topology *topology, struct hwloc_obj *tree)
 

Detailed Description

-

Typedef Documentation

- -

◆ hwloc_disc_phase_t

+

Function Documentation

+ +

◆ hwloc_pcidisc_check_bridge_type()

- + + + + + + + + + + + + + + +
typedef enum hwloc_disc_phase_e hwloc_disc_phase_thwloc_obj_type_t hwloc_pcidisc_check_bridge_type (unsigned device_class,
const unsigned char * config 
)
-

Discovery phase.

+

Return the hwloc object type (PCI device or Bridge) for the given class and configuration space.

+

This function requires 16 bytes of common configuration header at the beginning of config.

-

Enumeration Type Documentation

- -

◆ hwloc_disc_phase_e

+ +

◆ hwloc_pcidisc_find_bridge_buses()

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
enum hwloc_disc_phase_eint hwloc_pcidisc_find_bridge_buses (unsigned domain,
unsigned bus,
unsigned dev,
unsigned func,
unsigned * secondary_busp,
unsigned * subordinate_busp,
const unsigned char * config 
)
-

Discovery phase.

- - - - - - - - - -
Enumerator
HWLOC_DISC_PHASE_GLOBAL 

xml or synthetic, platform-specific components such as bgq. Discovers everything including CPU, memory, I/O and everything else. A component with a Global phase usually excludes all other phases.

-
HWLOC_DISC_PHASE_CPU 

CPU discovery.

-
HWLOC_DISC_PHASE_MEMORY 

Attach memory to existing CPU objects.

-
HWLOC_DISC_PHASE_PCI 

Attach PCI devices and bridges to existing CPU objects.

-
HWLOC_DISC_PHASE_IO 

I/O discovery that requires PCI devices (OS devices such as OpenCL, CUDA, etc.).

-
HWLOC_DISC_PHASE_MISC 

Misc objects that gets added below anything else.

-
HWLOC_DISC_PHASE_ANNOTATE 

Annotating existing objects, adding distances, etc.

-
HWLOC_DISC_PHASE_TWEAK 

Final tweaks to a ready-to-use topology. This phase runs once the topology is loaded, before it is returned to the topology. Hence it may only use the main hwloc API for modifying the topology, for instance by restricting it, adding info attributes, etc.

-
+

Fills the attributes of the given PCI bridge using the given PCI config space.

+

This function requires 32 bytes of common configuration header at the beginning of config.

+

Returns -1 and destroys /p obj if bridge fields are invalid.

+ +
+
+ +

◆ hwloc_pcidisc_find_cap()

+ +
+
+ + + + + + + + + + + + + + + + + + +
unsigned hwloc_pcidisc_find_cap (const unsigned char * config,
unsigned cap 
)
+
+ +

Return the offset of the given capability in the PCI config space buffer.

+

This function requires a 256-bytes config space. Unknown/unavailable bytes should be set to 0xff.

- -

◆ hwloc_disc_status_flag_e

+ +

◆ hwloc_pcidisc_find_linkspeed()

- + + + + + + + + + + + + + + + + + + + + +
enum hwloc_disc_status_flag_eint hwloc_pcidisc_find_linkspeed (const unsigned char * config,
unsigned offset,
float * linkspeed 
)
-

Discovery status flags.

- - -
Enumerator
HWLOC_DISC_STATUS_FLAG_GOT_ALLOWED_RESOURCES 

The sets of allowed resources were already retrieved.

-
+

Fill linkspeed by reading the PCI config space where PCI_CAP_ID_EXP is at position offset.

+

Needs 20 bytes of EXP capability block starting at offset in the config space for registers up to link status.

-

Function Documentation

- -

◆ hwloc_backend_alloc()

+ +

◆ hwloc_pcidisc_tree_attach()

- + @@ -175,8 +239,8 @@ - - + + @@ -186,27 +250,39 @@
struct hwloc_backend* hwloc_backend_alloc int hwloc_pcidisc_tree_attach ( struct hwloc_topology *  topology,
struct hwloc_disc_componentcomponent struct hwloc_objtree 
-

Allocate a backend structure, set good default values, initialize backend->component and topology, etc. The caller will then modify whatever needed, and call hwloc_backend_enable().

+

Add some hostbridges on top of the given tree of PCI objects and attach them to the topology.

+

Other backends may lookup PCI objects or localities (for instance to attach OS devices) by using hwloc_pcidisc_find_by_busid() or hwloc_pcidisc_find_busid_parent().

- -

◆ hwloc_backend_enable()

+ +

◆ hwloc_pcidisc_tree_insert_by_busid()

- + - - + + + + + + + + + + + +
int hwloc_backend_enable void hwloc_pcidisc_tree_insert_by_busid (struct hwloc_backendbackend)struct hwloc_obj ** treep,
struct hwloc_objobj 
)
-

Enable a previously allocated and setup backend.

+

Insert a PCI object in the given PCI tree by looking at PCI bus IDs.

+

If treep points to NULL, the new object is inserted there.

@@ -215,7 +291,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00226.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00226.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00226.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00226.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Components and Plugins: Generic components +Hardware Locality (hwloc): Components and Plugins: finding PCI objects during other discoveries @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,81 +27,79 @@
- + +/* @license-end */
-
Components and Plugins: Generic components
+
Components and Plugins: finding PCI objects during other discoveries
- - - -

-Data Structures

struct  hwloc_component
 
- - - -

-Typedefs

typedef enum hwloc_component_type_e hwloc_component_type_t
 
- - - + + +

-Enumerations

enum  hwloc_component_type_e { HWLOC_COMPONENT_TYPE_DISC, -HWLOC_COMPONENT_TYPE_XML - }
 

+Functions

struct hwloc_objhwloc_pci_find_parent_by_busid (struct hwloc_topology *topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
 

Detailed Description

-

Typedef Documentation

- -

◆ hwloc_component_type_t

+

Function Documentation

+ +

◆ hwloc_pci_find_parent_by_busid()

- + + + + -
typedef enum hwloc_component_type_e hwloc_component_type_tstruct hwloc_obj* hwloc_pci_find_parent_by_busid (struct hwloc_topology * topology,
-
- -

Generic component type.

- -
-
-

Enumeration Type Documentation

- -

◆ hwloc_component_type_e

- -
-
- - + + + + + + + + + + + + + + + + + + + + + + + + + + +
enum hwloc_component_type_eunsigned domain,
unsigned bus,
unsigned dev,
unsigned func 
)
-

Generic component type.

- - - -
Enumerator
HWLOC_COMPONENT_TYPE_DISC 

The data field must point to a struct hwloc_disc_component.

-
HWLOC_COMPONENT_TYPE_XML 

The data field must point to a struct hwloc_xml_component.

-
+

Find the normal parent of a PCI bus ID.

+

Look at PCI affinity to find out where the given PCI bus ID should be attached.

+

This function should be used to attach an I/O device under the corresponding PCI object (if any), or under a normal (non-I/O) object with same locality.

@@ -110,7 +108,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00227.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00227.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00227.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00227.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Components and Plugins: Core functions to be used by components +Hardware Locality (hwloc): Netloc API @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,378 +27,80 @@
- + +/* @license-end */
-
Components and Plugins: Core functions to be used by components
+
Netloc API
- - - -

-Typedefs

typedef void(* hwloc_report_error_t) (const char *msg, int line)
 
- - - - - - - - - - - - - - - - - - - + + +

-Functions

struct hwloc_objhwloc_insert_object_by_cpuset (struct hwloc_topology *topology, hwloc_obj_t obj)
 
void hwloc_report_os_error (const char *msg, int line)
 
int hwloc_hide_errors (void)
 
struct hwloc_objhwloc__insert_object_by_cpuset (struct hwloc_topology *topology, hwloc_obj_t root, hwloc_obj_t obj, hwloc_report_error_t report_error)
 
void hwloc_insert_object_by_parent (struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj)
 
hwloc_obj_t hwloc_alloc_setup_object (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned os_index)
 
int hwloc_obj_add_children_sets (hwloc_obj_t obj)
 
int hwloc_topology_reconnect (hwloc_topology_t topology, unsigned long flags)
 
static int hwloc_plugin_check_namespace (const char *pluginname, const char *symbol)
 

+Enumerations

enum  {
+  NETLOC_SUCCESS = 0, +NETLOC_ERROR = -1, +NETLOC_ERROR_NOTDIR = -2, +NETLOC_ERROR_NOENT = -3, +
+  NETLOC_ERROR_EMPTY = -4, +NETLOC_ERROR_MULTIPLE = -5, +NETLOC_ERROR_NOT_IMPL = -6, +NETLOC_ERROR_EXISTS = -7, +
+  NETLOC_ERROR_NOT_FOUND = -8, +NETLOC_ERROR_MAX = -9 +
+ }
 

Detailed Description

-

Typedef Documentation

- -

◆ hwloc_report_error_t

+

Enumeration Type Documentation

+ +

◆ anonymous enum

- +
typedef void(* hwloc_report_error_t) (const char *msg, int line)anonymous enum
- -

Type of error callbacks during object insertion.

- -
-
-

Function Documentation

- -

◆ hwloc__insert_object_by_cpuset()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
struct hwloc_obj* hwloc__insert_object_by_cpuset (struct hwloc_topology * topology,
hwloc_obj_t root,
hwloc_obj_t obj,
hwloc_report_error_t report_error 
)
-
- -

Add an object to the topology and specify which error callback to use.

-

This function is similar to hwloc_insert_object_by_cpuset() but it allows specifying where to start insertion from (if root is NULL, the topology root object is used), and specifying the error callback.

- -
-
- -

◆ hwloc_alloc_setup_object()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
hwloc_obj_t hwloc_alloc_setup_object (hwloc_topology_t topology,
hwloc_obj_type_t type,
unsigned os_index 
)
-
- -

Allocate and initialize an object of the given type and physical index.

-

If os_index is unknown or irrelevant, use HWLOC_UNKNOWN_INDEX.

- -
-
- -

◆ hwloc_hide_errors()

- -
-
- - - - - - - - -
int hwloc_hide_errors (void )
-
- -

Check whether insertion errors are hidden.

- -
-
- -

◆ hwloc_insert_object_by_cpuset()

- -
-
- - - - - - - - - - - - - - - - - - -
struct hwloc_obj* hwloc_insert_object_by_cpuset (struct hwloc_topology * topology,
hwloc_obj_t obj 
)
-
- -

Add an object to the topology.

-

It is sorted along the tree of other objects according to the inclusion of cpusets, to eventually be added as a child of the smallest object including this object.

-

If the cpuset is empty, the type of the object (and maybe some attributes) must be enough to find where to insert the object. This is especially true for NUMA nodes with memory and no CPUs.

-

The given object should not have children.

-

This shall only be called before levels are built.

-

In case of error, hwloc_report_os_error() is called.

-

The caller should check whether the object type is filtered-out before calling this function.

-

The topology cpuset/nodesets will be enlarged to include the object sets.

-

Returns the object on success. Returns NULL and frees obj on error. Returns another object and frees obj if it was merged with an identical pre-existing object.

- -
-
- -

◆ hwloc_insert_object_by_parent()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void hwloc_insert_object_by_parent (struct hwloc_topology * topology,
hwloc_obj_t parent,
hwloc_obj_t obj 
)
-
- -

Insert an object somewhere in the topology.

-

It is added as the last child of the given parent. The cpuset is completely ignored, so strange objects such as I/O devices should preferably be inserted with this.

-

When used for "normal" children with cpusets (when importing from XML when duplicating a topology), the caller should make sure that:

    -
  • children are inserted in order,
  • -
  • children cpusets do not intersect.
  • -
-

The given object may have normal, I/O or Misc children, as long as they are in order as well. These children must have valid parent and next_sibling pointers.

-

The caller should check whether the object type is filtered-out before calling this function.

- -
-
- -

◆ hwloc_obj_add_children_sets()

- -
-
- - - - - - - - -
int hwloc_obj_add_children_sets (hwloc_obj_t obj)
-
- -

Setup object cpusets/nodesets by OR'ing its children.

-

Used when adding an object late in the topology. Will update the new object by OR'ing all its new children sets.

-

Used when PCI backend adds a hostbridge parent, when distances add a new Group, etc.

- -
-
- -

◆ hwloc_plugin_check_namespace()

- -
-
- - - - - +

Return codes

+
- - - - - - - - - - - - - - - - - - -
static int hwloc_plugin_check_namespace (const char * pluginname,
const char * symbol 
)
-
-inlinestatic
+ + + + + + + + + +
Enumerator
NETLOC_SUCCESS 

Success

+
NETLOC_ERROR 

Error: General condition

+
NETLOC_ERROR_NOTDIR 

Error: URI is not a directory

+
NETLOC_ERROR_NOENT 

Error: URI is invalid, no such entry

+
NETLOC_ERROR_EMPTY 

Error: No networks found

+
NETLOC_ERROR_MULTIPLE 

Error: Multiple matching networks found

+
NETLOC_ERROR_NOT_IMPL 

Error: Interface not implemented

+
NETLOC_ERROR_EXISTS 

Error: If the entry already exists when trying to add to a lookup table

+
NETLOC_ERROR_NOT_FOUND 

Error: No path found

+
NETLOC_ERROR_MAX 

Error: Enum upper bound marker. No errors less than this number Will not be returned externally.

+
-
- -

Make sure that plugins can lookup core symbols.

-

This is a sanity check to avoid lazy-lookup failures when libhwloc is loaded within a plugin, and later tries to load its own plugins. This may fail (and abort the program) if libhwloc symbols are in a private namespace.

-
Returns
0 on success.
-
--1 if the plugin cannot be successfully loaded. The caller plugin init() callback should return a negative error code as well.
-

Plugins should call this function in their init() callback to avoid later crashes if lazy symbol resolution is used by the upper layer that loaded hwloc (e.g. OpenCL implementations using dlopen with RTLD_LAZY).

-
Note
The build system must define HWLOC_INSIDE_PLUGIN if and only if building the caller as a plugin.
-
-This function should remain inline so plugins can call it even when they cannot find libhwloc symbols.
- -
-
- -

◆ hwloc_report_os_error()

- -
-
- - - - - - - - - - - - - - - - - - -
void hwloc_report_os_error (const char * msg,
int line 
)
-
- -

Report an insertion error from a backend.

- -
-
- -

◆ hwloc_topology_reconnect()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_topology_reconnect (hwloc_topology_t topology,
unsigned long flags 
)
-
- -

Request a reconnection of children and levels in the topology.

-

May be used by backends during discovery if they need arrays or lists of object within levels or children to be fully connected.

-

flags is currently unused, must 0.

@@ -407,7 +109,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00228.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00228.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00228.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00228.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): Components and Plugins: Filtering objects - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
- -
-
Components and Plugins: Filtering objects
-
-
- - - - - - - - - - -

-Functions

static int hwloc_filter_check_pcidev_subtype_important (unsigned classid)
 
static int hwloc_filter_check_osdev_subtype_important (hwloc_obj_osdev_type_t subtype)
 
static int hwloc_filter_check_keep_object_type (hwloc_topology_t topology, hwloc_obj_type_t type)
 
static int hwloc_filter_check_keep_object (hwloc_topology_t topology, hwloc_obj_t obj)
 
-

Detailed Description

-

Function Documentation

- -

◆ hwloc_filter_check_keep_object()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
static int hwloc_filter_check_keep_object (hwloc_topology_t topology,
hwloc_obj_t obj 
)
-
-inlinestatic
-
- -

Check whether the given object should be filtered-out.

-
Returns
1 if the object type should be kept, 0 otherwise.
- -
-
- -

◆ hwloc_filter_check_keep_object_type()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
static int hwloc_filter_check_keep_object_type (hwloc_topology_t topology,
hwloc_obj_type_t type 
)
-
-inlinestatic
-
- -

Check whether a non-I/O object type should be filtered-out.

-

Cannot be used for I/O objects.

-
Returns
1 if the object type should be kept, 0 otherwise.
- -
-
- -

◆ hwloc_filter_check_osdev_subtype_important()

- -
-
- - - - - -
- - - - - - - - -
static int hwloc_filter_check_osdev_subtype_important (hwloc_obj_osdev_type_t subtype)
-
-inlinestatic
-
- -

Check whether the given OS device subtype is important.

-
Returns
1 if important, 0 otherwise.
- -
-
- -

◆ hwloc_filter_check_pcidev_subtype_important()

- -
-
- - - - - -
- - - - - - - - -
static int hwloc_filter_check_pcidev_subtype_important (unsigned classid)
-
-inlinestatic
-
- -

Check whether the given PCI device classid is important.

-
Returns
1 if important, 0 otherwise.
- -
-
-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00229.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00229.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00229.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00229.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,296 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): Components and Plugins: helpers for PCI discovery - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
- -
-
Components and Plugins: helpers for PCI discovery
-
-
- - - - - - - - - - - - - - -

-Functions

unsigned hwloc_pcidisc_find_cap (const unsigned char *config, unsigned cap)
 
int hwloc_pcidisc_find_linkspeed (const unsigned char *config, unsigned offset, float *linkspeed)
 
hwloc_obj_type_t hwloc_pcidisc_check_bridge_type (unsigned device_class, const unsigned char *config)
 
int hwloc_pcidisc_find_bridge_buses (unsigned domain, unsigned bus, unsigned dev, unsigned func, unsigned *secondary_busp, unsigned *subordinate_busp, const unsigned char *config)
 
void hwloc_pcidisc_tree_insert_by_busid (struct hwloc_obj **treep, struct hwloc_obj *obj)
 
int hwloc_pcidisc_tree_attach (struct hwloc_topology *topology, struct hwloc_obj *tree)
 
-

Detailed Description

-

Function Documentation

- -

◆ hwloc_pcidisc_check_bridge_type()

- -
-
- - - - - - - - - - - - - - - - - - -
hwloc_obj_type_t hwloc_pcidisc_check_bridge_type (unsigned device_class,
const unsigned char * config 
)
-
- -

Return the hwloc object type (PCI device or Bridge) for the given class and configuration space.

-

This function requires 16 bytes of common configuration header at the beginning of config.

- -
-
- -

◆ hwloc_pcidisc_find_bridge_buses()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_pcidisc_find_bridge_buses (unsigned domain,
unsigned bus,
unsigned dev,
unsigned func,
unsigned * secondary_busp,
unsigned * subordinate_busp,
const unsigned char * config 
)
-
- -

Fills the attributes of the given PCI bridge using the given PCI config space.

-

This function requires 32 bytes of common configuration header at the beginning of config.

-

Returns -1 and destroys /p obj if bridge fields are invalid.

- -
-
- -

◆ hwloc_pcidisc_find_cap()

- -
-
- - - - - - - - - - - - - - - - - - -
unsigned hwloc_pcidisc_find_cap (const unsigned char * config,
unsigned cap 
)
-
- -

Return the offset of the given capability in the PCI config space buffer.

-

This function requires a 256-bytes config space. Unknown/unavailable bytes should be set to 0xff.

- -
-
- -

◆ hwloc_pcidisc_find_linkspeed()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int hwloc_pcidisc_find_linkspeed (const unsigned char * config,
unsigned offset,
float * linkspeed 
)
-
- -

Fill linkspeed by reading the PCI config space where PCI_CAP_ID_EXP is at position offset.

-

Needs 20 bytes of EXP capability block starting at offset in the config space for registers up to link status.

- -
-
- -

◆ hwloc_pcidisc_tree_attach()

- -
-
- - - - - - - - - - - - - - - - - - -
int hwloc_pcidisc_tree_attach (struct hwloc_topology * topology,
struct hwloc_objtree 
)
-
- -

Add some hostbridges on top of the given tree of PCI objects and attach them to the topology.

-

Other backends may lookup PCI objects or localities (for instance to attach OS devices) by using hwloc_pcidisc_find_by_busid() or hwloc_pcidisc_find_busid_parent().

- -
-
- -

◆ hwloc_pcidisc_tree_insert_by_busid()

- -
-
- - - - - - - - - - - - - - - - - - -
void hwloc_pcidisc_tree_insert_by_busid (struct hwloc_obj ** treep,
struct hwloc_objobj 
)
-
- -

Insert a PCI object in the given PCI tree by looking at PCI bus IDs.

-

If treep points to NULL, the new object is inserted there.

- -
-
-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00230.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00230.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00230.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00230.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): Components and Plugins: finding PCI objects during other discoveries - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
- -
-
Components and Plugins: finding PCI objects during other discoveries
-
-
- - - - -

-Functions

struct hwloc_objhwloc_pci_find_parent_by_busid (struct hwloc_topology *topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
 
-

Detailed Description

-

Function Documentation

- -

◆ hwloc_pci_find_parent_by_busid()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
struct hwloc_obj* hwloc_pci_find_parent_by_busid (struct hwloc_topology * topology,
unsigned domain,
unsigned bus,
unsigned dev,
unsigned func 
)
-
- -

Find the normal parent of a PCI bus ID.

-

Look at PCI affinity to find out where the given PCI bus ID should be attached.

-

This function should be used to attach an I/O device under the corresponding PCI object (if any), or under a normal (non-I/O) object with same locality.

- -
-
-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00231.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00231.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00231.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00231.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Netloc API +Hardware Locality (hwloc): hwloc_obj Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,88 +27,663 @@
- + +/* @license-end */
-
Netloc API
+
hwloc_obj Struct Reference
+ +

#include <hwloc.h>

- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

-Enumerations

enum  {
-  NETLOC_SUCCESS = 0, -NETLOC_ERROR = -1, -NETLOC_ERROR_NOTDIR = -2, -NETLOC_ERROR_NOENT = -3, -
-  NETLOC_ERROR_EMPTY = -4, -NETLOC_ERROR_MULTIPLE = -5, -NETLOC_ERROR_NOT_IMPL = -6, -NETLOC_ERROR_EXISTS = -7, -
-  NETLOC_ERROR_NOT_FOUND = -8, -NETLOC_ERROR_MAX = -9 -
- }
 

+Data Fields

hwloc_obj_type_t type
 
char * subtype
 
unsigned os_index
 
char * name
 
hwloc_uint64_t total_memory
 
union hwloc_obj_attr_uattr
 
int depth
 
unsigned logical_index
 
struct hwloc_objnext_cousin
 
struct hwloc_objprev_cousin
 
struct hwloc_objparent
 
unsigned sibling_rank
 
struct hwloc_objnext_sibling
 
struct hwloc_objprev_sibling
 
int symmetric_subtree
 
hwloc_cpuset_t cpuset
 
hwloc_cpuset_t complete_cpuset
 
hwloc_nodeset_t nodeset
 
hwloc_nodeset_t complete_nodeset
 
struct hwloc_info_sinfos
 
unsigned infos_count
 
void * userdata
 
hwloc_uint64_t gp_index
 
List and array of normal children below this object (except Memory, I/O and Misc children).
unsigned arity
 
struct hwloc_obj ** children
 
struct hwloc_objfirst_child
 
struct hwloc_objlast_child
 
List of Memory children below this object.
unsigned memory_arity
 
struct hwloc_objmemory_first_child
 
List of I/O children below this object.
unsigned io_arity
 
struct hwloc_objio_first_child
 
List of Misc children below this object.
unsigned misc_arity
 
struct hwloc_objmisc_first_child
 

Detailed Description

-

Enumeration Type Documentation

- -

◆ anonymous enum

+

Structure of a topology object.

+

Applications must not modify any field except hwloc_obj.userdata.

+

Field Documentation

+ +

◆ arity

- +
anonymous enumunsigned hwloc_obj::arity
-

Return codes

- - - - - - - - - - - -
Enumerator
NETLOC_SUCCESS 

Success

-
NETLOC_ERROR 

Error: General condition

-
NETLOC_ERROR_NOTDIR 

Error: URI is not a directory

-
NETLOC_ERROR_NOENT 

Error: URI is invalid, no such entry

-
NETLOC_ERROR_EMPTY 

Error: No networks found

-
NETLOC_ERROR_MULTIPLE 

Error: Multiple matching networks found

-
NETLOC_ERROR_NOT_IMPL 

Error: Interface not implemented

-
NETLOC_ERROR_EXISTS 

Error: If the entry already exists when trying to add to a lookup table

-
NETLOC_ERROR_NOT_FOUND 

Error: No path found

-
NETLOC_ERROR_MAX 

Error: Enum upper bound marker. No errors less than this number Will not be returned externally.

-
+ +

Number of normal children. Memory, Misc and I/O children are not listed here but rather in their dedicated children list.

+ +
+
+ +

◆ attr

+ +
+
+ + + + +
union hwloc_obj_attr_u* hwloc_obj::attr
+
+ +

Object type-specific Attributes, may be NULL if no attribute value was found.

+ +
+
+ +

◆ children

+ +
+
+ + + + +
struct hwloc_obj** hwloc_obj::children
+
+ +

Normal children, children[0 .. arity -1].

+ +
+
+ +

◆ complete_cpuset

+ +
+
+ + + + +
hwloc_cpuset_t hwloc_obj::complete_cpuset
+
+ +

The complete CPU set of logical processors of this object,.

+

This may include not only the same as the cpuset field, but also some CPUs for which topology information is unknown or incomplete, some offlines CPUs, and the CPUs that are ignored when the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED flag is not set. Thus no corresponding PU object may be found in the topology, because the precise position is undefined. It is however known that it would be somewhere under this object.

+
Note
Its value must not be changed, hwloc_bitmap_dup() must be used instead.
+ +
+
+ +

◆ complete_nodeset

+ +
+
+ + + + +
hwloc_nodeset_t hwloc_obj::complete_nodeset
+
+ +

The complete NUMA node set of this object,.

+

This may include not only the same as the nodeset field, but also some NUMA nodes for which topology information is unknown or incomplete, some offlines nodes, and the nodes that are ignored when the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED flag is not set. Thus no corresponding NUMA node object may be found in the topology, because the precise position is undefined. It is however known that it would be somewhere under this object.

+

If there are no NUMA nodes in the machine, all the memory is close to this object, so only the first bit is set in complete_nodeset.

+
Note
Its value must not be changed, hwloc_bitmap_dup() must be used instead.
+ +
+
+ +

◆ cpuset

+ +
+
+ + + + +
hwloc_cpuset_t hwloc_obj::cpuset
+
+ +

CPUs covered by this object.

+

This is the set of CPUs for which there are PU objects in the topology under this object, i.e. which are known to be physically contained in this object and known how (the children path between this object and the PU objects).

+

If the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED configuration flag is set, some of these CPUs may not be allowed for binding, see hwloc_topology_get_allowed_cpuset().

+
Note
All objects have non-NULL CPU and node sets except Misc and I/O objects.
+
+Its value must not be changed, hwloc_bitmap_dup() must be used instead.
+ +
+
+ +

◆ depth

+ +
+
+ + + + +
int hwloc_obj::depth
+
+ +

Vertical index in the hierarchy.

+

For normal objects, this is the depth of the horizontal level that contains this object and its cousins of the same type. If the topology is symmetric, this is equal to the parent depth plus one, and also equal to the number of parent/child links from the root object to here.

+

For special objects (NUMA nodes, I/O and Misc) that are not in the main tree, this is a special negative value that corresponds to their dedicated level, see hwloc_get_type_depth() and hwloc_get_type_depth_e. Those special values can be passed to hwloc functions such hwloc_get_nbobjs_by_depth() as usual.

+ +
+
+ +

◆ first_child

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::first_child
+
+ +

First normal child.

+ +
+
+ +

◆ gp_index

+ +
+
+ + + + +
hwloc_uint64_t hwloc_obj::gp_index
+
+ +

Global persistent index. Generated by hwloc, unique across the topology (contrary to os_index) and persistent across topology changes (contrary to logical_index). Mostly used internally, but could also be used by application to identify objects.

+ +
+
+ +

◆ infos

+ +
+
+ + + + +
struct hwloc_info_s* hwloc_obj::infos
+
+ +

Array of stringified info type=name.

+ +
+
+ +

◆ infos_count

+ +
+
+ + + + +
unsigned hwloc_obj::infos_count
+
+ +

Size of infos array.

+ +
+
+ +

◆ io_arity

+ +
+
+ + + + +
unsigned hwloc_obj::io_arity
+
+ +

Number of I/O children. These children are listed in io_first_child.

+ +
+
+ +

◆ io_first_child

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::io_first_child
+
+ +

First I/O child. Bridges, PCI and OS devices are listed here (io_arity and io_first_child) instead of in the normal children list. See also hwloc_obj_type_is_io().

+ +
+
+ +

◆ last_child

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::last_child
+
+ +

Last normal child.

+ +
+
+ +

◆ logical_index

+ +
+
+ + + + +
unsigned hwloc_obj::logical_index
+
+ +

Horizontal index in the whole list of similar objects, hence guaranteed unique across the entire machine. Could be a "cousin_rank" since it's the rank within the "cousin" list below Note that this index may change when restricting the topology or when inserting a group.

+ +
+
+ +

◆ memory_arity

+ +
+
+ + + + +
unsigned hwloc_obj::memory_arity
+
+ +

Number of Memory children. These children are listed in memory_first_child.

+ +
+
+ +

◆ memory_first_child

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::memory_first_child
+
+ +

First Memory child. NUMA nodes and Memory-side caches are listed here (memory_arity and memory_first_child) instead of in the normal children list. See also hwloc_obj_type_is_memory().

+

A memory hierarchy starts from a normal CPU-side object (e.g. Package) and ends with NUMA nodes as leaves. There might exist some memory-side caches between them in the middle of the memory subtree.

+ +
+
+ +

◆ misc_arity

+ +
+
+ + + + +
unsigned hwloc_obj::misc_arity
+
+ +

Number of Misc children. These children are listed in misc_first_child.

+ +
+
+ +

◆ misc_first_child

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::misc_first_child
+
+ +

First Misc child. Misc objects are listed here (misc_arity and misc_first_child) instead of in the normal children list.

+ +
+
+ +

◆ name

+ +
+
+ + + + +
char* hwloc_obj::name
+
+ +

Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name string is more useful than numerical indexes.

+ +
+
+ +

◆ next_cousin

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::next_cousin
+
+ +

Next object of same type and depth.

+ +
+
+ +

◆ next_sibling

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::next_sibling
+
+ +

Next object below the same parent (inside the same list of children).

+ +
+
+ +

◆ nodeset

+ +
+
+ + + + +
hwloc_nodeset_t hwloc_obj::nodeset
+
+ +

NUMA nodes covered by this object or containing this object.

+

This is the set of NUMA nodes for which there are NUMA node objects in the topology under or above this object, i.e. which are known to be physically contained in this object or containing it and known how (the children path between this object and the NUMA node objects).

+

In the end, these nodes are those that are close to the current object.

+

If the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED configuration flag is set, some of these nodes may not be allowed for allocation, see hwloc_topology_get_allowed_nodeset().

+

If there are no NUMA nodes in the machine, all the memory is close to this object, so only the first bit may be set in nodeset.

+
Note
All objects have non-NULL CPU and node sets except Misc and I/O objects.
+
+Its value must not be changed, hwloc_bitmap_dup() must be used instead.
+ +
+
+ +

◆ os_index

+ +
+
+ + + + +
unsigned hwloc_obj::os_index
+
+ +

OS-provided physical index number. It is not guaranteed unique across the entire machine, except for PUs and NUMA nodes. Set to HWLOC_UNKNOWN_INDEX if unknown or irrelevant for this object.

+ +
+
+ +

◆ parent

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::parent
+
+ +

Parent, NULL if root (Machine object)

+ +
+
+ +

◆ prev_cousin

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::prev_cousin
+
+ +

Previous object of same type and depth.

+ +
+
+ +

◆ prev_sibling

+ +
+
+ + + + +
struct hwloc_obj* hwloc_obj::prev_sibling
+
+ +

Previous object below the same parent (inside the same list of children).

+ +
+
+ +

◆ sibling_rank

+ +
+
+ + + + +
unsigned hwloc_obj::sibling_rank
+
+ +

Index in parent's children[] array. Or the index in parent's Memory, I/O or Misc children list.

+ +
+
+ +

◆ subtype

+ +
+
+ + + + +
char* hwloc_obj::subtype
+
+ +

Subtype string to better describe the type field.

+ +
+
+ +

◆ symmetric_subtree

+ +
+
+ + + + +
int hwloc_obj::symmetric_subtree
+
+ +

Set if the subtree of normal objects below this object is symmetric, which means all normal children and their children have identical subtrees.

+

Memory, I/O and Misc children are ignored.

+

If set in the topology root object, lstopo may export the topology as a synthetic string.

+ +
+
+ +

◆ total_memory

+ +
+
+ + + + +
hwloc_uint64_t hwloc_obj::total_memory
+
+ +

Total memory (in bytes) in NUMA nodes below this object.

+ +
+
+ +

◆ type

+ +
+
+ + + + +
hwloc_obj_type_t hwloc_obj::type
+
+ +

Type of object.

+ +
+
+ +

◆ userdata

+ +
+
+ + + + +
void* hwloc_obj::userdata
+
+ +

Application-given private data pointer, initialized to NULL, use it as you wish. See hwloc_topology_set_userdata_export_callback() in hwloc/export.h if you wish to export this field to XML.

+
The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00235.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00235.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00235.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00235.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj Struct Reference +Hardware Locality (hwloc): hwloc_obj_attr_u Union Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,654 +27,146 @@ - + +/* @license-end */
-
hwloc_obj Struct Reference
+
hwloc_obj_attr_u Union Reference

#include <hwloc.h>

+ + + + + + + + + + + + + +

+Data Structures

struct  hwloc_bridge_attr_s
 
struct  hwloc_cache_attr_s
 
struct  hwloc_group_attr_s
 
struct  hwloc_numanode_attr_s
 
struct  hwloc_osdev_attr_s
 
struct  hwloc_pcidev_attr_s
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +

Data Fields

hwloc_obj_type_t type
 
char * subtype
 
unsigned os_index
 
char * name
 
hwloc_uint64_t total_memory
 
union hwloc_obj_attr_uattr
 
int depth
 
unsigned logical_index
 
struct hwloc_objnext_cousin
 
struct hwloc_objprev_cousin
 
struct hwloc_objparent
 
unsigned sibling_rank
 
struct hwloc_objnext_sibling
 
struct hwloc_objprev_sibling
 
int symmetric_subtree
 
hwloc_cpuset_t cpuset
 
hwloc_cpuset_t complete_cpuset
 
hwloc_nodeset_t nodeset
 
hwloc_nodeset_t complete_nodeset
 
struct hwloc_info_sinfos
 
unsigned infos_count
 
void * userdata
 
hwloc_uint64_t gp_index
 
List and array of normal children below this object (except Memory, I/O and Misc children).
unsigned arity
 
struct hwloc_obj ** children
 
struct hwloc_objfirst_child
 
struct hwloc_objlast_child
 
List of Memory children below this object.
unsigned memory_arity
 
struct hwloc_objmemory_first_child
 
List of I/O children below this object.
unsigned io_arity
 
struct hwloc_objio_first_child
 
List of Misc children below this object.
unsigned misc_arity
 
struct hwloc_objmisc_first_child
 
struct hwloc_obj_attr_u::hwloc_numanode_attr_s numanode
 
struct hwloc_obj_attr_u::hwloc_cache_attr_s cache
 
struct hwloc_obj_attr_u::hwloc_group_attr_s group
 
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
 
struct hwloc_obj_attr_u::hwloc_bridge_attr_s bridge
 
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
 

Detailed Description

-

Structure of a topology object.

-

Applications must not modify any field except hwloc_obj.userdata.

+

Object type-specific Attributes.

Field Documentation

- -

◆ arity

+ +

◆ bridge

- +
unsigned hwloc_obj::aritystruct hwloc_obj_attr_u::hwloc_bridge_attr_s hwloc_obj_attr_u::bridge
-

Number of normal children. Memory, Misc and I/O children are not listed here but rather in their dedicated children list.

- -
-
- -

◆ attr

- -
-
- - - - -
union hwloc_obj_attr_u* hwloc_obj::attr
-
- -

Object type-specific Attributes, may be NULL if no attribute value was found.

- -
-
- -

◆ children

- -
-
- - - - -
struct hwloc_obj** hwloc_obj::children
-
- -

Normal children, children[0 .. arity -1].

- -
-
- -

◆ complete_cpuset

- -
-
- - - - -
hwloc_cpuset_t hwloc_obj::complete_cpuset
-
- -

The complete CPU set of logical processors of this object,.

-

This may include not only the same as the cpuset field, but also some CPUs for which topology information is unknown or incomplete, some offlines CPUs, and the CPUs that are ignored when the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED flag is not set. Thus no corresponding PU object may be found in the topology, because the precise position is undefined. It is however known that it would be somewhere under this object.

-
Note
Its value must not be changed, hwloc_bitmap_dup() must be used instead.
- -
-
- -

◆ complete_nodeset

- -
-
- - - - -
hwloc_nodeset_t hwloc_obj::complete_nodeset
-
- -

The complete NUMA node set of this object,.

-

This may include not only the same as the nodeset field, but also some NUMA nodes for which topology information is unknown or incomplete, some offlines nodes, and the nodes that are ignored when the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED flag is not set. Thus no corresponding NUMA node object may be found in the topology, because the precise position is undefined. It is however known that it would be somewhere under this object.

-

If there are no NUMA nodes in the machine, all the memory is close to this object, so only the first bit is set in complete_nodeset.

-
Note
Its value must not be changed, hwloc_bitmap_dup() must be used instead.
- -
-
- -

◆ cpuset

- -
-
- - - - -
hwloc_cpuset_t hwloc_obj::cpuset
-
- -

CPUs covered by this object.

-

This is the set of CPUs for which there are PU objects in the topology under this object, i.e. which are known to be physically contained in this object and known how (the children path between this object and the PU objects).

-

If the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED configuration flag is set, some of these CPUs may not be allowed for binding, see hwloc_topology_get_allowed_cpuset().

-
Note
All objects have non-NULL CPU and node sets except Misc and I/O objects.
-
-Its value must not be changed, hwloc_bitmap_dup() must be used instead.
- -
-
- -

◆ depth

- -
-
- - - - -
int hwloc_obj::depth
-
- -

Vertical index in the hierarchy.

-

For normal objects, this is the depth of the horizontal level that contains this object and its cousins of the same type. If the topology is symmetric, this is equal to the parent depth plus one, and also equal to the number of parent/child links from the root object to here.

-

For special objects (NUMA nodes, I/O and Misc) that are not in the main tree, this is a special negative value that corresponds to their dedicated level, see hwloc_get_type_depth() and hwloc_get_type_depth_e. Those special values can be passed to hwloc functions such hwloc_get_nbobjs_by_depth() as usual.

- -
-
- -

◆ first_child

- -
-
- - - - -
struct hwloc_obj* hwloc_obj::first_child
-
- -

First normal child.

- -
-
- -

◆ gp_index

- -
-
- - - - -
hwloc_uint64_t hwloc_obj::gp_index
-
- -

Global persistent index. Generated by hwloc, unique across the topology (contrary to os_index) and persistent across topology changes (contrary to logical_index). Mostly used internally, but could also be used by application to identify objects.

- -
-
- -

◆ infos

- -
-
- - - - -
struct hwloc_info_s* hwloc_obj::infos
-
- -

Array of stringified info type=name.

- -
-
- -

◆ infos_count

- -
-
- - - - -
unsigned hwloc_obj::infos_count
-
- -

Size of infos array.

- -
-
- -

◆ io_arity

- -
-
- - - - -
unsigned hwloc_obj::io_arity
-
- -

Number of I/O children. These children are listed in io_first_child.

- -
-
- -

◆ io_first_child

- -
-
- - - - -
struct hwloc_obj* hwloc_obj::io_first_child
-
- -

First I/O child. Bridges, PCI and OS devices are listed here (io_arity and io_first_child) instead of in the normal children list. See also hwloc_obj_type_is_io().

- -
-
- -

◆ last_child

- -
-
- - - - -
struct hwloc_obj* hwloc_obj::last_child
-
- -

Last normal child.

- -
-
- -

◆ logical_index

- -
-
- - - - -
unsigned hwloc_obj::logical_index
-
- -

Horizontal index in the whole list of similar objects, hence guaranteed unique across the entire machine. Could be a "cousin_rank" since it's the rank within the "cousin" list below Note that this index may change when restricting the topology or when inserting a group.

- -
-
- -

◆ memory_arity

- -
-
- - - - -
unsigned hwloc_obj::memory_arity
-
- -

Number of Memory children. These children are listed in memory_first_child.

- -
-
- -

◆ memory_first_child

- -
-
- - - - -
struct hwloc_obj* hwloc_obj::memory_first_child
-
- -

First Memory child. NUMA nodes and Memory-side caches are listed here (memory_arity and memory_first_child) instead of in the normal children list. See also hwloc_obj_type_is_memory().

-

A memory hierarchy starts from a normal CPU-side object (e.g. Package) and ends with NUMA nodes as leaves. There might exist some memory-side caches between them in the middle of the memory subtree.

-
- -

◆ misc_arity

+ +

◆ cache

- +
unsigned hwloc_obj::misc_aritystruct hwloc_obj_attr_u::hwloc_cache_attr_s hwloc_obj_attr_u::cache
-

Number of Misc children. These children are listed in misc_first_child.

-
- -

◆ misc_first_child

+ +

◆ group

- +
struct hwloc_obj* hwloc_obj::misc_first_childstruct hwloc_obj_attr_u::hwloc_group_attr_s hwloc_obj_attr_u::group
-

First Misc child. Misc objects are listed here (misc_arity and misc_first_child) instead of in the normal children list.

-
- -

◆ name

+ +

◆ numanode

- +
char* hwloc_obj::namestruct hwloc_obj_attr_u::hwloc_numanode_attr_s hwloc_obj_attr_u::numanode
-

Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name string is more useful than numerical indexes.

-
- -

◆ next_cousin

+ +

◆ osdev

- +
struct hwloc_obj* hwloc_obj::next_cousinstruct hwloc_obj_attr_u::hwloc_osdev_attr_s hwloc_obj_attr_u::osdev
-

Next object of same type and depth.

-
- -

◆ next_sibling

+ +

◆ pcidev

- +
struct hwloc_obj* hwloc_obj::next_siblingstruct hwloc_obj_attr_u::hwloc_pcidev_attr_s hwloc_obj_attr_u::pcidev
-

Next object below the same parent (inside the same list of children).

- -
-
- -

◆ nodeset

- -
-
- - - - -
hwloc_nodeset_t hwloc_obj::nodeset
-
- -

NUMA nodes covered by this object or containing this object.

-

This is the set of NUMA nodes for which there are NUMA node objects in the topology under or above this object, i.e. which are known to be physically contained in this object or containing it and known how (the children path between this object and the NUMA node objects).

-

In the end, these nodes are those that are close to the current object.

-

If the HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED configuration flag is set, some of these nodes may not be allowed for allocation, see hwloc_topology_get_allowed_nodeset().

-

If there are no NUMA nodes in the machine, all the memory is close to this object, so only the first bit may be set in nodeset.

-
Note
All objects have non-NULL CPU and node sets except Misc and I/O objects.
-
-Its value must not be changed, hwloc_bitmap_dup() must be used instead.
- -
-
- -

◆ os_index

- -
-
- - - - -
unsigned hwloc_obj::os_index
-
- -

OS-provided physical index number. It is not guaranteed unique across the entire machine, except for PUs and NUMA nodes. Set to HWLOC_UNKNOWN_INDEX if unknown or irrelevant for this object.

- -
-
- -

◆ parent

- -
-
- - - - -
struct hwloc_obj* hwloc_obj::parent
-
- -

Parent, NULL if root (Machine object)

- -
-
- -

◆ prev_cousin

- -
-
- - - - -
struct hwloc_obj* hwloc_obj::prev_cousin
-
- -

Previous object of same type and depth.

- -
-
- -

◆ prev_sibling

- -
-
- - - - -
struct hwloc_obj* hwloc_obj::prev_sibling
-
- -

Previous object below the same parent (inside the same list of children).

- -
-
- -

◆ sibling_rank

- -
-
- - - - -
unsigned hwloc_obj::sibling_rank
-
- -

Index in parent's children[] array. Or the index in parent's Memory, I/O or Misc children list.

- -
-
- -

◆ subtype

- -
-
- - - - -
char* hwloc_obj::subtype
-
- -

Subtype string to better describe the type field.

- -
-
- -

◆ symmetric_subtree

- -
-
- - - - -
int hwloc_obj::symmetric_subtree
-
- -

Set if the subtree of normal objects below this object is symmetric, which means all normal children and their children have identical subtrees.

-

Memory, I/O and Misc children are ignored.

-

If set in the topology root object, lstopo may export the topology as a synthetic string.

- -
-
- -

◆ total_memory

- -
-
- - - - -
hwloc_uint64_t hwloc_obj::total_memory
-
- -

Total memory (in bytes) in NUMA nodes below this object.

- -
-
- -

◆ type

- -
-
- - - - -
hwloc_obj_type_t hwloc_obj::type
-
- -

Type of object.

- -
-
- -

◆ userdata

- -
-
- - - - -
void* hwloc_obj::userdata
-
- -

Application-given private data pointer, initialized to NULL, use it as you wish. See hwloc_topology_set_userdata_export_callback() in hwloc/export.h if you wish to export this field to XML.

-
-
The documentation for this struct was generated from the following file:
    +
    The documentation for this union was generated from the following file:
@@ -682,7 +174,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00239.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00239.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00239.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00239.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj_attr_u Union Reference +Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_numanode_attr_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,22 +27,27 @@
- + +/* @license-end */ +
-
hwloc_obj_attr_u Union Reference
+
hwloc_obj_attr_u::hwloc_numanode_attr_s Struct Reference
@@ -50,122 +55,68 @@ - - - - - - - - - - - +

Data Structures

struct  hwloc_bridge_attr_s
 
struct  hwloc_cache_attr_s
 
struct  hwloc_group_attr_s
 
struct  hwloc_numanode_attr_s
 
struct  hwloc_osdev_attr_s
 
struct  hwloc_pcidev_attr_s
struct  hwloc_memory_page_type_s
 
- - - - - - - - - - - - + + + + + +

Data Fields

struct hwloc_obj_attr_u::hwloc_numanode_attr_s numanode
 
struct hwloc_obj_attr_u::hwloc_cache_attr_s cache
 
struct hwloc_obj_attr_u::hwloc_group_attr_s group
 
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev
 
struct hwloc_obj_attr_u::hwloc_bridge_attr_s bridge
 
struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev
 
hwloc_uint64_t local_memory
 
unsigned page_types_len
 
struct hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_spage_types
 

Detailed Description

-

Object type-specific Attributes.

+

NUMA node-specific Object Attributes.

Field Documentation

- -

◆ bridge

+ +

◆ local_memory

- +
struct hwloc_obj_attr_u::hwloc_bridge_attr_s hwloc_obj_attr_u::bridgehwloc_uint64_t hwloc_obj_attr_u::hwloc_numanode_attr_s::local_memory
-
-
- -

◆ cache

- -
-
- - - - -
struct hwloc_obj_attr_u::hwloc_cache_attr_s hwloc_obj_attr_u::cache
-
+

Local memory (in bytes)

- -

◆ group

+ +

◆ page_types

- +
struct hwloc_obj_attr_u::hwloc_group_attr_s hwloc_obj_attr_u::groupstruct hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s * hwloc_obj_attr_u::hwloc_numanode_attr_s::page_types
- -

◆ numanode

+ +

◆ page_types_len

- +
struct hwloc_obj_attr_u::hwloc_numanode_attr_s hwloc_obj_attr_u::numanodeunsigned hwloc_obj_attr_u::hwloc_numanode_attr_s::page_types_len
-
-
- -

◆ osdev

- -
-
- - - - -
struct hwloc_obj_attr_u::hwloc_osdev_attr_s hwloc_obj_attr_u::osdev
-
- -
-
- -

◆ pcidev

- -
-
- - - - -
struct hwloc_obj_attr_u::hwloc_pcidev_attr_s hwloc_obj_attr_u::pcidev
-
+

Size of array page_types.

-
The documentation for this union was generated from the following file:
    +
    The documentation for this struct was generated from the following file:
@@ -173,7 +124,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00243.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00243.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00243.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00243.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_numanode_attr_s Struct Reference +Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,91 +27,71 @@
- + +/* @license-end */
-
hwloc_obj_attr_u::hwloc_numanode_attr_s Struct Reference
+
hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s Struct Reference

#include <hwloc.h>

- - - -

-Data Structures

struct  hwloc_memory_page_type_s
 
- - - - - - + + + +

Data Fields

hwloc_uint64_t local_memory
 
unsigned page_types_len
 
struct hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_spage_types
 
hwloc_uint64_t size
 
hwloc_uint64_t count
 

Detailed Description

-

NUMA node-specific Object Attributes.

+

Array of local memory page types, NULL if no local memory and page_types is 0.

+

The array is sorted by increasing size fields. It contains page_types_len slots.

Field Documentation

- -

◆ local_memory

+ +

◆ count

- +
hwloc_uint64_t hwloc_obj_attr_u::hwloc_numanode_attr_s::local_memoryhwloc_uint64_t hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s::count
-

Local memory (in bytes)

+

Number of pages of this size.

- -

◆ page_types

+ +

◆ size

- +
struct hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s * hwloc_obj_attr_u::hwloc_numanode_attr_s::page_typeshwloc_uint64_t hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s::size
-
-
- -

◆ page_types_len

- -
-
- - - - -
unsigned hwloc_obj_attr_u::hwloc_numanode_attr_s::page_types_len
-
- -

Size of array page_types.

+

Size of pages.

@@ -123,7 +103,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00247.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00247.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00247.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00247.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s Struct Reference +Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_cache_attr_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,25 +27,26 @@
- + +/* @license-end */
-
hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s Struct Reference
+
hwloc_obj_attr_u::hwloc_cache_attr_s Struct Reference
@@ -53,44 +54,97 @@ - - - - + + + + + + + + + +

Data Fields

hwloc_uint64_t size
 
hwloc_uint64_t count
 
hwloc_uint64_t size
 
unsigned depth
 
unsigned linesize
 
int associativity
 
hwloc_obj_cache_type_t type
 

Detailed Description

-

Array of local memory page types, NULL if no local memory and page_types is 0.

-

The array is sorted by increasing size fields. It contains page_types_len slots.

+

Cache-specific Object Attributes.

Field Documentation

- -

◆ count

+ +

◆ associativity

- +
hwloc_uint64_t hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s::countint hwloc_obj_attr_u::hwloc_cache_attr_s::associativity
-

Number of pages of this size.

+

Ways of associativity, -1 if fully associative, 0 if unknown.

- -

◆ size

+ +

◆ depth

- +
hwloc_uint64_t hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s::sizeunsigned hwloc_obj_attr_u::hwloc_cache_attr_s::depth
-

Size of pages.

+

Depth of cache (e.g., L1, L2, ...etc.)

+ +
+
+ +

◆ linesize

+ +
+
+ + + + +
unsigned hwloc_obj_attr_u::hwloc_cache_attr_s::linesize
+
+ +

Cache-line size in bytes. 0 if unknown.

+ +
+
+ +

◆ size

+ +
+
+ + + + +
hwloc_uint64_t hwloc_obj_attr_u::hwloc_cache_attr_s::size
+
+ +

Size of cache in bytes.

+ +
+
+ +

◆ type

+ +
+
+ + + + +
hwloc_obj_cache_type_t hwloc_obj_attr_u::hwloc_cache_attr_s::type
+
+ +

Cache type.

@@ -102,7 +156,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00251.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00251.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00251.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00251.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_cache_attr_s Struct Reference +Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_group_attr_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,25 +27,26 @@
- + +/* @license-end */
-
hwloc_obj_attr_u::hwloc_cache_attr_s Struct Reference
+
hwloc_obj_attr_u::hwloc_group_attr_s Struct Reference
@@ -53,97 +54,79 @@ - - - - - - - - - - + + + + + + + +

Data Fields

hwloc_uint64_t size
 
unsigned depth
 
unsigned linesize
 
int associativity
 
hwloc_obj_cache_type_t type
 
unsigned depth
 
unsigned kind
 
unsigned subkind
 
unsigned char dont_merge
 

Detailed Description

-

Cache-specific Object Attributes.

+

Group-specific Object Attributes.

Field Documentation

- -

◆ associativity

+ +

◆ depth

- +
int hwloc_obj_attr_u::hwloc_cache_attr_s::associativityunsigned hwloc_obj_attr_u::hwloc_group_attr_s::depth
-

Ways of associativity, -1 if fully associative, 0 if unknown.

+

Depth of group object. It may change if intermediate Group objects are added.

- -

◆ depth

+ +

◆ dont_merge

- +
unsigned hwloc_obj_attr_u::hwloc_cache_attr_s::depthunsigned char hwloc_obj_attr_u::hwloc_group_attr_s::dont_merge
-

Depth of cache (e.g., L1, L2, ...etc.)

+

Flag preventing groups from being automatically merged with identical parent or children.

- -

◆ linesize

+ +

◆ kind

- +
unsigned hwloc_obj_attr_u::hwloc_cache_attr_s::linesizeunsigned hwloc_obj_attr_u::hwloc_group_attr_s::kind
-

Cache-line size in bytes. 0 if unknown.

+

Internally-used kind of group.

- -

◆ size

+ +

◆ subkind

- +
hwloc_uint64_t hwloc_obj_attr_u::hwloc_cache_attr_s::sizeunsigned hwloc_obj_attr_u::hwloc_group_attr_s::subkind
-

Size of cache in bytes.

- -
-
- -

◆ type

- -
-
- - - - -
hwloc_obj_cache_type_t hwloc_obj_attr_u::hwloc_cache_attr_s::type
-
- -

Cache type.

+

Internally-used subkind to distinguish different levels of groups with same kind.

@@ -155,7 +138,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00255.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00255.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00255.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00255.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_group_attr_s Struct Reference +Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_pcidev_attr_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,25 +27,26 @@
- + +/* @license-end */
-
hwloc_obj_attr_u::hwloc_group_attr_s Struct Reference
+
hwloc_obj_attr_u::hwloc_pcidev_attr_s Struct Reference
@@ -53,79 +54,183 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +

Data Fields

unsigned depth
 
unsigned kind
 
unsigned subkind
 
unsigned char dont_merge
 
unsigned short domain
 
unsigned char bus
 
unsigned char dev
 
unsigned char func
 
unsigned short class_id
 
unsigned short vendor_id
 
unsigned short device_id
 
unsigned short subvendor_id
 
unsigned short subdevice_id
 
unsigned char revision
 
float linkspeed
 

Detailed Description

-

Group-specific Object Attributes.

+

PCI Device specific Object Attributes.

Field Documentation

- -

◆ depth

+ +

◆ bus

- +
unsigned hwloc_obj_attr_u::hwloc_group_attr_s::depthunsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::bus
-

Depth of group object. It may change if intermediate Group objects are added.

+
+
+ +

◆ class_id

+ +
+
+ + + + +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::class_id
+
- -

◆ dont_merge

+ +

◆ dev

- +
unsigned char hwloc_obj_attr_u::hwloc_group_attr_s::dont_mergeunsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::dev
-

Flag preventing groups from being automatically merged with identical parent or children.

+
+
+ +

◆ device_id

+ +
+
+ + + + +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::device_id
+
- -

◆ kind

+ +

◆ domain

- +
unsigned hwloc_obj_attr_u::hwloc_group_attr_s::kindunsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::domain
-

Internally-used kind of group.

+
+
+ +

◆ func

+ +
+
+ + + + +
unsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::func
+
- -

◆ subkind

+ +

◆ linkspeed

- +
unsigned hwloc_obj_attr_u::hwloc_group_attr_s::subkindfloat hwloc_obj_attr_u::hwloc_pcidev_attr_s::linkspeed
-

Internally-used subkind to distinguish different levels of groups with same kind.

+
+
+ +

◆ revision

+ +
+
+ + + + +
unsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::revision
+
+ +
+
+ +

◆ subdevice_id

+ +
+
+ + + + +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::subdevice_id
+
+ +
+
+ +

◆ subvendor_id

+ +
+
+ + + + +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::subvendor_id
+
+ +
+
+ +

◆ vendor_id

+ +
+
+ + + + +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::vendor_id
+
@@ -137,7 +242,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00259.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00259.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00259.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00259.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_pcidev_attr_s Struct Reference +Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_bridge_attr_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,25 +27,26 @@
- + +/* @license-end */
-
hwloc_obj_attr_u::hwloc_pcidev_attr_s Struct Reference
+
hwloc_obj_attr_u::hwloc_bridge_attr_s Struct Reference
@@ -53,180 +54,167 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +

Data Fields

unsigned short domain
 
unsigned char bus
 
unsigned char dev
 
unsigned char func
 
unsigned short class_id
 
unsigned short vendor_id
 
unsigned short device_id
 
unsigned short subvendor_id
 
unsigned short subdevice_id
 
unsigned char revision
 
float linkspeed
 
union {
   struct hwloc_pcidev_attr_s   pci
 
upstream
 
hwloc_obj_bridge_type_t upstream_type
 
union {
   struct {
      unsigned short   domain
 
      unsigned char   secondary_bus
 
      unsigned char   subordinate_bus
 
   }   pci
 
downstream
 
hwloc_obj_bridge_type_t downstream_type
 
unsigned depth
 

Detailed Description

-

PCI Device specific Object Attributes.

+

Bridge specific Object Attribues.

Field Documentation

- -

◆ bus

+ +

◆ depth

- +
unsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::busunsigned hwloc_obj_attr_u::hwloc_bridge_attr_s::depth
- -

◆ class_id

+ +

◆ domain

- +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::class_idunsigned short hwloc_obj_attr_u::hwloc_bridge_attr_s::domain
- -

◆ dev

+ +

◆ downstream

- +
unsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::devunion { ... } hwloc_obj_attr_u::hwloc_bridge_attr_s::downstream
- -

◆ device_id

+ +

◆ downstream_type

- +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::device_idhwloc_obj_bridge_type_t hwloc_obj_attr_u::hwloc_bridge_attr_s::downstream_type
- -

◆ domain

+ +

◆ pci [1/2]

- +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::domainstruct { ... } hwloc_obj_attr_u::hwloc_bridge_attr_s::pci
- -

◆ func

+ +

◆ pci [2/2]

- +
unsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::funcstruct hwloc_pcidev_attr_s hwloc_obj_attr_u::hwloc_bridge_attr_s::pci
- -

◆ linkspeed

+ +

◆ secondary_bus

- +
float hwloc_obj_attr_u::hwloc_pcidev_attr_s::linkspeedunsigned char hwloc_obj_attr_u::hwloc_bridge_attr_s::secondary_bus
- -

◆ revision

+ +

◆ subordinate_bus

- +
unsigned char hwloc_obj_attr_u::hwloc_pcidev_attr_s::revisionunsigned char hwloc_obj_attr_u::hwloc_bridge_attr_s::subordinate_bus
- -

◆ subdevice_id

+ +

◆ upstream

- +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::subdevice_idunion { ... } hwloc_obj_attr_u::hwloc_bridge_attr_s::upstream
- -

◆ subvendor_id

+ +

◆ upstream_type

- - -
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::subvendor_id
-
- -
-
- -

◆ vendor_id

- -
-
- - - +
unsigned short hwloc_obj_attr_u::hwloc_pcidev_attr_s::vendor_idhwloc_obj_bridge_type_t hwloc_obj_attr_u::hwloc_bridge_attr_s::upstream_type
@@ -241,7 +229,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00263.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00263.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00263.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00263.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_bridge_attr_s Struct Reference - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - - -
-
- -
-
hwloc_obj_attr_u::hwloc_bridge_attr_s Struct Reference
-
-
- -

#include <hwloc.h>

- - - - - - - - - - - - - - - - - - - - - - - - - -

-Data Fields

union {
   struct hwloc_pcidev_attr_s   pci
 
upstream
 
hwloc_obj_bridge_type_t upstream_type
 
union {
   struct {
      unsigned short   domain
 
      unsigned char   secondary_bus
 
      unsigned char   subordinate_bus
 
   }   pci
 
downstream
 
hwloc_obj_bridge_type_t downstream_type
 
unsigned depth
 
-

Detailed Description

-

Bridge specific Object Attribues.

-

Field Documentation

- -

◆ depth

- -
-
- - - - -
unsigned hwloc_obj_attr_u::hwloc_bridge_attr_s::depth
-
- -
-
- -

◆ domain

- -
-
- - - - -
unsigned short hwloc_obj_attr_u::hwloc_bridge_attr_s::domain
-
- -
-
- -

◆ downstream

- -
-
- - - - -
union { ... } hwloc_obj_attr_u::hwloc_bridge_attr_s::downstream
-
- -
-
- -

◆ downstream_type

- -
-
- - - - -
hwloc_obj_bridge_type_t hwloc_obj_attr_u::hwloc_bridge_attr_s::downstream_type
-
- -
-
- -

◆ pci [1/2]

- -
-
- - - - -
struct { ... } hwloc_obj_attr_u::hwloc_bridge_attr_s::pci
-
- -
-
- -

◆ pci [2/2]

- -
-
- - - - -
struct hwloc_pcidev_attr_s hwloc_obj_attr_u::hwloc_bridge_attr_s::pci
-
- -
-
- -

◆ secondary_bus

- -
-
- - - - -
unsigned char hwloc_obj_attr_u::hwloc_bridge_attr_s::secondary_bus
-
- -
-
- -

◆ subordinate_bus

- -
-
- - - - -
unsigned char hwloc_obj_attr_u::hwloc_bridge_attr_s::subordinate_bus
-
- -
-
- -

◆ upstream

- -
-
- - - - -
union { ... } hwloc_obj_attr_u::hwloc_bridge_attr_s::upstream
-
- -
-
- -

◆ upstream_type

- -
-
- - - - -
hwloc_obj_bridge_type_t hwloc_obj_attr_u::hwloc_bridge_attr_s::upstream_type
-
- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00275.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00275.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00275.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00275.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,88 @@ + + + + + + + +Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_osdev_attr_s Struct Reference + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + + +
+
+ +
+
hwloc_obj_attr_u::hwloc_osdev_attr_s Struct Reference
+
+
+ +

#include <hwloc.h>

+ + + + +

+Data Fields

hwloc_obj_osdev_type_t type
 
+

Detailed Description

+

OS Device specific Object Attributes.

+

Field Documentation

+ +

◆ type

+ +
+
+ + + + +
hwloc_obj_osdev_type_t hwloc_obj_attr_u::hwloc_osdev_attr_s::type
+
+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00279.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00279.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00279.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00279.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_obj_attr_u::hwloc_osdev_attr_s Struct Reference +Hardware Locality (hwloc): hwloc_info_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,25 +27,22 @@
- + +/* @license-end */ -
-
hwloc_obj_attr_u::hwloc_osdev_attr_s Struct Reference
+
hwloc_info_s Struct Reference
@@ -53,24 +50,45 @@ - - + + + +

Data Fields

hwloc_obj_osdev_type_t type
 
char * name
 
char * value
 

Detailed Description

-

OS Device specific Object Attributes.

+

Field Documentation

- -

◆ type

+ +

◆ name

+ +
+
+ + + + +
char* hwloc_info_s::name
+
+ +

Info name.

+ +
+
+ +

◆ value

- +
hwloc_obj_osdev_type_t hwloc_obj_attr_u::hwloc_osdev_attr_s::typechar* hwloc_info_s::value
+

Info value.

+

The documentation for this struct was generated from the following file:
    @@ -81,7 +99,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00283.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00283.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00283.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00283.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_info_s Struct Reference +Hardware Locality (hwloc): hwloc_topology_discovery_support Struct Reference @@ -19,7 +19,7 @@
    Hardware Locality (hwloc) -  2.1.0 +  2.2.0
    @@ -27,21 +27,22 @@
- + +/* @license-end */
-
hwloc_info_s Struct Reference
+
hwloc_topology_discovery_support Struct Reference
@@ -49,44 +50,97 @@ - - - - + + + + + + + + + +

Data Fields

char * name
 
char * value
 
unsigned char pu
 
unsigned char numa
 
unsigned char numa_memory
 
unsigned char disallowed_pu
 
unsigned char disallowed_numa
 

Detailed Description

-

Object info.

-
See also
Consulting and Adding Key-Value Info Attributes
+

Flags describing actual discovery support for this topology.

Field Documentation

- -

◆ name

+ +

◆ disallowed_numa

- +
char* hwloc_info_s::nameunsigned char hwloc_topology_discovery_support::disallowed_numa
-

Info name.

+

Detecting and identifying NUMA nodes that are not available to the current process is supported.

- -

◆ value

+ +

◆ disallowed_pu

- +
char* hwloc_info_s::valueunsigned char hwloc_topology_discovery_support::disallowed_pu
-

Info value.

+

Detecting and identifying PU objects that are not available to the current process is supported.

+ +
+
+ +

◆ numa

+ +
+
+ + + + +
unsigned char hwloc_topology_discovery_support::numa
+
+ +

Detecting the number of NUMA nodes is supported.

+ +
+
+ +

◆ numa_memory

+ +
+
+ + + + +
unsigned char hwloc_topology_discovery_support::numa_memory
+
+ +

Detecting the amount of memory in NUMA nodes is supported.

+ +
+
+ +

◆ pu

+ +
+
+ + + + +
unsigned char hwloc_topology_discovery_support::pu
+
+ +

Detecting the number of PU objects is supported.

@@ -98,7 +152,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00287.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00287.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00287.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00287.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_discovery_support Struct Reference +Hardware Locality (hwloc): hwloc_topology_cpubind_support Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,21 +27,22 @@
- + +/* @license-end */
-
hwloc_topology_discovery_support Struct Reference
+
hwloc_topology_cpubind_support Struct Reference
@@ -49,97 +50,195 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +

Data Fields

unsigned char pu
 
unsigned char numa
 
unsigned char numa_memory
 
unsigned char disallowed_pu
 
unsigned char disallowed_numa
 
unsigned char set_thisproc_cpubind
 
unsigned char get_thisproc_cpubind
 
unsigned char set_proc_cpubind
 
unsigned char get_proc_cpubind
 
unsigned char set_thisthread_cpubind
 
unsigned char get_thisthread_cpubind
 
unsigned char set_thread_cpubind
 
unsigned char get_thread_cpubind
 
unsigned char get_thisproc_last_cpu_location
 
unsigned char get_proc_last_cpu_location
 
unsigned char get_thisthread_last_cpu_location
 

Detailed Description

-

Flags describing actual discovery support for this topology.

+

Flags describing actual PU binding support for this topology.

+

A flag may be set even if the feature isn't supported in all cases (e.g. binding to random sets of non-contiguous objects).

Field Documentation

- -

◆ disallowed_numa

+ +

◆ get_proc_cpubind

- +
unsigned char hwloc_topology_discovery_support::disallowed_numaunsigned char hwloc_topology_cpubind_support::get_proc_cpubind
+

Getting the binding of a whole given process is supported.

-

Detecting and identifying NUMA nodes that are not available to the current process is supported.

+
+
+ +

◆ get_proc_last_cpu_location

+ +
+
+ + + + +
unsigned char hwloc_topology_cpubind_support::get_proc_last_cpu_location
+
+

Getting the last processors where a whole process ran is supported

- -

◆ disallowed_pu

+ +

◆ get_thisproc_cpubind

- +
unsigned char hwloc_topology_discovery_support::disallowed_puunsigned char hwloc_topology_cpubind_support::get_thisproc_cpubind
+

Getting the binding of the whole current process is supported.

-

Detecting and identifying PU objects that are not available to the current process is supported.

+
+
+ +

◆ get_thisproc_last_cpu_location

+ +
+
+ + + + +
unsigned char hwloc_topology_cpubind_support::get_thisproc_last_cpu_location
+
+

Getting the last processors where the whole current process ran is supported

- -

◆ numa

+ +

◆ get_thisthread_cpubind

- +
unsigned char hwloc_topology_discovery_support::numaunsigned char hwloc_topology_cpubind_support::get_thisthread_cpubind
+

Getting the binding of the current thread only is supported.

-

Detecting the number of NUMA nodes is supported.

+
+
+ +

◆ get_thisthread_last_cpu_location

+ +
+
+ + + + +
unsigned char hwloc_topology_cpubind_support::get_thisthread_last_cpu_location
+
+

Getting the last processors where the current thread ran is supported

- -

◆ numa_memory

+ +

◆ get_thread_cpubind

- +
unsigned char hwloc_topology_discovery_support::numa_memoryunsigned char hwloc_topology_cpubind_support::get_thread_cpubind
+

Getting the binding of a given thread only is supported.

-

Detecting the amount of memory in NUMA nodes is supported.

+
+
+ +

◆ set_proc_cpubind

+ +
+
+ + + + +
unsigned char hwloc_topology_cpubind_support::set_proc_cpubind
+
+

Binding a whole given process is supported.

+ +
+
+ +

◆ set_thisproc_cpubind

+ +
+
+ + + + +
unsigned char hwloc_topology_cpubind_support::set_thisproc_cpubind
+
+

Binding the whole current process is supported.

- -

◆ pu

+ +

◆ set_thisthread_cpubind

- +
unsigned char hwloc_topology_discovery_support::puunsigned char hwloc_topology_cpubind_support::set_thisthread_cpubind
+

Binding the current thread only is supported.

+ +
+
+ +

◆ set_thread_cpubind

-

Detecting the number of PU objects is supported.

+
+
+ + + + +
unsigned char hwloc_topology_cpubind_support::set_thread_cpubind
+
+

Binding a given thread only is supported.

@@ -151,7 +250,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00291.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00291.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00291.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00291.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_cpubind_support Struct Reference +Hardware Locality (hwloc): hwloc_topology_membind_support Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,21 +27,22 @@
- + +/* @license-end */
-
hwloc_topology_cpubind_support Struct Reference
+
hwloc_topology_membind_support Struct Reference
@@ -49,101 +50,154 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Fields

unsigned char set_thisproc_cpubind
 
unsigned char get_thisproc_cpubind
 
unsigned char set_proc_cpubind
 
unsigned char get_proc_cpubind
 
unsigned char set_thisthread_cpubind
 
unsigned char get_thisthread_cpubind
 
unsigned char set_thread_cpubind
 
unsigned char get_thread_cpubind
 
unsigned char get_thisproc_last_cpu_location
 
unsigned char get_proc_last_cpu_location
 
unsigned char get_thisthread_last_cpu_location
 
unsigned char set_thisproc_membind
 
unsigned char get_thisproc_membind
 
unsigned char set_proc_membind
 
unsigned char get_proc_membind
 
unsigned char set_thisthread_membind
 
unsigned char get_thisthread_membind
 
unsigned char set_area_membind
 
unsigned char get_area_membind
 
unsigned char alloc_membind
 
unsigned char firsttouch_membind
 
unsigned char bind_membind
 
unsigned char interleave_membind
 
unsigned char nexttouch_membind
 
unsigned char migrate_membind
 
unsigned char get_area_memlocation
 

Detailed Description

-

Flags describing actual PU binding support for this topology.

+

Flags describing actual memory binding support for this topology.

A flag may be set even if the feature isn't supported in all cases (e.g. binding to random sets of non-contiguous objects).

Field Documentation

- -

◆ get_proc_cpubind

+ +

◆ alloc_membind

- +
unsigned char hwloc_topology_cpubind_support::get_proc_cpubindunsigned char hwloc_topology_membind_support::alloc_membind
-

Getting the binding of a whole given process is supported.

+

Allocating a bound memory area is supported.

- -

◆ get_proc_last_cpu_location

+ +

◆ bind_membind

- +
unsigned char hwloc_topology_cpubind_support::get_proc_last_cpu_locationunsigned char hwloc_topology_membind_support::bind_membind
-

Getting the last processors where a whole process ran is supported

+

Bind policy is supported.

- -

◆ get_thisproc_cpubind

+ +

◆ firsttouch_membind

- +
unsigned char hwloc_topology_cpubind_support::get_thisproc_cpubindunsigned char hwloc_topology_membind_support::firsttouch_membind
-

Getting the binding of the whole current process is supported.

+

First-touch policy is supported.

+ +
+
+ +

◆ get_area_membind

+ +
+
+ + + + +
unsigned char hwloc_topology_membind_support::get_area_membind
+
+

Getting the binding of a given memory area is supported.

+ +
+
+ +

◆ get_area_memlocation

+ +
+
+ + + + +
unsigned char hwloc_topology_membind_support::get_area_memlocation
+
+

Getting the last NUMA nodes where a memory area was allocated is supported

+ +
+
+ +

◆ get_proc_membind

+ +
+
+ + + + +
unsigned char hwloc_topology_membind_support::get_proc_membind
+
+

Getting the binding of a whole given process is supported.

- -

◆ get_thisproc_last_cpu_location

+ +

◆ get_thisproc_membind

- +
unsigned char hwloc_topology_cpubind_support::get_thisproc_last_cpu_locationunsigned char hwloc_topology_membind_support::get_thisproc_membind
-

Getting the last processors where the whole current process ran is supported

+

Getting the binding of the whole current process is supported.

- -

◆ get_thisthread_cpubind

+ +

◆ get_thisthread_membind

- +
unsigned char hwloc_topology_cpubind_support::get_thisthread_cpubindunsigned char hwloc_topology_membind_support::get_thisthread_membind
@@ -151,93 +205,108 @@
- -

◆ get_thisthread_last_cpu_location

+ +

◆ interleave_membind

- +
unsigned char hwloc_topology_cpubind_support::get_thisthread_last_cpu_locationunsigned char hwloc_topology_membind_support::interleave_membind
-

Getting the last processors where the current thread ran is supported

+

Interleave policy is supported.

- -

◆ get_thread_cpubind

+ +

◆ migrate_membind

- +
unsigned char hwloc_topology_cpubind_support::get_thread_cpubindunsigned char hwloc_topology_membind_support::migrate_membind
-

Getting the binding of a given thread only is supported.

+

Migration flags is supported.

- -

◆ set_proc_cpubind

+ +

◆ nexttouch_membind

- +
unsigned char hwloc_topology_cpubind_support::set_proc_cpubindunsigned char hwloc_topology_membind_support::nexttouch_membind
-

Binding a whole given process is supported.

+

Next-touch migration policy is supported.

- -

◆ set_thisproc_cpubind

+ +

◆ set_area_membind

- +
unsigned char hwloc_topology_cpubind_support::set_thisproc_cpubindunsigned char hwloc_topology_membind_support::set_area_membind
-

Binding the whole current process is supported.

+

Binding a given memory area is supported.

- -

◆ set_thisthread_cpubind

+ +

◆ set_proc_membind

- +
unsigned char hwloc_topology_cpubind_support::set_thisthread_cpubindunsigned char hwloc_topology_membind_support::set_proc_membind
-

Binding the current thread only is supported.

+

Binding a whole given process is supported.

- -

◆ set_thread_cpubind

+ +

◆ set_thisproc_membind

- +
unsigned char hwloc_topology_cpubind_support::set_thread_cpubindunsigned char hwloc_topology_membind_support::set_thisproc_membind
-

Binding a given thread only is supported.

+

Binding the whole current process is supported.

+ +
+
+ +

◆ set_thisthread_membind

+ +
+
+ + + + +
unsigned char hwloc_topology_membind_support::set_thisthread_membind
+
+

Binding the current thread only is supported.

@@ -249,7 +318,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00295.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00295.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00295.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00295.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_membind_support Struct Reference +Hardware Locality (hwloc): hwloc_topology_support Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,21 +27,22 @@
- + +/* @license-end */
-
hwloc_topology_membind_support Struct Reference
+
hwloc_topology_support Struct Reference
@@ -49,263 +50,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +

Data Fields

unsigned char set_thisproc_membind
 
unsigned char get_thisproc_membind
 
unsigned char set_proc_membind
 
unsigned char get_proc_membind
 
unsigned char set_thisthread_membind
 
unsigned char get_thisthread_membind
 
unsigned char set_area_membind
 
unsigned char get_area_membind
 
unsigned char alloc_membind
 
unsigned char firsttouch_membind
 
unsigned char bind_membind
 
unsigned char interleave_membind
 
unsigned char nexttouch_membind
 
unsigned char migrate_membind
 
unsigned char get_area_memlocation
 
struct hwloc_topology_discovery_supportdiscovery
 
struct hwloc_topology_cpubind_supportcpubind
 
struct hwloc_topology_membind_supportmembind
 

Detailed Description

-

Flags describing actual memory binding support for this topology.

-

A flag may be set even if the feature isn't supported in all cases (e.g. binding to random sets of non-contiguous objects).

+

Set of flags describing actual support for this topology.

+

This is retrieved with hwloc_topology_get_support() and will be valid until the topology object is destroyed. Note: the values are correct only after discovery.

Field Documentation

- -

◆ alloc_membind

+ +

◆ cpubind

- +
unsigned char hwloc_topology_membind_support::alloc_membindstruct hwloc_topology_cpubind_support* hwloc_topology_support::cpubind
-

Allocating a bound memory area is supported.

- -

◆ bind_membind

+ +

◆ discovery

- +
unsigned char hwloc_topology_membind_support::bind_membindstruct hwloc_topology_discovery_support* hwloc_topology_support::discovery
-

Bind policy is supported.

- -

◆ firsttouch_membind

+ +

◆ membind

- +
unsigned char hwloc_topology_membind_support::firsttouch_membindstruct hwloc_topology_membind_support* hwloc_topology_support::membind
-

First-touch policy is supported.

- -
-
- -

◆ get_area_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::get_area_membind
-
-

Getting the binding of a given memory area is supported.

- -
-
- -

◆ get_area_memlocation

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::get_area_memlocation
-
-

Getting the last NUMA nodes where a memory area was allocated is supported

- -
-
- -

◆ get_proc_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::get_proc_membind
-
-

Getting the binding of a whole given process is supported.

- -
-
- -

◆ get_thisproc_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::get_thisproc_membind
-
-

Getting the binding of the whole current process is supported.

- -
-
- -

◆ get_thisthread_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::get_thisthread_membind
-
-

Getting the binding of the current thread only is supported.

- -
-
- -

◆ interleave_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::interleave_membind
-
-

Interleave policy is supported.

- -
-
- -

◆ migrate_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::migrate_membind
-
-

Migration flags is supported.

- -
-
- -

◆ nexttouch_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::nexttouch_membind
-
-

Next-touch migration policy is supported.

- -
-
- -

◆ set_area_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::set_area_membind
-
-

Binding a given memory area is supported.

- -
-
- -

◆ set_proc_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::set_proc_membind
-
-

Binding a whole given process is supported.

- -
-
- -

◆ set_thisproc_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::set_thisproc_membind
-
-

Binding the whole current process is supported.

- -
-
- -

◆ set_thisthread_membind

- -
-
- - - - -
unsigned char hwloc_topology_membind_support::set_thisthread_membind
-
-

Binding the current thread only is supported.

@@ -317,7 +111,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00299.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00299.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00299.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00299.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_support Struct Reference +Hardware Locality (hwloc): hwloc_distances_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,90 +27,117 @@
- + +/* @license-end */
-
hwloc_topology_support Struct Reference
+
hwloc_distances_s Struct Reference
-

#include <hwloc.h>

+

#include <distances.h>

- - - - - - + + + + + + + +

Data Fields

struct hwloc_topology_discovery_supportdiscovery
 
struct hwloc_topology_cpubind_supportcpubind
 
struct hwloc_topology_membind_supportmembind
 
unsigned nbobjs
 
hwloc_obj_tobjs
 
unsigned long kind
 
hwloc_uint64_t * values
 

Detailed Description

-

Set of flags describing actual support for this topology.

-

This is retrieved with hwloc_topology_get_support() and will be valid until the topology object is destroyed. Note: the values are correct only after discovery.

+

Matrix of distances between a set of objects.

+

This matrix often contains latencies between NUMA nodes (as reported in the System Locality Distance Information Table (SLIT) in the ACPI specification), which may or may not be physically accurate. It corresponds to the latency for accessing the memory of one node from a core in another node. The corresponding kind is HWLOC_DISTANCES_KIND_FROM_OS | HWLOC_DISTANCES_KIND_FROM_USER.

+

The matrix may also contain bandwidths between random sets of objects, possibly provided by the user, as specified in the kind attribute.

Field Documentation

- -

◆ cpubind

+ +

◆ kind

- +
struct hwloc_topology_cpubind_support* hwloc_topology_support::cpubindunsigned long hwloc_distances_s::kind
+

OR'ed set of hwloc_distances_kind_e.

+
- -

◆ discovery

+ +

◆ nbobjs

- +
struct hwloc_topology_discovery_support* hwloc_topology_support::discoveryunsigned hwloc_distances_s::nbobjs
+

Number of objects described by the distance matrix.

+
- -

◆ membind

+ +

◆ objs

- +
struct hwloc_topology_membind_support* hwloc_topology_support::membindhwloc_obj_t* hwloc_distances_s::objs
+

Array of objects described by the distance matrix. These objects are not in any particular order, see hwloc_distances_obj_index() and hwloc_distances_obj_pair_values() for easy ways to find objects in this array and their corresponding values.

+ +
+
+ +

◆ values

+ +
+
+ + + + +
hwloc_uint64_t* hwloc_distances_s::values
+
+ +

Matrix of distances between objects, stored as a one-dimension array.

+

Distance from i-th to j-th object is stored in slot i*nbobjs+j. The meaning of the value depends on the kind attribute.

+

The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00303.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00303.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00303.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00303.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_distances_s Struct Reference +Hardware Locality (hwloc): hwloc_cl_device_topology_amd Union Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,116 +27,172 @@
- + +/* @license-end */
-
hwloc_distances_s Struct Reference
+
hwloc_cl_device_topology_amd Union Reference
-

#include <distances.h>

+

#include <opencl.h>

- - - - - - - - + + + + + + + + + + + + + + + + + + + +

Data Fields

unsigned nbobjs
 
hwloc_obj_tobjs
 
unsigned long kind
 
hwloc_uint64_t * values
 
struct {
   cl_uint   type
 
   cl_uint   data [5]
 
raw
 
struct {
   cl_uint   type
 
   cl_char   unused [17]
 
   cl_char   bus
 
   cl_char   device
 
   cl_char   function
 
pcie
 
-

Detailed Description

-

Matrix of distances between a set of objects.

-

This matrix often contains latencies between NUMA nodes (as reported in the System Locality Distance Information Table (SLIT) in the ACPI specification), which may or may not be physically accurate. It corresponds to the latency for accessing the memory of one node from a core in another node. The corresponding kind is HWLOC_DISTANCES_KIND_FROM_OS | HWLOC_DISTANCES_KIND_FROM_USER.

-

The matrix may also contain bandwidths between random sets of objects, possibly provided by the user, as specified in the kind attribute.

-

Field Documentation

- -

◆ kind

+

Field Documentation

+ +

◆ bus

- +
unsigned long hwloc_distances_s::kindcl_char hwloc_cl_device_topology_amd::bus
-

OR'ed set of hwloc_distances_kind_e.

+
+
+ +

◆ data

+ +
+
+ + + + +
cl_uint hwloc_cl_device_topology_amd::data[5]
+
- -

◆ nbobjs

+ +

◆ device

- +
unsigned hwloc_distances_s::nbobjscl_char hwloc_cl_device_topology_amd::device
-

Number of objects described by the distance matrix.

+
+
+ +

◆ function

+ +
+
+ + + + +
cl_char hwloc_cl_device_topology_amd::function
+
- -

◆ objs

+ +

◆ pcie

- +
hwloc_obj_t* hwloc_distances_s::objsstruct { ... } hwloc_cl_device_topology_amd::pcie
-

Array of objects described by the distance matrix. These objects are not in any particular order, see hwloc_distances_obj_index() and hwloc_distances_obj_pair_values() for easy ways to find objects in this array and their corresponding values.

+
+
+ +

◆ raw

+ +
+
+ + + + +
struct { ... } hwloc_cl_device_topology_amd::raw
+
- -

◆ values

+ +

◆ type

- +
hwloc_uint64_t* hwloc_distances_s::valuescl_uint hwloc_cl_device_topology_amd::type
-

Matrix of distances between objects, stored as a one-dimension array.

-

Distance from i-th to j-th object is stored in slot i*nbobjs+j. The meaning of the value depends on the kind attribute.

+
+
+ +

◆ unused

+ +
+
+ + + + +
cl_char hwloc_cl_device_topology_amd::unused[17]
+
-
The documentation for this struct was generated from the following file:
    -
  • distances.h
  • +
    The documentation for this union was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00307.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00307.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00307.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00307.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): hwloc_cl_device_topology_amd Union Reference - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
- -
-
hwloc_cl_device_topology_amd Union Reference
-
-
- -

#include <opencl.h>

- - - - - - - - - - - - - - - - - - - - - - -

-Data Fields

struct {
   cl_uint   type
 
   cl_uint   data [5]
 
raw
 
struct {
   cl_uint   type
 
   cl_char   unused [17]
 
   cl_char   bus
 
   cl_char   device
 
   cl_char   function
 
pcie
 
-

Field Documentation

- -

◆ bus

- -
-
- - - - -
cl_char hwloc_cl_device_topology_amd::bus
-
- -
-
- -

◆ data

- -
-
- - - - -
cl_uint hwloc_cl_device_topology_amd::data[5]
-
- -
-
- -

◆ device

- -
-
- - - - -
cl_char hwloc_cl_device_topology_amd::device
-
- -
-
- -

◆ function

- -
-
- - - - -
cl_char hwloc_cl_device_topology_amd::function
-
- -
-
- -

◆ pcie

- -
-
- - - - -
struct { ... } hwloc_cl_device_topology_amd::pcie
-
- -
-
- -

◆ raw

- -
-
- - - - -
struct { ... } hwloc_cl_device_topology_amd::raw
-
- -
-
- -

◆ type

- -
-
- - - - -
cl_uint hwloc_cl_device_topology_amd::type
-
- -
-
- -

◆ unused

- -
-
- - - - -
cl_char hwloc_cl_device_topology_amd::unused[17]
-
- -
-
-
The documentation for this union was generated from the following file: -
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00315.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00315.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00315.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00315.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,126 @@ + + + + + + + +Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u Union Reference + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + +
+
+ +
+
hwloc_topology_diff_obj_attr_u Union Reference
+
+
+ +

#include <diff.h>

+ + + + + + + + +

+Data Structures

struct  hwloc_topology_diff_obj_attr_generic_s
 
struct  hwloc_topology_diff_obj_attr_string_s
 
struct  hwloc_topology_diff_obj_attr_uint64_s
 
+ + + + + + + +

+Data Fields

struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s generic
 
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s uint64
 
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s string
 
+

Detailed Description

+

One object attribute difference.

+

Field Documentation

+ +

◆ generic

+ +
+
+ + + + +
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s hwloc_topology_diff_obj_attr_u::generic
+
+ +
+
+ +

◆ string

+ +
+
+ + + + +
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s hwloc_topology_diff_obj_attr_u::string
+
+ +
+
+ +

◆ uint64

+ +
+
+ + + + +
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s hwloc_topology_diff_obj_attr_u::uint64
+
+ +
+
+
The documentation for this union was generated from the following file: +
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00319.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00319.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00319.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00319.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u Union Reference +Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,99 +27,60 @@ - + +/* @license-end */ +
-
hwloc_topology_diff_obj_attr_u Union Reference
+
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s Struct Reference
-

#include <diff.h>

+

#include <diff.h>

- - - - - - - -

-Data Structures

struct  hwloc_topology_diff_obj_attr_generic_s
 
struct  hwloc_topology_diff_obj_attr_string_s
 
struct  hwloc_topology_diff_obj_attr_uint64_s
 
- - - - - - + +

Data Fields

struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s generic
 
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s uint64
 
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s string
 
hwloc_topology_diff_obj_attr_type_t type
 
-

Detailed Description

-

One object attribute difference.

-

Field Documentation

- -

◆ generic

- -
-
- - - - -
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s hwloc_topology_diff_obj_attr_u::generic
-
- -
-
- -

◆ string

- -
-
- - - - -
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s hwloc_topology_diff_obj_attr_u::string
-
- -
-
- -

◆ uint64

+

Field Documentation

+ +

◆ type

- +
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s hwloc_topology_diff_obj_attr_u::uint64hwloc_topology_diff_obj_attr_type_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s::type
-
The documentation for this union was generated from the following file:
    -
  • diff.h
  • +
    The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00323.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00323.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00323.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00323.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s Struct Reference +Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,44 +27,95 @@ - + +/* @license-end */
-
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s Struct Reference
+
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s Struct Reference
-

#include <diff.h>

+

#include <diff.h>

- - + + + + + + + +

Data Fields

hwloc_topology_diff_obj_attr_type_t type
 
hwloc_topology_diff_obj_attr_type_t type
 
hwloc_uint64_t index
 
hwloc_uint64_t oldvalue
 
hwloc_uint64_t newvalue
 
-

Field Documentation

- -

◆ type

+

Detailed Description

+

Integer attribute modification with an optional index.

+

Field Documentation

+ +

◆ index

- + + +
hwloc_topology_diff_obj_attr_type_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s::typehwloc_uint64_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::index
+
+ +
+
+ +

◆ newvalue

+ +
+
+ + + + +
hwloc_uint64_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::newvalue
+
+ +
+
+ +

◆ oldvalue

+ +
+
+ + + + +
hwloc_uint64_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::oldvalue
+
+ +
+
+ +

◆ type

+ +
+
+ + +
hwloc_topology_diff_obj_attr_type_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::type
@@ -72,14 +123,14 @@

The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00327.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00327.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00327.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00327.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s Struct Reference +Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,94 +27,95 @@ - + +/* @license-end */
-
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s Struct Reference
+
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s Struct Reference
-

#include <diff.h>

+

#include <diff.h>

- - - - - - - - + + + + + + + +

Data Fields

hwloc_topology_diff_obj_attr_type_t type
 
hwloc_uint64_t index
 
hwloc_uint64_t oldvalue
 
hwloc_uint64_t newvalue
 
hwloc_topology_diff_obj_attr_type_t type
 
char * name
 
char * oldvalue
 
char * newvalue
 

Detailed Description

-

Integer attribute modification with an optional index.

+

String attribute modification with an optional name.

Field Documentation

- -

◆ index

+ +

◆ name

- +
hwloc_uint64_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::indexchar* hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::name
- -

◆ newvalue

+ +

◆ newvalue

- +
hwloc_uint64_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::newvaluechar* hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::newvalue
- -

◆ oldvalue

+ +

◆ oldvalue

- +
hwloc_uint64_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::oldvaluechar* hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::oldvalue
- -

◆ type

+ +

◆ type

- +
hwloc_topology_diff_obj_attr_type_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::typehwloc_topology_diff_obj_attr_type_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::type
@@ -122,14 +123,14 @@

The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00331.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00331.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00331.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00331.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s Struct Reference +Hardware Locality (hwloc): hwloc_topology_diff_u Union Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,109 +27,100 @@
- + +/* @license-end */ -
-
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s Struct Reference
+
hwloc_topology_diff_u Union Reference
-

#include <diff.h>

+

#include <diff.h>

+ + + + + + + +

+Data Structures

struct  hwloc_topology_diff_generic_s
 
struct  hwloc_topology_diff_obj_attr_s
 
struct  hwloc_topology_diff_too_complex_s
 
- - - - - - - - + + + + + +

Data Fields

hwloc_topology_diff_obj_attr_type_t type
 
char * name
 
char * oldvalue
 
char * newvalue
 
struct hwloc_topology_diff_u::hwloc_topology_diff_generic_s generic
 
struct hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s obj_attr
 
struct hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s too_complex
 

Detailed Description

-

String attribute modification with an optional name.

+

One element of a difference list between two topologies.

Field Documentation

- -

◆ name

- -
-
- - - - -
char* hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::name
-
- -
-
- -

◆ newvalue

+ +

◆ generic

- +
char* hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::newvaluestruct hwloc_topology_diff_u::hwloc_topology_diff_generic_s hwloc_topology_diff_u::generic
- -

◆ oldvalue

+ +

◆ obj_attr

- +
char* hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::oldvaluestruct hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s hwloc_topology_diff_u::obj_attr
- -

◆ type

+ +

◆ too_complex

- +
hwloc_topology_diff_obj_attr_type_t hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::typestruct hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s hwloc_topology_diff_u::too_complex
-
The documentation for this struct was generated from the following file:
    -
  • diff.h
  • +
    The documentation for this union was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00335.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00335.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00335.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00335.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_u Union Reference +Hardware Locality (hwloc): hwloc_topology_diff_u::hwloc_topology_diff_generic_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,99 +27,76 @@
- + +/* @license-end */ +
-
hwloc_topology_diff_u Union Reference
+
hwloc_topology_diff_u::hwloc_topology_diff_generic_s Struct Reference
-

#include <diff.h>

+

#include <diff.h>

- - - - - - - -

-Data Structures

struct  hwloc_topology_diff_generic_s
 
struct  hwloc_topology_diff_obj_attr_s
 
struct  hwloc_topology_diff_too_complex_s
 
- - - - - - + + + +

Data Fields

struct hwloc_topology_diff_u::hwloc_topology_diff_generic_s generic
 
struct hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s obj_attr
 
struct hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s too_complex
 
hwloc_topology_diff_type_t type
 
union hwloc_topology_diff_unext
 
-

Detailed Description

-

One element of a difference list between two topologies.

-

Field Documentation

- -

◆ generic

- -
-
- - - - -
struct hwloc_topology_diff_u::hwloc_topology_diff_generic_s hwloc_topology_diff_u::generic
-
- -
-
- -

◆ obj_attr

+

Field Documentation

+ +

◆ next

- +
struct hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s hwloc_topology_diff_u::obj_attrunion hwloc_topology_diff_u* hwloc_topology_diff_u::hwloc_topology_diff_generic_s::next
- -

◆ too_complex

+ +

◆ type

- +
struct hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s hwloc_topology_diff_u::too_complexhwloc_topology_diff_type_t hwloc_topology_diff_u::hwloc_topology_diff_generic_s::type
-
The documentation for this union was generated from the following file:
    -
  • diff.h
  • +
    The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00339.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00339.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00339.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00339.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_u::hwloc_topology_diff_generic_s Struct Reference +Hardware Locality (hwloc): hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,60 +27,109 @@ - + +/* @license-end */
-
hwloc_topology_diff_u::hwloc_topology_diff_generic_s Struct Reference
+
hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s Struct Reference
-

#include <diff.h>

+

#include <diff.h>

- - - - + + + + + + + + + +

Data Fields

hwloc_topology_diff_type_t type
 
union hwloc_topology_diff_unext
 
hwloc_topology_diff_type_t type
 
union hwloc_topology_diff_unext
 
int obj_depth
 
unsigned obj_index
 
union hwloc_topology_diff_obj_attr_u diff
 

Field Documentation

- -

◆ next

+ +

◆ diff

- +
union hwloc_topology_diff_u* hwloc_topology_diff_u::hwloc_topology_diff_generic_s::nextunion hwloc_topology_diff_obj_attr_u hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::diff
- -

◆ type

+ +

◆ next

- + + +
hwloc_topology_diff_type_t hwloc_topology_diff_u::hwloc_topology_diff_generic_s::typeunion hwloc_topology_diff_u* hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::next
+
+ +
+
+ +

◆ obj_depth

+ +
+
+ + + + +
int hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::obj_depth
+
+ +
+
+ +

◆ obj_index

+ +
+
+ + + + +
unsigned hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::obj_index
+
+ +
+
+ +

◆ type

+ +
+
+ + +
hwloc_topology_diff_type_t hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::type
@@ -88,14 +137,14 @@

The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00343.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00343.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00343.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00343.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s Struct Reference +Hardware Locality (hwloc): hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,108 +27,93 @@ - + +/* @license-end */
-
hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s Struct Reference
+
hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s Struct Reference
-

#include <diff.h>

+

#include <diff.h>

- - - - - - - - - - + + + + + + + +

Data Fields

hwloc_topology_diff_type_t type
 
union hwloc_topology_diff_unext
 
int obj_depth
 
unsigned obj_index
 
union hwloc_topology_diff_obj_attr_u diff
 
hwloc_topology_diff_type_t type
 
union hwloc_topology_diff_unext
 
int obj_depth
 
unsigned obj_index
 

Field Documentation

- -

◆ diff

+ +

◆ next

- +
union hwloc_topology_diff_obj_attr_u hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::diffunion hwloc_topology_diff_u* hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::next
- -

◆ next

+ +

◆ obj_depth

- +
union hwloc_topology_diff_u* hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::nextint hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::obj_depth
- -

◆ obj_depth

+ +

◆ obj_index

- +
int hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::obj_depthunsigned hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::obj_index
- -

◆ obj_index

+ +

◆ type

- - -
unsigned hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::obj_index
-
- -
-
- -

◆ type

- -
-
- - - +
hwloc_topology_diff_type_t hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::typehwloc_topology_diff_type_t hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::type
@@ -136,14 +121,14 @@

The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00347.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00347.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00347.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00347.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s Struct Reference +Hardware Locality (hwloc): hwloc_disc_component Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,107 +27,154 @@ - + +/* @license-end */ -
-
hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s Struct Reference
+
hwloc_disc_component Struct Reference
-

#include <diff.h>

+

#include <plugins.h>

- - - - - - - - + + + + + + + + + + + +

Data Fields

hwloc_topology_diff_type_t type
 
union hwloc_topology_diff_unext
 
int obj_depth
 
unsigned obj_index
 
const char * name
 
unsigned phases
 
unsigned excluded_phases
 
struct hwloc_backend *(* instantiate )(struct hwloc_topology *topology, struct hwloc_disc_component *component, unsigned excluded_phases, const void *data1, const void *data2, const void *data3)
 
unsigned priority
 
unsigned enabled_by_default
 
-

Field Documentation

- -

◆ next

+

Detailed Description

+

Discovery component structure.

+

This is the major kind of components, taking care of the discovery. They are registered by generic components, either statically-built or as plugins.

+

Field Documentation

+ +

◆ enabled_by_default

- +
union hwloc_topology_diff_u* hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::nextunsigned hwloc_disc_component::enabled_by_default
+

Enabled by default. If unset, if will be disabled unless explicitly requested.

+
- -

◆ obj_depth

+ +

◆ excluded_phases

- +
int hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::obj_depthunsigned hwloc_disc_component::excluded_phases
+

Component phases to exclude, as an OR'ed set of hwloc_disc_phase_t.

+

For a GLOBAL component, this usually includes all other phases (~UL).

+

Other components only exclude types that may bring conflicting topology information. MISC components should likely not be excluded since they usually bring non-primary additional information.

+
- -

◆ obj_index

+ +

◆ instantiate

- +
unsigned hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::obj_indexstruct hwloc_backend*(* hwloc_disc_component::instantiate) (struct hwloc_topology *topology, struct hwloc_disc_component *component, unsigned excluded_phases, const void *data1, const void *data2, const void *data3)
+

Instantiate callback to create a backend from the component. Parameters data1, data2, data3 are NULL except for components that have special enabling routines such as hwloc_topology_set_xml().

+
- -

◆ type

+ +

◆ name

- +
hwloc_topology_diff_type_t hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::typeconst char* hwloc_disc_component::name
+

Name. If this component is built as a plugin, this name does not have to match the plugin filename.

+ +
+
+ +

◆ phases

+ +
+
+ + + + +
unsigned hwloc_disc_component::phases
+
+ +

Discovery phases performed by this component. OR'ed set of hwloc_disc_phase_t.

+ +
+
+ +

◆ priority

+ +
+
+ + + + +
unsigned hwloc_disc_component::priority
+
+ +

Component priority. Used to sort topology->components, higher priority first. Also used to decide between two components with the same name.

+

Usual values are 50 for native OS (or platform) components, 45 for x86, 40 for no-OS fallback, 30 for global components (xml, synthetic), 20 for pci, 10 for other misc components (opencl etc.).

+

The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00351.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00351.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00351.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00351.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_disc_component Struct Reference +Hardware Locality (hwloc): hwloc_disc_status Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,153 +27,97 @@ - + +/* @license-end */
-
hwloc_disc_component Struct Reference
+
hwloc_disc_status Struct Reference
-

#include <plugins.h>

+

#include <plugins.h>

- - - - - - - - - - - - + + + + + +

Data Fields

const char * name
 
unsigned phases
 
unsigned excluded_phases
 
struct hwloc_backend *(* instantiate )(struct hwloc_topology *topology, struct hwloc_disc_component *component, unsigned excluded_phases, const void *data1, const void *data2, const void *data3)
 
unsigned priority
 
unsigned enabled_by_default
 
hwloc_disc_phase_t phase
 
unsigned excluded_phases
 
unsigned long flags
 

Detailed Description

-

Discovery component structure.

-

This is the major kind of components, taking care of the discovery. They are registered by generic components, either statically-built or as plugins.

+

Discovery status structure.

+

Used by the core and backends to inform about what has been/is being done during the discovery process.

Field Documentation

- -

◆ enabled_by_default

+ +

◆ excluded_phases

- +
unsigned hwloc_disc_component::enabled_by_defaultunsigned hwloc_disc_status::excluded_phases
-

Enabled by default. If unset, if will be disabled unless explicitly requested.

+

Dynamically excluded phases. If a component decides during discovery that some phases are no longer needed.

- -

◆ excluded_phases

+ +

◆ flags

- +
unsigned hwloc_disc_component::excluded_phasesunsigned long hwloc_disc_status::flags
-

Component phases to exclude, as an OR'ed set of hwloc_disc_phase_t.

-

For a GLOBAL component, this usually includes all other phases (~UL).

-

Other components only exclude types that may bring conflicting topology information. MISC components should likely not be excluded since they usually bring non-primary additional information.

+

OR'ed set of hwloc_disc_status_flag_e.

- -

◆ instantiate

+ +

◆ phase

- +
struct hwloc_backend*(* hwloc_disc_component::instantiate) (struct hwloc_topology *topology, struct hwloc_disc_component *component, unsigned excluded_phases, const void *data1, const void *data2, const void *data3)hwloc_disc_phase_t hwloc_disc_status::phase
-

Instantiate callback to create a backend from the component. Parameters data1, data2, data3 are NULL except for components that have special enabling routines such as hwloc_topology_set_xml().

- -
-
- -

◆ name

- -
-
- - - - -
const char* hwloc_disc_component::name
-
- -

Name. If this component is built as a plugin, this name does not have to match the plugin filename.

- -
-
- -

◆ phases

- -
-
- - - - -
unsigned hwloc_disc_component::phases
-
- -

Discovery phases performed by this component. OR'ed set of hwloc_disc_phase_t.

- -
-
- -

◆ priority

- -
-
- - - - -
unsigned hwloc_disc_component::priority
-
- -

Component priority. Used to sort topology->components, higher priority first. Also used to decide between two components with the same name.

-

Usual values are 50 for native OS (or platform) components, 45 for x86, 40 for no-OS fallback, 30 for global components (xml, synthetic), 20 for pci, 10 for other misc components (opencl etc.).

+

The current discovery phase that is performed. Must match one of the phases in the component phases field.


The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00355.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00355.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00355.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00355.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_disc_status Struct Reference +Hardware Locality (hwloc): hwloc_backend Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,96 +27,171 @@
- + +/* @license-end */
-
hwloc_disc_status Struct Reference
+
hwloc_backend Struct Reference
-

#include <plugins.h>

+

#include <plugins.h>

- - - - - - + + + + + + + + + + + + + +

Data Fields

hwloc_disc_phase_t phase
 
unsigned excluded_phases
 
unsigned long flags
 
unsigned phases
 
unsigned long flags
 
int is_thissystem
 
void * private_data
 
void(* disable )(struct hwloc_backend *backend)
 
int(* discover )(struct hwloc_backend *backend, struct hwloc_disc_status *status)
 
int(* get_pci_busid_cpuset )(struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset)
 

Detailed Description

-

Discovery status structure.

-

Used by the core and backends to inform about what has been/is being done during the discovery process.

+

Discovery backend structure.

+

A backend is the instantiation of a discovery component. When a component gets enabled for a topology, its instantiate() callback creates a backend.

+

hwloc_backend_alloc() initializes all fields to default values that the component may change (except "component" and "next") before enabling the backend with hwloc_backend_enable().

+

Most backends assume that the topology is_thissystem flag is set because they talk to the underlying operating system. However they may still be used in topologies without the is_thissystem flag for debugging reasons. In practice, they are usually auto-disabled in such cases (excluded by xml or synthetic backends, or by environment variables when changing the Linux fsroot or the x86 cpuid path).

Field Documentation

- -

◆ excluded_phases

+ +

◆ disable

- +
unsigned hwloc_disc_status::excluded_phasesvoid(* hwloc_backend::disable) (struct hwloc_backend *backend)
-

Dynamically excluded phases. If a component decides during discovery that some phases are no longer needed.

+

Callback for freeing the private_data. May be NULL.

- -

◆ flags

+ +

◆ discover

- +
unsigned long hwloc_disc_status::flagsint(* hwloc_backend::discover) (struct hwloc_backend *backend, struct hwloc_disc_status *status)
-

OR'ed set of hwloc_disc_status_flag_e.

+

Main discovery callback. returns -1 on error, either because it couldn't add its objects ot the existing topology, or because of an actual discovery/gathering failure. May be NULL.

- -

◆ phase

+ +

◆ flags

- +
hwloc_disc_phase_t hwloc_disc_status::phaseunsigned long hwloc_backend::flags
-

The current discovery phase that is performed. Must match one of the phases in the component phases field.

+

Backend flags, currently always 0.

+ +
+
+ +

◆ get_pci_busid_cpuset

+ +
+
+ + + + +
int(* hwloc_backend::get_pci_busid_cpuset) (struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset)
+
+ +

Callback to retrieve the locality of a PCI object. Called by the PCI core when attaching PCI hierarchy to CPU objects. May be NULL.

+ +
+
+ +

◆ is_thissystem

+ +
+
+ + + + +
int hwloc_backend::is_thissystem
+
+ +

Backend-specific 'is_thissystem' property. Set to 0 if the backend disables the thissystem flag for this topology (e.g. loading from xml or synthetic string, or using a different fsroot on Linux, or a x86 CPUID dump). Set to -1 if the backend doesn't care (default).

+ +
+
+ +

◆ phases

+ +
+
+ + + + +
unsigned hwloc_backend::phases
+
+ +

Discovery phases performed by this component, possibly without some of them if excluded by other components. OR'ed set of hwloc_disc_phase_t.

+ +
+
+ +

◆ private_data

+ +
+
+ + + + +
void* hwloc_backend::private_data
+
+ +

Backend private data, or NULL if none.


The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00359.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00359.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00359.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00359.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_backend Struct Reference +Hardware Locality (hwloc): hwloc_component Struct Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,170 +27,159 @@
- + +/* @license-end */
-
hwloc_backend Struct Reference
+
hwloc_component Struct Reference
-

#include <plugins.h>

+

#include <plugins.h>

- - - - - - - - - - - - - - + + + + + + + + + + + +

Data Fields

unsigned phases
 
unsigned long flags
 
int is_thissystem
 
void * private_data
 
void(* disable )(struct hwloc_backend *backend)
 
int(* discover )(struct hwloc_backend *backend, struct hwloc_disc_status *status)
 
int(* get_pci_busid_cpuset )(struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset)
 
unsigned abi
 
int(* init )(unsigned long flags)
 
void(* finalize )(unsigned long flags)
 
hwloc_component_type_t type
 
unsigned long flags
 
void * data
 

Detailed Description

-

Discovery backend structure.

-

A backend is the instantiation of a discovery component. When a component gets enabled for a topology, its instantiate() callback creates a backend.

-

hwloc_backend_alloc() initializes all fields to default values that the component may change (except "component" and "next") before enabling the backend with hwloc_backend_enable().

-

Most backends assume that the topology is_thissystem flag is set because they talk to the underlying operating system. However they may still be used in topologies without the is_thissystem flag for debugging reasons. In practice, they are usually auto-disabled in such cases (excluded by xml or synthetic backends, or by environment variables when changing the Linux fsroot or the x86 cpuid path).

+

Generic component structure.

+

Generic components structure, either statically listed by configure in static-components.h or dynamically loaded as a plugin.

Field Documentation

- -

◆ disable

+ +

◆ abi

- +
void(* hwloc_backend::disable) (struct hwloc_backend *backend)unsigned hwloc_component::abi
-

Callback for freeing the private_data. May be NULL.

+

Component ABI version, set to HWLOC_COMPONENT_ABI.

- -

◆ discover

+ +

◆ data

- +
int(* hwloc_backend::discover) (struct hwloc_backend *backend, struct hwloc_disc_status *status)void* hwloc_component::data
-

Main discovery callback. returns -1 on error, either because it couldn't add its objects ot the existing topology, or because of an actual discovery/gathering failure. May be NULL.

+

Component data, pointing to a struct hwloc_disc_component or struct hwloc_xml_component.

- -

◆ flags

+ +

◆ finalize

- +
unsigned long hwloc_backend::flagsvoid(* hwloc_component::finalize) (unsigned long flags)
-

Backend flags, currently always 0.

+

Process-wide component termination callback.

+

This optional callback is called after unregistering the component from the hwloc core (before unloading the plugin).

+

flags is always 0 for now.

+
Note
If the component uses ltdl for loading its own plugins, it should load/unload them only in init() and finalize(), to avoid race conditions with hwloc's use of ltdl.
- -

◆ get_pci_busid_cpuset

+ +

◆ flags

- +
int(* hwloc_backend::get_pci_busid_cpuset) (struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset)unsigned long hwloc_component::flags
-

Callback to retrieve the locality of a PCI object. Called by the PCI core when attaching PCI hierarchy to CPU objects. May be NULL.

+

Component flags, unused for now.

- -

◆ is_thissystem

+ +

◆ init

- +
int hwloc_backend::is_thissystemint(* hwloc_component::init) (unsigned long flags)
-

Backend-specific 'is_thissystem' property. Set to 0 if the backend disables the thissystem flag for this topology (e.g. loading from xml or synthetic string, or using a different fsroot on Linux, or a x86 CPUID dump). Set to -1 if the backend doesn't care (default).

+

Process-wide component initialization callback.

+

This optional callback is called when the component is registered to the hwloc core (after loading the plugin).

+

When the component is built as a plugin, this callback should call hwloc_check_plugin_namespace() and return an negative error code on error.

+

flags is always 0 for now.

+
Returns
0 on success, or a negative code on error.
+
Note
If the component uses ltdl for loading its own plugins, it should load/unload them only in init() and finalize(), to avoid race conditions with hwloc's use of ltdl.
- -

◆ phases

+ +

◆ type

- +
unsigned hwloc_backend::phaseshwloc_component_type_t hwloc_component::type
-

Discovery phases performed by this component, possibly without some of them if excluded by other components. OR'ed set of hwloc_disc_phase_t.

- -
-
- -

◆ private_data

- -
-
- - - - -
void* hwloc_backend::private_data
-
- -

Backend private data, or NULL if none.

+

Component type.


The documentation for this struct was generated from the following file:
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00360.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00360.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00360.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00360.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,564 @@ + + + + + + + +Hardware Locality (hwloc): Hardware Locality (hwloc) Introduction + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + +
+
+
+
Hardware Locality (hwloc) Introduction
+
+
+

Portable abstraction of hierarchical architectures for high-performance computing

+
+

+

+ See also Further Reading +or the Related pages tab above + for links to more sections about hwloc concepts. +
+

+

+

+

+

+hwloc Summary

+

hwloc provides command line tools and a C API to obtain the hierarchical map of key computing elements within a node, such as: NUMA memory nodes, shared caches, processor packages, dies and cores, processing units (logical processors or "threads") and even I/O devices. hwloc also gathers various attributes such as cache and memory information, and is portable across a variety of different operating systems and platforms.

+

hwloc primarily aims at helping high-performance computing (HPC) applications, but is also applicable to any project seeking to exploit code and/or data locality on modern computing platforms.

+

hwloc supports the following operating systems:

+
    +
  • +Linux (including old kernels not having sysfs topology information, with knowledge of cpusets, ScaleMP vSMP support, etc.) on all supported hardware, including Intel Xeon Phi and NumaScale NumaConnect.
  • +
  • +Solaris (with support for processor sets and logical domains)
  • +
  • +AIX
  • +
  • +Darwin / OS X
  • +
  • +FreeBSD and its variants (such as kFreeBSD/GNU)
  • +
  • +NetBSD
  • +
  • +HP-UX
  • +
  • +Microsoft Windows
  • +
  • +IBM BlueGene/Q Compute Node Kernel (CNK)
  • +
+

Since it uses standard Operating System information, hwloc's support is mostly independant from the processor type (x86, powerpc, ...) and just relies on the Operating System support. The main exception is BSD operating systems (NetBSD, FreeBSD, etc.) because they do not provide support topology information, hence hwloc uses an x86-only CPUID-based backend (which can be used for other OSes too, see the Components and plugins section).

+

To check whether hwloc works on a particular machine, just try to build it and run lstopo or lstopo-no-graphics. If some things do not look right (e.g. bogus or missing cache information), see Questions and Bugs.

+

hwloc only reports the number of processors on unsupported operating systems; no topology information is available.

+

For development and debugging purposes, hwloc also offers the ability to work on "fake" topologies:

+ +

hwloc can display the topology in a human-readable format, either in graphical mode (X11), or by exporting in one of several different formats, including: plain text, PDF, PNG, and FIG (see Command-line Examples below). Note that some of the export formats require additional support libraries.

+

hwloc offers a programming interface for manipulating topologies and objects. It also brings a powerful CPU bitmap API that is used to describe topology objects location on physical/logical processors. See the Programming Interface below. It may also be used to binding applications onto certain cores or memory nodes. Several utility programs are also provided to ease command-line manipulation of topology objects, binding of processes, and so on.

+

Perl bindings are available from Bernd Kallies on CPAN.

+

Python bindings are available from Guy Streeter:

+

+

+

+

+hwloc Installation

+

The generic installation procedure for both hwloc and netloc is described in Installation.

+

The hwloc command-line tool "lstopo" produces human-readable topology maps, as mentioned above. It can also export maps to the "fig" file format. Support for PDF, Postscript, and PNG exporting is provided if the "Cairo" development package (usually cairo-devel or libcairo2-dev) can be found in "lstopo" when hwloc is configured and build.

+

The hwloc core may also benefit from the following development packages:

    +
  • +

    libpciaccess for full I/O device discovery (libpciaccess-devel or libpciaccess-dev package). On Linux, PCI discovery may still be performed (without vendor/device names) even if libpciaccess cannot be used.

    +

    +
  • +
  • +AMD or NVIDIA OpenCL implementations for OpenCL device discovery.
  • +
  • +the NVIDIA CUDA Toolkit for CUDA device discovery.
  • +
  • +the NVIDIA Management Library (NVML) for NVML device discovery. It is included in CUDA since version 8.0. Older NVML releases were available within the NVIDIA GPU Deployment Kit from https://developer.nvidia.com/gpu-deployment-kit .
  • +
  • +the NV-CONTROL X extension library (NVCtrl) for NVIDIA display discovery. The relevant development package is usually libXNVCtrl-devel or libxnvctrl-dev. It is also available within nvidia-settings from ftp://download.nvidia.com/XFree86/nvidia-settings/ and https://github.com/NVIDIA/nvidia-settings/ .
  • +
  • +libxml2 for full XML import/export support (otherwise, the internal minimalistic parser will only be able to import XML files that were exported by the same hwloc release). See Importing and exporting topologies from/to XML files for details. The relevant development package is usually libxml2-devel or libxml2-dev.
  • +
  • +libudev on Linux for easier discovery of OS device information (otherwise hwloc will try to manually parse udev raw files). The relevant development package is usually libudev-devel or libudev-dev.
  • +
  • +libtool's ltdl library for dynamic plugin loading if the native dlopen cannot be used. The relevant development package is usually libtool-ltdl-devel or libltdl-dev.
  • +
+

PCI and XML support may be statically built inside the main hwloc library, or as separate dynamically-loaded plugins (see the Components and plugins section).

+

Note that because of the possibility of GPL taint, the pciutils library libpci will not be used (remember that hwloc is BSD-licensed).

+

+

+

+

+Command-line Examples

+

On a 4-package 2-core machine with hyper-threading, the lstopo tool may show the following graphical output:

+
+ +
+

Here's the equivalent output in textual form:

+
Machine
+  NUMANode L#0 (P#0)
+  Package L#0 + L3 L#0 (4096KB)
+    L2 L#0 (1024KB) + L1 L#0 (16KB) + Core L#0
+      PU L#0 (P#0)
+      PU L#1 (P#8)
+    L2 L#1 (1024KB) + L1 L#1 (16KB) + Core L#1
+      PU L#2 (P#4)
+      PU L#3 (P#12)
+  Package L#1 + L3 L#1 (4096KB)
+    L2 L#2 (1024KB) + L1 L#2 (16KB) + Core L#2
+      PU L#4 (P#1)
+      PU L#5 (P#9)
+    L2 L#3 (1024KB) + L1 L#3 (16KB) + Core L#3
+      PU L#6 (P#5)
+      PU L#7 (P#13)
+  Package L#2 + L3 L#2 (4096KB)
+    L2 L#4 (1024KB) + L1 L#4 (16KB) + Core L#4
+      PU L#8 (P#2)
+      PU L#9 (P#10)
+    L2 L#5 (1024KB) + L1 L#5 (16KB) + Core L#5
+      PU L#10 (P#6)
+      PU L#11 (P#14)
+  Package L#3 + L3 L#3 (4096KB)
+    L2 L#6 (1024KB) + L1 L#6 (16KB) + Core L#6
+      PU L#12 (P#3)
+      PU L#13 (P#11)
+    L2 L#7 (1024KB) + L1 L#7 (16KB) + Core L#7
+      PU L#14 (P#7)
+      PU L#15 (P#15)
+

Note that there is also an equivalent output in XML that is meant for exporting/importing topologies but it is hardly readable to human-beings (see Importing and exporting topologies from/to XML files for details).

+

On a 4-package 2-core Opteron NUMA machine (with two core cores disallowed by the administrator), the lstopo tool may show the following graphical output (with --disallowed for displaying disallowed objects):

+
+ +
+

Here's the equivalent output in textual form:

+
Machine (32GB total)
+  Package L#0
+    NUMANode L#0 (P#0 8190MB)
+    L2 L#0 (1024KB) + L1 L#0 (64KB) + Core L#0 + PU L#0 (P#0)
+    L2 L#1 (1024KB) + L1 L#1 (64KB) + Core L#1 + PU L#1 (P#1)
+  Package L#1
+    NUMANode L#1 (P#1 8192MB)
+    L2 L#2 (1024KB) + L1 L#2 (64KB) + Core L#2 + PU L#2 (P#2)
+    L2 L#3 (1024KB) + L1 L#3 (64KB) + Core L#3 + PU L#3 (P#3)
+  Package L#2
+    NUMANode L#2 (P#2 8192MB)
+    L2 L#4 (1024KB) + L1 L#4 (64KB) + Core L#4 + PU L#4 (P#4)
+    L2 L#5 (1024KB) + L1 L#5 (64KB) + Core L#5 + PU L#5 (P#5)
+  Package L#3
+    NUMANode L#3 (P#3 8192MB)
+    L2 L#6 (1024KB) + L1 L#6 (64KB) + Core L#6 + PU L#6 (P#6)
+    L2 L#7 (1024KB) + L1 L#7 (64KB) + Core L#7 + PU L#7 (P#7)
+

On a 2-package quad-core Xeon (pre-Nehalem, with 2 dual-core dies into each package):

+
+ +
+

Here's the same output in textual form:

+
Machine (total 16GB)
+  NUMANode L#0 (P#0 16GB)
+  Package L#0
+    L2 L#0 (4096KB)
+      L1 L#0 (32KB) + Core L#0 + PU L#0 (P#0)
+      L1 L#1 (32KB) + Core L#1 + PU L#1 (P#4)
+    L2 L#1 (4096KB)
+      L1 L#2 (32KB) + Core L#2 + PU L#2 (P#2)
+      L1 L#3 (32KB) + Core L#3 + PU L#3 (P#6)
+  Package L#1
+    L2 L#2 (4096KB)
+      L1 L#4 (32KB) + Core L#4 + PU L#4 (P#1)
+      L1 L#5 (32KB) + Core L#5 + PU L#5 (P#5)
+    L2 L#3 (4096KB)
+      L1 L#6 (32KB) + Core L#6 + PU L#6 (P#3)
+      L1 L#7 (32KB) + Core L#7 + PU L#7 (P#7)
+

+

+

+

+Programming Interface

+

The basic interface is available in hwloc.h. Some higher-level functions are available in hwloc/helper.h to reduce the need to manually manipulate objects and follow links between them. Documentation for all these is provided later in this document. Developers may also want to look at hwloc/inlines.h which contains the actual inline code of some hwloc.h routines, and at this document, which provides good higher-level topology traversal examples.

+

To precisely define the vocabulary used by hwloc, a Terms and Definitions section is available and should probably be read first.

+

Each hwloc object contains a cpuset describing the list of processing units that it contains. These bitmaps may be used for CPU binding and Memory binding. hwloc offers an extensive bitmap manipulation interface in hwloc/bitmap.h.

+

Moreover, hwloc also comes with additional helpers for interoperability with several commonly used environments. See the Interoperability With Other Software section for details.

+

The complete API documentation is available in a full set of HTML pages, man pages, and self-contained PDF files (formatted for both both US letter and A4 formats) in the source tarball in doc/doxygen-doc/.

+

NOTE: If you are building the documentation from a Git clone, you will need to have Doxygen and pdflatex installed – the documentation will be built during the normal "make" process. The documentation is installed during "make install" to $prefix/share/doc/hwloc/ and your systems default man page tree (under $prefix, of course).

+

+Portability

+

Operating System have varying support for CPU and memory binding, e.g. while some Operating Systems provide interfaces for all kinds of CPU and memory bindings, some others provide only interfaces for a limited number of kinds of CPU and memory binding, and some do not provide any binding interface at all. Hwloc's binding functions would then simply return the ENOSYS error (Function not implemented), meaning that the underlying Operating System does not provide any interface for them. CPU binding and Memory binding provide more information on which hwloc binding functions should be preferred because interfaces for them are usually available on the supported Operating Systems.

+

Similarly, the ability of reporting topology information varies from one platform to another. As shown in Command-line Examples, hwloc can obtain information on a wide variety of hardware topologies. However, some platforms and/or operating system versions will only report a subset of this information. For example, on an PPC64-based system with 8 cores (each with 2 hardware threads) running a default 2.6.18-based kernel from RHEL 5.4, hwloc is only able to glean information about NUMA nodes and processor units (PUs). No information about caches, packages, or cores is available.

+

Here's the graphical output from lstopo on this platform when Simultaneous Multi-Threading (SMT) is enabled:

+
+ +
+

And here's the graphical output from lstopo on this platform when SMT is disabled:

+
+ +
+

Notice that hwloc only sees half the PUs when SMT is disabled. PU L#6, for example, seems to change location from NUMA node #0 to #1. In reality, no PUs "moved" – they were simply re-numbered when hwloc only saw half as many (see also Logical index in Indexes and Sets). Hence, PU L#6 in the SMT-disabled picture probably corresponds to PU L#12 in the SMT-enabled picture.

+

This same "PUs have disappeared" effect can be seen on other platforms – even platforms / OSs that provide much more information than the above PPC64 system. This is an unfortunate side-effect of how operating systems report information to hwloc.

+

Note that upgrading the Linux kernel on the same PPC64 system mentioned above to 2.6.34, hwloc is able to discover all the topology information. The following picture shows the entire topology layout when SMT is enabled:

+
+ +
+

Developers using the hwloc API or XML output for portable applications should therefore be extremely careful to not make any assumptions about the structure of data that is returned. For example, per the above reported PPC topology, it is not safe to assume that PUs will always be descendants of cores.

+

Additionally, future hardware may insert new topology elements that are not available in this version of hwloc. Long-lived applications that are meant to span multiple different hardware platforms should also be careful about making structure assumptions. For example, a new element may someday exist between a core and a PU.

+

+API Example

+

The following small C example (available in the source tree as ``doc/examples/hwloc-hello.c'') prints the topology of the machine and performs some thread and memory binding. More examples are available in the doc/examples/ directory of the source tree.

+
/* Example hwloc API program.
+
*
+
* See other examples under doc/examples/ in the source tree
+
* for more details.
+
*
+
* Copyright © 2009-2016 Inria. All rights reserved.
+
* Copyright © 2009-2011 Université Bordeaux
+
* Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
+
* See COPYING in top-level directory.
+
*
+
* hwloc-hello.c
+
*/
+
+
#include "hwloc.h"
+
+
#include <errno.h>
+
#include <stdio.h>
+
#include <string.h>
+
+
static void print_children(hwloc_topology_t topology, hwloc_obj_t obj,
+
int depth)
+
{
+
char type[32], attr[1024];
+
unsigned i;
+
+
hwloc_obj_type_snprintf(type, sizeof(type), obj, 0);
+
printf("%*s%s", 2*depth, "", type);
+
if (obj->os_index != (unsigned) -1)
+
printf("#%u", obj->os_index);
+
hwloc_obj_attr_snprintf(attr, sizeof(attr), obj, " ", 0);
+
if (*attr)
+
printf("(%s)", attr);
+
printf("\n");
+
for (i = 0; i < obj->arity; i++) {
+
print_children(topology, obj->children[i], depth + 1);
+
}
+
}
+
+
int main(void)
+
{
+
int depth;
+
unsigned i, n;
+
unsigned long size;
+
int levels;
+
char string[128];
+
int topodepth;
+
void *m;
+
hwloc_topology_t topology;
+ + +
+
/* Allocate and initialize topology object. */
+
hwloc_topology_init(&topology);
+
+
/* ... Optionally, put detection configuration here to ignore
+
some objects types, define a synthetic topology, etc....
+
+
The default is to detect all the objects of the machine that
+
the caller is allowed to access. See Configure Topology
+
Detection. */
+
+
/* Perform the topology detection. */
+ +
+
/* Optionally, get some additional topology information
+
in case we need the topology depth later. */
+
topodepth = hwloc_topology_get_depth(topology);
+
+
/*****************************************************************
+
* First example:
+
* Walk the topology with an array style, from level 0 (always
+
* the system level) to the lowest level (always the proc level).
+
*****************************************************************/
+
for (depth = 0; depth < topodepth; depth++) {
+
printf("*** Objects at level %d\n", depth);
+
for (i = 0; i < hwloc_get_nbobjs_by_depth(topology, depth);
+
i++) {
+
hwloc_obj_type_snprintf(string, sizeof(string),
+
hwloc_get_obj_by_depth(topology, depth, i), 0);
+
printf("Index %u: %s\n", i, string);
+
}
+
}
+
+
/*****************************************************************
+
* Second example:
+
* Walk the topology with a tree style.
+
*****************************************************************/
+
printf("*** Printing overall tree\n");
+
print_children(topology, hwloc_get_root_obj(topology), 0);
+
+
/*****************************************************************
+
* Third example:
+
* Print the number of packages.
+
*****************************************************************/
+ + +
printf("*** The number of packages is unknown\n");
+
} else {
+
printf("*** %u package(s)\n",
+ +
}
+
+
/*****************************************************************
+
* Fourth example:
+
* Compute the amount of cache that the first logical processor
+
* has above it.
+
*****************************************************************/
+
levels = 0;
+
size = 0;
+
for (obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, 0);
+
obj;
+
obj = obj->parent)
+ +
levels++;
+
size += obj->attr->cache.size;
+
}
+
printf("*** Logical processor 0 has %d caches totaling %luKB\n",
+
levels, size / 1024);
+
+
/*****************************************************************
+
* Fifth example:
+
* Bind to only one thread of the last core of the machine.
+
*
+
* First find out where cores are, or else smaller sets of CPUs if
+
* the OS doesn't have the notion of a "core".
+
*****************************************************************/
+ +
+
/* Get last core. */
+
obj = hwloc_get_obj_by_depth(topology, depth,
+ +
if (obj) {
+
/* Get a copy of its cpuset that we may modify. */
+ +
+
/* Get only one logical processor (in case the core is
+
SMT/hyper-threaded). */
+ +
+
/* And try to bind ourself there. */
+
if (hwloc_set_cpubind(topology, cpuset, 0)) {
+
char *str;
+
int error = errno;
+ +
printf("Couldn't bind to cpuset %s: %s\n", str, strerror(error));
+
free(str);
+
}
+
+
/* Free our cpuset copy */
+ +
}
+
+
/*****************************************************************
+
* Sixth example:
+
* Allocate some memory on the last NUMA node, bind some existing
+
* memory to the last NUMA node.
+
*****************************************************************/
+
/* Get last node. There's always at least one. */
+ +
obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, n - 1);
+
+
size = 1024*1024;
+
m = hwloc_alloc_membind(topology, size, obj->nodeset,
+ +
hwloc_free(topology, m, size);
+
+
m = malloc(size);
+
hwloc_set_area_membind(topology, m, size, obj->nodeset,
+ +
free(m);
+
+
/* Destroy topology object. */
+ +
+
return 0;
+
}
+

hwloc provides a pkg-config executable to obtain relevant compiler and linker flags. For example, it can be used thusly to compile applications that utilize the hwloc library (assuming GNU Make):

+
CFLAGS += $(shell pkg-config --cflags hwloc)
+LDLIBS += $(shell pkg-config --libs hwloc)
+
+hwloc-hello: hwloc-hello.c
+        $(CC) hwloc-hello.c $(CFLAGS) -o hwloc-hello $(LDLIBS)
+

On a machine 2 processor packages – each package of which has two processing cores – the output from running hwloc-hello could be something like the following:

+
shell$ ./hwloc-hello
+*** Objects at level 0
+Index 0: Machine
+*** Objects at level 1
+Index 0: Package#0
+Index 1: Package#1
+*** Objects at level 2
+Index 0: Core#0
+Index 1: Core#1
+Index 2: Core#3
+Index 3: Core#2
+*** Objects at level 3
+Index 0: PU#0
+Index 1: PU#1
+Index 2: PU#2
+Index 3: PU#3
+*** Printing overall tree
+Machine
+  Package#0
+    Core#0
+      PU#0
+    Core#1
+      PU#1
+  Package#1
+    Core#3
+      PU#2
+    Core#2
+      PU#3
+*** 2 package(s)
+*** Logical processor 0 has 0 caches totaling 0KB
+shell$ 
+

+

+

+

+History / Credits

+

hwloc is the evolution and merger of the libtopology (http://runtime.bordeaux.inria.fr/libtopology/) project and the Portable Linux Processor Affinity (PLPA) (http://www.open-mpi.org/projects/plpa/) project. Because of functional and ideological overlap, these two code bases and ideas were merged and released under the name "hwloc" as an Open MPI sub-project.

+

libtopology was initially developed by the inria Runtime Team-Project (http://runtime.bordeaux.inria.fr/) (headed by Raymond Namyst (http://dept-info.labri.fr/~namyst/). PLPA was initially developed by the Open MPI development team as a sub-project. Both are now deprecated in favor of hwloc, which is distributed as an Open MPI sub-project.

+

+

+

+
+
+
int hwloc_bitmap_singlify(hwloc_bitmap_t bitmap)
Keep a single index among those set in bitmap bitmap.
+
int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags)
Bind current process or thread on cpus given in physical bitmap set.
+
@ HWLOC_OBJ_CORE
Core. A computation unit (may be shared by several logical processors).
Definition: hwloc.h:197
+
void hwloc_topology_destroy(hwloc_topology_t topology)
Terminate and free a topology context.
+
unsigned os_index
OS-provided physical index number. It is not guaranteed unique across the entire machine,...
Definition: hwloc.h:389
+
int hwloc_topology_init(hwloc_topology_t *topologyp)
Allocate a topology context.
+
int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type.
+
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:386
+
static hwloc_obj_t hwloc_get_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
Returns the topology object at logical index idx with type type.
+
hwloc_uint64_t size
Size of cache in bytes.
Definition: hwloc.h:603
+
@ HWLOC_MEMBIND_BIND
Allocate memory on the specified nodes.
Definition: hwloc.h:1390
+
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:403
+
static hwloc_obj_t hwloc_get_root_obj(hwloc_topology_t topology)
Returns the top-object of the topology-tree.
+
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:678
+
static int hwloc_get_nbobjs_by_type(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the width of level type type.
+
void hwloc_bitmap_free(hwloc_bitmap_t bitmap)
Free bitmap bitmap.
+
Structure of a topology object.
Definition: hwloc.h:384
+
unsigned arity
Number of normal children. Memory, Misc and I/O children are not listed here but rather in their dedi...
Definition: hwloc.h:440
+
struct hwloc_obj_attr_u::hwloc_cache_attr_s cache
+
struct hwloc_obj ** children
Normal children, children[0 .. arity -1].
Definition: hwloc.h:444
+
int hwloc_obj_type_is_cache(hwloc_obj_type_t type)
Check whether an object type is a CPU Cache (Data, Unified or Instruction).
+
hwloc_obj_t hwloc_get_obj_by_depth(hwloc_topology_t topology, int depth, unsigned idx)
Returns the topology object at logical index idx from depth depth.
+
@ HWLOC_TYPE_DEPTH_UNKNOWN
No object of given type exists in the topology.
Definition: hwloc.h:808
+
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:500
+
struct hwloc_obj * parent
Parent, NULL if root (Machine object)
Definition: hwloc.h:434
+
unsigned hwloc_get_nbobjs_by_depth(hwloc_topology_t topology, int depth)
Returns the width of level at depth depth.
+
int hwloc_obj_type_snprintf(char *restrict string, size_t size, hwloc_obj_t obj, int verbose)
Stringify the type of a given topology object into a human-readable form.
+
hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap)
Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.
+
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.
Definition: hwloc.h:140
+
int hwloc_set_area_membind(hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Bind the already-allocated memory identified by (addr, len) to the NUMA node(s) specified by set.
+
@ HWLOC_OBJ_PACKAGE
Physical package. The physical package that usually gets inserted into a socket on the motherboard....
Definition: hwloc.h:191
+
int hwloc_bitmap_asprintf(char **strp, hwloc_const_bitmap_t bitmap)
Stringify a bitmap into a newly allocated string.
+
static int hwloc_get_type_or_below_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type or below.
+
int hwloc_topology_load(hwloc_topology_t topology)
Build the actual topology.
+
int hwloc_free(hwloc_topology_t topology, void *addr, size_t len)
Free memory that was previously allocated by hwloc_alloc() or hwloc_alloc_membind().
+
hwloc_nodeset_t nodeset
NUMA nodes covered by this object or containing this object.
Definition: hwloc.h:528
+
int hwloc_obj_attr_snprintf(char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, int verbose)
Stringify the attributes of a given topology object into a human-readable form.
+
@ HWLOC_MEMBIND_BYNODESET
Consider the bitmap argument as a nodeset.
Definition: hwloc.h:1478
+
void * hwloc_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags)
Allocate some memory on NUMA memory nodes specified by set.
+
@ HWLOC_OBJ_NUMANODE
NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...
Definition: hwloc.h:236
+
@ HWLOC_OBJ_PU
Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical ...
Definition: hwloc.h:201
+
int depth
Vertical index in the hierarchy.
Definition: hwloc.h:407
+
int hwloc_topology_get_depth(hwloc_topology_t restrict topology)
Get the depth of the hierarchical tree of objects.
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00361.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00361.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00361.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00361.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,170 @@ + + + + + + + +Hardware Locality (hwloc): Terms and Definitions + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + +
+
+
+
Terms and Definitions
+
+
+

+

+

+

+Objects

+
+
Object
+

Interesting kind of part of the system, such as a Core, a L2Cache, a NUMA memory node, etc. The different types detected by hwloc are detailed in the hwloc_obj_type_t enumeration.

+

There are four kinds of Objects: Memory (NUMA nodes and Memory-side caches), I/O (Bridges, PCI and OS devices), Misc, and Normal (everything else, including Machine, Package, Die, Core, PU, CPU Caches, etc.). Normal and Memory objects have (non-NULL) CPU sets and nodesets, while I/O and Misc don't.

+

Objects are topologically sorted by locality (CPU and node sets) into a tree (see Hierarchy, Tree and Levels).

+

+
+
Processing Unit (or Logical Processor)
+

The smallest processing element that can be represented by a hwloc object. It may be a single-core processor, a core of a multicore processor, or a single thread in a SMT processor. hwloc's PU acronym stands for Processing Unit.

+

"Logical processor" should not be confused with "Logical index of a + processor".

+

+
+
Package
+

A processor Package is the physical package that usually gets inserted into a socket on the motherboard. It is also often called a physical processor or a CPU even if these names bring confusion with respect to cores and processing units. A processor package usually contains multiple cores (and may also be composed of multiple dies). hwloc Package objects were called Sockets up to hwloc 1.10.

+

+
+
NUMA Node
+

An object that contains memory that is directly and byte-accessible to the host processors. It is usually close to some cores as specified by its CPU set. Hence it is attached as a memory child of the object that groups those cores together, for instance a Package objects with 4 Core children (see Hierarchy, Tree and Levels).

+

+
+
Memory-side Cache
+

A cache in front of a specific memory region (e.g. a range of physical addresses). It caches all accesses to that region without caring about which core issued the request. This is the opposite of usual CPU caches where only accesses from the local cores are cached, without caring about the target memory.

+

In hwloc, memory-side caches are memory objects placed between their local CPU objects (parent) and the target NUMA node memory (child).

+
+
+

+

+

+

+Indexes and Sets

+
+
OS or physical index
+

The index that the operating system (OS) uses to identify the object. This may be completely arbitrary, non-unique, non-contiguous, not representative of logical proximity, and may depend on the BIOS configuration. That is why hwloc almost never uses them, only in the default lstopo output (P#x) and cpuset masks. See also Should I use logical or physical/OS indexes? and how?.

+

+
+
Logical index
+

Index to uniquely identify objects of the same type and depth, automatically computed by hwloc according to the topology. It expresses logical proximity in a generic way, i.e. objects which have adjacent logical indexes are adjacent in the topology. That is why hwloc almost always uses it in its API, since it expresses logical proximity. They can be shown (as L#x) by lstopo thanks to the -l option. This index is always linear and in the range [0, num_objs_same_type_same_level-1]. Think of it as ``cousin rank.'' The ordering is based on topology first, and then on OS CPU numbers, so it is stable across everything except firmware CPU renumbering. "Logical index" should not be confused with "Logical processor". A "Logical + processor" (which in hwloc we rather call "processing unit" to avoid the confusion) has both a physical index (as chosen arbitrarily by BIOS/OS) and a logical index (as computed according to logical proximity by hwloc). See also Should I use logical or physical/OS indexes? and how?.

+

+
+
CPU set
+

The set of logical processors (or processing units) logically included in an object (if it makes sense). They are always expressed using physical logical processor numbers (as announced by the OS). They are implemented as the hwloc_bitmap_t opaque structure. hwloc CPU sets are just masks, they do not have any relation with an operating system actual binding notion like Linux' cpusets. I/O and Misc objects do not have CPU sets while all Normal and Memory objects have non-NULL CPU sets.

+

+
+
Node set
+

The set of NUMA memory nodes logically included in an object (if it makes sense). They are always expressed using physical node numbers (as announced by the OS). They are implemented with the hwloc_bitmap_t opaque structure. as bitmaps. I/O and Misc objects do not have Node sets while all Normal and Memory objects have non-NULL nodesets.

+

+
+
Bitmap
+

A possibly-infinite set of bits used for describing sets of objects such as CPUs (CPU sets) or memory nodes (Node sets). They are implemented with the hwloc_bitmap_t opaque structure.

+

+
+
+

+

+

+

+Hierarchy, Tree and Levels

+
+
Parent object
+

The object logically containing the current object, for example because its CPU set includes the CPU set of the current object. All objects have a non-NULL parent, except the root of the topology (Machine object).

+

+
+
Ancestor object
+

The parent object, or its own parent, and so on.

+

+
+
Children object(s)
+

The object (or objects) contained in the current object because their CPU set is included in the CPU set of the current object. Each object may also contain separated lists for Memory, I/O and Misc object children.

+

+
+
Arity
+

The number of normal children of an object. There are also specific arities for Memory, I/O and Misc children.

+

+
+
Sibling objects
+

Objects in the same children list, which all of them are normal children of the same parent, or all of them are Memory children of the same parent, or I/O children, or Misc. They usually have the same type (and hence are cousins, as well). But they may not if the topology is asymmetric.

+

+
+
Sibling rank
+

Index to uniquely identify objects which have the same parent, and is always in the range [0, arity-1] (respectively memory_arity, io_arity or misc_arity for Memory, I/O and Misc children of a parent).

+

+
+
Cousin objects
+

Objects of the same type (and depth) as the current object, even if they do not have the same parent.

+

+
+
Level
+

Set of objects of the same type and depth. All these objects are cousins.

+

Memory, I/O and Misc objects also have their own specific levels and (virtual) depth.

+

+
+
Depth
+

Nesting level in the object tree, starting from the root object. If the topology is symmetric, the depth of a child is equal to the parent depth plus one, and an object depth is also equal to the number of parent/child links between the root object and the given object. If the topology is asymmetric, the difference between some parent and child depths may be larger than one when some intermediate levels (for instance groups) are missing in only some parts of the machine.

+

The depth of the Machine object is always 0 since it is always the root of the topology. The depth of PU objects is equal to the number of levels in the topology minus one.

+

Memory, I/O and Misc objects also have their own specific levels and depth.

+

+
+
+

The following diagram can help to understand the vocabulary of the relationships by showing the example of a machine with two dual core packages (with no hardware threads); thus, a topology with 5 levels. Each box with rounded corner corresponds to one hwloc_obj_t, containing the values of the different integer fields (depth, logical_index, etc.), and arrows show to which other hwloc_obj_t pointers point to (first_child, parent, etc.).

+

The topology always starts with a Machine object as root (depth 0) and ends with PU objects at the bottom (depth 4 here).

+

Objects of the same level (cousins) are listed in red boxes and linked with red arrows. Children of the same parent (siblings) are linked with blue arrows.

+

The L2 cache of the last core is intentionally missing to show how asymmetric topologies are handled. See What happens if my topology is asymmetric? for more information about such strange topologies.

+
+ +
+

It should be noted that for PU objects, the logical index – as computed linearly by hwloc – is not the same as the OS index.

+

The NUMA node is on the side because it is not part of the main tree but rather attached to the object that corresponds to its locality (the entire machine here, hence the root object). It is attached as a Memory child (in green) and has a virtual depth (negative). It could also have siblings if there were multiple local NUMA nodes, or cousins if other NUMA nodes were attached somewhere else in the machine.

+

I/O or Misc objects could be attached in a similar manner.

+
+
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00362.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00362.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00362.html 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00362.html 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,139 @@ + + + + + + + +Hardware Locality (hwloc): Command-Line Tools + + + + + + +
+
+ + + + + + +
+
Hardware Locality (hwloc) +  2.2.0 +
+
+
+ + + + + + +
+
+
+
Command-Line Tools
+
+
+

+

+

+

hwloc comes with an extensive C programming interface and several command line utilities. Each of them is fully documented in its own manual page; the following is a summary of the available command line tools.

+

+

+

+

+lstopo and lstopo-no-graphics

+

lstopo (also known as hwloc-ls) displays the hierarchical topology map of the current system. The output may be graphical, ascii-art or textual, and can also be exported to numerous file formats such as PDF, PNG, XML, and others. Advanced graphical outputs require the "Cairo" development package (usually cairo-devel or libcairo2-dev).

+

lstopo and lstopo-no-graphics accept the same command-line options. However, graphical outputs are only available in lstopo. Textual outputs (those that do not depend on heavy external libraries such as Cairo) are supported in both lstopo and lstopo-no-graphics.

+

This command can also display the processes currently bound to a part of the machine (via the --ps option).

+

Note that lstopo can read XML files and/or alternate chroot filesystems and display topological maps representing those systems (e.g., use lstopo to output an XML file on one system, and then use lstopo to read in that XML file and display it on a different system).

+

+

+

+

+hwloc-bind

+

hwloc-bind binds processes to specific hardware objects through a flexible syntax. A simple example is binding an executable to specific cores (or packages or bitmaps or ...). The hwloc-bind(1) man page provides much more detail on what is possible.

+

hwloc-bind can also be used to retrieve the current process' binding, or retrieve the last CPU(s) where a process ran, or operate on memory binding.

+

Just like hwloc-calc, the input locations given to hwloc-bind may be either objects or cpusets (bitmaps as reported by hwloc-calc or hwloc-distrib).

+

+

+

+

+hwloc-calc

+

hwloc-calc is hwloc's Swiss Army Knife command-line tool for converting things. The input may be either objects or cpusets (bitmaps as reported by another hwloc-calc instance or by hwloc-distrib), that may be combined by addition, intersection or subtraction. The output kinds include:

    +
  • +a cpuset bitmap: This compact opaque representation of objects is useful for shell scripts etc. It may passed to hwloc command-line tools such as hwloc-calc or hwloc-bind, or to hwloc command-line options such as lstopo --restrict.
  • +
  • +the amount of the equivalent hwloc objects from a specific type, or the list of their indexes. This is useful for iterating over all similar objects (for instance all cores) within a given part of a platform.
  • +
  • +a hierarchical description of objects, for instance a thread index within a core within a package. This gives a better view of the actual location of an object.
  • +
+

Moreover, input and/or output may be use either physical/OS object indexes or as hwloc's logical object indexes. It eases cooperation with external tools such as taskset or numactl by exporting hwloc specifications into list of processor or NUMA node physical indexes. See also Should I use logical or physical/OS indexes? and how?.

+

+

+

+

+hwloc-info

+

hwloc-info dumps information about the given objects, as well as all its specific attributes. It is intended to be used with tools such as grep for filtering certain attribute lines. When no object is specified, or when --topology is passed, hwloc-info prints a summary of the topology. When --support is passed, hwloc-info lists the supported features for the topology.

+

+

+

+

+hwloc-distrib

+

hwloc-distrib generates a set of cpuset bitmaps that are uniformly distributed across the machine for the given number of processes. These strings may be used with hwloc-bind to run processes to maximize their memory bandwidth by properly distributing them across the machine.

+

+

+

+

+hwloc-ps

+

hwloc-ps is a tool to display the bindings of processes that are currently running on the local machine. By default, hwloc-ps only lists processes that are bound; unbound process (and Linux kernel threads) are not displayed.

+

+

+

+

+hwloc-annotate

+

hwloc-annotate may modify object (and topology) attributes such as string information (see Custom string infos for details) or Misc children objects. It reads an input topology from a XML file and outputs the annotated topology as another XML file.

+

+

+

+

+hwloc-diff, hwloc-patch and hwloc-compress-dir

+

hwloc-diff computes the difference between two topologies and outputs it to another XML file.

+

hwloc-patch reads such a difference file and applies to another topology.

+

hwloc-compress-dir compresses an entire directory of XML files by using hwloc-diff to save the differences between topologies instead of entire topologies.

+

+

+

+

+hwloc-dump-hwdata

+

hwloc-dump-hwdata is a Linux and x86-specific tool that dumps (during boot, privileged) some topology and locality information from raw hardware files (SMBIOS and ACPI tables) to human-readable and world-accessible files that the hwloc library will later reuse.

+

Currently only used on Intel Xeon Phi processor platforms. See Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?.

+

See HWLOC_DUMPED_HWDATA_DIR in Environment Variables for details about the location of dumped files.

+

+

+

+

+hwloc-gather-topology and hwloc-gather-cpuid

+

hwloc-gather-topology is a Linux-specific tool that saves the relevant topology files of the current machine into a tarball (and the corresponding lstopo outputs).

+

hwloc-gather-cpuid is a x86-specific tool that dumps the result of CPUID instructions on the current machine into a directory.

+

The output of hwloc-gather-cpuid is included in the tarball saved by hwloc-gather-topology when running on Linux/x86.

+

These files may be used later (possibly offline) for simulating or debugging a machine without actually running on it.

+
+
+ + + + diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00363.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00363.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00363.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00363.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): hwloc_component Struct Reference +Hardware Locality (hwloc): Environment Variables @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,158 +27,159 @@
- + +/* @license-end */
-
- +
-
hwloc_component Struct Reference
+
Environment Variables
- -

#include <plugins.h>

- - - - - - - - - - - - - - -

-Data Fields

unsigned abi
 
int(* init )(unsigned long flags)
 
void(* finalize )(unsigned long flags)
 
hwloc_component_type_t type
 
unsigned long flags
 
void * data
 
-

Detailed Description

-

Generic component structure.

-

Generic components structure, either statically listed by configure in static-components.h or dynamically loaded as a plugin.

-

Field Documentation

- -

◆ abi

- -
-
- - - - -
unsigned hwloc_component::abi
-
- -

Component ABI version, set to HWLOC_COMPONENT_ABI.

- -
-
- -

◆ data

- -
-
- - - - -
void* hwloc_component::data
-
- -

Component data, pointing to a struct hwloc_disc_component or struct hwloc_xml_component.

- -
-
- -

◆ finalize

- -
-
- - - - -
void(* hwloc_component::finalize) (unsigned long flags)
-
- -

Process-wide component termination callback.

-

This optional callback is called after unregistering the component from the hwloc core (before unloading the plugin).

-

flags is always 0 for now.

-
Note
If the component uses ltdl for loading its own plugins, it should load/unload them only in init() and finalize(), to avoid race conditions with hwloc's use of ltdl.
- -
-
- -

◆ flags

- -
-
- - - - -
unsigned long hwloc_component::flags
-
- -

Component flags, unused for now.

- -
-
- -

◆ init

- -
-
- - - - -
int(* hwloc_component::init) (unsigned long flags)
-
- -

Process-wide component initialization callback.

-

This optional callback is called when the component is registered to the hwloc core (after loading the plugin).

-

When the component is built as a plugin, this callback should call hwloc_check_plugin_namespace() and return an negative error code on error.

-

flags is always 0 for now.

-
Returns
0 on success, or a negative code on error.
-
Note
If the component uses ltdl for loading its own plugins, it should load/unload them only in init() and finalize(), to avoid race conditions with hwloc's use of ltdl.
- -
-
- -

◆ type

- -
-
- - - - -
hwloc_component_type_t hwloc_component::type
-
- -

Component type.

- -
-
-
The documentation for this struct was generated from the following file:
    -
  • plugins.h
  • +

    +

    +

    +

    The behavior of the hwloc library and tools may be tuned thanks to the following environment variables.

    +
    +
    HWLOC_XMLFILE=/path/to/file.xml
    +

    enforces the discovery from the given XML file as if hwloc_topology_set_xml() had been called. This file may have been generated earlier with lstopo file.xml. For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, HWLOC_THISSYSTEM should be set 1 in the environment too, to assert that the loaded file is really the underlying system. See also Importing and exporting topologies from/to XML files.

    +

    +
    +
    HWLOC_SYNTHETIC=synthetic_description
    +

    enforces the discovery through a synthetic description string as if hwloc_topology_set_synthetic() had been called. For convenience, this backend provides empty binding hooks which just return success. See also Synthetic topologies.

    +

    +
    +
    HWLOC_XML_VERBOSE=1
    +
    +
    HWLOC_SYNTHETIC_VERBOSE=1
    +

    enables verbose messages in the XML or synthetic topology backends. hwloc XML backends (see Importing and exporting topologies from/to XML files) can emit some error messages to the error output stream. Enabling these verbose messages within hwloc can be useful for understanding failures to parse input XML topologies. Similarly, enabling verbose messages in the synthetic topology backend can help understand why the description string is invalid. See also Synthetic topologies.

    +

    +
    +
    HWLOC_THISSYSTEM=1
    +

    enforces the return value of hwloc_topology_is_thissystem(), as if HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM was set with hwloc_topology_set_flags(). It means that it makes hwloc assume that the selected backend provides the topology for the system on which we are running, even if it is not the OS-specific backend but the XML backend for instance. This means making the binding functions actually call the OS-specific system calls and really do binding, while the XML backend would otherwise provide empty hooks just returning success. This can be used for efficiency reasons to first detect the topology once, save it to an XML file, and quickly reload it later through the XML backend, but still having binding functions actually do bind. This also enables support for the variable HWLOC_THISSYSTEM_ALLOWED_RESOURCES.

    +

    +
    +
    HWLOC_THISSYSTEM_ALLOWED_RESOURCES=1
    +

    Get the set of allowed resources from the native operating system even if the topology was loaded from XML or synthetic description, as if HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES was set with hwloc_topology_set_flags(). This variable requires the topology to match the current system (see the variable HWLOC_THISSYSTEM). This is useful when the topology is not loaded directly from the local machine (e.g. for performance reason) and it comes with all resources, but the running process is restricted to only a part of the machine (for instance because of Linux Cgroup/Cpuset).

    +

    +
    +
    HWLOC_ALLOW=all
    +

    Totally ignore administrative restrictions such as Linux Cgroups and consider all resources (PUs and NUMA nodes) as allowed. This is different from setting HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED which gathers all resources but marks the unavailable ones as disallowed.

    +

    +
    +
    HWLOC_HIDE_ERRORS=0
    +

    enables or disables verbose reporting of errors. The hwloc library may issue warnings to the standard error stream when it detects a problem during topology discovery, for instance if the operating system (or user) gives contradictory topology information. Setting this environment variable to 1 removes the actual displaying of these error messages.

    +

    +
    +
    HWLOC_USE_NUMA_DISTANCES=7
    +

    enables or disables the use of NUMA distances. NUMA distances and memory target/initiator information may be used to improve the locality of NUMA nodes, especially CPU-less nodes. Bits in the value of this environment variable enable different features: Bit 0 enables the gathering of NUMA distances from the operating system. Bit 1 further enables the use of NUMA distances to improve the locality of CPU-less nodes. Bit 2 enables the use of target/initiator information.

    +

    +
    +
    HWLOC_GROUPING=1
    +

    enables or disables objects grouping based on distances. By default, hwloc uses distance matrices between objects (either read from the OS or given by the user) to find groups of close objects. These groups are described by adding intermediate Group objects in the topology. Setting this environment variable to 0 will disable this grouping. This variable supersedes the obsolete HWLOC_IGNORE_DISTANCES variable.

    +

    +
    +
    HWLOC_GROUPING_ACCURACY=0.05
    +

    relaxes distance comparison during grouping. By default, objects may be grouped if their distances form a minimal distance graph. When setting this variable to 0.02, and when HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE is given, these distances do not have to be strictly equal anymore, they may just be equal with a 2% error. If set to try instead of a numerical value, hwloc will try to group with perfect accuracy (0, the default), then with 0.01, 0.02, 0.05 and finally 0.1. Numbers given in this environment variable should always use a dot as a decimal mark (for instance 0.01 instead of 0,01).

    +

    +
    +
    HWLOC_GROUPING_VERBOSE=0
    +

    enables or disables some verbose messages during grouping. If this variable is set to 1, some debug messages will be displayed during distance-based grouping of objects even if debug was not specific at configure time. This is useful when trying to find an interesting distance grouping accuracy.

    +

    +
    +
    HWLOC_PCI_LOCALITY=<domain/bus> <cpuset>;...
    +
    +
    HWLOC_PCI_LOCALITY=/path/to/pci/locality/file
    +

    changes the locality of I/O devices behing the specified PCI buses. If no I/O locality information is available or if the BIOS reports incorrect information, it is possible to move a I/O device tree (OS and/or PCI devices with optional bridges) near a custom set of processors.
    + Localities are given either inside the environment variable itself, or in the pointed file. They may be separated either by semi-colons or by line-breaks.
    + Each locality contains a domain/bus specification (in hexadecimal numbers as usual) followed by a whitespace and a cpuset:

      +
    • +0001 <cpuset> specifies the locality of all buses in PCI domain 0000.
    • +
    • +0000:0f <cpuset> specifies only PCI bus 0f in domain 0000.
    • +
    • +0002:04-0a <cpuset> specifies a range of buses (from 04 to 0a) within domain 0002.
    -
    +

    Domain/bus specifications should usually match entire hierarchies of buses behind a bridge (including primary, secondary and subordinate buses). For instance, if hostbridge 0000:00 is above other bridges/switches with buses 0000:01 to 0000:09, the variable should be HWLOC_PCI_LOCALITY="0000:00-09 <cpuset>". It supersedes the old HWLOC_PCI_0000_00_LOCALCPUS=<cpuset> which only works when hostbridges exist in the topology.
    + If the variable is defined to empty or invalid, no forced PCI locality is applied but hwloc's internal automatic locality quirks are disabled, which means the exact PCI locality reported by the platform is used.

    +

    + +
    HWLOC_X86_TOPOEXT_NUMANODES=0
    +

    use AMD topoext CPUID leaf in the x86 backend to detect NUMA nodes. When using the x86 backend, setting this variable to 1 enables the building of NUMA nodes from AMD processor CPUID instructions. However this strategy does not always reflect BIOS configuration such as NUMA interleaving. And node indexes may be different from those of the operating system. Hence this should only be used when OS backends are wrong and the user is sure that CPUID returns correct NUMA information.

    +

    +
    +
    HWLOC_KEEP_NVIDIA_GPU_NUMA_NODES=0
    +

    show or hide NUMA nodes that correspond to NVIDIA GPU memory. By default they are ignored to avoid interleaved memory being allocated on GPU by mistake. Setting this environment variable to 1 exposes these NUMA nodes. They may be recognized by the GPUMemory subtype. They also have a PCIBusID info attribute to identify the corresponding GPU.

    +

    +
    +
    HWLOC_KNL_MSCACHE_L3=0
    +

    Expose the KNL MCDRAM in cache mode as a Memory-side Cache instead of a L3. hwloc releases prior to 2.1 exposed the MCDRAM cache as a CPU-side L3 cache. Now that Memory-side caches are supported by hwloc, it is still exposed as a L3 by default to avoid breaking existing applications. Setting this environment variable to 1 will expose it as a proper Memory-side cache.

    +

    +
    +
    HWLOC_ANNOTATE_GLOBAL_COMPONENTS=0
    +

    Allow components to annotate the topology even if they are usually excluded by global components by default. Setting this variable to 1 and also setting HWLOC_COMPONENTS=xml,pci,stop enables the addition of PCI vendor and model info attributes to a XML topology that was generated without those names (if pciaccess was missing).

    +

    +
    +
    HWLOC_FSROOT=/path/to/linux/filesystem-root/
    +

    switches to reading the topology from the specified Linux filesystem root instead of the main file-system root. This directory may have been saved previously from another machine with hwloc-gather-topology.
    + One should likely also set HWLOC_COMPONENTS=linux,stop so that non-Linux backends are disabled (the -i option of command-line tools takes care of both).
    + Not using the main file-system root causes hwloc_topology_is_thissystem() to return 0. For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, HWLOC_THISSYSTEM should be set 1 in the environment too, to assert that the loaded file is really the underlying system.

    +

    +
    +
    HWLOC_CPUID_PATH=/path/to/cpuid/
    +

    forces the x86 backend to read dumped CPUIDs from the given directory instead of executing actual x86 CPUID instructions. This directory may have been saved previously from another machine with hwloc-gather-cpuid.
    + One should likely also set HWLOC_COMPONENTS=x86,stop so that non-x86 backends are disabled (the -i option of command-line tools takes care of both).
    + It causes hwloc_topology_is_thissystem() to return 0. For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, HWLOC_THISSYSTEM should be set 1 in the environment too, to assert that the loaded CPUID dump is really the underlying system.

    +

    +
    +
    HWLOC_DUMPED_HWDATA_DIR=/path/to/dumped/files/
    +

    loads files dumped by hwloc-dump-hwdata (on Linux) from the given directory. The default dump/load directory is configured during build based on --runstatedir, --localstatedir, and --prefix options. It usually points to /var/run/hwloc/ in Linux distribution packages, but it may also point to $prefix/var/run/hwloc/ when manually installing and only specifying --prefix.

    +

    +
    +
    HWLOC_COMPONENTS=list,of,components
    +

    forces a list of components to enable or disable. Enable or disable the given comma-separated list of components (if they do not conflict with each other). Component names prefixed with - are disabled (a single phase may also be disabled).

    +

    Once the end of the list is reached, hwloc falls back to enabling the remaining components (sorted by priority) that do not conflict with the already enabled ones, and unless explicitly disabled in the list. If stop is met, the enabling loop immediately stops, no more component is enabled.

    +

    If xml or synthetic components are selected, the corresponding XML filename or synthetic description string should be pass in HWLOC_XMLFILE or HWLOC_SYNTHETIC respectively.

    +

    Since this variable is the low-level and more generic way to select components, it takes precedence over environment variables for selecting components.

    +

    If the variable is set to an empty string (or set to a single comma), no specific component is loaded first, all components are loaded in priority order.

    +

    See Selecting which components to use for details.

    +

    +
    +
    HWLOC_COMPONENTS_VERBOSE=1
    +

    displays verbose information about components. Display messages when components are registered or enabled. This is the recommended way to list the available components with their priority (all of them are registered at startup).

    +

    +
    +
    HWLOC_PLUGINS_PATH=/path/to/hwloc/plugins/:...
    +

    changes the default search directory for plugins. By default, $libdir/hwloc is used. The variable may contain several colon-separated directories.

    +

    +
    +
    HWLOC_PLUGINS_VERBOSE=1
    +

    displays verbose information about plugins. List which directories are scanned, which files are loaded, and which components are successfully loaded.

    +

    +
    +
    HWLOC_PLUGINS_BLACKLIST=filename1,filename2,...
    +

    prevents plugins from being loaded if their filename (without path) is listed. Plugin filenames may be found in verbose messages outputted when HWLOC_PLUGINS_VERBOSE=1.

    +

    +
    +
    HWLOC_DEBUG_VERBOSE=0
    +

    disables all verbose messages that are enabled by default when –enable-debug is passed to configure.

    +

    +
    + +
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00364.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00364.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00364.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00364.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Hardware Locality (hwloc) Introduction +Hardware Locality (hwloc): CPU and Memory Binding Overview @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,317 +27,46 @@
- + +/* @license-end */ -
+
-
Hardware Locality (hwloc) Introduction
+
CPU and Memory Binding Overview
-

Portable abstraction of hierarchical architectures for high-performance computing

-
-

+

- See also Further Reading -or the Related pages tab above - for links to more sections about hwloc concepts. -

-

-

-

-

-hwloc Summary

-

hwloc provides command line tools and a C API to obtain the hierarchical map of key computing elements within a node, such as: NUMA memory nodes, shared caches, processor packages, dies and cores, processing units (logical processors or "threads") and even I/O devices. hwloc also gathers various attributes such as cache and memory information, and is portable across a variety of different operating systems and platforms.

-

hwloc primarily aims at helping high-performance computing (HPC) applications, but is also applicable to any project seeking to exploit code and/or data locality on modern computing platforms.

-

hwloc supports the following operating systems:

-
    -
  • -Linux (including old kernels not having sysfs topology information, with knowledge of cpusets, ScaleMP vSMP support, etc.) on all supported hardware, including Intel Xeon Phi and NumaScale NumaConnect.
  • -
  • -Solaris (with support for processor sets and logical domains)
  • -
  • -AIX
  • -
  • -Darwin / OS X
  • -
  • -FreeBSD and its variants (such as kFreeBSD/GNU)
  • -
  • -NetBSD
  • -
  • -HP-UX
  • -
  • -Microsoft Windows
  • -
  • -IBM BlueGene/Q Compute Node Kernel (CNK)
  • -
-

Since it uses standard Operating System information, hwloc's support is mostly independant from the processor type (x86, powerpc, ...) and just relies on the Operating System support. The main exception is BSD operating systems (NetBSD, FreeBSD, etc.) because they do not provide support topology information, hence hwloc uses an x86-only CPUID-based backend (which can be used for other OSes too, see the Components and plugins section).

-

To check whether hwloc works on a particular machine, just try to build it and run lstopo or lstopo-no-graphics. If some things do not look right (e.g. bogus or missing cache information), see Questions and Bugs.

-

hwloc only reports the number of processors on unsupported operating systems; no topology information is available.

-

For development and debugging purposes, hwloc also offers the ability to work on "fake" topologies:

+

Some operating systems do not systematically provide separate functions for CPU and memory binding. This means that CPU binding functions may have have effects on the memory binding policy. Likewise, changing the memory binding policy may change the CPU binding of the current thread. This is often not a problem for applications, so by default hwloc will make use of these functions when they provide better binding support.

+

If the application does not want the CPU binding to change when changing the memory policy, it needs to use the HWLOC_MEMBIND_NOCPUBIND flag to prevent hwloc from using OS functions which would change the CPU binding. Additionally, HWLOC_CPUBIND_NOMEMBIND can be passed to CPU binding function to prevent hwloc from using OS functions would change the memory binding policy. Of course, using these flags will reduce hwloc's overall support for binding, so their use is discouraged.

+

One can avoid using these flags but still closely control both memory and CPU binding by allocating memory, touching each page in the allocated memory, and then changing the CPU binding. The already-really-allocated memory will then be "locked" to physical memory and will not be migrated. Thus, even if the memory binding policy gets changed by the CPU binding order, the already-allocated memory will not change with it. When binding and allocating further memory, the CPU binding should be performed again in case the memory binding altered the previously-selected CPU binding.

+

Not all operating systems support the notion of a "current" memory binding policy for the current process, but such operating systems often still provide a way to allocate data on a given node set. Conversely, some operating systems support the notion of a "current" memory binding policy and do not permit allocating data on a specific node set without changing the current policy and allocate the data. To provide the most powerful coverage of these facilities, hwloc provides:

  • -Symmetrical tree of resources generated from a list of level arities, see Synthetic topologies.
  • +functions that set/get the current memory binding policies (if supported): hwloc_set/get_membind() and hwloc_set/get_proc_membind()
  • -Remote machine simulation through the gathering of topology as XML files, see Importing and exporting topologies from/to XML files.
  • -
-

hwloc can display the topology in a human-readable format, either in graphical mode (X11), or by exporting in one of several different formats, including: plain text, PDF, PNG, and FIG (see Command-line Examples below). Note that some of the export formats require additional support libraries.

-

hwloc offers a programming interface for manipulating topologies and objects. It also brings a powerful CPU bitmap API that is used to describe topology objects location on physical/logical processors. See the Programming Interface below. It may also be used to binding applications onto certain cores or memory nodes. Several utility programs are also provided to ease command-line manipulation of topology objects, binding of processes, and so on.

-

Perl bindings are available from Bernd Kallies on CPAN.

-

Python bindings are available from Guy Streeter:

-

-

-

-

-hwloc Installation

-

The generic installation procedure for both hwloc and netloc is described in Installation.

-

The hwloc command-line tool "lstopo" produces human-readable topology maps, as mentioned above. It can also export maps to the "fig" file format. Support for PDF, Postscript, and PNG exporting is provided if the "Cairo" development package (usually cairo-devel or libcairo2-dev) can be found in "lstopo" when hwloc is configured and build.

-

The hwloc core may also benefit from the following development packages:

    -
  • -

    libpciaccess for full I/O device discovery (libpciaccess-devel or libpciaccess-dev package). On Linux, PCI discovery may still be performed (without vendor/device names) even if libpciaccess cannot be used.

    -

    -
  • -
  • -AMD or NVIDIA OpenCL implementations for OpenCL device discovery.
  • +a function that allocates memory bound to specific node set without changing the current memory binding policy (if supported): hwloc_alloc_membind().
  • -the NVIDIA CUDA Toolkit for CUDA device discovery.
  • -
  • -the NVIDIA Management Library (NVML) for NVML device discovery. It is included in CUDA since version 8.0. Older NVML releases were available within the NVIDIA GPU Deployment Kit from https://developer.nvidia.com/gpu-deployment-kit .
  • -
  • -the NV-CONTROL X extension library (NVCtrl) for NVIDIA display discovery. The relevant development package is usually libXNVCtrl-devel or libxnvctrl-dev. It is also available within nvidia-settings from ftp://download.nvidia.com/XFree86/nvidia-settings/ and https://github.com/NVIDIA/nvidia-settings/ .
  • -
  • -libxml2 for full XML import/export support (otherwise, the internal minimalistic parser will only be able to import XML files that were exported by the same hwloc release). See Importing and exporting topologies from/to XML files for details. The relevant development package is usually libxml2-devel or libxml2-dev.
  • -
  • -libudev on Linux for easier discovery of OS device information (otherwise hwloc will try to manually parse udev raw files). The relevant development package is usually libudev-devel or libudev-dev.
  • -
  • -libtool's ltdl library for dynamic plugin loading. The relevant development package is usually libtool-ltdl-devel or libltdl-dev.
  • +a helper which, if needed, changes the current memory binding policy of the process in order to obtain memory binding: hwloc_alloc_membind_policy().
-

PCI and XML support may be statically built inside the main hwloc library, or as separate dynamically-loaded plugins (see the Components and plugins section).

-

Note that because of the possibility of GPL taint, the pciutils library libpci will not be used (remember that hwloc is BSD-licensed).

-

-

-

-

-Command-line Examples

-

On a 4-package 2-core machine with hyper-threading, the lstopo tool may show the following graphical output:

-
-dudley.png -
-

Here's the equivalent output in textual form:

-
Machine
-  NUMANode L#0 (P#0)
-  Package L#0 + L3 L#0 (4096KB)
-    L2 L#0 (1024KB) + L1 L#0 (16KB) + Core L#0
-      PU L#0 (P#0)
-      PU L#1 (P#8)
-    L2 L#1 (1024KB) + L1 L#1 (16KB) + Core L#1
-      PU L#2 (P#4)
-      PU L#3 (P#12)
-  Package L#1 + L3 L#1 (4096KB)
-    L2 L#2 (1024KB) + L1 L#2 (16KB) + Core L#2
-      PU L#4 (P#1)
-      PU L#5 (P#9)
-    L2 L#3 (1024KB) + L1 L#3 (16KB) + Core L#3
-      PU L#6 (P#5)
-      PU L#7 (P#13)
-  Package L#2 + L3 L#2 (4096KB)
-    L2 L#4 (1024KB) + L1 L#4 (16KB) + Core L#4
-      PU L#8 (P#2)
-      PU L#9 (P#10)
-    L2 L#5 (1024KB) + L1 L#5 (16KB) + Core L#5
-      PU L#10 (P#6)
-      PU L#11 (P#14)
-  Package L#3 + L3 L#3 (4096KB)
-    L2 L#6 (1024KB) + L1 L#6 (16KB) + Core L#6
-      PU L#12 (P#3)
-      PU L#13 (P#11)
-    L2 L#7 (1024KB) + L1 L#7 (16KB) + Core L#7
-      PU L#14 (P#7)
-      PU L#15 (P#15)
-

Note that there is also an equivalent output in XML that is meant for exporting/importing topologies but it is hardly readable to human-beings (see Importing and exporting topologies from/to XML files for details).

-

On a 4-package 2-core Opteron NUMA machine (with two core cores disallowed by the administrator), the lstopo tool may show the following graphical output (with --disallowed for displaying disallowed objects):

-
-hagrid.png -
-

Here's the equivalent output in textual form:

-
Machine (32GB total)
-  Package L#0
-    NUMANode L#0 (P#0 8190MB)
-    L2 L#0 (1024KB) + L1 L#0 (64KB) + Core L#0 + PU L#0 (P#0)
-    L2 L#1 (1024KB) + L1 L#1 (64KB) + Core L#1 + PU L#1 (P#1)
-  Package L#1
-    NUMANode L#1 (P#1 8192MB)
-    L2 L#2 (1024KB) + L1 L#2 (64KB) + Core L#2 + PU L#2 (P#2)
-    L2 L#3 (1024KB) + L1 L#3 (64KB) + Core L#3 + PU L#3 (P#3)
-  Package L#2
-    NUMANode L#2 (P#2 8192MB)
-    L2 L#4 (1024KB) + L1 L#4 (64KB) + Core L#4 + PU L#4 (P#4)
-    L2 L#5 (1024KB) + L1 L#5 (64KB) + Core L#5 + PU L#5 (P#5)
-  Package L#3
-    NUMANode L#3 (P#3 8192MB)
-    L2 L#6 (1024KB) + L1 L#6 (64KB) + Core L#6 + PU L#6 (P#6)
-    L2 L#7 (1024KB) + L1 L#7 (64KB) + Core L#7 + PU L#7 (P#7)
-

On a 2-package quad-core Xeon (pre-Nehalem, with 2 dual-core dies into each package):

-
-emmett.png -
-

Here's the same output in textual form:

-
Machine (total 16GB)
-  NUMANode L#0 (P#0 16GB)
-  Package L#0
-    L2 L#0 (4096KB)
-      L1 L#0 (32KB) + Core L#0 + PU L#0 (P#0)
-      L1 L#1 (32KB) + Core L#1 + PU L#1 (P#4)
-    L2 L#1 (4096KB)
-      L1 L#2 (32KB) + Core L#2 + PU L#2 (P#2)
-      L1 L#3 (32KB) + Core L#3 + PU L#3 (P#6)
-  Package L#1
-    L2 L#2 (4096KB)
-      L1 L#4 (32KB) + Core L#4 + PU L#4 (P#1)
-      L1 L#5 (32KB) + Core L#5 + PU L#5 (P#5)
-    L2 L#3 (4096KB)
-      L1 L#6 (32KB) + Core L#6 + PU L#6 (P#3)
-      L1 L#7 (32KB) + Core L#7 + PU L#7 (P#7)
-

-

-

-

-Programming Interface

-

The basic interface is available in hwloc.h. Some higher-level functions are available in hwloc/helper.h to reduce the need to manually manipulate objects and follow links between them. Documentation for all these is provided later in this document. Developers may also want to look at hwloc/inlines.h which contains the actual inline code of some hwloc.h routines, and at this document, which provides good higher-level topology traversal examples.

-

To precisely define the vocabulary used by hwloc, a Terms and Definitions section is available and should probably be read first.

-

Each hwloc object contains a cpuset describing the list of processing units that it contains. These bitmaps may be used for CPU binding and Memory binding. hwloc offers an extensive bitmap manipulation interface in hwloc/bitmap.h.

-

Moreover, hwloc also comes with additional helpers for interoperability with several commonly used environments. See the Interoperability With Other Software section for details.

-

The complete API documentation is available in a full set of HTML pages, man pages, and self-contained PDF files (formatted for both both US letter and A4 formats) in the source tarball in doc/doxygen-doc/.

-

NOTE: If you are building the documentation from a Git clone, you will need to have Doxygen and pdflatex installed – the documentation will be built during the normal "make" process. The documentation is installed during "make install" to $prefix/share/doc/hwloc/ and your systems default man page tree (under $prefix, of course).

-

-Portability

-

Operating System have varying support for CPU and memory binding, e.g. while some Operating Systems provide interfaces for all kinds of CPU and memory bindings, some others provide only interfaces for a limited number of kinds of CPU and memory binding, and some do not provide any binding interface at all. Hwloc's binding functions would then simply return the ENOSYS error (Function not implemented), meaning that the underlying Operating System does not provide any interface for them. CPU binding and Memory binding provide more information on which hwloc binding functions should be preferred because interfaces for them are usually available on the supported Operating Systems.

-

Similarly, the ability of reporting topology information varies from one platform to another. As shown in Command-line Examples, hwloc can obtain information on a wide variety of hardware topologies. However, some platforms and/or operating system versions will only report a subset of this information. For example, on an PPC64-based system with 8 cores (each with 2 hardware threads) running a default 2.6.18-based kernel from RHEL 5.4, hwloc is only able to glean information about NUMA nodes and processor units (PUs). No information about caches, packages, or cores is available.

-

Here's the graphical output from lstopo on this platform when Simultaneous Multi-Threading (SMT) is enabled:

-
-ppc64-with-smt.png -
-

And here's the graphical output from lstopo on this platform when SMT is disabled:

-
-ppc64-without-smt.png -
-

Notice that hwloc only sees half the PUs when SMT is disabled. PU L#6, for example, seems to change location from NUMA node #0 to #1. In reality, no PUs "moved" – they were simply re-numbered when hwloc only saw half as many (see also Logical index in Indexes and Sets). Hence, PU L#6 in the SMT-disabled picture probably corresponds to PU L#12 in the SMT-enabled picture.

-

This same "PUs have disappeared" effect can be seen on other platforms – even platforms / OSs that provide much more information than the above PPC64 system. This is an unfortunate side-effect of how operating systems report information to hwloc.

-

Note that upgrading the Linux kernel on the same PPC64 system mentioned above to 2.6.34, hwloc is able to discover all the topology information. The following picture shows the entire topology layout when SMT is enabled:

-
-ppc64-full-with-smt.png -
-

Developers using the hwloc API or XML output for portable applications should therefore be extremely careful to not make any assumptions about the structure of data that is returned. For example, per the above reported PPC topology, it is not safe to assume that PUs will always be descendants of cores.

-

Additionally, future hardware may insert new topology elements that are not available in this version of hwloc. Long-lived applications that are meant to span multiple different hardware platforms should also be careful about making structure assumptions. For example, a new element may someday exist between a core and a PU.

-

-API Example

-

The following small C example (available in the source tree as ``doc/examples/hwloc-hello.c'') prints the topology of the machine and performs some thread and memory binding. More examples are available in the doc/examples/ directory of the source tree.

-
/* Example hwloc API program.
*
* See other examples under doc/examples/ in the source tree
* for more details.
*
* Copyright © 2009-2016 Inria. All rights reserved.
* Copyright © 2009-2011 Université Bordeaux
* Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*
* hwloc-hello.c
*/
#include "hwloc.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
static void print_children(hwloc_topology_t topology, hwloc_obj_t obj,
int depth)
{
char type[32], attr[1024];
unsigned i;
hwloc_obj_type_snprintf(type, sizeof(type), obj, 0);
printf("%*s%s", 2*depth, "", type);
if (obj->os_index != (unsigned) -1)
printf("#%u", obj->os_index);
hwloc_obj_attr_snprintf(attr, sizeof(attr), obj, " ", 0);
if (*attr)
printf("(%s)", attr);
printf("\n");
for (i = 0; i < obj->arity; i++) {
print_children(topology, obj->children[i], depth + 1);
}
}
int main(void)
{
int depth;
unsigned i, n;
unsigned long size;
int levels;
char string[128];
int topodepth;
void *m;
hwloc_topology_t topology;
/* Allocate and initialize topology object. */
hwloc_topology_init(&topology);
/* ... Optionally, put detection configuration here to ignore
some objects types, define a synthetic topology, etc....
The default is to detect all the objects of the machine that
the caller is allowed to access. See Configure Topology
Detection. */
/* Perform the topology detection. */
/* Optionally, get some additional topology information
in case we need the topology depth later. */
topodepth = hwloc_topology_get_depth(topology);
/*****************************************************************
* First example:
* Walk the topology with an array style, from level 0 (always
* the system level) to the lowest level (always the proc level).
*****************************************************************/
for (depth = 0; depth < topodepth; depth++) {
printf("*** Objects at level %d\n", depth);
for (i = 0; i < hwloc_get_nbobjs_by_depth(topology, depth);
i++) {
hwloc_obj_type_snprintf(string, sizeof(string),
hwloc_get_obj_by_depth(topology, depth, i), 0);
printf("Index %u: %s\n", i, string);
}
}
/*****************************************************************
* Second example:
* Walk the topology with a tree style.
*****************************************************************/
printf("*** Printing overall tree\n");
print_children(topology, hwloc_get_root_obj(topology), 0);
/*****************************************************************
* Third example:
* Print the number of packages.
*****************************************************************/
if (depth == HWLOC_TYPE_DEPTH_UNKNOWN) {
printf("*** The number of packages is unknown\n");
} else {
printf("*** %u package(s)\n",
hwloc_get_nbobjs_by_depth(topology, depth));
}
/*****************************************************************
* Fourth example:
* Compute the amount of cache that the first logical processor
* has above it.
*****************************************************************/
levels = 0;
size = 0;
for (obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, 0);
obj;
obj = obj->parent)
levels++;
size += obj->attr->cache.size;
}
printf("*** Logical processor 0 has %d caches totaling %luKB\n",
levels, size / 1024);
/*****************************************************************
* Fifth example:
* Bind to only one thread of the last core of the machine.
*
* First find out where cores are, or else smaller sets of CPUs if
* the OS doesn't have the notion of a "core".
*****************************************************************/
/* Get last core. */
obj = hwloc_get_obj_by_depth(topology, depth,
hwloc_get_nbobjs_by_depth(topology, depth) - 1);
if (obj) {
/* Get a copy of its cpuset that we may modify. */
cpuset = hwloc_bitmap_dup(obj->cpuset);
/* Get only one logical processor (in case the core is
SMT/hyper-threaded). */
/* And try to bind ourself there. */
if (hwloc_set_cpubind(topology, cpuset, 0)) {
char *str;
int error = errno;
printf("Couldn't bind to cpuset %s: %s\n", str, strerror(error));
free(str);
}
/* Free our cpuset copy */
}
/*****************************************************************
* Sixth example:
* Allocate some memory on the last NUMA node, bind some existing
* memory to the last NUMA node.
*****************************************************************/
/* Get last node. There's always at least one. */
obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, n - 1);
size = 1024*1024;
m = hwloc_alloc_membind(topology, size, obj->nodeset,
hwloc_free(topology, m, size);
m = malloc(size);
hwloc_set_area_membind(topology, m, size, obj->nodeset,
free(m);
/* Destroy topology object. */
return 0;
}

hwloc provides a pkg-config executable to obtain relevant compiler and linker flags. For example, it can be used thusly to compile applications that utilize the hwloc library (assuming GNU Make):

-
CFLAGS += $(shell pkg-config --cflags hwloc)
-LDLIBS += $(shell pkg-config --libs hwloc)
-
-hwloc-hello: hwloc-hello.c
-        $(CC) hwloc-hello.c $(CFLAGS) -o hwloc-hello $(LDLIBS)
-

On a machine 2 processor packages – each package of which has two processing cores – the output from running hwloc-hello could be something like the following:

-
shell$ ./hwloc-hello
-*** Objects at level 0
-Index 0: Machine
-*** Objects at level 1
-Index 0: Package#0
-Index 1: Package#1
-*** Objects at level 2
-Index 0: Core#0
-Index 1: Core#1
-Index 2: Core#3
-Index 3: Core#2
-*** Objects at level 3
-Index 0: PU#0
-Index 1: PU#1
-Index 2: PU#2
-Index 3: PU#3
-*** Printing overall tree
-Machine
-  Package#0
-    Core#0
-      PU#0
-    Core#1
-      PU#1
-  Package#1
-    Core#3
-      PU#2
-    Core#2
-      PU#3
-*** 2 package(s)
-*** Logical processor 0 has 0 caches totaling 0KB
-shell$ 
-

-

-

-

-History / Credits

-

hwloc is the evolution and merger of the libtopology (http://runtime.bordeaux.inria.fr/libtopology/) project and the Portable Linux Processor Affinity (PLPA) (http://www.open-mpi.org/projects/plpa/) project. Because of functional and ideological overlap, these two code bases and ideas were merged and released under the name "hwloc" as an Open MPI sub-project.

-

libtopology was initially developed by the inria Runtime Team-Project (http://runtime.bordeaux.inria.fr/) (headed by Raymond Namyst (http://dept-info.labri.fr/~namyst/). PLPA was initially developed by the Open MPI development team as a sub-project. Both are now deprecated in favor of hwloc, which is distributed as an Open MPI sub-project.

-

-

-

+

An application can thus use the two first sets of functions if it wants to manage separately the global process binding policy and directed allocation, or use the third set of functions if it does not care about the process memory binding policy.

+

See CPU binding and Memory binding for hwloc's API functions regarding CPU and memory binding, respectively. There are some examples under doc/examples/ in the source tree.

+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00365.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00365.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00365.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00365.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Terms and Definitions +Hardware Locality (hwloc): I/O Devices @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,142 +27,170 @@
- + +/* @license-end */ -
+
-
Terms and Definitions
+
I/O Devices

-

+
+

+

hwloc usually manipulates processing units and memory but it can also discover I/O devices and report their locality as well. This is useful for placing I/O intensive applications on cores near the I/O devices they use, or for gathering information about all platform components.

+

+

+

+

+Enabling and requirements

+

I/O discovery is disabled by default (except in lstopo) for performance reasons. It can be enabled by changing the filtering of I/O object types to HWLOC_TYPE_FILTER_KEEP_IMPORTANT or HWLOC_TYPE_FILTER_KEEP_ALL before loading the topology, for instance with hwloc_topology_set_io_types_filter().

+

Note that I/O discovery requires significant help from the operating system. The pciaccess library (the development package is usually libpciaccess-devel or libpciaccess-dev) is needed to fully detect PCI devices and bridges/switches. On Linux, PCI discovery may still be performed even if libpciaccess cannot be used. But it misses PCI device names. Moreover, some operating systems require privileges for probing PCI devices, see Does hwloc require privileged access? for details.

+

The actual locality of I/O devices is only currently detected on Linux. Other operating system will just report I/O devices as being attached to the topology root object.

+

+

+

+

+I/O objects

+

When I/O discovery is enabled and supported, some additional objects are added to the topology. The corresponding I/O object types are:

+

Any of these types may be filtered individually with hwloc_topology_set_type_filter().

+

hwloc tries to attach these new objects to normal objects (usually NUMA nodes) to match their actual physical location. For instance, if a I/O hub (or root complex) is physically connected to a package, the corresponding hwloc bridge object (and its PCI bridges and devices children) is inserted as a child of the corresponding hwloc Package object. These children are not in the normal children list but rather in the I/O-specific children list.

+

I/O objects also have neither CPU sets nor node sets (NULL pointers) because they are not directly usable by the user applications for binding. Moreover I/O hierarchies may be highly complex (asymmetric trees of bridges). So I/O objects are placed in specific levels with custom depths. Their lists may still be traversed with regular helpers such as hwloc_get_next_obj_by_type(). However, hwloc offers some dedicated helpers such as hwloc_get_next_pcidev() and hwloc_get_next_osdev() for convenience (see Finding I/O objects).

+

+

+

+

+OS devices

+

Although each PCI device is uniquely identified by its bus ID (e.g. 0000:01:02.3), a user-space application can hardly find out which PCI device it is actually using. Applications rather use software handles (such as the eth0 network interface, the sda hard drive, or the mlx4_0 OpenFabrics HCA). Therefore hwloc tries to add software devices (HWLOC_OBJ_OS_DEVICE, also known as OS devices).

+

OS devices may be attached below PCI devices, but they may also be attached directly to normal objects. Indeed some OS devices are not related to PCI. For instance, NVDIMM block devices (such as pmem0s on Linux) are directly attached near their NUMA node (I/O child of the parent whose memory child is the NUMA node). Also, if hwloc could not discover PCI for some reason, PCI-related OS devices may also be attached directly to normal objects.

+

hwloc first tries to discover OS devices from the operating system, e.g. eth0, sda or mlx4_0. However, this ability is currently only available on Linux for some classes of devices.

+

hwloc then tries to discover software devices through additional I/O components using external libraries. For instance proprietary graphics drivers do not expose any named OS device, but hwloc may still create one OS object per software handle when supported. For instance the opencl and cuda components may add some opencl0d0 and cuda0 OS device objects.

+

Here is a list of OS device objects commonly created by hwloc components when I/O discovery is enabled and supported.

+
    +
  • +Hard disks or non-volatile memory devices (HWLOC_OBJ_OSDEV_BLOCK)
      +
    • +sda or dax2.0 (Linux component)
    • +
    +
  • +
  • +Network interfaces (HWLOC_OBJ_OSDEV_NETWORK)
      +
    • +eth0, wlan0, ib0 (Linux component)
    • +
    +
  • +
  • +OpenFabrics (InfiniBand, Omni-Path, usNIC, etc) HCAs (HWLOC_OBJ_OSDEV_OPENFABRICS)
      +
    • +mlx5_0, hfi1_0, qib0, usnic_0 (Linux component)
    • +
    +
  • +
  • +GPUs (HWLOC_OBJ_OSDEV_GPU)
      +
    • +nvml0 for the first NVML device (NVML component, using the NVIDIA Management Library)
    • +
    • +:0.0 for the first display (GL component, using the NV-CONTROL X extension library, NVCtrl)
    • +
    +
  • +
  • +

    Co-Processors (HWLOC_OBJ_OSDEV_COPROC)

      +
    • +opencl0d0 for the first device of the first OpenCL platform, opencl1d3 for the fourth device of the second OpenCL platform (OpenCL component)
    • +
    • +cuda0 for the first NVIDIA CUDA device (CUDA component, using the NVIDIA CUDA Library)
    • +
    • +DMA engine channel (HWLOC_OBJ_OSDEV_DMA) +
    • +
    +

    Note that some PCI devices may contain multiple software devices (see the example below).

    +

    See also Interoperability With Other Software for managing these devices without considering them as hwloc objects.

    +

    +

-

-Objects

-
-
Object
-

Interesting kind of part of the system, such as a Core, a L2Cache, a NUMA memory node, etc. The different types detected by hwloc are detailed in the hwloc_obj_type_t enumeration.

-

There are four kinds of Objects: Memory (NUMA nodes and Memory-side caches), I/O (Bridges, PCI and OS devices), Misc, and Normal (everything else, including Machine, Package, Die, Core, PU, CPU Caches, etc.). Normal and Memory objects have (non-NULL) CPU sets and nodesets, while I/O and Misc don't.

-

Objects are topologically sorted by locality (CPU and node sets) into a tree (see Hierarchy, Tree and Levels).

-

-
-
Processing Unit (or Logical Processor)
-

The smallest processing element that can be represented by a hwloc object. It may be a single-core processor, a core of a multicore processor, or a single thread in a SMT processor. hwloc's PU acronym stands for Processing Unit.

-

"Logical processor" should not be confused with "Logical index of a - processor".

-

-
-
Package
-

A processor Package is the physical package that usually gets inserted into a socket on the motherboard. It is also often called a physical processor or a CPU even if these names bring confusion with respect to cores and processing units. A processor package usually contains multiple cores (and may also be composed of multiple dies). hwloc Package objects were called Sockets up to hwloc 1.10.

-

-
-
NUMA Node
-

An object that contains memory that is directly and byte-accessible to the host processors. It is usually close to some cores as specified by its CPU set. Hence it is attached as a memory child of the object that groups those cores together, for instance a Package objects with 4 Core children (see Hierarchy, Tree and Levels).

-

-
-
Memory-side Cache
-

A cache in front of a specific memory region (e.g. a range of physical addresses). It caches all accesses to that region without caring about which core issued the request. This is the opposite of usual CPU caches where only accesses from the local cores are cached, without caring about the target memory.

-

In hwloc, memory-side caches are memory objects placed between their local CPU objects (parent) and the target NUMA node memory (child).

-
-
+ + +

+PCI devices and bridges

+

A PCI hierarchy is usually organized as follows: A hostbridge object ( HWLOC_OBJ_BRIDGE object with upstream type Host and downstream type PCI) is attached below a normal object (usually the entire machine or a NUMA node). There may be multiple hostbridges in the machine, attached to different places, but all PCI devices are below one of them (unless the Bridge object type is filtered-out).

+

Each hostbridge contains one or several children, either other bridges (usually PCI to PCI switches) or PCI devices (HWLOC_OBJ_PCI_DEVICE). The number of bridges between the hostbridge and a PCI device depends on the machine.

-

+

-

-Indexes and Sets

-
-
OS or physical index
-

The index that the operating system (OS) uses to identify the object. This may be completely arbitrary, non-unique, non-contiguous, not representative of logical proximity, and may depend on the BIOS configuration. That is why hwloc almost never uses them, only in the default lstopo output (P#x) and cpuset masks. See also Should I use logical or physical/OS indexes? and how?.

-

-
-
Logical index
-

Index to uniquely identify objects of the same type and depth, automatically computed by hwloc according to the topology. It expresses logical proximity in a generic way, i.e. objects which have adjacent logical indexes are adjacent in the topology. That is why hwloc almost always uses it in its API, since it expresses logical proximity. They can be shown (as L#x) by lstopo thanks to the -l option. This index is always linear and in the range [0, num_objs_same_type_same_level-1]. Think of it as ``cousin rank.'' The ordering is based on topology first, and then on OS CPU numbers, so it is stable across everything except firmware CPU renumbering. "Logical index" should not be confused with "Logical processor". A "Logical - processor" (which in hwloc we rather call "processing unit" to avoid the confusion) has both a physical index (as chosen arbitrarily by BIOS/OS) and a logical index (as computed according to logical proximity by hwloc). See also Should I use logical or physical/OS indexes? and how?.

-

-
-
CPU set
-

The set of logical processors (or processing units) logically included in an object (if it makes sense). They are always expressed using physical logical processor numbers (as announced by the OS). They are implemented as the hwloc_bitmap_t opaque structure. hwloc CPU sets are just masks, they do not have any relation with an operating system actual binding notion like Linux' cpusets. I/O and Misc objects do not have CPU sets while all Normal and Memory objects have non-NULL CPU sets.

-

-
-
Node set
-

The set of NUMA memory nodes logically included in an object (if it makes sense). They are always expressed using physical node numbers (as announced by the OS). They are implemented with the hwloc_bitmap_t opaque structure. as bitmaps. I/O and Misc objects do not have Node sets while all Normal and Memory objects have non-NULL nodesets.

-

-
-
Bitmap
-

A possibly-infinite set of bits used for describing sets of objects such as CPUs (CPU sets) or memory nodes (Node sets). They are implemented with the hwloc_bitmap_t opaque structure.

-

-
-
+

+Consulting I/O devices and binding

+

I/O devices may be consulted by traversing the topology manually (with usual routines such as hwloc_get_obj_by_type()) or by using dedicated helpers (such as hwloc_get_pcidev_by_busid(), see Finding I/O objects).

+

I/O objects do not actually contain any locality information because their CPU sets and node sets are NULL. Their locality must be retrieved by walking up the object tree (through the parent link) until an non-I/O object is found (see hwloc_get_non_io_ancestor_obj()). This normal object should have non-NULL CPU sets and node sets which describe the processing units and memory that are immediately close to the I/O device. For instance the path from a OS device to its locality may go across a PCI device parent, one or several bridges, up to a Package node with the same locality.

+

Command-line tools are also aware of I/O devices. lstopo displays the interesting ones by default (passing --no-io disables it).

+

hwloc-calc and hwloc-bind may manipulate I/O devices specified by PCI bus ID or by OS device name.

    +
  • +pci=0000:02:03.0 is replaced by the set of CPUs that are close to the PCI device whose bus ID is given.
  • +
  • +os=eth0 is replaced by CPUs that are close to the I/O device whose software handle is called eth0.
  • +
+

This enables easy binding of I/O-intensive applications near the device they use.

-

+

-

-Hierarchy, Tree and Levels

-
-
Parent object
-

The object logically containing the current object, for example because its CPU set includes the CPU set of the current object. All objects have a non-NULL parent, except the root of the topology (Machine object).

-

-
-
Ancestor object
-

The parent object, or its own parent, and so on.

-

-
-
Children object(s)
-

The object (or objects) contained in the current object because their CPU set is included in the CPU set of the current object. Each object may also contain separated lists for Memory, I/O and Misc object children.

-

-
-
Arity
-

The number of normal children of an object. There are also specific arities for Memory, I/O and Misc children.

-

-
-
Sibling objects
-

Objects in the same children list, which all of them are normal children of the same parent, or all of them are Memory children of the same parent, or I/O children, or Misc. They usually have the same type (and hence are cousins, as well). But they may not if the topology is asymmetric.

-

-
-
Sibling rank
-

Index to uniquely identify objects which have the same parent, and is always in the range [0, arity-1] (respectively memory_arity, io_arity or misc_arity for Memory, I/O and Misc children of a parent).

-

-
-
Cousin objects
-

Objects of the same type (and depth) as the current object, even if they do not have the same parent.

-

-
-
Level
-

Set of objects of the same type and depth. All these objects are cousins.

-

Memory, I/O and Misc objects also have their own specific levels and (virtual) depth.

-

-
-
Depth
-

Nesting level in the object tree, starting from the root object. If the topology is symmetric, the depth of a child is equal to the parent depth plus one, and an object depth is also equal to the number of parent/child links between the root object and the given object. If the topology is asymmetric, the difference between some parent and child depths may be larger than one when some intermediate levels (for instance groups) are missing in only some parts of the machine.

-

The depth of the Machine object is always 0 since it is always the root of the topology. The depth of PU objects is equal to the number of levels in the topology minus one.

-

Memory, I/O and Misc objects also have their own specific levels and depth.

-

-
-
-

The following diagram can help to understand the vocabulary of the relationships by showing the example of a machine with two dual core packages (with no hardware threads); thus, a topology with 5 levels. Each box with rounded corner corresponds to one hwloc_obj_t, containing the values of the different integer fields (depth, logical_index, etc.), and arrows show to which other hwloc_obj_t pointers point to (first_child, parent, etc.).

-

The topology always starts with a Machine object as root (depth 0) and ends with PU objects at the bottom (depth 4 here).

-

Objects of the same level (cousins) are listed in red boxes and linked with red arrows. Children of the same parent (siblings) are linked with blue arrows.

-

The L2 cache of the last core is intentionally missing to show how asymmetric topologies are handled. See What happens if my topology is asymmetric? for more information about such strange topologies.

+

+Examples

+

The following picture shows a dual-package dual-core host whose PCI bus is connected to the first package and NUMA node.

-diagram.png +
-

It should be noted that for PU objects, the logical index – as computed linearly by hwloc – is not the same as the OS index.

-

The NUMA node is on the side because it is not part of the main tree but rather attached to the object that corresponds to its locality (the entire machine here, hence the root object). It is attached as a Memory child (in green) and has a virtual depth (negative). It could also have siblings if there were multiple local NUMA nodes, or cousins if other NUMA nodes were attached somewhere else in the machine.

-

I/O or Misc object could be attached in a similar manner.

-
+

Six interesting PCI devices were discovered. However, hwloc found some corresponding software devices (eth0, eth1, sda, mlx4_0, ib0, and ib1) for only four of these physical devices. The other ones (PCI 102b:0532 and PCI 8086:3a20) are an unused IDE controller (no disk attached) and a graphic card (no corresponding software device reported to the user by the operating system).

+

On the contrary, it should be noted that three different software devices were found for the last PCI device (PCI 15b3:634a). Indeed this OpenFabrics HCA PCI device object contains one one OpenFabrics software device (mlx4_0) and two virtual network interface software devices (ib0 and ib1).

+

Here is the corresponding textual output:

+
Machine (24GB total)
+  Package L#0
+    NUMANode L#0 (P#0 12GB)
+    L3 L#0 (8192KB)
+      L2 L#0 (256KB) + L1 L#0 (32KB) + Core L#0 + PU L#0 (P#0)
+      L2 L#1 (256KB) + L1 L#1 (32KB) + Core L#1 + PU L#1 (P#2)
+    HostBridge
+      PCIBridge
+        PCI 01:00.0 (Ethernet)
+          Net "eth0"
+        PCI 01:00.1 (Ethernet)
+          Net "eth1"
+      PCIBridge
+        PCI 03:00.0 (RAID)
+          Block "sda"
+      PCIBridge
+        PCI 04:03.0 (VGA)
+      PCI 00:1f.2 (IDE)
+      PCI 51:00.0 (InfiniBand)
+        Net "ib0"
+        Net "ib1"
+        Net "mlx4_0"
+  Package L#1
+    NUMANode L#1 (P#1 12GB)
+    L3 L#1 (8192KB)
+      L2 L#2 (256KB) + L1 L#2 (32KB) + Core L#2 + PU L#2 (P#1)
+      L2 L#3 (256KB) + L1 L#3 (32KB) + Core L#3 + PU L#3 (P#3)
+
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00366.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00366.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00366.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00366.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Command-Line Tools +Hardware Locality (hwloc): Miscellaneous objects @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,111 +27,54 @@ - + +/* @license-end */ -
+
-
Command-Line Tools
+
Miscellaneous objects

-

hwloc comes with an extensive C programming interface and several command line utilities. Each of them is fully documented in its own manual page; the following is a summary of the available command line tools.

+

hwloc topologies may be annotated with Misc objects (of type HWLOC_OBJ_MISC) either automatically or by the user. This is an flexible way to annotate topologies with large sets of information since Misc objects may be inserted anywhere in the topology (to annotate specific objects or parts of the topology), even below other Misc objects, and each of them may contain multiple attributes (see also How do I annotate the topology with private notes?).

+

These Misc objects may have a subtype field to replace Misc with something else in the lstopo output.

-

+

-

-lstopo and lstopo-no-graphics

-

lstopo (also known as hwloc-ls) displays the hierarchical topology map of the current system. The output may be graphical, ascii-art or textual, and can also be exported to numerous file formats such as PDF, PNG, XML, and others. Advanced graphical outputs require the "Cairo" development package (usually cairo-devel or libcairo2-dev).

-

lstopo and lstopo-no-graphics accept the same command-line options. However, graphical outputs are only available in lstopo. Textual outputs (those that do not depend on heavy external libraries such as Cairo) are supported in both lstopo and lstopo-no-graphics.

-

This command can also display the processes currently bound to a part of the machine (via the --ps option).

-

Note that lstopo can read XML files and/or alternate chroot filesystems and display topological maps representing those systems (e.g., use lstopo to output an XML file on one system, and then use lstopo to read in that XML file and display it on a different system).

-

-

-

-

-hwloc-bind

-

hwloc-bind binds processes to specific hardware objects through a flexible syntax. A simple example is binding an executable to specific cores (or packages or bitmaps or ...). The hwloc-bind(1) man page provides much more detail on what is possible.

-

hwloc-bind can also be used to retrieve the current process' binding, or retrieve the last CPU(s) where a process ran, or operate on memory binding.

-

Just like hwloc-calc, the input locations given to hwloc-bind may be either objects or cpusets (bitmaps as reported by hwloc-calc or hwloc-distrib).

-

-

-

-

-hwloc-calc

-

hwloc-calc is hwloc's Swiss Army Knife command-line tool for converting things. The input may be either objects or cpusets (bitmaps as reported by another hwloc-calc instance or by hwloc-distrib), that may be combined by addition, intersection or subtraction. The output kinds include:

    -
  • -a cpuset bitmap: This compact opaque representation of objects is useful for shell scripts etc. It may passed to hwloc command-line tools such as hwloc-calc or hwloc-bind, or to hwloc command-line options such as lstopo --restrict.
  • +

    +Misc objects added by hwloc

    +

    hwloc only uses Misc objects when other object types are not sufficient, and when the Misc object type is not filtered-out anymore. This currently includes:

    • -the amount of the equivalent hwloc objects from a specific type, or the list of their indexes. This is useful for iterating over all similar objects (for instance all cores) within a given part of a platform.
    • +Memory modules (DIMMs), on Linux when privileged and when dmi-sysfs is supported by the kernel. These objects have a subtype field of value MemoryModule. They are currently always attached to the root object. Their attributes describe the DIMM vendor, model, etc. lstopo -v displays them as:
      Misc(MemoryModule) (P#1 DeviceLocation="Bottom-Slot 2(right)" BankLocation="BANK 2" Vendor=Elpida SerialNumber=21733667 AssetTag=9876543210 PartNumber="EBJ81UG8EFU0-GN-F ")
      +
    • -a hierarchical description of objects, for instance a thread index within a core within a package. This gives a better view of the actual location of an object.
    • +Displaying process binding in lstopo --top. These objects have a subtype field of value Process and a name attribute made of their PID and program name. They are attached below the object they are bound to. The textual lstopo displays them as:
      PU L#0 (P#0)
      +
      Misc(Process) 4445 myprogram
      +
    -

    Moreover, input and/or output may be use either physical/OS object indexes or as hwloc's logical object indexes. It eases cooperation with external tools such as taskset or numactl by exporting hwloc specifications into list of processor or NUMA node physical indexes. See also Should I use logical or physical/OS indexes? and how?.

    -

    -

-

-

-hwloc-info

-

hwloc-info dumps information about the given objects, as well as all its specific attributes. It is intended to be used with tools such as grep for filtering certain attribute lines. When no object is specified, or when --topology is passed, hwloc-info prints a summary of the topology. When --support is passed, hwloc-info lists the supported features for the topology.

-

-

-

-

-hwloc-distrib

-

hwloc-distrib generates a set of cpuset bitmaps that are uniformly distributed across the machine for the given number of processes. These strings may be used with hwloc-bind to run processes to maximize their memory bandwidth by properly distributing them across the machine.

-

-

-

-

-hwloc-ps

-

hwloc-ps is a tool to display the bindings of processes that are currently running on the local machine. By default, hwloc-ps only lists processes that are bound; unbound process (and Linux kernel threads) are not displayed.

-

-

-

-

-hwloc-annotate

-

hwloc-annotate may modify object (and topology) attributes such as string information (see Custom string infos for details) or Misc children objects. It reads an input topology from a XML file and outputs the annotated topology as another XML file.

-

-

-

-

-hwloc-diff, hwloc-patch and hwloc-compress-dir

-

hwloc-diff computes the difference between two topologies and outputs it to another XML file.

-

hwloc-patch reads such a difference file and applies to another topology.

-

hwloc-compress-dir compresses an entire directory of XML files by using hwloc-diff to save the differences between topologies instead of entire topologies.

-

-

-

-

-hwloc-dump-hwdata

-

hwloc-dump-hwdata is a Linux and x86-specific tool that dumps (during boot, privileged) some topology and locality information from raw hardware files (SMBIOS and ACPI tables) to human-readable and world-accessible files that the hwloc library will later reuse.

-

Currently only used on Intel Xeon Phi processor platforms. See Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?.

-

See HWLOC_DUMPED_HWDATA_DIR in Environment Variables for details about the location of dumped files.

-

+

-

-hwloc-gather-topology and hwloc-gather-cpuid

-

hwloc-gather-topology is a Linux-specific tool that saves the relevant topology files of the current machine into a tarball (and the corresponding lstopo outputs).

-

hwloc-gather-cpuid is a x86-specific tool that dumps the result of CPUID instructions on the current machine into a directory.

-

The output of hwloc-gather-cpuid is included in the tarball saved by hwloc-gather-topology when running on Linux/x86.

-

These files may be used later (possibly offline) for simulating or debugging a machine without actually running on it.

+

+Annotating topologies with Misc objects

+

The user may annotate hwloc topologies with its own Misc objects. This can be achieved with hwloc_topology_insert_misc_object() as well as hwloc-annotate command-line tool.

+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00367.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00367.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00367.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00367.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Environment Variables +Hardware Locality (hwloc): Object attributes @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,157 +27,167 @@
- + +/* @license-end */ -
+
-
Environment Variables
+
Object attributes

-

-

-

The behavior of the hwloc library and tools may be tuned thanks to the following environment variables.

-
-
HWLOC_XMLFILE=/path/to/file.xml
-

enforces the discovery from the given XML file as if hwloc_topology_set_xml() had been called. This file may have been generated earlier with lstopo file.xml. For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, HWLOC_THISSYSTEM should be set 1 in the environment too, to assert that the loaded file is really the underlying system. See also Importing and exporting topologies from/to XML files.

-

-
-
HWLOC_SYNTHETIC=synthetic_description
-

enforces the discovery through a synthetic description string as if hwloc_topology_set_synthetic() had been called. For convenience, this backend provides empty binding hooks which just return success. See also Synthetic topologies.

-

-
-
HWLOC_XML_VERBOSE=1
+
+

+

+Normal attributes

+

hwloc objects have many generic attributes in the hwloc_obj structure, for instance their logical_index or os_index (see Should I use logical or physical/OS indexes? and how?), depth or name.

+

The kind of object is first described by the obj->type generic attribute (an integer). OS devices also have a specific obj->attr->osdev.type integer for distinguishing between NICs, GPUs, etc. Objects may also have an optional obj->subtype pointing to a better description string. For instance subtype is useful to say what Group objects are actually made of (e.g. Book for Linux S/390 books). It may also specify that a Block OS device is a Disk, or that a CoProcessor OS device is a CUDA device. This subtype is displayed by lstopo either in place or after the main obj->type attribute. NUMA nodes that correspond GPU memory may also have GPUMemory as subtype.

+

Each object also contains an attr field that, if non NULL, points to a union hwloc_obj_attr_u of type-specific attribute structures. For instance, a L2Cache object obj contains cache-specific information in obj->attr->cache, such as its size and associativity, cache type. See hwloc_obj_attr_u for details.

+

+

+

+

+Custom string infos

+

Aside os these generic attribute fields, hwloc annotates many objects with string attributes that are made of a key and a value. Each object contains a list of such pairs that may be consulted manually (looking at the object infos array field) or using the hwloc_obj_get_info_by_name(). The user may additionally add new key-value pairs to any object using hwloc_obj_add_info() or the hwloc-annotate program.

+

Here is a non-exhaustive list of attributes that may be automatically added by hwloc. Note that these attributes heavily depend on the ability of the operating system to report them. Many of them will therefore be missing on some OS.

+

+

+

+

+Hardware Platform Information

+

These info attributes are attached to the root object (Machine).

+
+
PlatformName, PlatformModel, PlatformVendor, PlatformBoardID, PlatformRevision,
-
HWLOC_SYNTHETIC_VERBOSE=1
-

enables verbose messages in the XML or synthetic topology backends. hwloc XML backends (see Importing and exporting topologies from/to XML files) can emit some error messages to the error output stream. Enabling these verbose messages within hwloc can be useful for understanding failures to parse input XML topologies. Similarly, enabling verbose messages in the synthetic topology backend can help understand why the description string is invalid. See also Synthetic topologies.

-

-
-
HWLOC_THISSYSTEM=1
-

enforces the return value of hwloc_topology_is_thissystem(), as if HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM was set with hwloc_topology_set_flags(). It means that it makes hwloc assume that the selected backend provides the topology for the system on which we are running, even if it is not the OS-specific backend but the XML backend for instance. This means making the binding functions actually call the OS-specific system calls and really do binding, while the XML backend would otherwise provide empty hooks just returning success. This can be used for efficiency reasons to first detect the topology once, save it to an XML file, and quickly reload it later through the XML backend, but still having binding functions actually do bind. This also enables support for the variable HWLOC_THISSYSTEM_ALLOWED_RESOURCES.

-

-
-
HWLOC_THISSYSTEM_ALLOWED_RESOURCES=1
-

Get the set of allowed resources from the native operating system even if the topology was loaded from XML or synthetic description, as if HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES was set with hwloc_topology_set_flags(). This variable requires the topology to match the current system (see the variable HWLOC_THISSYSTEM). This is useful when the topology is not loaded directly from the local machine (e.g. for performance reason) and it comes with all resources, but the running process is restricted to only a part of the machine (for instance because of Linux Cgroup/Cpuset).

-

-
-
HWLOC_ALLOW=all
-

Totally ignore administrative restrictions such as Linux Cgroups and consider all resources (PUs and NUMA nodes) as allowed. This is different from setting HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED which gathers all resources but marks the unavailable ones as disallowed.

-

-
-
HWLOC_HIDE_ERRORS=0
-

enables or disables verbose reporting of errors. The hwloc library may issue warnings to the standard error stream when it detects a problem during topology discovery, for instance if the operating system (or user) gives contradictory topology information. Setting this environment variable to 1 removes the actual displaying of these error messages.

-

-
-
HWLOC_USE_NUMA_DISTANCES=7
-

enables or disables the use of NUMA distances. NUMA distances and memory target/initiator information may be used to improve the locality of NUMA nodes, especially CPU-less nodes. Bits in the value of this environment variable enable different features: Bit 0 enables the gathering of NUMA distances from the operating system. Bit 1 further enables the use of NUMA distances to improve the locality of CPU-less nodes. Bit 2 enables the use of target/initiator information.

-

-
-
HWLOC_GROUPING=1
-

enables or disables objects grouping based on distances. By default, hwloc uses distance matrices between objects (either read from the OS or given by the user) to find groups of close objects. These groups are described by adding intermediate Group objects in the topology. Setting this environment variable to 0 will disable this grouping. This variable supersedes the obsolete HWLOC_IGNORE_DISTANCES variable.

-

-
-
HWLOC_GROUPING_ACCURACY=0.05
-

relaxes distance comparison during grouping. By default, objects may be grouped if their distances form a minimal distance graph. When setting this variable to 0.02, and when HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE is given, these distances do not have to be strictly equal anymore, they may just be equal with a 2% error. If set to try instead of a numerical value, hwloc will try to group with perfect accuracy (0, the default), then with 0.01, 0.02, 0.05 and finally 0.1. Numbers given in this environment variable should always use a dot as a decimal mark (for instance 0.01 instead of 0,01).

-

+
SystemVersionRegister, ProcessorVersionRegister (Machine)
+
Some POWER/PowerPC-specific attributes describing the platform and processor. Currently only available on Linux. Usually added to Package objects, but can be in Machine instead if hwloc failed to discover any package.
+
DMIBoardVendor, DMIBoardName, etc.
+
DMI hardware information such as the motherboard and chassis models and vendors, the BIOS revision, etc., as reported by Linux under /sys/class/dmi/id/.
+
MemoryMode, ClusterMode
+

Intel Xeon Phi processor configuration modes. Available if hwloc-dump-hwdata was used (see Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?) or if hwloc managed to guess them from the NUMA configuration.

+

The memory mode may be Cache, Flat, Hybrid50 (half the MCDRAM is used as a cache) or Hybrid25 (25% of MCDRAM as cache). The cluster mode may be Quadrant, Hemisphere, All2All, SNC2 or SNC4. See doc/examples/get-knl-modes.c in the source directory for an example of retrieving these attributes.

-
HWLOC_GROUPING_VERBOSE=0
-

enables or disables some verbose messages during grouping. If this variable is set to 1, some debug messages will be displayed during distance-based grouping of objects even if debug was not specific at configure time. This is useful when trying to find an interesting distance grouping accuracy.

-

-
-
HWLOC_PCI_LOCALITY=<domain/bus> <cpuset>;...
+
+

+

+

+

+Operating System Information

+

These info attributes are attached to the root object (Machine).

+
+
OSName, OSRelease, OSVersion, HostName, Architecture
+
The operating system name, release, version, the hostname and the architecture name, as reported by the Unix uname command.
+
LinuxCgroup
+
The name the Linux control group where the calling process is placed.
+
+

+

+

+

+hwloc Information

+

Unless specified, these info attributes are attached to the root object (Machine).

+
+
Backend (topology root, or specific object added by that backend)
+
The name of the hwloc backend/component that filled the topology. If several components were combined, multiple Backend keys may exist, with different values, for instance x86 and Linux in the root object and CUDA in CUDA OS device objects.
+
SyntheticDescription
+
The description string that was given to hwloc to build this synthetic topology.
+
hwlocVersion
+
The version number of the hwloc library that was used to generate the topology. If the topology was loaded from XML, this is not the hwloc version that loaded it, but rather the first hwloc instance that exported the topology to XML earlier.
+
ProcessName
+
The name of the process that contains the hwloc library that was used to generate the topology. If the topology was from XML, this is not the hwloc process that loaded it, but rather the first process that exported the topology to XML earlier.
+
+

+

+

+

+CPU Information

+

These info attributes are attached to Package objects, or to the root object (Machine) if package locality information is missing.

+
+
CPUModel
+
The processor model name.
+
CPUVendor, CPUModelNumber, CPUFamilyNumber, CPUStepping
+
The processor vendor name, model number, family number, and stepping number. Currently available for x86 and Xeon Phi processors on most systems, and for ia64 processors on Linux (except CPUStepping).
+
CPURevision
+
A POWER/PowerPC-specific general processor revision number, currently only available on Linux.
+
CPUType
+
A Solaris-specific general processor type name, such as "i86pc".
+
+

+

+

+

+OS Device Information

+

These info attributes are attached to OS device objects specified in parentheses.

+
+
Vendor, Model, Revision, SerialNumber, Size, SectorSize (Block OS devices)
+
The vendor and model names, revision, serial number, size (in kB) and SectorSize (in bytes).
+
LinuxDeviceID (Block OS devices)
+
The major/minor device number such as 8:0 of Linux device.
+
GPUVendor, GPUModel (GPU or Co-Processor OS devices)
+
The vendor and model names of the GPU device.
+
OpenCLDeviceType, OpenCLPlatformIndex,
-
HWLOC_PCI_LOCALITY=/path/to/pci/locality/file
-

changes the locality of I/O devices behing the specified PCI buses. If no I/O locality information is available or if the BIOS reports incorrect information, it is possible to move a I/O device tree (OS and/or PCI devices with optional bridges) near a custom set of processors.
- Localities are given either inside the environment variable itself, or in the pointed file. They may be separated either by semi-colons or by line-breaks.
- Each locality contains a domain/bus specification (in hexadecimal numbers as usual) followed by a whitespace and a cpuset:

    -
  • -0001 <cpuset> specifies the locality of all buses in PCI domain 0000.
  • -
  • -0000:0f <cpuset> specifies only PCI bus 0f in domain 0000.
  • -
  • -0002:04-0a <cpuset> specifies a range of buses (from 04 to 0a) within domain 0002.
  • -
-

Domain/bus specifications should usually match entire hierarchies of buses behind a bridge (including primary, secondary and subordinate buses). For instance, if hostbridge 0000:00 contains other bridges creating buses 0000:01 to 0000:09, the variable should be HWLOC_PCI_LOCALITY="0000:00-09 <cpuset>". It supersedes the old HWLOC_PCI_0000_00_LOCALCPUS=<cpuset> which only works when hostbridges exist in the topology.
- If the variable is defined to empty or invalid, no forced PCI locality is applied but hwloc's internal automatic locality quirks are disabled, which means the exact PCI locality reported by the platform is used.

-

-
-
HWLOC_X86_TOPOEXT_NUMANODES=0
-

use AMD topoext CPUID leaf in the x86 backend to detect NUMA nodes. When using the x86 backend, setting this variable to 1 enables the building of NUMA nodes from AMD processor CPUID instructions. However this strategy does not always reflect BIOS configuration such as NUMA interleaving. And node indexes may be different from those of the operating system. Hence this should only be used when OS backends are wrong and the user is sure that CPUID returns correct NUMA information.

-

-
-
HWLOC_KEEP_NVIDIA_GPU_NUMA_NODES=0
-

show or hide NUMA nodes that correspond to NVIDIA GPU memory. By default they are ignored to avoid interleaved memory being allocated on GPU by mistake. Setting this environment variable to 1 exposes these NUMA nodes. They may be recognized by the GPUMemory subtype. They also have a PCIBusID info attribute to identify the corresponding GPU.

-

-
-
HWLOC_KNL_MSCACHE_L3=0
-

Expose the KNL MCDRAM in cache mode as a Memory-side Cache instead of a L3. hwloc releases prior to 2.1 exposed the MCDRAM cache as a CPU-side L3 cache. Now that Memory-side caches are supported by hwloc, it is still exposed as a L3 by default to avoid breaking existing applications. Setting this environment variable to 1 will expose it as a proper Memory-side cache.

-

-
-
HWLOC_ANNOTATE_GLOBAL_COMPONENTS=0
-

Allow components to annotate the topology even if they are usually excluded by global components by default. Setting this variable to 1 and also setting HWLOC_COMPONENTS=xml,pci,stop enables the addition of PCI vendor and model info attributes to a XML topology that was generated without those names (if pciaccess was missing).

-

-
-
HWLOC_FSROOT=/path/to/linux/filesystem-root/
-

switches to reading the topology from the specified Linux filesystem root instead of the main file-system root. This directory may have been saved previously from another machine with hwloc-gather-topology.
- One should likely also set HWLOC_COMPONENTS=linux,stop so that non-Linux backends are disabled (the -i option of command-line tools takes care of both).
- Not using the main file-system root causes hwloc_topology_is_thissystem() to return 0. For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, HWLOC_THISSYSTEM should be set 1 in the environment too, to assert that the loaded file is really the underlying system.

-

-
-
HWLOC_CPUID_PATH=/path/to/cpuid/
-

forces the x86 backend to read dumped CPUIDs from the given directory instead of executing actual x86 CPUID instructions. This directory may have been saved previously from another machine with hwloc-gather-cpuid.
- One should likely also set HWLOC_COMPONENTS=x86,stop so that non-x86 backends are disabled (the -i option of command-line tools takes care of both).
- It causes hwloc_topology_is_thissystem() to return 0. For convenience, this backend provides empty binding hooks which just return success. To have hwloc still actually call OS-specific hooks, HWLOC_THISSYSTEM should be set 1 in the environment too, to assert that the loaded CPUID dump is really the underlying system.

-

-
-
HWLOC_DUMPED_HWDATA_DIR=/path/to/dumped/files/
-

loads files dumped by hwloc-dump-hwdata (on Linux) from the given directory. The default dump/load directory is configured during build based on --runstatedir, --localstatedir, and --prefix options. It usually points to /var/run/hwloc/ in Linux distribution packages, but it may also point to $prefix/var/run/hwloc/ when manually installing and only specifying --prefix.

-

-
-
HWLOC_COMPONENTS=list,of,components
-

forces a list of components to enable or disable. Enable or disable the given comma-separated list of components (if they do not conflict with each other). Component names prefixed with - are disabled (a single phase may also be disabled).

-

Once the end of the list is reached, hwloc falls back to enabling the remaining components (sorted by priority) that do not conflict with the already enabled ones, and unless explicitly disabled in the list. If stop is met, the enabling loop immediately stops, no more component is enabled.

-

If xml or synthetic components are selected, the corresponding XML filename or synthetic description string should be pass in HWLOC_XMLFILE or HWLOC_SYNTHETIC respectively.

-

Since this variable is the low-level and more generic way to select components, it takes precedence over environment variables for selecting components.

-

If the variable is set to an empty string (or set to a single comma), no specific component is loaded first, all components are loaded in priority order.

-

See Selecting which components to use for details.

-

-
-
HWLOC_COMPONENTS_VERBOSE=1
-

displays verbose information about components. Display messages when components are registered or enabled. This is the recommended way to list the available components with their priority (all of them are registered at startup).

-

-
-
HWLOC_PLUGINS_PATH=/path/to/hwloc/plugins/:...
-

changes the default search directory for plugins. By default, $libdir/hwloc is used. The variable may contain several colon-separated directories.

-

-
-
HWLOC_PLUGINS_VERBOSE=1
-

displays verbose information about plugins. List which directories are scanned, which files are loaded, and which components are successfully loaded.

-

-
-
HWLOC_PLUGINS_BLACKLIST=filename1,filename2,...
-

prevents plugins from being loaded if their filename (without path) is listed. Plugin filenames may be found in verbose messages outputted when HWLOC_PLUGINS_VERBOSE=1.

-

-
-
HWLOC_DEBUG_VERBOSE=0
-

disables all verbose messages that are enabled by default when –enable-debug is passed to configure.

-

-
+
OpenCLPlatformName, OpenCLPlatformDeviceIndex (OpenCL OS devices)
+
The type of OpenCL device, the OpenCL platform index and name, and the index of the device within the platform.
+
OpenCLComputeUnits, OpenCLGlobalMemorySize (OpenCL OS devices)
+
The number of compute units and global memory size (in kB) of an OpenCL device.
+
NVIDIAUUID, NVIDIASerial (NVML GPU OS devices)
+
The UUID and Serial of NVIDIA GPUs.
+
CUDAMultiProcessors, CUDACoresPerMP,
+
+
CUDAGlobalMemorySize, CUDAL2CacheSize, CUDASharedMemorySizePerMP (CUDA OS devices)
+
The number of shared multiprocessors, the number of cores per multiprocessor, the global memory size, the (global) L2 cache size, and size of the shared memory in each multiprocessor of a CUDA device. Sizes are in kB.
+
Address, Port (Network interface OS devices)
+
The MAC address and the port number of a software network interface, such as eth4 on Linux.
+
NodeGUID, SysImageGUID, Port1State, Port2LID, Port2LMC, Port3GID1 (OpenFabrics OS devices)
+
The node GUID and GUID mask, the state of a port #1 (value is 4 when active), the LID and LID mask count of port #2, and GID #1 of port #3.
+
+

+

+

+

+Other Object-specific Information

+

These info attributes are attached to objects specified in parentheses.

+
+
DAXDevice (NUMA Nodes)
+
The name of the Linux DAX device that was used to expose a non-volatile memory region as a volatile NUMA node.
+
PCIBusID (GPUMemory NUMA Nodes)
+
The PCI bus ID of the GPU whose memory is exposed in this NUMA node.
+
Inclusive (Caches)
+
The inclusiveness of a cache (1 if inclusive, 0 otherwise). Currently only available on x86 processors.
+
SolarisProcessorGroup (Group)
+
The Solaris kstat processor group name that was used to build this Group object.
+
PCIVendor, PCIDevice (PCI devices and bridges)
+
The vendor and device names of the PCI device.
+
PCISlot (PCI devices or Bridges)
+
The name/number of the physical slot where the device is plugged. If the physical device contains PCI bridges above the actual PCI device, the attribute may be attached to the highest bridge (i.e. the first object that actually appears below the physical slot).
+
Vendor, AssetTag, PartNumber, DeviceLocation, BankLocation (MemoryModule Misc objects)
+
Information about memory modules (DIMMs) extracted from SMBIOS.
+
+

+

+

+

+User-Given Information

+

Here is a non-exhaustive list of user-provided info attributes that have a special meaning:

+
lstopoStyle
+
Enforces the style of an object (background and text colors) in the graphical output of lstopo. See CUSTOM COLORS in the lstopo(1) manpage for details.
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00368.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00368.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00368.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00368.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): CPU and Memory Binding Overview +Hardware Locality (hwloc): Importing and exporting topologies from/to XML files @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,44 +27,61 @@
- + +/* @license-end */
-
+
-
CPU and Memory Binding Overview
+
Importing and exporting topologies from/to XML files

-

Some operating systems do not systematically provide separate functions for CPU and memory binding. This means that CPU binding functions may have have effects on the memory binding policy. Likewise, changing the memory binding policy may change the CPU binding of the current thread. This is often not a problem for applications, so by default hwloc will make use of these functions when they provide better binding support.

-

If the application does not want the CPU binding to change when changing the memory policy, it needs to use the HWLOC_MEMBIND_NOCPUBIND flag to prevent hwloc from using OS functions which would change the CPU binding. Additionally, HWLOC_CPUBIND_NOMEMBIND can be passed to CPU binding function to prevent hwloc from using OS functions would change the memory binding policy. Of course, using these flags will reduce hwloc's overall support for binding, so their use is discouraged.

-

One can avoid using these flags but still closely control both memory and CPU binding by allocating memory, touching each page in the allocated memory, and then changing the CPU binding. The already-really-allocated memory will then be "locked" to physical memory and will not be migrated. Thus, even if the memory binding policy gets changed by the CPU binding order, the already-allocated memory will not change with it. When binding and allocating further memory, the CPU binding should be performed again in case the memory binding altered the previously-selected CPU binding.

-

Not all operating systems support the notion of a "current" memory binding policy for the current process, but such operating systems often still provide a way to allocate data on a given node set. Conversely, some operating systems support the notion of a "current" memory binding policy and do not permit allocating data on a specific node set without changing the current policy and allocate the data. To provide the most powerful coverage of these facilities, hwloc provides:

-
    -
  • -functions that set/get the current memory binding policies (if supported): hwloc_set/get_membind() and hwloc_set/get_proc_membind()
  • -
  • -a function that allocates memory bound to specific node set without changing the current memory binding policy (if supported): hwloc_alloc_membind().
  • -
  • -a helper which, if needed, changes the current memory binding policy of the process in order to obtain memory binding: hwloc_alloc_membind_policy().
  • -
-

An application can thus use the two first sets of functions if it wants to manage separately the global process binding policy and directed allocation, or use the third set of functions if it does not care about the process memory binding policy.

-

See CPU binding and Memory binding for hwloc's API functions regarding CPU and memory binding, respectively. There are some examples under doc/examples/ in the source tree.

+

hwloc offers the ability to export topologies to XML files and reload them later. This is for instance useful for loading topologies faster (see I do not want hwloc to rediscover my enormous machine topology every time I rerun a process), manipulating other nodes' topology, or avoiding the need for privileged processes (see Does hwloc require privileged access?).

+

Topologies may be exported to XML files thanks to hwloc_topology_export_xml(), or to a XML memory buffer with hwloc_topology_export_xmlbuffer(). The lstopo program can also serve as a XML topology export tool.

+

XML topologies may then be reloaded later with hwloc_topology_set_xml() and hwloc_topology_set_xmlbuffer(). The HWLOC_XMLFILE environment variable also tells hwloc to load the topology from the given XML file (see Environment Variables).

+
Note
Loading XML topologies disables binding because the loaded topology may not correspond to the physical machine that loads it. This behavior may be reverted by asserting that loaded file really matches the underlying system with the HWLOC_THISSYSTEM environment variable or the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM topology flag.
+
+The topology flag HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES may be used to load a XML topology that contains the entire machine and restrict it to the part that is actually available to the current process (e.g. when Linux Cgroup/Cpuset are used to restrict the set of resources).
+
+hwloc also offers the ability to export/import Topology differences.
+
+XML topology files are not localized. They use a dot as a decimal separator. Therefore any exported topology can be reloaded on any other machine without requiring to change the locale.
+
+XML exports contain all details about the platform. It means that two very similar nodes still have different XML exports (e.g. some serial numbers or MAC addresses are different). If a less precise exporting/importing is required, one may want to look at Synthetic topologies instead.
+

+

+

+

+libxml2 and minimalistic XML backends

+

hwloc offers two backends for importing/exporting XML.

+

First, it can use the libxml2 library for importing/exporting XML files. It features full XML support, for instance when those files have to be manipulated by non-hwloc software (e.g. a XSLT parser). The libxml2 backend is enabled by default if libxml2 development headers are available (the relevant development package is usually libxml2-devel or libxml2-dev).

+

If libxml2 is not available at configure time, or if --disable-libxml2 is passed, hwloc falls back to a custom backend. Contrary to the aforementioned full XML backend with libxml2, this minimalistic XML backend cannot be guaranteed to work with external programs. It should only be assumed to be compatible with the same hwloc release (even if using the libxml2 backend). Its advantage is, however, to always be available without requiring any external dependency.

+

If libxml2 is available but the core hwloc library should not directly depend on it, the libxml2 support may be built as a dynamicall-loaded plugin. One should pass --enable-plugins to enable plugin support (when supported) and build as plugins all component that support it. Or pass --enable-plugins=xml_libxml to only build this libxml2 support as a plugin.

+

+

+

+

+XML import error management

+

Importing XML files can fail at least because of file access errors, invalid XML syntax, non-hwloc-valid XML contents, or incompatibilities between hwloc releases (see Are XML topology files compatible between hwloc releases?).

+

Both backend cannot detect all these errors when the input XML file or buffer is selected (when hwloc_topology_set_xml() or hwloc_topology_set_xmlbuffer() is called). Some errors such non-hwloc-valid contents can only be detected later when loading the topology with hwloc_topology_load().

+

It is therefore strongly recommended to check the return value of both hwloc_topology_set_xml() (or hwloc_topology_set_xmlbuffer()) and hwloc_topology_load() to handle all these errors.

+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00369.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00369.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00369.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00369.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): I/O Devices +Hardware Locality (hwloc): Synthetic topologies @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,170 +27,91 @@
- + +/* @license-end */ -
+
-
I/O Devices
+
Synthetic topologies

-

hwloc usually manipulates processing units and memory but it can also discover I/O devices and report their locality as well. This is useful for placing I/O intensive applications on cores near the I/O devices they use, or for gathering information about all platform components.

-

-

-

-

-Enabling and requirements

-

I/O discovery is disabled by default (except in lstopo) for performance reasons. It can be enabled by changing the filtering of I/O object types to HWLOC_TYPE_FILTER_KEEP_IMPORTANT or HWLOC_TYPE_FILTER_KEEP_ALL before loading the topology, for instance with hwloc_topology_set_io_types_filter().

-

Note that I/O discovery requires significant help from the operating system. The pciaccess library (the development package is usually libpciaccess-devel or libpciaccess-dev) is needed to fully detect PCI devices and bridges. On Linux, PCI discovery may still be performed even if libpciaccess cannot be used. But it misses PCI device names. Moreover, some operating systems require privileges for probing PCI devices, see Does hwloc require privileged access? for details.

-

The actual locality of I/O devices is only currently detected on Linux. Other operating system will just report I/O devices as being attached to the topology root object.

-

-

-

-

-I/O objects

-

When I/O discovery is enabled and supported, some additional objects are added to the topology. The corresponding I/O object types are:

-

Any of these types may be filtered individually with hwloc_topology_set_type_filter().

-

hwloc tries to attach these new objects to normal objects (usually NUMA nodes) to match their actual physical location. For instance, if a I/O Hub is physically connected to a package, the corresponding hwloc bridge object (and its PCI bridges and devices children) is inserted as a child of the corresponding hwloc Package object. These children are not in the normal children list but rather in the I/O-specific children list.

-

I/O objects also have neither CPU sets nor node sets (NULL pointers) because they are not directly usable by the user applications for binding. Moreover I/O hierarchies may be highly complex (asymmetric trees of bridges). So I/O objects are placed in specific levels with custom depths. Their lists may still be traversed with regular helpers such as hwloc_get_next_obj_by_type(). However, hwloc offers some dedicated helpers such as hwloc_get_next_pcidev() and hwloc_get_next_osdev() for convenience (see Finding I/O objects).

-

-

-

-

-OS devices

-

Although each PCI device is uniquely identified by its bus ID (e.g. 0000:01:02.3), a user-space application can hardly find out which PCI device it is actually using. Applications rather use software handles (such as the eth0 network interface, the sda hard drive, or the mlx4_0 OpenFabrics HCA). Therefore hwloc tries to add software devices (HWLOC_OBJ_OS_DEVICE, also known as OS devices).

-

OS devices may be attached below PCI devices, but they may also be attached directly to normal objects. Indeed some OS devices are not related to PCI. For instance, NVDIMM block devices (such as pmem0s on Linux) are directly attached near their NUMA node (I/O child of the parent whose memory child is the NUMA node). Also, if hwloc could not discover PCI for some reason, PCI-related OS devices may also be attached directly to normal objects.

-

hwloc first tries to discover OS devices from the operating system, e.g. eth0, sda or mlx4_0. However, this ability is currently only available on Linux for some classes of devices.

-

hwloc then tries to discover software devices through additional I/O components using external libraries. For instance proprietary graphics drivers do not expose any named OS device, but hwloc may still create one OS object per software handle when supported. For instance the opencl and cuda components may add some opencl0d0 and cuda0 OS device objects.

-

Here is a list of OS device objects commonly created by hwloc components when I/O discovery is enabled and supported.

-
    -
  • -Hard disks or non-volatile memory devices (HWLOC_OBJ_OSDEV_BLOCK)
      -
    • -sda or dax2.0 (Linux component)
    • -
    -
  • -
  • -Network interfaces (HWLOC_OBJ_OSDEV_NETWORK)
      -
    • -eth0, wlan0, ib0 (Linux component)
    • -
    -
  • -
  • -OpenFabrics (InfiniBand, Omni-Path, usNIC, etc) HCAs (HWLOC_OBJ_OSDEV_OPENFABRICS)
      -
    • -mlx5_0, hfi1_0, qib0, usnic_0 (Linux component)
    • -
    -
  • -
  • -GPUs (HWLOC_OBJ_OSDEV_GPU)
      -
    • -nvml0 for the first NVML device (NVML component, using the NVIDIA Management Library)
    • -
    • -:0.0 for the first display (GL component, using the NV-CONTROL X extension library, NVCtrl)
    • -
    -
  • -
  • -Co-Processors (HWLOC_OBJ_OSDEV_COPROC)
      -
    • -opencl0d0 for the first device of the first OpenCL platform, opencl1d3 for the fourth device of the second OpenCL platform (OpenCL component)
    • -
    • -cuda0 for the first NVIDIA CUDA device (CUDA component, using the NVIDIA CUDA Library)
    • -
    • -mic0 for the first Intel Xeon Phi (MIC) coprocessor (Linux component)
    • -
    -
  • -
  • -DMA engine channel (HWLOC_OBJ_OSDEV_DMA) -
  • -
-

Note that some PCI devices may contain multiple software devices (see the example below).

-

See also Interoperability With Other Software for managing these devices without considering them as hwloc objects.

-

-

-

-

-PCI devices and bridges

-

A PCI hierarchy is usually organized as follows: A hostbridge object ( HWLOC_OBJ_BRIDGE object with upstream type Host and downstream type PCI) is attached below a normal object (usually the entire machine or a NUMA node). There may be multiple hostbridges in the machine, attached to different places, but all PCI devices are below one of them (unless the Bridge object type is filtered-out).

-

Each hostbridge contains one or several children, either other bridges (usually PCI to PCI) or PCI devices (HWLOC_OBJ_PCI_DEVICE). The number of bridges between the hostbridge and a PCI device depends on the machine.

-

-

-

-

-Consulting I/O devices and binding

-

I/O devices may be consulted by traversing the topology manually (with usual routines such as hwloc_get_obj_by_type()) or by using dedicated helpers (such as hwloc_get_pcidev_by_busid(), see Finding I/O objects).

-

I/O objects do not actually contain any locality information because their CPU sets and node sets are NULL. Their locality must be retrieved by walking up the object tree (through the parent link) until an non-I/O object is found (see hwloc_get_non_io_ancestor_obj()). This normal object should have non-NULL CPU sets and node sets which describe the processing units and memory that are immediately close to the I/O device. For instance the path from a OS device to its locality may go across a PCI device parent, one or several bridges, up to a Package node with the same locality.

-

Command-line tools are also aware of I/O devices. lstopo displays the interesting ones by default (passing --no-io disables it).

-

hwloc-calc and hwloc-bind may manipulate I/O devices specified by PCI bus ID or by OS device name.

    -
  • -pci=0000:02:03.0 is replaced by the set of CPUs that are close to the PCI device whose bus ID is given.
  • -
  • -os=eth0 is replaced by CPUs that are close to the I/O device whose software handle is called eth0.
  • -
-

This enables easy binding of I/O-intensive applications near the device they use.

-

-

-

-

-Examples

-

The following picture shows a dual-package dual-core host whose PCI bus is connected to the first package and NUMA node.

-
-devel09-pci.png -
-

Six interesting PCI devices were discovered. However, hwloc found some corresponding software devices (eth0, eth1, sda, mlx4_0, ib0, and ib1) for only four of these physical devices. The other ones (PCI 102b:0532 and PCI 8086:3a20) are an unused IDE controller (no disk attached) and a graphic card (no corresponding software device reported to the user by the operating system).

-

On the contrary, it should be noted that three different software devices were found for the last PCI device (PCI 15b3:634a). Indeed this OpenFabrics HCA PCI device object contains one one OpenFabrics software device (mlx4_0) and two virtual network interface software devices (ib0 and ib1).

-

Here is the corresponding textual output:

-
Machine (24GB total)
+

hwloc may load fake or remote topologies so as to consult them without having the underlying hardware available. Aside from loading XML topologies, hwloc also enables the building of synthetic topologies that are described by a single string listing the arity of each levels.

+

For instance, lstopo may create a topology made of 2 packages, containing a single NUMA node and a L2 cache above two single-threaded cores:

+
$ lstopo -i "pack:2 node:1 l2:1 core:2 pu:1" -
+Machine (2048MB)
   Package L#0
-    NUMANode L#0 (P#0 12GB)
-    L3 L#0 (8192KB)
-      L2 L#0 (256KB) + L1 L#0 (32KB) + Core L#0 + PU L#0 (P#0)
-      L2 L#1 (256KB) + L1 L#1 (32KB) + Core L#1 + PU L#1 (P#2)
-    HostBridge
-      PCIBridge
-        PCI 01:00.0 (Ethernet)
-          Net "eth0"
-        PCI 01:00.1 (Ethernet)
-          Net "eth1"
-      PCIBridge
-        PCI 03:00.0 (RAID)
-          Block "sda"
-      PCIBridge
-        PCI 04:03.0 (VGA)
-      PCI 00:1f.2 (IDE)
-      PCI 51:00.0 (InfiniBand)
-        Net "ib0"
-        Net "ib1"
-        Net "mlx4_0"
+    NUMANode L#0 (P#0 1024MB)
+    L2 L#0 (4096KB)
+      Core L#0 + PU L#0 (P#0)
+      Core L#1 + PU L#1 (P#1)
   Package L#1
-    NUMANode L#1 (P#1 12GB)
-    L3 L#1 (8192KB)
-      L2 L#2 (256KB) + L1 L#2 (32KB) + Core L#2 + PU L#2 (P#1)
-      L2 L#3 (256KB) + L1 L#3 (32KB) + Core L#3 + PU L#3 (P#3)
-
+ NUMANode L#1 (P#1 1024MB) + L2 L#1 (4096KB) + Core L#2 + PU L#2 (P#2) + Core L#3 + PU L#3 (P#3) +

Replacing - with file.xml in this command line will export this topology to XML as usual.

+
Note
Synthetic topologies offer a very basic way to export a topology and reimport it on another machine. It is a lot less precise than XML but may still be enough when only the hierarchy of resources matters.
+

+

+

+

+Synthetic description string

+

Each item in the description string gives the type of the level and the number of such children under each object of the previous level. That is why the above topology contains 4 cores (2 cores times 2 nodes).

+

These type names must be written as numanode, package, core, l2u, l1i, pu, group (hwloc_obj_type_sscanf() is used for parsing the type names). They do not need to be written case-sensitively, nor entirely (as long as there is no ambiguity, 2 characters such as ma select a Machine level). Note that I/O and Misc objects are not available.

+

Instead of specifying the type of each level, it is possible to just specify the arities and let hwloc choose all types according to usual topologies. The following examples are therefore equivalent:

$ lstopo -i "2 3 4 5 6"
+$ lstopo -i "Package:2 NUMANode:3 L2Cache:4 Core:5 PU:6"
+

NUMA nodes are handled in a special way since they are not part of the main CPU hierarchy but rather attached below it as memory children. Thus, NUMANode:3 actually means Group:3 where one NUMA node is attached below each group. These groups are merged back into the parent when possible (typically when a single NUMA node is requested below each parent).

+

It is also possible the explicitly attach NUMA nodes to specific levels. For instance, a topology similar to a Intel Xeon Phi processor (with 2 NUMA nodes per 16-core group) may be created with:

$ lstopo -i "package:1 group:4 [numa] [numa] core:16 pu:4"
+

The root object does not appear in the synthetic description string since it is always a Machine object. Therefore the Machine type is disallowed in the description as well.

+

A NUMA level (with a single NUMA node) is automatically added if needed.

+

Each item may be followed parentheses containing a list of space-separated attributes. For instance:

    +
  • +L2iCache:2(size=32kB) specifies 2 children of 32kB level-2 instruction caches. The size may be specified in bytes (without any unit suffix) or as TB, GB, MB or kB.
  • +
  • +NUMANode:3(memory=16MB) specifies 3 NUMA nodes with 16MB each. The size may be specified in bytes (without any unit suffix) or as TB, GB, MB or kB.
  • +
  • +PU:2(indexes=0,2,1,3) specifies 2 PU children and the full list of OS indexes among the entire set of 4 PU objects.
  • +
  • +PU:2(indexes=numa:core) specifies 2 PU children whose OS indexes are interleaved by NUMA node first and then by package.
  • +
  • +Attributes in parentheses at the very beginning of the description apply to the root object.
  • +
+

+

+

+

+Loading a synthetic topology

+

Aside from lstopo, the hwloc programming interface offers the same ability by passing the synthetic description string to hwloc_topology_set_synthetic() before hwloc_topology_load().

+

Synthetic topologies are created by the synthetic component. This component may be enabled by force by setting the HWLOC_SYNTHETIC environment variable to something such as node:2 core:3 pu:4.

+

Loading a synthetic topology disables binding support since the topology usually does not match the underlying hardware. Binding may be reenabled as usual by setting HWLOC_THISSYSTEM=1 in the environment or by setting the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM topology flag.

+

+

+

+

+Exporting a topology as a synthetic string

+

The function hwloc_topology_export_synthetic() may export a topology as a synthetic string. It offers a convenient way to quickly describe the contents of a machine. The lstopo tool may also perform such an export by forcing the output format.

+
$ lstopo --of synthetic --no-io
+Package:1 L3Cache:1 L2Cache:2 L1dCache:1 L1iCache:1 Core:1 PU:2
+

The exported string may be passed back to hwloc for recreating another similar topology (see also Are synthetic strings compatible between hwloc releases?). The entire tree will be similar, but some attributes such as the processor model will be missing.

+

Such an export is only possible if the topology is totally symmetric. It means that the symmetric_subtree field of the root object is set. Also memory children should be attached in a symmetric way (e.g. the same number of memory children below each Package object, etc.). However, I/O devices and Misc objects are ignored when looking at symmetry and exporting the string.

+
+ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00370.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00370.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00370.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00370.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Miscellaneous objects +Hardware Locality (hwloc): Interoperability With Other Software @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,49 +27,73 @@ - + +/* @license-end */ -
+
-
Miscellaneous objects
+
Interoperability With Other Software

-

hwloc topologies may be annotated with Misc objects (of type HWLOC_OBJ_MISC) either automatically or by the user. This is an flexible way to annotate topologies with large sets of information since Misc objects may be inserted anywhere in the topology (to annotate specific objects or parts of the topology), even below other Misc objects, and each of them may contain multiple attributes (see also How do I annotate the topology with private notes?).

-

These Misc objects may have a subtype field to replace Misc with something else in the lstopo output.

-

-

-

-

-Misc objects added by hwloc

-

hwloc only uses Misc objects when other object types are not sufficient, and when the Misc object type is not filtered-out anymore. This currently includes:

    -
  • -Memory modules (DIMMs), on Linux when privileged and when dmi-sysfs is supported by the kernel. These objects have a subtype field of value MemoryModule. They are currently always attached to the root object. Their attributes describe the DIMM vendor, model, etc. lstopo -v displays them as:
    Misc(MemoryModule) (P#1 DeviceLocation="Bottom-Slot 2(right)" BankLocation="BANK 2" Vendor=Elpida SerialNumber=21733667 AssetTag=9876543210 PartNumber="EBJ81UG8EFU0-GN-F ")
  • -
  • -Displaying process binding in lstopo --top. These objects have a subtype field of value Process and a name attribute made of their PID and program name. They are attached below the object they are bound to. The textual lstopo displays them as:
    PU L#0 (P#0)
    Misc(Process) 4445 myprogram
  • -
-

-

-

-

-Annotating topologies with Misc objects

-

The user may annotate hwloc topologies with its own Misc objects. This can be achieved with hwloc_topology_insert_misc_object() as well as hwloc-annotate command-line tool.

+

Although hwloc offers its own portable interface, it still may have to interoperate with specific or non-portable libraries that manipulate similar kinds of objects. hwloc therefore offers several specific "helpers" to assist converting between those specific interfaces and hwloc.

+

Some external libraries may be specific to a particular OS; others may not always be available. The hwloc core therefore generally does not explicitly depend on these types of libraries. However, when a custom application uses or otherwise depends on such a library, it may optionally include the corresponding hwloc helper to extend the hwloc interface with dedicated helpers.

+

Most of these helpers use structures that are specific to these external libraries and only meaningful on the local machine. If so, the helper requires the input topology to match the current machine. Some helpers also require I/O device discovery to be supported and enabled for the current topology.

+
+
Linux specific features
+

hwloc/linux.h offers Linux-specific helpers that utilize some non-portable features of the Linux system, such as binding threads through their thread ID ("tid") or parsing kernel CPU mask files.

+

+
+
Linux libnuma
+

hwloc/linux-libnuma.h provides conversion helpers between hwloc CPU sets and libnuma-specific types, such as bitmasks. It helps you use libnuma memory-binding functions with hwloc CPU sets.

+

+
+
Glibc
+

hwloc/glibc-sched.h offers conversion routines between Glibc and hwloc CPU sets in order to use hwloc with functions such as sched_getaffinity() or pthread_attr_setaffinity_np().

+

+
+
OpenFabrics Verbs
+

hwloc/openfabrics-verbs.h helps interoperability with the OpenFabrics Verbs interface. For example, it can return a list of processors near an OpenFabrics device. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

+

+
+
OpenCL
+

hwloc/opencl.h enables interoperability with the OpenCL interface. Only the AMD and NVIDIA implementations currently offer locality information. It may return the list of processors near a GPU given as a cl_device_id. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

+

+
+
NVIDIA CUDA
+

hwloc/cuda.h and hwloc/cudart.h enable interoperability with NVIDIA CUDA Driver and Runtime interfaces. For instance, it may return the list of processors near NVIDIA GPUs. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

+

+
+
NVIDIA Management Library (NVML)
+

hwloc/nvml.h enables interoperability with the NVIDIA NVML interface. It may return the list of processors near a NVIDIA GPU given as a nvmlDevice_t. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

+

+
+
NVIDIA displays
+

hwloc/gl.h enables interoperability with NVIDIA displays using the NV-CONTROL X extension (NVCtrl library). If I/O device discovery is enabled, it may return the OS device hwloc object that corresponds to a display given as a name such as :0.0 or given as a port/device pair (server/screen).

+

+
+
Taskset command-line tool
+

The taskset command-line tool is widely used for binding processes. It manipulates CPU set strings in a format that is slightly different from hwloc's one (it does not divide the string in fixed-size subsets and separates them with commas). To ease interoperability, hwloc offers routines to convert hwloc CPU sets from/to taskset-specific string format. Most hwloc command-line tools also support the --taskset option to manipulate taskset-specific strings.

+

+
+
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00371.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00371.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00371.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00371.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Object attributes +Hardware Locality (hwloc): Thread Safety @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,169 +27,59 @@
- + +/* @license-end */ -
+
-
Object attributes
+
Thread Safety

-

-

-

-Normal attributes

-

hwloc objects have many generic attributes in the hwloc_obj structure, for instance their logical_index or os_index (see Should I use logical or physical/OS indexes? and how?), depth or name.

-

The kind of object is first described by the obj->type generic attribute (an integer). OS devices also have a specific obj->attr->osdev.type integer for distinguishing between NICs, GPUs, etc. Objects may also have an optional obj->subtype pointing to a better description string. For instance subtype is useful to say what Group objects are actually made of (e.g. Book for Linux S/390 books). It may also specify that a Block OS device is a Disk, or that a CoProcessor OS device is a CUDA device. This subtype is displayed by lstopo either in place or after the main obj->type attribute. NUMA nodes that correspond GPU memory may also have GPUMemory as subtype.

-

Each object also contains an attr field that, if non NULL, points to a union hwloc_obj_attr_u of type-specific attribute structures. For instance, a L2Cache object obj contains cache-specific information in obj->attr->cache, such as its size and associativity, cache type. See hwloc_obj_attr_u for details.

-

-

-

-

-Custom string infos

-

Aside os these generic attribute fields, hwloc annotates many objects with string attributes that are made of a key and a value. Each object contains a list of such pairs that may be consulted manually (looking at the object infos array field) or using the hwloc_obj_get_info_by_name(). The user may additionally add new key-value pairs to any object using hwloc_obj_add_info() or the hwloc-annotate program.

-

Here is a non-exhaustive list of attributes that may be automatically added by hwloc. Note that these attributes heavily depend on the ability of the operating system to report them. Many of them will therefore be missing on some OS.

-

-

-

-

-Hardware Platform Information

-

These info attributes are attached to the root object (Machine).

-
-
PlatformName, PlatformModel, PlatformVendor, PlatformBoardID, PlatformRevision,
-
-
SystemVersionRegister, ProcessorVersionRegister (Machine)
-
Some POWER/PowerPC-specific attributes describing the platform and processor. Currently only available on Linux. Usually added to Package objects, but can be in Machine instead if hwloc failed to discover any package.
-
DMIBoardVendor, DMIBoardName, etc.
-
DMI hardware information such as the motherboard and chassis models and vendors, the BIOS revision, etc., as reported by Linux under /sys/class/dmi/id/.
-
MemoryMode, ClusterMode
-

Intel Xeon Phi processor configuration modes. Available if hwloc-dump-hwdata was used (see Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?) or if hwloc managed to guess them from the NUMA configuration.

-

The memory mode may be Cache, Flat, Hybrid50 (half the MCDRAM is used as a cache) or Hybrid25 (25% of MCDRAM as cache). The cluster mode may be Quadrant, Hemisphere, All2All, SNC2 or SNC4. See doc/examples/get-knl-modes.c in the source directory for an example of retrieving these attributes.

+
+

+

Like most libraries that mainly fill data structures, hwloc is not thread safe but rather reentrant: all state is held in a hwloc_topology_t instance without mutex protection. That means, for example, that two threads can safely operate on and modify two different hwloc_topology_t instances, but they should not simultaneously invoke functions that modify the same instance. Similarly, one thread should not modify a hwloc_topology_t instance while another thread is reading or traversing it. However, two threads can safely read or traverse the same hwloc_topology_t instance concurrently.

+

When running in multiprocessor environments, be aware that proper thread synchronization and/or memory coherency protection is needed to pass hwloc data (such as hwloc_topology_t pointers) from one processor to another (e.g., a mutex, semaphore, or a memory barrier). Note that this is not a hwloc-specific requirement, but it is worth mentioning.

+

For reference, hwloc_topology_t modification operations include (but may not be limited to):

+
+
Creation and destruction
+

hwloc_topology_init(), hwloc_topology_load(), hwloc_topology_destroy() (see Topology Creation and Destruction) imply major modifications of the structure, including freeing some objects. No other thread cannot access the topology or any of its objects at the same time.

+

Also references to objects inside the topology are not valid anymore after these functions return.

+

+
+
Runtime topology modifications
+

hwloc_topology_insert_misc_object(), hwloc_topology_alloc_group_object(), and hwloc_topology_insert_group_object() (see Modifying a loaded Topology) may modify the topology significantly by adding objects inside the tree, changing the topology depth, etc.

+

hwloc_distances_add() and hwloc_distances_remove() (see Add or remove distances between objects) modify the list of distance structures in the topology, and the former may even insert new Group objects.

+

hwloc_topology_restrict() modifies the topology even more dramatically by removing some objects.

+

Although references to former objects may still be valid after insertion or restriction, it is strongly advised to not rely on any such guarantee and always re-consult the topology to reacquire new instances of objects.

+

+
+
Consulting distances
+

hwloc_distances_get() and its variants are thread-safe except if the topology was recently modified (because distances may involve objects that were removed).

+

Whenever the topology is modified (see above), one dummy (but valid) hwloc_distances_get() call should be performed in the same thread-safe context to force the refresh of internal distances structures.

+

Once this refresh has been performed, multiple hwloc_distances_get() may then be performed concurrently by multiple threads.

+

+
+
Locating topologies
+

hwloc_topology_set_* (see Topology Detection Configuration and Query) do not modify the topology directly, but they do modify internal structures describing the behavior of the upcoming invocation of hwloc_topology_load(). Hence, all of these functions should not be used concurrently.

+

-
-

-

-

-

-Operating System Information

-

These info attributes are attached to the root object (Machine).

-
-
OSName, OSRelease, OSVersion, HostName, Architecture
-
The operating system name, release, version, the hostname and the architecture name, as reported by the Unix uname command.
-
LinuxCgroup
-
The name the Linux control group where the calling process is placed.
-
-

-

-

-

-hwloc Information

-

Unless specified, these info attributes are attached to the root object (Machine).

-
-
Backend (topology root, or specific object added by that backend)
-
The name of the hwloc backend/component that filled the topology. If several components were combined, multiple Backend keys may exist, with different values, for instance x86 and Linux in the root object and CUDA in CUDA OS device objects.
-
SyntheticDescription
-
The description string that was given to hwloc to build this synthetic topology.
-
hwlocVersion
-
The version number of the hwloc library that was used to generate the topology. If the topology was loaded from XML, this is not the hwloc version that loaded it, but rather the first hwloc instance that exported the topology to XML earlier.
-
ProcessName
-
The name of the process that contains the hwloc library that was used to generate the topology. If the topology was from XML, this is not the hwloc process that loaded it, but rather the first process that exported the topology to XML earlier.
-
-

-

-

-

-CPU Information

-

These info attributes are attached to Package objects, or to the root object (Machine) if package locality information is missing.

-
-
CPUModel
-
The processor model name.
-
CPUVendor, CPUModelNumber, CPUFamilyNumber, CPUStepping
-
The processor vendor name, model number, family number, and stepping number. Currently available for x86 and Xeon Phi processors on most systems, and for ia64 processors on Linux (except CPUStepping).
-
CPURevision
-
A POWER/PowerPC-specific general processor revision number, currently only available on Linux.
-
CPUType
-
A Solaris-specific general processor type name, such as "i86pc".
-
-

-

-

-

-OS Device Information

-

These info attributes are attached to OS device objects specified in parentheses.

-
-
Vendor, Model, Revision, SerialNumber, Size, SectorSize (Block OS devices)
-
The vendor and model names, revision, serial number, size (in kB) and SectorSize (in bytes).
-
LinuxDeviceID (Block OS devices)
-
The major/minor device number such as 8:0 of Linux device.
-
GPUVendor, GPUModel (GPU or Co-Processor OS devices)
-
The vendor and model names of the GPU device.
-
OpenCLDeviceType, OpenCLPlatformIndex,
-
-
OpenCLPlatformName, OpenCLPlatformDeviceIndex (OpenCL OS devices)
-
The type of OpenCL device, the OpenCL platform index and name, and the index of the device within the platform.
-
OpenCLComputeUnits, OpenCLGlobalMemorySize (OpenCL OS devices)
-
The number of compute units and global memory size (in kB) of an OpenCL device.
-
NVIDIAUUID, NVIDIASerial (NVML GPU OS devices)
-
The UUID and Serial of NVIDIA GPUs.
-
CUDAMultiProcessors, CUDACoresPerMP,
-
-
CUDAGlobalMemorySize, CUDAL2CacheSize, CUDASharedMemorySizePerMP (CUDA OS devices)
-
The number of shared multiprocessors, the number of cores per multiprocessor, the global memory size, the (global) L2 cache size, and size of the shared memory in each multiprocessor of a CUDA device. Sizes are in kB.
-
MICSerialNumber (MIC coprocessor OS device)
-
The serial number of an Intel Xeon Phi (MIC) coprocessor. hwloc may run either inside the coprocessor itself, or on the host processor. That attribute is set in both cases, so that the exact same coprocessor may be identified from both point of views, even if there are multiple nodes with multiple MICs. When running hwloc on the host, each hwloc OS device object that corresponds to a Xeon Phi gets such an attribute. When running hwloc inside a Xeon Phi coprocessor, the root of the topology (Machine object) gets this attribute.
-
MICFamily, MICSKU, MICActiveCores, MICMemorySize (MIC coprocessor OS device)
-
The family, SKU (model), number of active cores, and memory size (in kB) of an Intel Xeon Phi (MIC) coprocessor.
-
Address, Port (Network interface OS devices)
-
The MAC address and the port number of a software network interface, such as eth4 on Linux.
-
NodeGUID, SysImageGUID, Port1State, Port2LID, Port2LMC, Port3GID1 (OpenFabrics OS devices)
-
The node GUID and GUID mask, the state of a port #1 (value is 4 when active), the LID and LID mask count of port #2, and GID #1 of port #3.
-
-

-

-

-

-Other Object-specific Information

-

These info attributes are attached to objects specified in parentheses.

-
-
DAXDevice (NUMA Nodes)
-
The name of the Linux DAX device that was used to expose a non-volatile memory region as a volatile NUMA node.
-
PCIBusID (GPUMemory NUMA Nodes)
-
The PCI bus ID of the GPU whose memory is exposed in this NUMA node.
-
Inclusive (Caches)
-
The inclusiveness of a cache (1 if inclusive, 0 otherwise). Currently only available on x86 processors.
-
SolarisProcessorGroup (Group)
-
The Solaris kstat processor group name that was used to build this Group object.
-
PCIVendor, PCIDevice (PCI devices and bridges)
-
The vendor and device names of the PCI device.
-
PCISlot (PCI devices or Bridges)
-
The name/number of the physical slot where the device is plugged. If the physical device contains PCI bridges above the actual PCI device, the attribute may be attached to the highest bridge (i.e. the first object that actually appears below the physical slot).
-
Vendor, AssetTag, PartNumber, DeviceLocation, BankLocation (MemoryModule Misc objects)
-
Information about memory modules (DIMMs) extracted from SMBIOS.
-
-

-

-

-

-User-Given Information

-

Here is a non-exhaustive list of user-provided info attributes that have a special meaning:

-
lstopoStyle
-
Enforces the style of an object (background and text colors) in the graphical output of lstopo. See CUSTOM COLORS in the lstopo(1) manpage for details.
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00372.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00372.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00372.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00372.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Importing and exporting topologies from/to XML files +Hardware Locality (hwloc): Components and plugins @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,59 +27,105 @@
- + +/* @license-end */
-
+
-
Importing and exporting topologies from/to XML files
+
Components and plugins

-

hwloc offers the ability to export topologies to XML files and reload them later. This is for instance useful for loading topologies faster (see I do not want hwloc to rediscover my enormous machine topology every time I rerun a process), manipulating other nodes' topology, or avoiding the need for privileged processes (see Does hwloc require privileged access?).

-

Topologies may be exported to XML files thanks to hwloc_topology_export_xml(), or to a XML memory buffer with hwloc_topology_export_xmlbuffer(). The lstopo program can also serve as a XML topology export tool.

-

XML topologies may then be reloaded later with hwloc_topology_set_xml() and hwloc_topology_set_xmlbuffer(). The HWLOC_XMLFILE environment variable also tells hwloc to load the topology from the given XML file.

-
Note
Loading XML topologies disables binding because the loaded topology may not correspond to the physical machine that loads it. This behavior may be reverted by asserting that loaded file really matches the underlying system with the HWLOC_THISSYSTEM environment variable or the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM topology flag.
-
-The topology flag HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES may be used to load a XML topology that contains the entire machine and restrict it to the part that is actually available to the current process (e.g. when Linux Cgroup/Cpuset are used to restrict the set of resources).
-
-hwloc also offers the ability to export/import Topology differences.
-
-XML topology files are not localized. They use a dot as a decimal separator. Therefore any exported topology can be reloaded on any other machine without requiring to change the locale.
-
-XML exports contain all details about the platform. It means that two very similar nodes still have different XML exports (e.g. some serial numbers or MAC addresses are different). If a less precise exporting/importing is required, one may want to look at Synthetic topologies instead.
+

hwloc is organized in components that are responsible for discovering objects. Depending on the topology configuration, some components will be used, some will be ignored. The usual default is to enable the native operating system component, (e.g. linux or solaris) and the pci miscellaneous component. If available, an architecture-specific component (such as x86) may also improve the topology detection.

+

If a XML topology is loaded, the xml discovery component will be used instead of all other components. It internally uses a specific class of components for the actual XML import/export routines (xml_libxml and xml_nolibxml) but these will not be discussed here (see libxml2 and minimalistic XML backends).

-

+

-

-libxml2 and minimalistic XML backends

-

hwloc offers two backends for importing/exporting XML.

-

First, it can use the libxml2 library for importing/exporting XML files. It features full XML support, for instance when those files have to be manipulated by non-hwloc software (e.g. a XSLT parser). The libxml2 backend is enabled by default if libxml2 development headers are available (the relevant development package is usually libxml2-devel or libxml2-dev).

-

If libxml2 is not available at configure time, or if --disable-libxml2 is passed, hwloc falls back to a custom backend. Contrary to the aforementioned full XML backend with libxml2, this minimalistic XML backend cannot be guaranteed to work with external programs. It should only be assumed to be compatible with the same hwloc release (even if using the libxml2 backend). Its advantage is, however, to always be available without requiring any external dependency.

-

If libxml2 is available but the core hwloc library should not directly depend on it, the libxml2 support may be built as a dynamicall-loaded plugin. One should pass --enable-plugins to enable plugin support (when supported) and build as plugins all component that support it. Or pass --enable-plugins=xml_libxml to only build this libxml2 support as a plugin.

+

+Components enabled by default

+

The hwloc core contains a list of components sorted by priority. Each one is enabled as long as it does not conflict with the previously enabled ones. This includes native operating system components, architecture-specific ones, and if available, I/O components such as pci.

+

Usually the native operating system component (when it exists, e.g. linux or aix) is enabled first. Then hwloc looks for an architecture specific component (e.g. x86). Finally there also exist a basic component (no_os) that just tries to discover the number of PUs in the system.

+

Each component discovers as much topology information as possible. Most of them, including most native OS components, do nothing unless the topology is still empty. Some others, such as x86 and pci, can complete and annotate what other backends found earlier. Discovery is performed by phases: CPUs are first discovered, then memory is attached, then PCI, etc.

+

Default priorities ensure that clever components are invoked first. Native operating system components have higher priorities, and are therefore invoked first, because they likely offer very detailed topology information. If needed, it will be later extended by architecture-specific information (e.g. from the x86 component).

+

If any configuration function such as hwloc_topology_set_xml() is used before loading the topology, the corresponding component is enabled first. Then, as usual, hwloc enables any other component (based on priorities) that does not conflict.

+

Certain components that manage a virtual topology, for instance XML topology import or synthetic topology description, conflict with all other components. Therefore, one of them may only be loaded (e.g. with hwloc_topology_set_xml()) if no other component is enabled.

+

The environment variable HWLOC_COMPONENTS_VERBOSE may be set to get verbose messages about component registration (including their priority) and enabling.

-

+

-

-XML import error management

-

Importing XML files can fail at least because of file access errors, invalid XML syntax, non-hwloc-valid XML contents, or incompatibilities between hwloc releases (see Are XML topology files compatible between hwloc releases?).

-

Both backend cannot detect all these errors when the input XML file or buffer is selected (when hwloc_topology_set_xml() or hwloc_topology_set_xmlbuffer() is called). Some errors such non-hwloc-valid contents can only be detected later when loading the topology with hwloc_topology_load().

-

It is therefore strongly recommended to check the return value of both hwloc_topology_set_xml() (or hwloc_topology_set_xmlbuffer()) and hwloc_topology_load() to handle all these errors.

+

+Selecting which components to use

+

If no topology configuration functions such as hwloc_topology_set_synthetic() have been called, plugins may be selected with environment variables such as HWLOC_XMLFILE, HWLOC_SYNTHETIC, HWLOC_FSROOT, or HWLOC_CPUID_PATH (see Environment Variables).

+

Finally, the environment variable HWLOC_COMPONENTS resets the list of selected components. If the variable is set and empty (or set to a single comma separating nothing, since some operating systems do not accept empty variables), the normal plugin priority order is used.

+

If the variable is set to x86 in this variable will cause the x86 component to take precedence over any other component, including the native operating system component. It is therefore loaded first, before hwloc tries to load all remaining non-conflicting components. In this case, x86 would take care of discovering everything it supports, instead of only completing what the native OS information. This may be useful if the native component is buggy on some platforms.

+

It is possible to prevent some components from being loaded by prefixing their name with - in the list. For instance x86,-pci will load the x86 component, then let hwloc load all the usual components except pci. A single component phase may also be blacklisted, for instance with -linux:io. hwloc_topology_set_components() may also be used inside the program to prevent the loading of a specific component (or phases) for the target topology.

+

It is possible to prevent all remaining components from being loaded by placing stop in the environment variable. Only the components listed before this keyword will be enabled.

+

+

+

+

+Loading components from plugins

+

Components may optionally be built as plugins so that the hwloc core library does not directly depend on their dependencies (for instance the libpciaccess library). Plugin support may be enabled with the --enable-plugins configure option. All components buildable as plugins will then be built as plugins. The configure option may be given a comma-separated list of component names to specify the exact list of components to build as plugins.

+

Plugins are built as independent dynamic libraries that are installed in $libdir/hwloc. All plugins found in this directory are loaded during topology_init() (unless blacklisted in HWLOC_PLUGINS_BLACKLIST, see Environment Variables). A specific list of directories (colon-separated) to scan may be specified in the HWLOC_PLUGINS_PATH environment variable.

+

Note that loading a plugin just means that the corresponding component is registered to the hwloc core. Components are then only enabled if the topology configuration requests it, as explained in the previous sections.

+

Also note that plugins should carefully be enabled and used when embedding hwloc in another project, see Embedding hwloc in Other Software for details.

+

+

+

+

+Existing components and plugins

+

All components distributed within hwloc are listed below. The list of actually available components may be listed at running with the HWLOC_COMPONENTS_VERBOSE environment variable (see Environment Variables).

+
+
linux
+
The official component for discovering CPU, memory and I/O devices on Linux. It discovers PCI devices without the help of external libraries such as libpciaccess, but requires the pci component for adding vendor/device names to PCI objects. It also discovers many kinds of Linux-specific OS devices.
+
aix, darwin, freebsd, hpux, netbsd, solaris, windows
+
Each officially supported operating system has its own native component, which is statically built when supported, and which is used by default.
+
x86
+
The x86 architecture (either 32 or 64 bits) has its own component that may complete or replace the previously-found CPU information. It is statically built when supported.
+
bgq
+
This component is specific to IBM BlueGene/Q compute node (running CNK). It is built and enabled by default when --host=powerpc64-bgq-linux is passed to configure (see How do I build hwloc for BlueGene/Q?).
+
no_os
+
A basic component that just tries to detect the number of processing units in the system. It mostly serves on operating systems that are not natively supported. It is always statically built.
+
pci
+
PCI object discovery uses the external pciaccess library (aka libpciaccess); see I/O Devices. It may also annotate existing PCI devices with vendor and device names. It may be built as a plugin.
+
opencl
+
The OpenCL component creates co-processor OS device objects such as opencl0d0 (first device of the first OpenCL platform) or opencl1d3 (fourth device of the second platform). Only the AMD OpenCL implementation currently offers locality information. It may be built as a plugin.
+
cuda
+
This component creates co-processor OS device objects such as cuda0 that correspond to NVIDIA GPUs used with CUDA library. It may be built as a plugin.
+
nvml
+
Probing the NVIDIA Management Library creates OS device objects such as nvml0 that are useful for batch schedulers. It also detects the actual PCIe link bandwidth without depending on power management state and without requiring administrator privileges. It may be built as a plugin.
+
gl
+
Probing the NV-CONTROL X extension (NVCtrl library) creates OS device objects such as :0.0 corresponding to NVIDIA displays. They are useful for graphical applications that need to place computation and/or data near a rendering GPU. It may be built as a plugin.
+
synthetic
+
Synthetic topology support (see Synthetic topologies) is always built statically.
+
xml
+
XML topology import (see Importing and exporting topologies from/to XML files) is always built statically. It internally uses one of the XML backends (see libxml2 and minimalistic XML backends).
    +
  • +xml_nolibxml is a basic and hwloc-specific XML import/export. It is always statically built.
  • +
  • +xml_libxml relies on the external libxml2 library for provinding a feature-complete XML import/export. It may be built as a plugin.
  • +
+
+
fake
+
A dummy plugin that does nothing but is used for debugging plugin support.
+
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00373.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00373.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00373.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00373.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Synthetic topologies +Hardware Locality (hwloc): Embedding hwloc in Other Software @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,89 +27,93 @@
- + +/* @license-end */ -
+
-
Synthetic topologies
+
Embedding hwloc in Other Software

-

hwloc may load fake or remote topologies so as to consult them without having the underlying hardware available. Aside from loading XML topologies, hwloc also enables the building of synthetic topologies that are described by a single string listing the arity of each levels.

-

For instance, lstopo may create a topology made of 2 packages, containing a single NUMA node and a L2 cache above two single-threaded cores:

-
$ lstopo -i "pack:2 node:1 l2:1 core:2 pu:1" -
-Machine (2048MB)
-  Package L#0
-    NUMANode L#0 (P#0 1024MB)
-    L2 L#0 (4096KB)
-      Core L#0 + PU L#0 (P#0)
-      Core L#1 + PU L#1 (P#1)
-  Package L#1
-    NUMANode L#1 (P#1 1024MB)
-    L2 L#1 (4096KB)
-      Core L#2 + PU L#2 (P#2)
-      Core L#3 + PU L#3 (P#3)
-

Replacing - with file.xml in this command line will export this topology to XML as usual.

-
Note
Synthetic topologies offer a very basic way to export a topology and reimport it on another machine. It is a lot less precise than XML but may still be enough when only the hierarchy of resources matters.
-

-

-

-

-Synthetic description string

-

Each item in the description string gives the type of the level and the number of such children under each object of the previous level. That is why the above topology contains 4 cores (2 cores times 2 nodes).

-

These type names must be written as numanode, package, core, l2u, l1i, pu, group (hwloc_obj_type_sscanf() is used for parsing the type names). They do not need to be written case-sensitively, nor entirely (as long as there is no ambiguity, 2 characters such as ma select a Machine level). Note that I/O and Misc objects are not available.

-

Instead of specifying the type of each level, it is possible to just specify the arities and let hwloc choose all types according to usual topologies. The following examples are therefore equivalent:

$ lstopo -i "2 3 4 5 6"
-$ lstopo -i "Package:2 NUMANode:3 L2Cache:4 Core:5 PU:6"
-

NUMA nodes are handled in a special way since they are not part of the main CPU hierarchy but rather attached below it as memory children. Thus, NUMANode:3 actually means Group:3 where one NUMA node is attached below each group. These groups are merged back into the parent when possible (typically when a single NUMA node is requested below each parent).

-

It is also possible the explicitly attach NUMA nodes to specific levels. For instance, a topology similar to a Intel Xeon Phi processor (with 2 NUMA nodes per 16-core group) may be created with:

$ lstopo -i "package:1 group:4 [numa] [numa] core:16 pu:4"
-

The root object does not appear in the synthetic description string since it is always a Machine object. Therefore the Machine type is disallowed in the description as well.

-

A NUMA level (with a single NUMA node) is automatically added if needed.

-

Each item may be followed parentheses containing a list of space-separated attributes. For instance:

    -
  • -L2iCache:2(size=32kB) specifies 2 children of 32kB level-2 instruction caches. The size may be specified in bytes (without any unit suffix) or as TB, GB, MB or kB.
  • -
  • -NUMANode:3(memory=16MB) specifies 3 NUMA nodes with 16MB each. The size may be specified in bytes (without any unit suffix) or as TB, GB, MB or kB.
  • -
  • -PU:2(indexes=0,2,1,3) specifies 2 PU children and the full list of OS indexes among the entire set of 4 PU objects.
  • -
  • -PU:2(indexes=numa:core) specifies 2 PU children whose OS indexes are interleaved by NUMA node first and then by package.
  • -
  • -Attributes in parentheses at the very beginning of the description apply to the root object.
  • +

    It can be desirable to include hwloc in a larger software package (be sure to check out the LICENSE file) so that users don't have to separately download and install it before installing your software. This can be advantageous to ensure that your software uses a known-tested/good version of hwloc, or for use on systems that do not have hwloc pre-installed.

    +

    When used in "embedded" mode, hwloc will:

    +
      +
    • not install any header files
    • +
    • not build any documentation files
    • +
    • not build or install any executables or tests
    • +
    • not build libhwloc.* – instead, it will build libhwloc_embedded.*
    +

    There are two ways to put hwloc into "embedded" mode. The first is directly from the configure command line:

    +
    shell$ ./configure --enable-embedded-mode ...
    +

    The second requires that your software project uses the GNU Autoconf / Automake / Libtool tool chain to build your software. If you do this, you can directly integrate hwloc's m4 configure macro into your configure script. You can then invoke hwloc's configuration tests and build setup by calling an m4 macro (see below).

    +

    Although hwloc dynamic shared object plugins may be used in embedded mode, the embedder project will have to manually setup dlopen or libltdl in its build system so that hwloc can load its plugins at run time. Also, embedders should be aware of complications that can arise due to public and private linker namespaces (e.g., if the embedder project is loaded into a private namespace and then hwloc tries to dynamically load its plugins, such loading may fail since the hwloc plugins can't find the hwloc symbols they need). The embedder project is strongly advised not to use hwloc's dynamically loading plugins / dlopen / libltdl capability.

    -

+

-

-Loading a synthetic topology

-

Aside from lstopo, the hwloc programming interface offers the same ability by passing the synthetic description string to hwloc_topology_set_synthetic() before hwloc_topology_load().

-

Synthetic topologies are created by the synthetic component. This component may be enabled by force by setting the HWLOC_SYNTHETIC environment variable to something such as node:2 core:3 pu:4.

-

Loading a synthetic topology disables binding support since the topology usually does not match the underlying hardware. Binding may be reenabled as usual by setting HWLOC_THISSYSTEM=1 in the environment or by setting the HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM topology flag.

+

+Using hwloc's M4 Embedding Capabilities

+

Every project is different, and there are many different ways of integrating hwloc into yours. What follows is one example of how to do it.

+

If your project uses recent versions Autoconf, Automake, and Libtool to build, you can use hwloc's embedded m4 capabilities. We have tested the embedded m4 with projects that use Autoconf 2.65, Automake 1.11.1, and Libtool 2.2.6b. Slightly earlier versions of may also work but are untested. Autoconf versions prior to 2.65 are almost certain to not work.

+

You can either copy all the config/hwloc*m4 files from the hwloc source tree to the directory where your project's m4 files reside, or you can tell aclocal to find more m4 files in the embedded hwloc's "config" subdirectory (e.g., add "-Ipath/to/embedded/hwloc/config" to your Makefile.am's ACLOCAL_AMFLAGS).

+

The following macros can then be used from your configure script (only HWLOC_SETUP_CORE must be invoked if using the m4 macros):

+
    +
  • HWLOC_SETUP_CORE(config-dir-prefix, action-upon-success, action-upon-failure, print_banner_or_not): Invoke the hwloc configuration tests and setup the hwloc tree to build. The first argument is the prefix to use for AC_OUTPUT files – it's where the hwloc tree is located relative to $top_srcdir. Hence, if your embedded hwloc is located in the source tree at contrib/hwloc, you should pass [contrib/hwloc] as the first argument. If HWLOC_SETUP_CORE and the rest of configure completes successfully, then "make" traversals of the hwloc tree with standard Automake targets (all, clean, install, etc.) should behave as expected. For example, it is safe to list the hwloc directory in the SUBDIRS of a higher-level Makefile.am. The last argument, if not empty, will cause the macro to display an announcement banner that it is starting the hwloc core configuration tests.

    +

    HWLOC_SETUP_CORE will set the following environment variables and AC_SUBST them: HWLOC_EMBEDDED_CFLAGS, HWLOC_EMBEDDED_CPPFLAGS, and HWLOC_EMBEDDED_LIBS. These flags are filled with the values discovered in the hwloc-specific m4 tests, and can be used in your build process as relevant. The _CFLAGS, _CPPFLAGS, and _LIBS variables are necessary to build libhwloc (or libhwloc_embedded) itself.

    +

    HWLOC_SETUP_CORE also sets HWLOC_EMBEDDED_LDADD environment variable (and AC_SUBSTs it) to contain the location of the libhwloc_embedded.la convenience Libtool archive. It can be used in your build process to link an application or other library against the embedded hwloc library.

    +

    NOTE: If the HWLOC_SET_SYMBOL_PREFIX macro is used, it must be invoked before HWLOC_SETUP_CORE.

    +
  • +
  • HWLOC_BUILD_STANDALONE: HWLOC_SETUP_CORE defaults to building hwloc in an "embedded" mode (described above). If HWLOC_BUILD_STANDALONE is invoked *before* HWLOC_SETUP_CORE, the embedded definitions will not apply (e.g., libhwloc.la will be built, not libhwloc_embedded.la).
  • +
  • HWLOC_SET_SYMBOL_PREFIX(foo_): Tells the hwloc to prefix all of hwloc's types and public symbols with "foo_"; meaning that function hwloc_init() becomes foo_hwloc_init(). Enum values are prefixed with an upper-case translation if the prefix supplied; HWLOC_OBJ_CORE becomes FOO_hwloc_OBJ_CORE. This is recommended behavior if you are including hwloc in middleware – it is possible that your software will be combined with other software that links to another copy of hwloc. If both uses of hwloc utilize different symbol prefixes, there will be no type/symbol clashes, and everything will compile, link, and run successfully. If you both embed hwloc without changing the symbol prefix and also link against an external hwloc, you may get multiple symbol definitions when linking your final library or application.
  • +
  • HWLOC_SETUP_DOCS, HWLOC_SETUP_UTILS, HWLOC_SETUP_TESTS: These three macros only apply when hwloc is built in "standalone" mode (i.e., they should NOT be invoked unless HWLOC_BUILD_STANDALONE has already been invoked).
  • +
  • HWLOC_DO_AM_CONDITIONALS: If you embed hwloc in a larger project and build it conditionally with Automake (e.g., if HWLOC_SETUP_CORE is invoked conditionally), you must unconditionally invoke HWLOC_DO_AM_CONDITIONALS to avoid warnings from Automake (for the cases where hwloc is not selected to be built). This macro is necessary because hwloc uses some AM_CONDITIONALs to build itself, and AM_CONDITIONALs cannot be defined conditionally. Note that it is safe (but unnecessary) to call HWLOC_DO_AM_CONDITIONALS even if HWLOC_SETUP_CORE is invoked unconditionally. If you are not using Automake to build hwloc, this macro is unnecessary (and will actually cause errors because it invoked AM_* macros that will be undefined).
  • +
+

NOTE: When using the HWLOC_SETUP_CORE m4 macro, it may be necessary to explicitly invoke AC_CANONICAL_TARGET (which requires config.sub and config.guess) and/or AC_USE_SYSTEM_EXTENSIONS macros early in the configure script (e.g., after AC_INIT but before AM_INIT_AUTOMAKE). See the Autoconf documentation for further information.

+

Also note that hwloc's top-level configure.ac script uses exactly the macros described above to build hwloc in a standalone mode (by default). You may want to examine it for one example of how these macros are used.

-

+

-

-Exporting a topology as a synthetic string

-

The function hwloc_topology_export_synthetic() may export a topology as a synthetic string. It offers a convenient way to quickly describe the contents of a machine. The lstopo tool may also perform such an export by forcing the output format.

-
$ lstopo --of synthetic --no-io
-Package:1 L3Cache:1 L2Cache:2 L1dCache:1 L1iCache:1 Core:1 PU:2
-

The exported string may be passed back to hwloc for recreating another similar topology (see also Are synthetic strings compatible between hwloc releases?). The entire tree will be similar, but some attributes such as the processor model will be missing.

-

Such an export is only possible if the topology is totally symmetric. It means that the symmetric_subtree field of the root object is set. Also memory children should be attached in a symmetric way (e.g. the same number of memory children below each Package object, etc.). However, I/O devices and Misc objects are ignored when looking at symmetry and exporting the string.

+

+Example Embedding hwloc

+

Here's an example of integrating with a larger project named sandbox that already uses Autoconf, Automake, and Libtool to build itself:

+
# First, cd into the sandbox project source tree
+shell$ cd sandbox
+shell$ cp -r /somewhere/else/hwloc-<version> my-embedded-hwloc
+shell$ edit Makefile.am
+  1. Add "-Imy-embedded-hwloc/config" to ACLOCAL_AMFLAGS
+  2. Add "my-embedded-hwloc" to SUBDIRS
+  3. Add "$(HWLOC_EMBEDDED_LDADD)" and "$(HWLOC_EMBEDDED_LIBS)" to 
+     sandbox's executable's LDADD line.  The former is the name of the 
+     Libtool convenience library that hwloc will generate.  The latter 
+     is any dependent support libraries that may be needed by 
+     $(HWLOC_EMBEDDED_LDADD).
+  4. Add "$(HWLOC_EMBEDDED_CFLAGS)" to AM_CFLAGS
+  5. Add "$(HWLOC_EMBEDDED_CPPFLAGS)" to AM_CPPFLAGS
+shell$ edit configure.ac
+  1. Add "HWLOC_SET_SYMBOL_PREFIX(sandbox_hwloc_)" line
+  2. Add "HWLOC_SETUP_CORE([my-embedded-hwloc], [happy=yes], [happy=no])" line
+  3. Add error checking for happy=no case
+shell$ edit sandbox.c
+  1. Add #include <hwloc.h>
+  2. Add calls to sandbox_hwloc_init() and other hwloc API functions
+

Now you can bootstrap, configure, build, and run the sandbox as normal – all calls to "sandbox_hwloc_*" will use the embedded hwloc rather than any system-provided copy of hwloc.

+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00374.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00374.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00374.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00374.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Interoperability With Other Software +Hardware Locality (hwloc): Frequently Asked Questions @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,75 +27,320 @@
- + +/* @license-end */ -
+
-
Interoperability With Other Software
+
Frequently Asked Questions

-

-

-

Although hwloc offers its own portable interface, it still may have to interoperate with specific or non-portable libraries that manipulate similar kinds of objects. hwloc therefore offers several specific "helpers" to assist converting between those specific interfaces and hwloc.

-

Some external libraries may be specific to a particular OS; others may not always be available. The hwloc core therefore generally does not explicitly depend on these types of libraries. However, when a custom application uses or otherwise depends on such a library, it may optionally include the corresponding hwloc helper to extend the hwloc interface with dedicated helpers.

-

Most of these helpers use structures that are specific to these external libraries and only meaningful on the local machine. If so, the helper requires the input topology to match the current machine. Some helpers also require I/O device discovery to be supported and enabled for the current topology.

-
-
Linux specific features
-

hwloc/linux.h offers Linux-specific helpers that utilize some non-portable features of the Linux system, such as binding threads through their thread ID ("tid") or parsing kernel CPU mask files.

-

-
-
Linux libnuma
-

hwloc/linux-libnuma.h provides conversion helpers between hwloc CPU sets and libnuma-specific types, such as bitmasks. It helps you use libnuma memory-binding functions with hwloc CPU sets.

-

-
-
Glibc
-

hwloc/glibc-sched.h offers conversion routines between Glibc and hwloc CPU sets in order to use hwloc with functions such as sched_getaffinity() or pthread_attr_setaffinity_np().

-

-
-
OpenFabrics Verbs
-

hwloc/openfabrics-verbs.h helps interoperability with the OpenFabrics Verbs interface. For example, it can return a list of processors near an OpenFabrics device. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

-

-
-
Intel Xeon Phi (MIC)
-

hwloc/intel-mic.h helps interoperability with Intel Xeon Phi (MIC) coprocessors by returning the list of processors near these devices. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

-

-
-
OpenCL
-

hwloc/opencl.h enables interoperability with the OpenCL interface. Only the AMD and NVIDIA implementations currently offer locality information. It may return the list of processors near a GPU given as a cl_device_id. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

-

-
-
NVIDIA CUDA
-

hwloc/cuda.h and hwloc/cudart.h enable interoperability with NVIDIA CUDA Driver and Runtime interfaces. For instance, it may return the list of processors near NVIDIA GPUs. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

-

-
-
NVIDIA Management Library (NVML)
-

hwloc/nvml.h enables interoperability with the NVIDIA NVML interface. It may return the list of processors near a NVIDIA GPU given as a nvmlDevice_t. It may also return the corresponding OS device hwloc object for further information (if I/O device discovery is enabled).

-

-
-
NVIDIA displays
-

hwloc/gl.h enables interoperability with NVIDIA displays using the NV-CONTROL X extension (NVCtrl library). If I/O device discovery is enabled, it may return the OS device hwloc object that corresponds to a display given as a name such as :0.0 or given as a port/device pair (server/screen).

-

-
-
Taskset command-line tool
-

The taskset command-line tool is widely used for binding processes. It manipulates CPU set strings in a format that is slightly different from hwloc's one (it does not divide the string in fixed-size subsets and separates them with commas). To ease interoperability, hwloc offers routines to convert hwloc CPU sets from/to taskset-specific string format. Most hwloc command-line tools also support the --taskset option to manipulate taskset-specific strings.

-

-
-
+
+

+

+Concepts

+

+I only need binding, why should I use hwloc ?

+

hwloc is its portable API that works on a variety of operating systems. It supports binding of threads, processes and memory buffers (see CPU binding and Memory binding). Even if some features are not supported on some systems, using hwloc is much easier than reimplementing your own portability layer.

+

Moreover, hwloc provides knowledge of cores and hardware threads. It offers easy ways to bind tasks to individual hardware threads, or to entire multithreaded cores, etc. See How may I ignore symmetric multithreading, hyper-threading, etc. in hwloc?. Most alternative software for binding do not even know whether each core is single-threaded, multithreaded or hyper-threaded. They would bind to individual threads without any way to know whether multiple tasks are in the same physical core.

+

However, using hwloc comes with an overhead since a topology must be loaded before gathering information and binding tasks or memory. Fortunately this overhead may be significantly reduced by filtering non-interesting information out of the topology. For instance the following code builds a topology that only contains Cores (explicitly filtered-in below), hardware threads (PUs, cannot be filtered-out), NUMA nodes (cannot be filtered-out), and the root object (usually a Machine; the root cannot be removed without breaking the tree).

+
hwloc_topology_t topology;
+hwloc_topology_init(&topology);
+/* filter everything out */
+hwloc_topology_set_all_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_NONE);
+/* filter Cores back in */
+hwloc_topology_set_type_filter(topology, HWLOC_OBJ_CORE, HWLOC_TYPE_FILTER_KEEP_ALL);
+hwloc_topology_load(topology);
+

However, one should remember that filtering such objects out removes locality information from the hwloc tree. For instance, we do not know anymore which PU is close to which NUMA node. This would be useful to applications that explicitly want to place specific memory buffers close to specific tasks. Those applications just need to tell hwloc to keep Group objects that bring structure information:

hwloc_topology_set_type_filter(topology, HWLOC_OBJ_GROUP, HWLOC_TYPE_FILTER_KEEP_STRUCTURE);
+

Note that the default configuration is to keep all objects enabled, except I/Os and instruction caches.

+

+Should I use logical or physical/OS indexes? and how?

+

One of the original reasons why hwloc was created is that physical/OS indexes (obj->os_index) are often crazy and unpredictable: logical processors numbers are usually non-contiguous (processors 0 and 1 are not physically close), they vary from one machine to another, and may even change after a BIOS or system update. This numbers make task placement hardly portable. Moreover some objects have no physical/OS numbers (caches), and some objects have non-unique numbers (core numbers are only unique within a socket). Physical/OS indexes are only guaranteed to exist and be unique for PU and NUMA nodes.

+

hwloc therefore introduces logical indexes (obj->logical_index) which are portable, contiguous and logically ordered (based on the resource organization in the locality tree). In general, one should only use logical indexes and just let hwloc do the internal conversion when really needed (when talking to the OS and hardware).

+

hwloc developers recommends that users do not use physical/OS indexes unless they really know what they are doing. The main reason for still using physical/OS indexes is when interacting with non-hwloc tools such as numactl or taskset, or when reading hardware information from raw sources such as /proc/cpuinfo.

+

lstopo options -l and -p may be used to switch between logical indexes (prefixed with L#) and physical/OS indexes (P#). Converting one into the other may also be achieved with hwloc-calc which may manipulate either logical or physical indexes as input or output. See also hwloc-calc.

+
# Convert PU with physical number 3 into logical number
+$ hwloc-calc -I pu --physical-input --logical-output pu:3
+5
+
+# Convert a set of NUMA nodes from logical to physical
+# (beware that the output order may not match the input order)
+$ hwloc-calc -I numa --logical-input --physical-output numa:2-3 numa:7
+0,2,5
+

+hwloc is only a structural model, it ignores performance models, memory bandwidth, etc.?

+

hwloc is indeed designed to provide applications with a structural model of the platform. This is an orthogonal approach to describing the machine with performance models, for instance using memory bandwidth or latencies measured by benchmarks. We believe that both approaches are important for helping application make the most of the hardware.

+

For instance, on a dual-processor host with four cores each, hwloc clearly shows which four cores are together. Latencies between all pairs of cores of the same processor are likely identical, and also likely lower than the latency between cores of different processors. However, the structural model cannot guarantee such implementation details. On the other side, performance models would reveal such details without always clearly identifying which cores are in the same processor.

+

The focus of hwloc is mainly of the structural modeling side. However, hwloc lets user adds performance information to the topology through distances (see Retrieve distances between objects and Add or remove distances between objects) or even custom annotations (see How do I annotate the topology with private notes?). hwloc may also use such distance information for grouping objects together (see hwloc only has a one-dimensional view of the architecture, it ignores distances? and What are these Group objects in my topology?).

+

+hwloc only has a one-dimensional view of the architecture, it ignores distances?

+

hwloc places all objects in a tree. Each level is a one-dimensional view of a set of similar objects. All children of the same object (siblings) are assumed to be equally interconnected (same distance between any of them), while the distance between children of different objects (cousins) is supposed to be larger.

+

Modern machines exhibit complex hardware interconnects, so this tree may miss some information about the actual physical distances between objects. The hwloc topology may therefore be annotated with distance information that may be used to build a more realistic representation (multi-dimensional) of each level. For instance, there can be a distance matrix that representing the latencies between any pair of NUMA nodes if the BIOS and/or operating system reports them.

+

For more information about the distance API, see Retrieve distances between objects and Add or remove distances between objects.

+

+What are these Group objects in my topology?

+

hwloc comes with a set of predefined object types (Core, Package, NUMA node, Caches) that match the vast majority of hardware platforms. The HWLOC_OBJ_GROUP type was designed for cases where this set is not sufficient. Groups may be used anywhere to add more structure information to the topology, for instance to show that 2 out of 4 NUMA nodes are actually closer than the others. When applicable, the subtype field describes why a Group was actually added (see also Normal attributes).

+

hwloc currently uses Groups for the following reasons:

    +
  • +NUMA parents when memory locality does not match any existing object.
  • +
  • +I/O parents when I/O locality does not match any existing object.
  • +
  • +Distance-based groups made of close objects.
  • +
  • +AMD Bulldozer dual-core compute units (subtype is ComputeUnit, in the x86 backend), but these objects are usually merged with the L2 caches.
  • +
  • +Intel Extended Topology Enumeration levels (in the x86 backend).
  • +
  • +Windows processor groups (unless they contain a single NUMA node, or a single Package, etc.).
  • +
  • +IBM S/390 "Books" on Linux (subtype is Book).
  • +
  • +AIX unknown hierarchy levels.
  • +
+

hwloc Groups are only kept if no other object has the same locality information. It means that a Group containing a single child is merged into that child. And a Group is merged into its parent if it is its only child. For instance a Windows processor group containing a single NUMA node would be merged with that NUMA node since it already contains the relevant hierarchy information.

+

When inserting a custom Group with hwloc_hwloc_topology_insert_group_object(), this merging may be disabled by setting its dont_merge attribute.

+

+What happens if my topology is asymmetric?

+

hwloc supports asymmetric topologies even if most platforms are usually symmetric. For example, there could be different types of processors in a single machine, each with different numbers of cores, symmetric multithreading, or levels of caches.

+

In practice, asymmetric topologies mostly appear when intermediate groups are added for I/O affinity: on a 4-package machine, an I/O bus may be connected to 2 packages. These packages are below an additional Group object, while the other packages are not (see also What are these Group objects in my topology?).

+

To understand how hwloc manages such cases, one should first remember the meaning of levels and cousin objects. All objects of the same type are gathered as horizontal levels with a given depth. They are also connected through the cousin pointers of the hwloc_obj structure. Object attribute (cache depth and type, group depth) are also taken in account when gathering objects as horizontal levels. To be clear: there will be one level for L1i caches, another level for L1d caches, another one for L2, etc.

+

If the topology is asymmetric (e.g., if a group is missing above some processors), a given horizontal level will still exist if there exist any objects of that type. However, some branches of the overall tree may not have an object located in that horizontal level. Note that this specific hole within one horizontal level does not imply anything for other levels. All objects of the same type are gathered in horizontal levels even if their parents or children have different depths and types.

+

See the diagram in Terms and Definitions for a graphical representation of such topologies.

+

Moreover, it is important to understand that a same parent object may have children of different types (and therefore, different depths). These children are therefore siblings (because they have the same parent), but they are not cousins (because they do not belong to the same horizontal level).

+

+What happens to my topology if I disable symmetric multithreading, hyper-threading, etc. in the system?

+

hwloc creates one PU (processing unit) object per hardware thread. If your machine supports symmetric multithreading, for instance Hyper-Threading, each Core object may contain multiple PU objects:

$ lstopo -
+...
+  Core L#0
+    PU L#0 (P#0)
+    PU L#1 (P#2)
+  Core L#1
+    PU L#2 (P#1)
+    PU L#3 (P#3)
+

x86 machines usually offer the ability to disable hyper-threading in the BIOS. Or it can be disabled on the Linux kernel command-line at boot time, or later by writing in sysfs virtual files.

+

If you do so, the hwloc topology structure does not significantly change, but some PU objects will not appear anymore. No level will disappear, you will see the same number of Core objects, but each of them will contain a single PU now. The PU level does not disappear either (remember that hwloc topologies always contain a PU level at the bottom of the topology) even if there is a single PU object per Core parent.

$ lstopo -
+...
+  Core L#0
+    PU L#0 (P#0)
+  Core L#1
+    PU L#1 (P#1)
+

+How may I ignore symmetric multithreading, hyper-threading, etc. in hwloc?

+

First, see What happens to my topology if I disable symmetric multithreading, hyper-threading, etc. in the system? for more information about multithreading.

+

If you need to ignore symmetric multithreading in software, you should likely manipulate hwloc Core objects directly:

/* get the number of cores */
+unsigned nbcores = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE);
+...
+/* get the third core below the first package */
+hwloc_obj_t package, core;
+package = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PACKAGE, 0);
+core = hwloc_get_obj_inside_cpuset_by_type(topology, package->cpuset,
+                                           HWLOC_OBJ_CORE, 2);
+

Whenever you want to bind a process or thread to a core, make sure you singlify its cpuset first, so that the task is actually bound to a single thread within this core (to avoid useless migrations).

/* bind on the second core */
+hwloc_obj_t core = hwloc_get_obj_by_type(topology, HWLOC_OBJ_CORE, 1);
+hwloc_cpuset_t set = hwloc_bitmap_dup(core->cpuset);
+hwloc_bitmap_singlify(set);
+hwloc_set_cpubind(topology, set, 0);
+hwloc_bitmap_free(set);
+

With hwloc-calc or hwloc-bind command-line tools, you may specify that you only want a single-thread within each core by asking for their first PU object:

$ hwloc-calc core:4-7
+0x0000ff00
+$ hwloc-calc core:4-7.pu:0
+0x00005500
+

When binding a process on the command-line, you may either specify the exact thread that you want to use, or ask hwloc-bind to singlify the cpuset before binding

$ hwloc-bind core:3.pu:0 -- echo "hello from first thread on core #3"
+hello from first thread on core #3
+...
+$ hwloc-bind core:3 --single -- echo "hello from a single thread on core #3"
+hello from a single thread on core #3
+

+

+

+

+Advanced

+

+I do not want hwloc to rediscover my enormous machine topology every time I rerun a process

+

Although the topology discovery is not expensive on common machines, its overhead may become significant when multiple processes repeat the discovery on large machines (for instance when starting one process per core in a parallel application). The machine topology usually does not vary much, except if some cores are stopped/restarted or if the administrator restrictions are modified. Thus rediscovering the whole topology again and again may look useless.

+

For this purpose, hwloc offers XML import/export and shared memory features.

+

XML lets you save the discovered topology to a file (for instance with the lstopo program) and reload it later by setting the HWLOC_XMLFILE environment variable. The HWLOC_THISSYSTEM environment variable should also be set to 1 to assert that loaded file is really the underlying system.

+

Loading a XML topology is usually much faster than querying multiple files or calling multiple functions of the operating system. It is also possible to manipulate such XML files with the C programming interface, and the import/export may also be directed to memory buffer (that may for instance be transmitted between applications through a package). See also Importing and exporting topologies from/to XML files.

+
Note
The environment variable HWLOC_THISSYSTEM_ALLOWED_RESOURCES may be used to load a XML topology that contains the entire machine and restrict it to the part that is actually available to the current process (e.g. when Linux Cgroup/Cpuset are used to restrict the set of resources). See Environment Variables.
+

Shared-memory topologies consist in one process exposing its topology in a shared-memory buffer so that other processes (running on the same machine) may use it directly. This has the advantage of reducing the memory footprint since a single topology is stored in physical memory for multiple processes. However, it requires all processes to map this shared-memory buffer at the same virtual address, which may be difficult in some cases. This API is described in Sharing topologies between processes.

+

+How many topologies may I use in my program?

+

hwloc lets you manipulate multiple topologies at the same time. However, these topologies consume memory and system resources (for instance file descriptors) until they are destroyed. It is therefore discouraged to open the same topology multiple times.

+

Sharing a single topology between threads is easy (see Thread Safety) since the vast majority of accesses are read-only.

+

If multiple topologies of different (but similar) nodes are needed in your program, have a look at How to avoid memory waste when manipulating multiple similar topologies?.

+

+How to avoid memory waste when manipulating multiple similar topologies?

+

hwloc does not share information between topologies. If multiple similar topologies are loaded in memory, for instance the topologies of different identical nodes of a cluster, lots of information will be duplicated.

+

hwloc/diff.h (see also Topology differences) offers the ability to compute topology differences, apply or unapply them, or export/import to/from XML. However, this feature is limited to basic differences such as attribute changes. It does not support complex modifications such as adding or removing some objects.

+

+How do I annotate the topology with private notes?

+

Each hwloc object contains a userdata field that may be used by applications to store private pointers. This field is only valid during the lifetime of these container object and topology. It becomes invalid as soon the topology is destroyed, or as soon as the object disappears, for instance when restricting the topology. The userdata field is not exported/imported to/from XML by default since hwloc does not know what it contains. This behavior may be changed by specifying application-specific callbacks with hwloc_topology_set_userdata_export_callback() and hwloc_topology_set_userdata_import_callback().

+

Each object may also contain some info attributes (key name and value) that are setup by hwloc during discovery and that may be extended by the user with hwloc_obj_add_info() (see also Object attributes). Contrary to the userdata field which is unique, multiple info attributes may exist for each object, even with the same name. These attributes are always exported to XML. However, only character strings may be used as key names and values.

+

It is also possible to insert Misc objects with a custom name anywhere as a leaf of the topology (see Miscellaneous objects). And Misc objects may have their own userdata and info attributes just like any other object.

+

The hwloc-annotate command-line tool may be used for adding Misc objects and info attributes.

+

There is also a topology-specific userdata pointer that can be used to recognize different topologies by storing a custom pointer. It may be manipulated with hwloc_topology_set_userdata() and hwloc_topology_get_userdata().

+

+

+

+

+Caveats

+

+Why is hwloc slow?

+

Building a hwloc topology on a large machine may be slow because the discovery of hundreds of hardware cores or threads takes time (especially when reading thousands of sysfs files on Linux). Ignoring some objects (for instance caches) that aren't useful to the current application may improve this overhead (see I only need binding, why should I use hwloc ?). One should also consider using XML (see I do not want hwloc to rediscover my enormous machine topology every time I rerun a process) to work around such issues.

+

Additionally, lstopo enables most hwloc objects and discovery flags by default so that the output topology is as precise as possible (while hwloc disables many of them by default). This includes I/O device discovery through PCI libraries as well as external libraries such as NVML. To speed up lstopo, you may disable such features with command-line options such as --no-io.

+

When NVIDIA GPU probing is enabled with CUDA or NVML, one should make sure that the Persistent mode is enabled (with nvidia-smi -pm 1) to avoid significant GPU initialization overhead.

+

When AMD GPU discovery is enabled with OpenCL and hwloc is used remotely over ssh, some spurious round-trips on the network may significantly increase the discovery time. Forcing the DISPLAY environment variable to the remote X server display (usually :0) instead of only setting the COMPUTE variable may avoid this.

+

Also remember that these components may be disabled at build-time with configure flags such as --disable-opencl, --disable-cuda or --disable-nvml, and at runtime with the environment variable HWLOC_COMPONENTS=-opencl,-cuda,-nvml or with hwloc_topology_set_components().

+

+Does hwloc require privileged access?

+

hwloc discovers the topology by querying the operating system. Some minor features may require privileged access to the operation system. For instance memory module discovery on Linux is reserved to root, and the entire PCI discovery on Solaris and BSDs requires access to some special files that are usually restricted to root (/dev/pci* or /devices/pci*).

+

To workaround this limitation, it is recommended to export the topology as a XML file generated by the administrator (with the lstopo program) and make it available to all users (see Importing and exporting topologies from/to XML files). It will offer all discovery information to any application without requiring any privileged access anymore. Only the necessary hardware characteristics will be exported, no sensitive information will be disclosed through this XML export.

+

This XML-based model also has the advantage of speeding up the discovery because reading a XML topology is usually much faster than querying the operating system again.

+

The utility hwloc-dump-hwdata is also involved in gathering privileged information at boot time and making it available to non-privileged users (note that this may require a specific SELinux MLS policy module). However, it only applies to Intel Xeon Phi processors for now (see Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?). See also HWLOC_DUMPED_HWDATA_DIR in Environment Variables for details about the location of dumped files.

+

+What should I do when hwloc reports "operating system" warnings?

+

When the operating system reports invalid locality information (because of either software or hardware bugs), hwloc may fail to insert some objects in the topology because they cannot fit in the already built tree of resources. If so, hwloc will report a warning like the following. The object causing this error is ignored, the discovery continues but the resulting topology will miss some objects and may be asymmetric (see also What happens if my topology is asymmetric?).

+
****************************************************************************
+* hwloc received invalid information from the operating system.
+*
+* L3 (cpuset 0x000003f0) intersects with NUMANode (P#0 cpuset 0x0000003f) without inclusion!
+* Error occurred in topology.c line 940
+*
+* Please report this error message to the hwloc user's mailing list,
+* along with the files generated by the hwloc-gather-topology script.
+*
+* hwloc will now ignore this invalid topology information and continue.
+****************************************************************************
+

These errors are common on large AMD platforms because of BIOS and/or Linux kernel bugs causing invalid L3 cache information. In the above example, the hardware reports a L3 cache that is shared by 2 cores in the first NUMA node and 4 cores in the second NUMA node. That's wrong, it should actually be shared by all 6 cores in a single NUMA node. The resulting topology will miss some L3 caches.

+

If your application does not care about cache sharing, or if you do not plan to request cache-aware binding in your process launcher, you may likely ignore this error (and hide it by setting HWLOC_HIDE_ERRORS=1 in your environment).

+

Some platforms report similar warnings about conflicting Packages and NUMANodes.

+

On x86 hosts, passing HWLOC_COMPONENTS=x86 in the environment may workaround some of these issues by switching to a different way to discover the topology.

+

Upgrading the BIOS and/or the operating system may help. Otherwise, as explained in the message, reporting this issue to the hwloc developers (by sending the tarball that is generated by the hwloc-gather-topology script on this platform) is a good way to make sure that this is a software (operating system) or hardware bug (BIOS, etc).

+

See also Questions and Bugs. Opening an issue on GitHub automatically displays hints on what information you should provide when reporting such bugs.

+

+Why does Valgrind complain about hwloc memory leaks?

+

If you are debugging your application with Valgrind, you want to avoid memory leak reports that are caused by hwloc and not by your program.

+

hwloc itself is often checked with Valgrind to make sure it does not leak memory. However, some global variables in hwloc dependencies are never freed. For instance libz allocates its global state once at startup and never frees it so that it may be reused later. Some libxml2 global state is also never freed because hwloc does not know whether it can safely ask libxml2 to free it (the application may also be using libxml2 outside of hwloc).

+

These unfreed variables cause leak reports in Valgrind. hwloc installs a Valgrind suppressions file to hide them. You should pass the following command-line option to Valgrind to use it:

  --suppressions=/path/to/hwloc-valgrind.supp
+

+

+

+

+Platform-specific

+

+How do I find the local MCDRAM NUMA node on Intel Xeon Phi processor?

+

Intel Xeon Phi processors introduced a new memory architecture by possibly having two distinct local memories: some normal memory (DDR) and some high-bandwidth on-package memory (MCDRAM). Processors can be configured in various clustering modes to have up to 4 Clusters. Moreover, each Cluster (quarter, half or whole processor) of the processor may have its own local parts of the DDR and of the MCDRAM. This memory and clustering configuration may be probed by looking at MemoryMode and ClusterMode attributes, see Hardware Platform Information and doc/examples/get-knl-modes.c in the source directory.

+

Starting with version 2.0, hwloc properly exposes this memory configuration. DDR and MCDRAM are attached as two memory children of the same parent, DDR first, and MCDRAM second if any. Depending on the processor configuration, that parent may be a Package, a Cache, or a Group object of type Cluster.

+

Hence cores may have one or two local NUMA nodes, listed by the core nodeset. An application may allocate local memory from a core by using that nodeset. The operating system will actually allocate from the DDR when possible, or fallback to the MCDRAM.

+

To allocate specifically on one of these memories, one should walk up the parent pointers until finding an object with some memory children. Looking at these memory children will give the DDR first, then the MCDRAM if any. Their nodeset may then be used for allocating or binding memory buffers.

+

One may also traverse the list of NUMA nodes until finding some whose cpuset matches the target core or PUs. The MCDRAM NUMA nodes may be identified thanks to the subtype field which is set to MCDRAM.

+

Command-line tools such as hwloc-bind may bind memory on the MCDRAM by using the hbm keyword. For instance, to bind on the first MCDRAM NUMA node:

+
$ hwloc-bind --membind --hbm numa:0 -- myprogram
+$ hwloc-bind --membind numa:0 -- myprogram
+

+Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?

+

Intel Xeon Phi processors may use the on-package memory (MCDRAM) as either memory or a memory-side cache (reported as a L3 cache by hwloc by default, see HWLOC_KNL_MSCACHE_L3 in Environment Variables). There are also several clustering modes that significantly affect the memory organization (see How do I find the local MCDRAM NUMA node on Intel Xeon Phi processor? for more information about these modes). Details about these are currently only available to privileged users. Without them, hwloc relies on a heuristic for guessing the modes.

+

The hwloc-dump-hwdata utility may be used to dump this privileged binary information into human-readable and world-accessible files that the hwloc library will later load. The utility should usually run as root once during boot, in order to update dumped information (stored under /var/run/hwloc by default) in case the MCDRAM or clustering configuration changed between reboots.

+

When SELinux MLS policy is enabled, a specific hwloc policy module may be required so that all users get access to the dumped files (in /var/run/hwloc by default). One may use hwloc policy files from the SELinux Reference Policy at https://github.com/TresysTechnology/refpolicy-contrib (see also the documentation at https://github.com/TresysTechnology/refpolicy/wiki/GettingStarted).

+

hwloc-dump-hwdata requires dmi-sysfs kernel module loaded.

+

The utility is currently unneeded on platforms without Intel Xeon Phi processors.

+

See HWLOC_DUMPED_HWDATA_DIR in Environment Variables for details about the location of dumped files.

+

+How do I build hwloc for BlueGene/Q?

+

IBM BlueGene/Q machines run a standard Linux on the login/frontend nodes and a custom CNK (Compute Node Kernel) on the compute nodes.

+

To discover the topology of a login/frontend node, hwloc should be configured as usual, without any BlueGene/Q-specific option.

+

However, one would likely rather discover the topology of the compute nodes where parallel jobs are actually running. If so, hwloc must be cross-compiled with the following configuration line:

./configure --host=powerpc64-bgq-linux --disable-shared --enable-static \
+  CPPFLAGS='-I/bgsys/drivers/ppcfloor -I/bgsys/drivers/ppcfloor/spi/include/kernel/cnk/'
+

CPPFLAGS may have to be updated if your platform headers are installed in a different directory.

+

+How do I build hwloc for Windows?

+

hwloc releases are available as pre-built ZIPs for Windows on both 32bits and 64bits x86 platforms. They are built using MSYS2 and MinGW on a Windows host. Such an environment allows using the Unix-like configure, make and make install steps without having to tweak too many variables or options. One may look at contrib/ci.inria.fr/job-3-mingw.sh in the hwloc repository for an example used for nightly testing.

+

hwloc releases also contain a basic Microsoft Visual Studio solution under contrib/windows/.

+

+How to get useful topology information on NetBSD?

+

The NetBSD (and FreeBSD) backend uses x86-specific topology discovery (through the x86 component). This implementation requires CPU binding so as to query topology information from each individual logical processor. This means that hwloc cannot find any useful topology information unless user-level process binding is allowed by the NetBSD kernel. The security.models.extensions.user_set_cpu_affinity sysctl variable must be set to 1 to do so. Otherwise, only the number of logical processors will be detected.

+

+Why does binding fail on AIX?

+

The AIX operating system requires specific user capabilities for attaching processes to resource sets (CAP_NUMA_ATTACH). Otherwise functions such as hwloc_set_cpubind() fail (return -1 with errno set to EPERM).

+

This capability must also be inherited (through the additional CAP_PROPAGATE capability) if you plan to bind a process before forking another process, for instance with hwloc-bind.

+

These capabilities may be given by the administrator with:

chuser "capabilities=CAP_PROPAGATE,CAP_NUMA_ATTACH" <username>
+

+

+

+

+Compatibility between hwloc versions

+

+How do I handle API changes?

+

The hwloc interface is extended with every new major release. Any application using the hwloc API should be prepared to check at compile-time whether some features are available in the currently installed hwloc distribution.

+

For instance, to check whether the hwloc version is at least 2.0, you should use:

#include <hwloc.h>
+#if HWLOC_API_VERSION >= 0x00020000
+...
+#endif
+

To check for the API of release X.Y.Z at build time, you may compare HWLOC_API_VERSION with (X<<16)+(Y<<8)+Z.

+

For supporting older releases that do not have HWLOC_OBJ_NUMANODE and HWLOC_OBJ_PACKAGE yet, you may use:

+
#include <hwloc.h>
+#if HWLOC_API_VERSION < 0x00010b00
+#define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
+#define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
+#endif
+

Once a program is built against a hwloc library, it may also dynamically link with compatible libraries from other hwloc releases. The version of that runtime library may be queried with hwloc_get_api_version(). See How do I handle ABI breaks? for using this function for testing ABI compatibility.

+

+What is the difference between API and library version numbers?

+

HWLOC_API_VERSION is the version of the API. It changes when functions are added, modified, etc. However it does not necessarily change from one release to another. For instance, two releases of the same series (e.g. 2.0.3 and 2.0.4) usually have the same HWLOC_API_VERSION (0x00020000). However their HWLOC_VERSION strings are different ("2.0.3" and "2.0.4" respectively).

+

+How do I handle ABI breaks?

+

The hwloc interface was deeply modified in release 2.0 to fix several issues of the 1.x interface (see Upgrading to the hwloc 2.0 API and the NEWS file in the source directory for details). The ABI was broken, which means applications must be recompiled against the new 2.0 interface.

+

To check that you are not mixing old/recent headers with a recent/old runtime library, check the major revision number in the API version:

#include <hwloc.h>
+  unsigned version = hwloc_get_api_version();
+  if ((version >> 16) != (HWLOC_API_VERSION >> 16)) {
+    fprintf(stderr,
+           "%s compiled for hwloc API 0x%x but running on library API 0x%x.\n"
+           "You may need to point LD_LIBRARY_PATH to the right hwloc library.\n"
+           "Aborting since the new ABI is not backward compatible.\n",
+           callname, HWLOC_API_VERSION, version);
+    exit(EXIT_FAILURE);
+  }
+

To specifically detect v2.0 issues:

#include <hwloc.h>
+#if HWLOC_API_VERSION >= 0x00020000
+  /* headers are recent */
+  if (hwloc_get_api_version() < 0x20000)
+    ... error out, the hwloc runtime library is older than 2.0 ...
+#else
+  /* headers are pre-2.0 */
+  if (hwloc_get_api_version() >= 0x20000)
+    ... error out, the hwloc runtime library is more recent than 2.0 ...
+#endif
+

In theory, library sonames prevent linking with incompatible libraries. However custom hwloc installations or improperly configured build environments may still lead to such issues. Hence running one of the above (cheap) checks before initializing hwloc topology may be useful.

+

+Are XML topology files compatible between hwloc releases?

+

XML topology files are forward-compatible: a XML file may be loaded by a hwloc library that is more recent than the hwloc release that exported that file.

+

However, hwloc XMLs are not always backward-compatible: Topologies exported by hwloc 2.x cannot be imported by 1.x by default (see XML changes for working around such issues). There are also some corner cases where backward compatibility is not guaranteed because of changes between major releases (for instance 1.11 XMLs could not be imported in 1.10).

+

XMLs are exchanged at runtime between some components of the HPC software stack (for instance the resource managers and MPI processes). Building all these components on the same (cluster-wide) hwloc installation is a good way to avoid such incompatibilities.

+

+Are synthetic strings compatible between hwloc releases?

+

Synthetic strings (see Synthetic topologies) are forward-compatible: a synthetic string generated by a release may be imported by future hwloc libraries.

+

However they are often not backward-compatible because new details may have been added to synthetic descriptions in recent releases. Some flags may be given to hwloc_topology_export_synthetic() to avoid such details and stay backward compatible.

+

+Is it possible to share a shared-memory topology between different hwloc releases?

+

Shared-memory topologies (see Sharing topologies between processes) have strong requirements on compatibility between hwloc libraries. Adopting a shared-memory topology fails if it was exported by a non-compatible hwloc release. Releases with same major revision are usually compatible (e.g. hwloc 2.0.4 may adopt a topology exported by 2.0.3) but different major revisions may be incompatible (e.g. hwloc 2.1.0 cannot adopt from 2.0.x).

+

Topologies are shared at runtime between some components of the HPC software stack (for instance the resource managers and MPI processes). Building all these components on the same (system-wide) hwloc installation is a good way to avoid such incompatibilities.

+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00375.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00375.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00375.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00375.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Thread Safety +Hardware Locality (hwloc): Upgrading to the hwloc 2.0 API @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,57 +27,325 @@
- + +/* @license-end */
-
+
-
Thread Safety
+
Upgrading to the hwloc 2.0 API

-

Like most libraries that mainly fill data structures, hwloc is not thread safe but rather reentrant: all state is held in a hwloc_topology_t instance without mutex protection. That means, for example, that two threads can safely operate on and modify two different hwloc_topology_t instances, but they should not simultaneously invoke functions that modify the same instance. Similarly, one thread should not modify a hwloc_topology_t instance while another thread is reading or traversing it. However, two threads can safely read or traverse the same hwloc_topology_t instance concurrently.

-

When running in multiprocessor environments, be aware that proper thread synchronization and/or memory coherency protection is needed to pass hwloc data (such as hwloc_topology_t pointers) from one processor to another (e.g., a mutex, semaphore, or a memory barrier). Note that this is not a hwloc-specific requirement, but it is worth mentioning.

-

For reference, hwloc_topology_t modification operations include (but may not be limited to):

-
-
Creation and destruction
-

hwloc_topology_init(), hwloc_topology_load(), hwloc_topology_destroy() (see Topology Creation and Destruction) imply major modifications of the structure, including freeing some objects. No other thread cannot access the topology or any of its objects at the same time.

-

Also references to objects inside the topology are not valid anymore after these functions return.

-

-
-
Runtime topology modifications
-

hwloc_topology_insert_misc_object(), hwloc_topology_alloc_group_object(), and hwloc_topology_insert_group_object() (see Modifying a loaded Topology) may modify the topology significantly by adding objects inside the tree, changing the topology depth, etc.

-

hwloc_distances_add() and hwloc_distances_remove() (see Add or remove distances between objects) modify the list of distance structures in the topology, and the former may even insert new Group objects.

-

hwloc_topology_restrict() modifies the topology even more dramatically by removing some objects.

-

Although references to former objects may still be valid after insertion or restriction, it is strongly advised to not rely on any such guarantee and always re-consult the topology to reacquire new instances of objects.

-

-
-
Consulting distances
-

hwloc_distances_get() and its variants are thread-safe except if the topology was recently modified (because distances may involve objects that were removed).

-

Whenever the topology is modified (see above), one dummy (but valid) hwloc_distances_get() call should be performed in the same thread-safe context to force the refresh of internal distances structures.

-

Once this refresh has been performed, multiple hwloc_distances_get() may then be performed concurrently by multiple threads.

-

-
-
Locating topologies
-

hwloc_topology_set_* (see Topology Detection Configuration and Query) do not modify the topology directly, but they do modify internal structures describing the behavior of the upcoming invocation of hwloc_topology_load(). Hence, all of these functions should not be used concurrently.

-

-
-
+

See Compatibility between hwloc versions for detecting the hwloc version that you are compiling and/or running against.

+

+

+

+

+New Organization of NUMA nodes and Memory

+

+Memory children

+

In hwloc v1.x, NUMA nodes were inside the tree, for instance Packages contained 2 NUMA nodes which contained a L3 and several cache.

+

Starting with hwloc v2.0, NUMA nodes are not in the main tree anymore. They are attached under objects as Memory Children on the side of normal children. This memory children list starts at obj->memory_first_child and its size is obj->memory_arity. Hence there can now exist two local NUMA nodes, for instance on Intel Xeon Phi processors.

+

The normal list of children (starting at obj->first_child, ending at obj->last_child, of size obj->arity, and available as the array obj->children) now only contains CPU-side objects: PUs, Cores, Packages, Caches, Groups, Machine and System. hwloc_get_next_child() may still be used to iterate over all children of all lists.

+

Hence the CPU-side hierarchy is built using normal children, while memory is attached to that hierarchy depending on its affinity.

+

+Examples

+
    +
  • +

    a UMA machine with 2 packages and a single NUMA node is now modeled as a "Machine" object with two "Package" children and one "NUMANode" memory children (displayed first in lstopo below):

    Machine (1024MB total)
    +  NUMANode L#0 (P#0 1024MB)
    +  Package L#0
    +    Core L#0 + PU L#0 (P#0)
    +    Core L#1 + PU L#1 (P#1)
    +  Package L#1
    +    Core L#2 + PU L#2 (P#2)
    +    Core L#3 + PU L#3 (P#3)
    +

    +
  • +
  • +

    a machine with 2 packages with one NUMA node and 2 cores in each is now:

    Machine (2048MB total)
    +  Package L#0
    +    NUMANode L#0 (P#0 1024MB)
    +    Core L#0 + PU L#0 (P#0)
    +    Core L#1 + PU L#1 (P#1)
    +  Package L#1
    +    NUMANode L#1 (P#1 1024MB)
    +    Core L#2 + PU L#2 (P#2)
    +    Core L#3 + PU L#3 (P#3)
    +

    +
  • +
  • +

    if there are two NUMA nodes per package, a Group object may be added to keep cores together with their local NUMA node:

    Machine (4096MB total)
    +  Package L#0
    +    Group0 L#0
    +      NUMANode L#0 (P#0 1024MB)
    +      Core L#0 + PU L#0 (P#0)
    +      Core L#1 + PU L#1 (P#1)
    +    Group0 L#1
    +      NUMANode L#1 (P#1 1024MB)
    +      Core L#2 + PU L#2 (P#2)
    +      Core L#3 + PU L#3 (P#3)
    +  Package L#1
    +    [...]
    +

    +
  • +
  • +if the platform has L3 caches whose localities are identical to NUMA nodes, Groups aren't needed:
    Machine (4096MB total)
    +  Package L#0
    +    L3 L#0 (16MB)
    +      NUMANode L#0 (P#0 1024MB)
    +      Core L#0 + PU L#0 (P#0)
    +      Core L#1 + PU L#1 (P#1)
    +    L3 L#1 (16MB)
    +      NUMANode L#1 (P#1 1024MB)
    +      Core L#2 + PU L#2 (P#2)
    +      Core L#3 + PU L#3 (P#3)
    +  Package L#1
    +    [...]
    +
  • +
+

+NUMA level and depth

+

NUMA nodes are not in "main" tree of normal objects anymore. Hence, they don't have a meaningful depth anymore (like I/O and Misc objects). They have a virtual (negative) depth (HWLOC_TYPE_DEPTH_NUMANODE) so that functions manipulating depths and level still work, and so that we can still iterate over the level of NUMA nodes just like for any other level.

+

For instance we can still use lines such as

int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
+hwloc_obj_t obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, 4);
+hwloc_obj_t node = hwloc_get_next_obj_by_depth(topology, HWLOC_TYPE_DEPTH_NUMANODE, prev);
+

The NUMA depth should not be compared with others. An unmodified code that still compares NUMA and Package depths (to find out whether Packages contain NUMA or the contrary) would now always assume Packages contain NUMA (because the NUMA depth is negative).

+

However, the depth of the Normal parents of NUMA nodes may be used instead. In the last example above, NUMA nodes are attached to L3 caches, hence one may compare the depth of Packages and L3 to find out that NUMA nodes are contained in Packages. This depth of parents may be retrieved with hwloc_get_memory_parents_depth(). However, this function may return HWLOC_TYPE_DEPTH_MULTIPLE on future platforms if NUMA nodes are attached to different levels.

+

+Finding Local NUMA nodes and looking at Children and Parents

+

Applications that walked up/down to find NUMANode parent/children must now be updated. Instead of looking directly for a NUMA node, one should now look for an object that has some memory children. NUMA node(s) will be be attached there. For instance, when looking for a NUMA node above a given core core:

hwloc_obj_t parent = core->parent;
+while (parent && !parent->memory_arity)
+  parent = parent->parent; /* no memory child, walk up */
+if (parent)
+  /* use parent->memory_first_child (and its siblings if there are multiple local NUMA nodes) */
+

The list of local NUMA nodes (usually a single one) is also described by the nodeset attribute of each object (which contains the physical indexes of these nodes). Iterating over the NUMA level is also an easy way to find local NUMA nodes:

hwloc_obj_t tmp = NULL;
+while ((tmp = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NUMANODE, tmp)) != NULL) {
+  if (hwloc_bitmap_isset(obj->nodeset, tmp->os_index))
+    /* tmp is a NUMA node local to obj, use it */
+}
+

Similarly finding objects that are close to a given NUMA nodes should be updated too. Instead of looking at the NUMA node parents/children, one should now find a Normal parent above that NUMA node, and then look at its parents/children as usual:

hwloc_obj_t tmp = obj->parent;
+while (hwloc_obj_type_is_memory(tmp))
+  tmp = tmp->parent;
+/* now use tmp instead of obj */
+

To avoid such hwloc v2.x-specific and NUMA-specific cases in the code, a generic lookup for any kind of object, including NUMA nodes, might also be implemented by iterating over a level. For instance finding an object of type type which either contains or is included in object obj can be performed by traversing the level of that type and comparing CPU sets:

hwloc_obj_t tmp = NULL;
+while ((tmp = hwloc_get_next_obj_by_type(topology, type, tmp)) != NULL) {
+  if (hwloc_bitmap_intersects(tmp->cpuset, obj->cpuset))
+    /* tmp matches, use it */
+}
+

This generic lookup works whenever type or obj are Normal or Memory objects since both have CPU sets. Moreover, it is compatible with the hwloc v1.x API.

+

+

+

+

+4 Kinds of Objects and Children

+

+I/O and Misc children

+

I/O children are not in the main object children list anymore either. They are in the list starting at obj->io_first_child and whose size if obj->io_arity.

+

Misc children are not in the main object children list anymore. They are in the list starting at obj->misc_first_child nd whose size if obj->misc_arity.

+

See hwloc_obj for details about children lists.

+

hwloc_get_next_child() may still be used to iterate over all children of all lists.

+

+Kinds of objects

+

Given the above, objects may now be of 4 kinds:

    +
  • +Normal (everything not listed below, including Machine, Package, Core, PU, CPU Caches, etc);
  • +
  • +Memory (currently NUMA nodes or Memory-side Caches), attached to parents as Memory children;
  • +
  • +I/O (Bridges, PCI and OS devices), attached to parents as I/O children;
  • +
  • +Misc objects, attached to parents as Misc children.
  • +
+

See hwloc_obj for details about children lists.

+

For a given object type, the kind may be found with hwloc_obj_type_is_normal(), hwloc_obj_type_is_memory(), hwloc_obj_type_is_normal(), or comparing with HWLOC_OBJ_MISC.

+

Normal and Memory objects have (non-NULL) CPU sets and nodesets, while I/O and Misc objects don't have any sets (they are NULL).

+

+

+

+

+HWLOC_OBJ_CACHE replaced

+

Instead of a single HWLOC_OBJ_CACHE, there are now 8 types HWLOC_OBJ_L1CACHE, ..., HWLOC_OBJ_L5CACHE, HWLOC_OBJ_L1ICACHE, ..., HWLOC_OBJ_L3ICACHE.

+

Cache object attributes are unchanged.

+

hwloc_get_cache_type_depth() is not needed to disambiguate cache types anymore since new types can be passed to hwloc_get_type_depth() without ever getting HWLOC_TYPE_DEPTH_MULTIPLE anymore.

+

hwloc_obj_type_is_cache(), hwloc_obj_type_is_dcache() and hwloc_obj_type_is_icache() may be used to check whether a given type is a cache, data/unified cache or instruction cache.

+

+

+

+

+allowed_cpuset and allowed_nodeset only in the main topology

+

Objects do not have allowed_cpuset and allowed_nodeset anymore. They are only available for the entire topology using hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset().

+

As usual, those are only needed when the INCLUDE_DISALLOWED topology flag is given, which means disallowed objects are kept in the topology. If so, one may find out whether some PUs inside an object is allowed by checking

hwloc_bitmap_intersects(obj->cpuset, hwloc_topology_get_allowed_cpuset(topology))
+

Replace cpusets with nodesets for NUMA nodes. To find out which ones, replace intersects() with and() to get the actual intersection.

+

+

+

+

+Object depths are now signed int

+

obj->depth as well as depths given to functions such as hwloc_get_obj_by_depth() or returned by hwloc_topology_get_depth() are now signed int.

+

Other depth such as cache-specific depth attribute are still unsigned.

+

+

+

+

+Memory attributes become NUMANode-specific

+

Memory attributes such as obj->memory.local_memory are now only available in NUMANode-specific attributes in obj->attr->numanode.local_memory.

+

obj->memory.total_memory is available in all objects as obj->total_memory.

+

See hwloc_obj_attr_u::hwloc_numanode_attr_s and hwloc_obj for details.

+

+

+

+

+Topology configuration changes

+

The old ignoring API as well as several configuration flags are replaced with the new filtering API, see hwloc_topology_set_type_filter() and its variants, and hwloc_type_filter_e for details.

+
    +
  • +

    hwloc_topology_ignore_type(), hwloc_topology_ignore_type_keep_structure() and hwloc_topology_ignore_all_keep_structure() are respectively superseded by

    hwloc_topology_set_type_filter(topology, type, HWLOC_TYPE_FILTER_KEEP_NONE);
    +hwloc_topology_set_type_filter(topology, type, HWLOC_TYPE_FILTER_KEEP_STRUCTURE);
    +hwloc_topology_set_all_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_STRUCTURE);
    +

    Also, the meaning of KEEP_STRUCTURE has changed (only entire levels may be ignored, instead of single objects), the old behavior is not available anymore.

    +

    +
  • +
  • +

    HWLOC_TOPOLOGY_FLAG_ICACHES is superseded by

    hwloc_topology_set_icache_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_ALL);
    +

    +
  • +
  • +

    HWLOC_TOPOLOGY_FLAG_WHOLE_IO, HWLOC_TOPOLOGY_FLAG_IO_DEVICES and HWLOC_TOPOLOGY_FLAG_IO_BRIDGES replaced.

    +

    To keep all I/O devices (PCI, Bridges, and OS devices), use:

    hwloc_topology_set_io_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_ALL);
    +

    To only keep important devices (Bridges with children, common PCI devices and OS devices):

    hwloc_topology_set_io_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_IMPORTANT);
    +

    +
  • +
+

+

+

+

+XML changes

+

2.0 XML files are not compatible with 1.x

+

2.0 can load 1.x files, but only NUMA distances are imported. Other distance matrices are ignored (they were never used by default anyway).

+

2.0 can export 1.x-compatible files, but only distances attached to the root object are exported (i.e. distances that cover the entire machine). Other distance matrices are dropped (they were never used by default anyway).

+

Users are advised to negociate hwloc versions between exporter and importer: If the importer isn't 2.x, the exporter should export to 1.x. Otherwise, things should work by default.

+

Hence hwloc_topology_export_xml() and hwloc_topology_export_xmlbuffer() have a new flags argument. to force a hwloc-1.x-compatible XML export.

    +
  • +If both always support 2.0, don't pass any flag.
  • +
  • +When the importer uses hwloc 1.x, export with HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1. Otherwise the importer will fail to import.
  • +
  • +When the exporter uses hwloc 1.x, it cannot pass any flag, and a 2.0 importer can import without problem.
  • +
+
#if HWLOC_API_VERSION >= 0x20000
+   if (need 1.x compatible XML export)
+      hwloc_topology_export_xml(...., HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1);
+   else /* need 2.x compatible XML export */
+      hwloc_topology_export_xml(...., 0);
+#else
+   hwloc_topology_export_xml(....);
+#endif
+

Additionally, hwloc_topology_diff_load_xml(), hwloc_topology_diff_load_xmlbuffer(), hwloc_topology_diff_export_xml(), hwloc_topology_diff_export_xmlbuffer() and hwloc_topology_diff_destroy() lost the topology argument: The first argument (topology) isn't needed anymore.

+

+

+

+

+Distances API totally rewritten

+

The new distances API is in hwloc/distances.h.

+

Distances are not accessible directly from objects anymore. One should first call hwloc_distances_get() (or a variant) to retrieve distances (possibly with one call to get the number of available distances structures, and another call to actually get them). Then it may consult these structures, and finally release them.

+

The set of object involved in a distances structure is specified by an array of objects, it may not always cover the entire machine or so.

+

+

+

+

+Return values of functions

+

Bitmap functions (and a couple other functions) can return errors (in theory).

+

Most bitmap functions may have to reallocate the internal bitmap storage. In v1.x, they would silently crash if realloc failed. In v2.0, they now return an int that can be negative on error. However, the preallocated storage is 512 bits, hence realloc will not even be used unless you run hwloc on machines with larger PU or NUMAnode indexes.

+

hwloc_obj_add_info(), hwloc_cpuset_from_nodeset() and hwloc_cpuset_from_nodeset() also return an int, which would be -1 in case of allocation errors.

+

+

+

+

+Misc API changes

+ +

+

+

+

+API removals and deprecations

+
    +
  • +

    HWLOC_OBJ_SYSTEM removed: The root object is always HWLOC_OBJ_MACHINE

    +

    +
  • +
  • +

    _membind_nodeset() memory binding interfaces deprecated: One should use the variant without _nodeset suffix and pass the HWLOC_MEMBIND_BYNODESET flag.

    +

    +
  • +
  • +

    HWLOC_MEMBIND_REPLICATE removed: no supported operating system supports it anymore.

    +

    +
  • +
  • +

    hwloc_obj_snprintf() removed because it was long-deprecated by hwloc_obj_type_snprintf() and hwloc_obj_attr_snprintf().

    +

    +
  • +
  • +

    hwloc_obj_type_sscanf() deprecated, hwloc_obj_type_of_string() removed.

    +

    +
  • +
  • +

    hwloc_cpuset_from/to_nodeset_strict() deprecated: Now useless since all topologies are NUMA. Use the variant without the _strict suffix

    +

    +
  • +
  • +

    hwloc_distribute() and hwloc_distributev() removed, deprecated by hwloc_distrib().

    +

    +
  • +
  • +

    The Custom interface (hwloc_topology_set_custom(), etc.) was removed, as well as the corresponding command-line tools (hwloc-assembler, etc.). Topologies always start with object with valid cpusets and nodesets.

    +

    +
  • +
  • +

    obj->online_cpuset removed: Offline PUs are simply listed in the complete_cpuset as previously.

    +

    +
  • +
  • +

    obj->os_level removed.

    +

    +
  • +
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00376.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00376.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00376.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00376.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Components and plugins +Hardware Locality (hwloc): Network Locality (netloc) @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,103 +27,163 @@
- + +/* @license-end */ -
+
-
Components and plugins
+
Network Locality (netloc)

-

hwloc is organized in components that are responsible for discovering objects. Depending on the topology configuration, some components will be used, some will be ignored. The usual default is to enable the native operating system component, (e.g. linux or solaris) and the pci miscellaneous component. If available, an architecture-specific component (such as x86) may also improve the topology detection.

-

If a XML topology is loaded, the xml discovery component will be used instead of all other components. It internally uses a specific class of components for the actual XML import/export routines (xml_libxml and xml_nolibxml) but these will not be discussed here (see libxml2 and minimalistic XML backends).

+

Portable abstraction of network topologies for high-performance computing.

+

The netloc documentation spans of these sections:

-

+

-

-Components enabled by default

-

The hwloc core contains a list of components sorted by priority. Each one is enabled as long as it does not conflict with the previously enabled ones. This includes native operating system components, architecture-specific ones, and if available, I/O components such as pci.

-

Usually the native operating system component (when it exists, e.g. linux or aix) is enabled first. Then hwloc looks for an architecture specific component (e.g. x86). Finally there also exist a basic component (no_os) that just tries to discover the number of PUs in the system.

-

Each component discovers as much topology information as possible. Most of them, including most native OS components, do nothing unless the topology is still empty. Some others, such as x86 and pci, can complete and annotate what other backends found earlier. Discovery is performed by phases: CPUs are first discovered, then memory is attached, then PCI, etc.

-

Default priorities ensure that clever components are invoked first. Native operating system components have higher priorities, and are therefore invoked first, because they likely offer very detailed topology information. If needed, it will be later extended by architecture-specific information (e.g. from the x86 component).

-

If any configuration function such as hwloc_topology_set_xml() is used before loading the topology, the corresponding component is enabled first. Then, as usual, hwloc enables any other component (based on priorities) that does not conflict.

-

Certain components that manage a virtual topology, for instance XML topology import or synthetic topology description, conflict with all other components. Therefore, one of them may only be loaded (e.g. with hwloc_topology_set_xml()) if no other component is enabled.

-

The environment variable HWLOC_COMPONENTS_VERBOSE may be set to get verbose messages about component registration (including their priority) and enabling.

-

-

+

+Netloc Summary

+

The Portable Network Locality (netloc) software package provides network topology discovery tools, and an abstract representation of those networks topologies for a range of network types and configurations. It is provided as a companion to the Portable Hardware Locality (hwloc) package. These two software packages work together to provide a comprehensive view of the HPC system topology, spanning from the processor cores in one server to the cores in another - including the complex network(s) in between.

+

Towards this end, netloc is divided into two sets of components. The first tools are for the admin to extract the information about the topology of the machines with topology discovery tools for each network type and discovery technique (called readers). The second set of tools is for the user to exploit the collected information: to display the topology or create a topology-aware mapping of the processes of an application.

+
+ +
+

+

-

-Selecting which components to use

-

If no topology configuration functions such as hwloc_topology_set_synthetic() have been called, plugins may be selected with environment variables such as HWLOC_XMLFILE, HWLOC_SYNTHETIC, HWLOC_FSROOT, or HWLOC_CPUID_PATH (see Environment Variables).

-

Finally, the environment variable HWLOC_COMPONENTS resets the list of selected components. If the variable is set and empty (or set to a single comma separating nothing, since some operating systems do not accept empty variables), the normal plugin priority order is used.

-

If the variable is set to x86 in this variable will cause the x86 component to take precedence over any other component, including the native operating system component. It is therefore loaded first, before hwloc tries to load all remaining non-conflicting components. In this case, x86 would take care of discovering everything it supports, instead of only completing what the native OS information. This may be useful if the native component is buggy on some platforms.

-

It is possible to prevent some components from being loaded by prefixing their name with - in the list. For instance x86,-pci will load the x86 component, then let hwloc load all the usual components except pci. A single component phase may also be blacklisted, for instance with -linux:io. hwloc_topology_set_components() may also be used inside the program to prevent the loading of a specific component (or phases) for the target topology.

-

It is possible to prevent all remaining components from being loaded by placing stop in the environment variable. Only the components listed before this keyword will be enabled.

+

+Supported Networks

+

For now, only InfiniBand (See Setup) is supported, but it is planned to be extended it very soon.

-

+

-

-Loading components from plugins

-

Components may optionally be built as plugins so that the hwloc core library does not directly depend on their dependencies (for instance the libpciaccess library). Plugin support may be enabled with the --enable-plugins configure option. All components buildable as plugins will then be built as plugins. The configure option may be given a comma-separated list of component names to specify the exact list of components to build as plugins.

-

Plugins are built as independent dynamic libraries that are installed in $libdir/hwloc. All plugins found in this directory are loaded during topology_init() (unless blacklisted in HWLOC_PLUGINS_BLACKLIST, see Environment Variables). A specific list of directories (colon-separated) to scan may be specified in the HWLOC_PLUGINS_PATH environment variable.

-

Note that loading a plugin just means that the corresponding component is registered to the hwloc core. Components are then only enabled if the topology configuration requests it, as explained in the previous sections.

-

Also note that plugins should carefully be enabled and used when embedding hwloc in another project, see Embedding hwloc in Other Software for details.

+

+Netloc Installation

+

The generic installation procedure for both hwloc and netloc is described in Installation.

+

Note that netloc is currently not supported on as many platforms as the original hwloc project. netloc is enabled by default when supported, or can be disabled by passing --disable-netloc to the configure command-line.

-

+

-

-Existing components and plugins

-

All components distributed within hwloc are listed below. The list of actually available components may be listed at running with the HWLOC_COMPONENTS_VERBOSE environment variable (see Environment Variables).

-
-
linux
-
The official component for discovering CPU, memory and I/O devices on Linux. It discovers PCI devices without the help of external libraries such as libpciaccess, but requires the pci component for adding vendor/device names to PCI objects. It also discovers many kinds of Linux-specific OS devices.
-
aix, darwin, freebsd, hpux, netbsd, solaris, windows
-
Each officially supported operating system has its own native component, which is statically built when supported, and which is used by default.
-
x86
-
The x86 architecture (either 32 or 64 bits) has its own component that may complete or replace the previously-found CPU information. It is statically built when supported.
-
bgq
-
This component is specific to IBM BlueGene/Q compute node (running CNK). It is built and enabled by default when --host=powerpc64-bgq-linux is passed to configure (see How do I build hwloc for BlueGene/Q?).
-
no_os
-
A basic component that just tries to detect the number of processing units in the system. It mostly serves on operating systems that are not natively supported. It is always statically built.
-
pci
-
PCI object discovery uses the external pciaccess library (aka libpciaccess); see I/O Devices. It may also annotate existing PCI devices with vendor and device names. It may be built as a plugin.
-
opencl
-
The OpenCL component creates co-processor OS device objects such as opencl0d0 (first device of the first OpenCL platform) or opencl1d3 (fourth device of the second platform). Only the AMD OpenCL implementation currently offers locality information. It may be built as a plugin.
-
cuda
-
This component creates co-processor OS device objects such as cuda0 that correspond to NVIDIA GPUs used with CUDA library. It may be built as a plugin.
-
nvml
-
Probing the NVIDIA Management Library creates OS device objects such as nvml0 that are useful for batch schedulers. It also detects the actual PCIe link bandwidth without depending on power management state and without requiring administrator privileges. It may be built as a plugin.
-
gl
-
Probing the NV-CONTROL X extension (NVCtrl library) creates OS device objects such as :0.0 corresponding to NVIDIA displays. They are useful for graphical applications that need to place computation and/or data near a rendering GPU. It may be built as a plugin.
-
synthetic
-
Synthetic topology support (see Synthetic topologies) is always built statically.
-
xml
-
XML topology import (see Importing and exporting topologies from/to XML files) is always built statically. It internally uses one of the XML backends (see libxml2 and minimalistic XML backends).
    -
  • -xml_nolibxml is a basic and hwloc-specific XML import/export. It is always statically built.
  • -
  • -xml_libxml relies on the external libxml2 library for provinding a feature-complete XML import/export. It may be built as a plugin.
  • -
-
-
fake
-
A dummy plugin that does nothing but is used for debugging plugin support.
-
-
+

+Setup

+

To use Netloc tools, we need two steps. The first step consists in getting information about network directly from tools distributed by manufacturers. For Infiniband, for instance, this operation needs privileges to access to the network device. For this step we have wrappers in Netloc that will call the right tools with the right options.

+

The second step will transform the raw files generated by manufacturer tools, into files in a format readable by Netloc tools, and that will not depend on network technologies.

+

To be clear, let's take an example with Infiniband. This first step is handled by netloc_ib_gather_raw that will call ibnetdiscover and ibroutes tools to generate the necessary raw data files. The step has to be run by an administrator, since the Infiniband tools need to access to the network device.

+
shell$ netloc_ib_gather_raw --help
+Usage: netloc_ib_gather_raw [options] <outdir>
+  Dumps topology information to <outdir>/ib-raw/
+  Subnets are guessed from the <outdir>/hwloc/ directory where
+  the hwloc XML exports of some nodes are stored.
+Options:
+ --sudo
+    Pass sudo to internal ibnetdiscover and ibroute invocations.
+    Useful when the entire script cannot run as root.
+ --hwloc-dir <dir>
+    Use <dir> instead of <outdir>/hwloc/ for hwloc XML exports.
+ --force-subnet [<subnet>:]<board>:<port> to force the discovery
+    Do not guess subnets from hwloc XML exports.
+    Force discovery on local board <board> port <port>
+    and optionally force the subnet id <subnet>
+    instead of reading it from the first GID.
+    Examples: --force-subnet mlx4_0:1
+              --force-subnet fe80:0000:0000:0000:mlx4_0:1
+ --ibnetdiscover /path/to/ibnetdiscover
+ --ibroute /path/to/ibroute
+    Specify exact location of programs. Default is /usr/bin/<program>
+ --sleep <n>
+    Sleep for <n> seconds between invocations of programs probing the network
+ --ignore-errors
+    Ignore errors from ibnetdiscover and ibroute, assume their outputs are ok
+ --force -f
+    Always rediscover to overwrite existing files without asking
+ --verbose -v
+    Add verbose messages
+ --dry-run
+    Do not actually run programs or modify anything
+ --help -h
+    Show this help
+
+shell$ ./netloc_ib_gather_raw /home/netloc/data
+WARNING: Not running as root.
+Using /home/netloc/data/hwloc as hwloc lstopo XML directory.
+
+Exporting local node hwloc XML...
+  Running lstopo-no-graphics...
+
+Found 1 subnets in hwloc directory:
+ Subnet fe80:0000:0000:0000 is locally accessible from board qib0 port 1.
+
+Looking at fe80:0000:0000:0000 (through local board qib0 port 1)...
+ Running ibnetdiscover...
+ Getting routes...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L112' LID 18...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L108' LID 20...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L102' LID 23...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L104' LID 25...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L106' LID 24...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L114' LID 22...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L116' LID 21...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L109' LID 12...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L111' LID 11...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L107' LID 13...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L103' LID 17...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L105' LID 16...
+  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L113' LID 15...
+

The second step, that can be done by a regular user, is done by the tool netloc_ib_extract_dats.

+
shell$ netloc_ib_extract_dats --help
+Usage: netloc_ib_extract_dats <path to input raw data files> <output path> [--hwloc-dir
+<hwloc xml path>]
+        hwloc-dir can be an absolute path or a relative path from output path
+
+shell$ netloc_ib_extract_dats /home/netloc/data/ib-raw /home/netloc/data/netloc \
+  --hwloc-dir ../hwloc
+Read subnet: fe80:0000:0000:0000
+2 partitions found
+        'node'
+        'admin'
+

+

+

+

+Topology display

+

Netloc provides a tool, netloc_draw.html, that displays a topology in a web browser, by using a JSON file.

+

+Generate the JSON file

+

In order to display a topology, Netloc needs to generate a JSON file corresponding to a topology. For this operation, the user must run netloc_draw_to_json.

+
shell$ netloc_draw_to_json --help
+Usage: netloc_draw_to_json <path to topology directory>
+
+shell$ netloc_draw_to_json /home/netloc/data/netloc
+

The netloc_draw_to_json command will write a JSON file for each topology file found in the input directory. The output files, written also in the input directory, can be open by netloc_draw.html in a web browser.

+

+Using netloc_draw

+

Once the JSON file is opened, the rendering is generated by the Javascript vis library for computing the position of the nodes. From the interface, it is possible to search for a specific node, to color the nodes, to expand merged switches, to show statistics, to export as an image... The user can interact with the nodes by moving them. For now, there are bugs and other nodes might move too.

+

The placement of the nodes is done statically if the topology is detected as a tree. If not, vis.js will use physics to find good positions, and it can be very time consuming.

+
+ +
+
+ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00377.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00377.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00377.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00377.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,11 +1,11 @@ - + - + -Hardware Locality (hwloc): Embedding hwloc in Other Software +Hardware Locality (hwloc): Netloc with Scotch @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,91 +27,64 @@ - + +/* @license-end */ -
+
-
Embedding hwloc in Other Software
+
Netloc with Scotch

-

It can be desirable to include hwloc in a larger software package (be sure to check out the LICENSE file) so that users don't have to separately download and install it before installing your software. This can be advantageous to ensure that your software uses a known-tested/good version of hwloc, or for use on systems that do not have hwloc pre-installed.

-

When used in "embedded" mode, hwloc will:

-
    -
  • not install any header files
  • -
  • not build any documentation files
  • -
  • not build or install any executables or tests
  • -
  • not build libhwloc.* – instead, it will build libhwloc_embedded.*
  • -
-

There are two ways to put hwloc into "embedded" mode. The first is directly from the configure command line:

-
shell$ ./configure --enable-embedded-mode ...
-

The second requires that your software project uses the GNU Autoconf / Automake / Libtool tool chain to build your software. If you do this, you can directly integrate hwloc's m4 configure macro into your configure script. You can then invoke hwloc's configuration tests and build setup by calling an m4 macro (see below).

-

Although hwloc dynamic shared object plugins may be used in embedded mode, the embedder project will have to manually setup libltdl in its build system so that hwloc can load its plugins at run time. Also, embedders should be aware of complications that can arise due to public and private linker namespaces (e.g., if the embedder project is loaded into a private namespace and then hwloc tries to dynamically load its plugins, such loading may fail since the hwloc plugins can't find the hwloc symbols they need). The embedder project is strongly advised not to use hwloc's dynamically loading plugins / libltdl capability.

+

Scotch is a toolbox for graph partitioning [XXX], that can do mapping between a communication graph and an architecture. Netloc interfaces with Scotch, by getting the topology of the machine and building the Scotch architecture. It is also possible to directly build a mapping file that can be given to mpirun.

-

+

-

-Using hwloc's M4 Embedding Capabilities

-

Every project is different, and there are many different ways of integrating hwloc into yours. What follows is one example of how to do it.

-

If your project uses recent versions Autoconf, Automake, and Libtool to build, you can use hwloc's embedded m4 capabilities. We have tested the embedded m4 with projects that use Autoconf 2.65, Automake 1.11.1, and Libtool 2.2.6b. Slightly earlier versions of may also work but are untested. Autoconf versions prior to 2.65 are almost certain to not work.

-

You can either copy all the config/hwloc*m4 files from the hwloc source tree to the directory where your project's m4 files reside, or you can tell aclocal to find more m4 files in the embedded hwloc's "config" subdirectory (e.g., add "-Ipath/to/embedded/hwloc/config" to your Makefile.am's ACLOCAL_AMFLAGS).

-

The following macros can then be used from your configure script (only HWLOC_SETUP_CORE must be invoked if using the m4 macros):

-
    -
  • HWLOC_SETUP_CORE(config-dir-prefix, action-upon-success, action-upon-failure, print_banner_or_not): Invoke the hwloc configuration tests and setup the hwloc tree to build. The first argument is the prefix to use for AC_OUTPUT files – it's where the hwloc tree is located relative to $top_srcdir. Hence, if your embedded hwloc is located in the source tree at contrib/hwloc, you should pass [contrib/hwloc] as the first argument. If HWLOC_SETUP_CORE and the rest of configure completes successfully, then "make" traversals of the hwloc tree with standard Automake targets (all, clean, install, etc.) should behave as expected. For example, it is safe to list the hwloc directory in the SUBDIRS of a higher-level Makefile.am. The last argument, if not empty, will cause the macro to display an announcement banner that it is starting the hwloc core configuration tests.

    -

    HWLOC_SETUP_CORE will set the following environment variables and AC_SUBST them: HWLOC_EMBEDDED_CFLAGS, HWLOC_EMBEDDED_CPPFLAGS, and HWLOC_EMBEDDED_LIBS. These flags are filled with the values discovered in the hwloc-specific m4 tests, and can be used in your build process as relevant. The _CFLAGS, _CPPFLAGS, and _LIBS variables are necessary to build libhwloc (or libhwloc_embedded) itself.

    -

    HWLOC_SETUP_CORE also sets HWLOC_EMBEDDED_LDADD environment variable (and AC_SUBSTs it) to contain the location of the libhwloc_embedded.la convenience Libtool archive. It can be used in your build process to link an application or other library against the embedded hwloc library.

    -

    NOTE: If the HWLOC_SET_SYMBOL_PREFIX macro is used, it must be invoked before HWLOC_SETUP_CORE.

    -
  • -
  • HWLOC_BUILD_STANDALONE: HWLOC_SETUP_CORE defaults to building hwloc in an "embedded" mode (described above). If HWLOC_BUILD_STANDALONE is invoked *before* HWLOC_SETUP_CORE, the embedded definitions will not apply (e.g., libhwloc.la will be built, not libhwloc_embedded.la).
  • -
  • HWLOC_SET_SYMBOL_PREFIX(foo_): Tells the hwloc to prefix all of hwloc's types and public symbols with "foo_"; meaning that function hwloc_init() becomes foo_hwloc_init(). Enum values are prefixed with an upper-case translation if the prefix supplied; HWLOC_OBJ_CORE becomes FOO_HWLOC_OBJ_CORE. This is recommended behavior if you are including hwloc in middleware – it is possible that your software will be combined with other software that links to another copy of hwloc. If both uses of hwloc utilize different symbol prefixes, there will be no type/symbol clashes, and everything will compile, link, and run successfully. If you both embed hwloc without changing the symbol prefix and also link against an external hwloc, you may get multiple symbol definitions when linking your final library or application.
  • -
  • HWLOC_SETUP_DOCS, HWLOC_SETUP_UTILS, HWLOC_SETUP_TESTS: These three macros only apply when hwloc is built in "standalone" mode (i.e., they should NOT be invoked unless HWLOC_BUILD_STANDALONE has already been invoked).
  • -
  • HWLOC_DO_AM_CONDITIONALS: If you embed hwloc in a larger project and build it conditionally with Automake (e.g., if HWLOC_SETUP_CORE is invoked conditionally), you must unconditionally invoke HWLOC_DO_AM_CONDITIONALS to avoid warnings from Automake (for the cases where hwloc is not selected to be built). This macro is necessary because hwloc uses some AM_CONDITIONALs to build itself, and AM_CONDITIONALs cannot be defined conditionally. Note that it is safe (but unnecessary) to call HWLOC_DO_AM_CONDITIONALS even if HWLOC_SETUP_CORE is invoked unconditionally. If you are not using Automake to build hwloc, this macro is unnecessary (and will actually cause errors because it invoked AM_* macros that will be undefined).
  • -
-

NOTE: When using the HWLOC_SETUP_CORE m4 macro, it may be necessary to explicitly invoke AC_CANONICAL_TARGET (which requires config.sub and config.guess) and/or AC_USE_SYSTEM_EXTENSIONS macros early in the configure script (e.g., after AC_INIT but before AM_INIT_AUTOMAKE). See the Autoconf documentation for further information.

-

Also note that hwloc's top-level configure.ac script uses exactly the macros described above to build hwloc in a standalone mode (by default). You may want to examine it for one example of how these macros are used.

+

+Introduction

+

Scotch is able to deal architectures to represent the topology of a complete machine. Scotch handles several types of topologies: complete graphs, hypercubes, fat trees, meshes, torus, and random graphs. Moreover, Scotch is able to manage parts of architectures that are called sub-architectures. Thus, from a complete architecture, we can create a sub-architecture that will represent the available resources of the complete machine.

-

+

-

-Example Embedding hwloc

-

Here's an example of integrating with a larger project named sandbox that already uses Autoconf, Automake, and Libtool to build itself:

-
# First, cd into the sandbox project source tree
-shell$ cd sandbox
-shell$ cp -r /somewhere/else/hwloc-<version> my-embedded-hwloc
-shell$ edit Makefile.am
-  1. Add "-Imy-embedded-hwloc/config" to ACLOCAL_AMFLAGS
-  2. Add "my-embedded-hwloc" to SUBDIRS
-  3. Add "$(HWLOC_EMBEDDED_LDADD)" and "$(HWLOC_EMBEDDED_LIBS)" to 
-     sandbox's executable's LDADD line.  The former is the name of the 
-     Libtool convenience library that hwloc will generate.  The latter 
-     is any dependent support libraries that may be needed by 
-     $(HWLOC_EMBEDDED_LDADD).
-  4. Add "$(HWLOC_EMBEDDED_CFLAGS)" to AM_CFLAGS
-  5. Add "$(HWLOC_EMBEDDED_CPPFLAGS)" to AM_CPPFLAGS
-shell$ edit configure.ac
-  1. Add "HWLOC_SET_SYMBOL_PREFIX(sandbox_hwloc_)" line
-  2. Add "HWLOC_SETUP_CORE([my-embedded-hwloc], [happy=yes], [happy=no])" line
-  3. Add error checking for happy=no case
-shell$ edit sandbox.c
-  1. Add #include <hwloc.h>
-  2. Add calls to sandbox_hwloc_init() and other hwloc API functions
-

Now you can bootstrap, configure, build, and run the sandbox as normal – all calls to "sandbox_hwloc_*" will use the embedded hwloc rather than any system-provided copy of hwloc.

+

+Setup

+

The first step in order to use Netloc tools is to discover the network. For this task, we provide tools called netloc_gather that are wrappers to the dedicated tools provided by the manufacturer of the network, that generate the raw data given by the devices. This task needs privileges to access to the network devices. Once, this task is completed, the raw data is converted in a generic format independent to the fabric by extract_dats. Figure 1 shows how the different modules of Netloc are linked, and what are the tools provided by Netloc.

+

+

+

+

+Tools and API

+

When the machine is discovered and all the needed files are generated as seen previously, a user can call the netlocscotch functions from the API and interact with Scotch.

+

+Build Scotch architectures

+

Netloc provides a function to export the built topology into the Scotch format. That will give the possibility to the user to play with the topology in Scotch. Since Netloc matches the discovered topology with known topologies, the Scotch architecture won’t be random graphs but known topologies also in Scotch that will lead to optimized graph algorithms. This function is called netlocscotch_build_arch.

+

When the network topology is a tree, the topology converted by netlocscotch is the complete topology of the machine containing intranode topologies from hwloc. In this case, merging the two levels results in a bigger tree. For other network topologies, the global graph created for Scotch is a generic graph since it not not (at this moment) possible to create nested known architectures.

+

+Build Scotch sub-architectures

+

Most of the time, the user does not have access to the complete machine. He uses a resource manager to run his application and he will gain access only to a set of nodes. In this case getting the Scotch architecture of the complete machine is not relevant. Fortunately, Netloc is also able to build a Scotch sub-architecture that will contain only the available nodes. For this operation the user needs to run a specific program, netloc_get_resources, that will record in a file, the lists of available nodes and available cores by using MPI and hwloc. From this file, the function netlocscotch_build_subarch will build the Scotch sub-architecture.

+

+Mapping of processes

+

A main goal in having all these data about the network topology, especially in Scotch structures, is to help the process placement. For that, we use the mapping of a process graph to the architecture provided by Scotch. As we have seen previously, Netloc is able to detect the structure of the topology and will build the adapted Scotch architecture that will be more efficient than a random structure.

+

In case, the network topology is not a tree, netlocscotch converts the complete topology into a generic graph. The drawback in that is the Scotch graph algorithms are less efficient. To overcome that, netlocscotch does two steps of mapping: first it maps the processes to the nodes, and then for each node maps the processes to the cores. We have to conduct tests to check if the method gives better results than using a generic graph directly.

+

The other input needed in Scotch is the process graph. Since we want to optimize the placement to decrease the communication time, a good metric for building the application graph is the amount of communications between all pairs of processes. Studies still have to be done to choose, in the most efficient way, what we take into account to define the amount of communications between the number of messages, the size of messages... This information will be transformed into a process graph.

+

Once we have a good mapping computed by Scotch, we can give it to the user, or Netloc can even generate the corresponding rank file useful to MPI.

+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00378.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00378.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00378.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00378.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,351 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): Frequently Asked Questions - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
-
-
Frequently Asked Questions
-
-
-

-

-

-

-Concepts

-

-I only need binding, why should I use hwloc ?

-

hwloc is its portable API that works on a variety of operating systems. It supports binding of threads, processes and memory buffers (see CPU binding and Memory binding). Even if some features are not supported on some systems, using hwloc is much easier than reimplementing your own portability layer.

-

Moreover, hwloc provides knowledge of cores and hardware threads. It offers easy ways to bind tasks to individual hardware threads, or to entire multithreaded cores, etc. See How may I ignore symmetric multithreading, hyper-threading, etc. in hwloc?. Most alternative software for binding do not even know whether each core is single-threaded, multithreaded or hyper-threaded. They would bind to individual threads without any way to know whether multiple tasks are in the same physical core.

-

However, using hwloc comes with an overhead since a topology must be loaded before gathering information and binding tasks or memory. Fortunately this overhead may be significantly reduced by filtering non-interesting information out of the topology. For instance the following code builds a topology that only contains Cores (explicitly filtered-in below), hardware threads (PUs, cannot be filtered-out), NUMA nodes (cannot be filtered-out), and the root object (usually a Machine; the root cannot be removed without breaking the tree).

-
hwloc_topology_t topology;
-hwloc_topology_init(&topology);
-/* filter everything out */
-hwloc_topology_set_all_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_NONE);
-/* filter Cores back in */
-hwloc_topology_set_type_filter(topology, HWLOC_OBJ_CORE, HWLOC_TYPE_FILTER_KEEP_ALL);
-hwloc_topology_load(topology);
-

However, one should remember that filtering such objects out removes locality information from the hwloc tree. For instance, we do not know anymore which PU is close to which NUMA node. This would be useful to applications that explicitly want to place specific memory buffers close to specific tasks. Those applications just need to tell hwloc to keep Group objects that bring structure information:

hwloc_topology_set_type_filter(topology, HWLOC_OBJ_GROUP, HWLOC_TYPE_FILTER_KEEP_STRUCTURE);
-

Note that the default configuration is to keep all objects enabled, except I/Os and instruction caches.

-

-Should I use logical or physical/OS indexes? and how?

-

One of the original reasons why hwloc was created is that physical/OS indexes (obj->os_index) are often crazy and unpredictable: logical processors numbers are usually non-contiguous (processors 0 and 1 are not physically close), they vary from one machine to another, and may even change after a BIOS or system update. This numbers make task placement hardly portable. Moreover some objects have no physical/OS numbers (caches), and some objects have non-unique numbers (core numbers are only unique within a socket). Physical/OS indexes are only guaranteed to exist and be unique for PU and NUMA nodes.

-

hwloc therefore introduces logical indexes (obj->logical_index) which are portable, contiguous and logically ordered (based on the resource organization in the locality tree). In general, one should only use logical indexes and just let hwloc do the internal conversion when really needed (when talking to the OS and hardware).

-

hwloc developers recommends that users do not use physical/OS indexes unless they really know what they are doing. The main reason for still using physical/OS indexes is when interacting with non-hwloc tools such as numactl or taskset, or when reading hardware information from raw sources such as /proc/cpuinfo.

-

lstopo options -l and -p may be used to switch between logical indexes (prefixed with L#) and physical/OS indexes (P#). Converting one into the other may also be achieved with hwloc-calc which may manipulate either logical or physical indexes as input or output. See also hwloc-calc.

-
# Convert PU with physical number 3 into logical number
-$ hwloc-calc -I pu --physical-input --logical-output pu:3
-5
-
-# Convert a set of NUMA nodes from logical to physical
-# (beware that the output order may not match the input order)
-$ hwloc-calc -I numa --logical-input --physical-output numa:2-3 numa:7
-0,2,5
-

-hwloc is only a structural model, it ignores performance models, memory bandwidth, etc.?

-

hwloc is indeed designed to provide applications with a structural model of the platform. This is an orthogonal approach to describing the machine with performance models, for instance using memory bandwidth or latencies measured by benchmarks. We believe that both approaches are important for helping application make the most of the hardware.

-

For instance, on a dual-processor host with four cores each, hwloc clearly shows which four cores are together. Latencies between all pairs of cores of the same processor are likely identical, and also likely lower than the latency between cores of different processors. However, the structural model cannot guarantee such implementation details. On the other side, performance models would reveal such details without always clearly identifying which cores are in the same processor.

-

The focus of hwloc is mainly of the structural modeling side. However, hwloc lets user adds performance information to the topology through distances (see Retrieve distances between objects and Add or remove distances between objects) or even custom annotations (see How do I annotate the topology with private notes?). hwloc may also use such distance information for grouping objects together (see hwloc only has a one-dimensional view of the architecture, it ignores distances? and What are these Group objects in my topology?).

-

-hwloc only has a one-dimensional view of the architecture, it ignores distances?

-

hwloc places all objects in a tree. Each level is a one-dimensional view of a set of similar objects. All children of the same object (siblings) are assumed to be equally interconnected (same distance between any of them), while the distance between children of different objects (cousins) is supposed to be larger.

-

Modern machines exhibit complex hardware interconnects, so this tree may miss some information about the actual physical distances between objects. The hwloc topology may therefore be annotated with distance information that may be used to build a more realistic representation (multi-dimensional) of each level. For instance, there can be a distance matrix that representing the latencies between any pair of NUMA nodes if the BIOS and/or operating system reports them.

-

For more information about the distance API, see Retrieve distances between objects and Add or remove distances between objects.

-

-What are these Group objects in my topology?

-

hwloc comes with a set of predefined object types (Core, Package, NUMA node, Caches) that match the vast majority of hardware platforms. The HWLOC_OBJ_GROUP type was designed for cases where this set is not sufficient. Groups may be used anywhere to add more structure information to the topology, for instance to show that 2 out of 4 NUMA nodes are actually closer than the others. When applicable, the subtype field describes why a Group was actually added (see also Normal attributes).

-

hwloc currently uses Groups for the following reasons:

    -
  • -NUMA parents when memory locality does not match any existing object.
  • -
  • -I/O parents when I/O locality does not match any existing object.
  • -
  • -Distance-based groups made of close objects.
  • -
  • -AMD Bulldozer dual-core compute units (subtype is ComputeUnit, in the x86 backend), but these objects are usually merged with the L2 caches.
  • -
  • -Intel Extended Topology Enumeration levels (in the x86 backend).
  • -
  • -Windows processor groups (unless they contain a single NUMA node, or a single Package, etc.).
  • -
  • -IBM S/390 "Books" on Linux (subtype is Book).
  • -
  • -AIX unknown hierarchy levels.
  • -
-

hwloc Groups are only kept if no other object has the same locality information. It means that a Group containing a single child is merged into that child. And a Group is merged into its parent if it is its only child. For instance a Windows processor group containing a single NUMA node would be merged with that NUMA node since it already contains the relevant hierarchy information.

-

When inserting a custom Group with hwloc_hwloc_topology_insert_group_object(), this merging may be disabled by setting its dont_merge attribute.

-

-What happens if my topology is asymmetric?

-

hwloc supports asymmetric topologies even if most platforms are usually symmetric. For example, there could be different types of processors in a single machine, each with different numbers of cores, symmetric multithreading, or levels of caches.

-

In practice, asymmetric topologies mostly appear when intermediate groups are added for I/O affinity: on a 4-package machine, an I/O bus may be connected to 2 packages. These packages are below an additional Group object, while the other packages are not (see also What are these Group objects in my topology?).

-

To understand how hwloc manages such cases, one should first remember the meaning of levels and cousin objects. All objects of the same type are gathered as horizontal levels with a given depth. They are also connected through the cousin pointers of the hwloc_obj structure. Object attribute (cache depth and type, group depth) are also taken in account when gathering objects as horizontal levels. To be clear: there will be one level for L1i caches, another level for L1d caches, another one for L2, etc.

-

If the topology is asymmetric (e.g., if a group is missing above some processors), a given horizontal level will still exist if there exist any objects of that type. However, some branches of the overall tree may not have an object located in that horizontal level. Note that this specific hole within one horizontal level does not imply anything for other levels. All objects of the same type are gathered in horizontal levels even if their parents or children have different depths and types.

-

See the diagram in Terms and Definitions for a graphical representation of such topologies.

-

Moreover, it is important to understand that a same parent object may have children of different types (and therefore, different depths). These children are therefore siblings (because they have the same parent), but they are not cousins (because they do not belong to the same horizontal level).

-

-What happens to my topology if I disable symmetric multithreading, hyper-threading, etc. in the system?

-

hwloc creates one PU (processing unit) object per hardware thread. If your machine supports symmetric multithreading, for instance Hyper-Threading, each Core object may contain multiple PU objects:

$ lstopo -
-...
-  Core L#0
-    PU L#0 (P#0)
-    PU L#1 (P#2)
-  Core L#1
-    PU L#2 (P#1)
-    PU L#3 (P#3)
-

x86 machines usually offer the ability to disable hyper-threading in the BIOS. Or it can be disabled on the Linux kernel command-line at boot time, or later by writing in sysfs virtual files.

-

If you do so, the hwloc topology structure does not significantly change, but some PU objects will not appear anymore. No level will disappear, you will see the same number of Core objects, but each of them will contain a single PU now. The PU level does not disappear either (remember that hwloc topologies always contain a PU level at the bottom of the topology) even if there is a single PU object per Core parent.

$ lstopo -
-...
-  Core L#0
-    PU L#0 (P#0)
-  Core L#1
-    PU L#1 (P#1)
-

-How may I ignore symmetric multithreading, hyper-threading, etc. in hwloc?

-

First, see What happens to my topology if I disable symmetric multithreading, hyper-threading, etc. in the system? for more information about multithreading.

-

If you need to ignore symmetric multithreading in software, you should likely manipulate hwloc Core objects directly:

/* get the number of cores */
-unsigned nbcores = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE);
-...
-/* get the third core below the first package */
-hwloc_obj_t package, core;
-package = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PACKAGE, 0);
-core = hwloc_get_obj_inside_cpuset_by_type(topology, package->cpuset,
-                                           HWLOC_OBJ_CORE, 2);
-

Whenever you want to bind a process or thread to a core, make sure you singlify its cpuset first, so that the task is actually bound to a single thread within this core (to avoid useless migrations).

/* bind on the second core */
-hwloc_obj_t core = hwloc_get_obj_by_type(topology, HWLOC_OBJ_CORE, 1);
-hwloc_cpuset_t set = hwloc_bitmap_dup(core->cpuset);
-hwloc_bitmap_singlify(set);
-hwloc_set_cpubind(topology, set, 0);
-hwloc_bitmap_free(set);
-

With hwloc-calc or hwloc-bind command-line tools, you may specify that you only want a single-thread within each core by asking for their first PU object:

$ hwloc-calc core:4-7
-0x0000ff00
-$ hwloc-calc core:4-7.pu:0
-0x00005500
-

When binding a process on the command-line, you may either specify the exact thread that you want to use, or ask hwloc-bind to singlify the cpuset before binding

$ hwloc-bind core:3.pu:0 -- echo "hello from first thread on core #3"
-hello from first thread on core #3
-...
-$ hwloc-bind core:3 --single -- echo "hello from a single thread on core #3"
-hello from a single thread on core #3
-

-

-

-

-Advanced

-

-I do not want hwloc to rediscover my enormous machine topology every time I rerun a process

-

Although the topology discovery is not expensive on common machines, its overhead may become significant when multiple processes repeat the discovery on large machines (for instance when starting one process per core in a parallel application). The machine topology usually does not vary much, except if some cores are stopped/restarted or if the administrator restrictions are modified. Thus rediscovering the whole topology again and again may look useless.

-

For this purpose, hwloc offers XML import/export and shared memory features.

-

XML lets you save the discovered topology to a file (for instance with the lstopo program) and reload it later by setting the HWLOC_XMLFILE environment variable. The HWLOC_THISSYSTEM environment variable should also be set to 1 to assert that loaded file is really the underlying system.

-

Loading a XML topology is usually much faster than querying multiple files or calling multiple functions of the operating system. It is also possible to manipulate such XML files with the C programming interface, and the import/export may also be directed to memory buffer (that may for instance be transmitted between applications through a package). See also Importing and exporting topologies from/to XML files.

-
Note
The environment variable HWLOC_THISSYSTEM_ALLOWED_RESOURCES may be used to load a XML topology that contains the entire machine and restrict it to the part that is actually available to the current process (e.g. when Linux Cgroup/Cpuset are used to restrict the set of resources). See Environment Variables.
-

Shared-memory topologies consist in one process exposing its topology in a shared-memory buffer so that other processes (running on the same machine) may use it directly. This has the advantage of reducing the memory footprint since a single topology is stored in physical memory for multiple processes. However, it requires all processes to map this shared-memory buffer at the same virtual address, which may be difficult in some cases. This API is described in Sharing topologies between processes.

-

-How many topologies may I use in my program?

-

hwloc lets you manipulate multiple topologies at the same time. However, these topologies consume memory and system resources (for instance file descriptors) until they are destroyed. It is therefore discouraged to open the same topology multiple times.

-

Sharing a single topology between threads is easy (see Thread Safety) since the vast majority of accesses are read-only.

-

If multiple topologies of different (but similar) nodes are needed in your program, have a look at How to avoid memory waste when manipulating multiple similar topologies?.

-

-How to avoid memory waste when manipulating multiple similar topologies?

-

hwloc does not share information between topologies. If multiple similar topologies are loaded in memory, for instance the topologies of different identical nodes of a cluster, lots of information will be duplicated.

-

hwloc/diff.h (see also Topology differences) offers the ability to compute topology differences, apply or unapply them, or export/import to/from XML. However, this feature is limited to basic differences such as attribute changes. It does not support complex modifications such as adding or removing some objects.

-

-How do I annotate the topology with private notes?

-

Each hwloc object contains a userdata field that may be used by applications to store private pointers. This field is only valid during the lifetime of these container object and topology. It becomes invalid as soon the topology is destroyed, or as soon as the object disappears, for instance when restricting the topology. The userdata field is not exported/imported to/from XML by default since hwloc does not know what it contains. This behavior may be changed by specifying application-specific callbacks with hwloc_topology_set_userdata_export_callback() and hwloc_topology_set_userdata_import_callback().

-

Each object may also contain some info attributes (key name and value) that are setup by hwloc during discovery and that may be extended by the user with hwloc_obj_add_info() (see also Object attributes). Contrary to the userdata field which is unique, multiple info attributes may exist for each object, even with the same name. These attributes are always exported to XML. However, only character strings may be used as key names and values.

-

It is also possible to insert Misc objects with a custom name anywhere as a leaf of the topology (see Miscellaneous objects). And Misc objects may have their own userdata and info attributes just like any other object.

-

The hwloc-annotate command-line tool may be used for adding Misc objects and info attributes.

-

There is also a topology-specific userdata pointer that can be used to recognize different topologies by storing a custom pointer. It may be manipulated with hwloc_topology_set_userdata() and hwloc_topology_get_userdata().

-

-

-

-

-Caveats

-

-Why is hwloc slow?

-

Building a hwloc topology on a large machine may be slow because the discovery of hundreds of hardware cores or threads takes time (especially when reading thousands of sysfs files on Linux). Ignoring some objects (for instance caches) that aren't useful to the current application may improve this overhead (see I only need binding, why should I use hwloc ?). One should also consider using XML (see I do not want hwloc to rediscover my enormous machine topology every time I rerun a process) to work around such issues.

-

Additionally, lstopo enables most hwloc objects and discovery flags by default so that the output topology is as precise as possible (while hwloc disables many of them by default). This includes I/O device discovery through PCI libraries as well as external libraries such as NVML. To speed up lstopo, you may disable such features with command-line options such as --no-io.

-

When NVIDIA GPU probing is enabled with CUDA or NVML, one should make sure that the Persistent mode is enabled (with nvidia-smi -pm 1) to avoid significant GPU initialization overhead.

-

When AMD GPU discovery is enabled with OpenCL and hwloc is used remotely over ssh, some spurious round-trips on the network may significantly increase the discovery time. Forcing the DISPLAY environment variable to the remote X server display (usually :0) instead of only setting the COMPUTE variable may avoid this.

-

Also remember that these components may be disabled at build-time with configure flags such as --disable-opencl, --disable-cuda or --disable-nvml, and at runtime with the environment variable HWLOC_COMPONENTS=-opencl,-cuda,-nvml or with hwloc_topology_set_components().

-

-Does hwloc require privileged access?

-

hwloc discovers the topology by querying the operating system. Some minor features may require privileged access to the operation system. For instance memory module discovery on Linux is reserved to root, and the entire PCI discovery on Solaris and BSDs requires access to some special files that are usually restricted to root (/dev/pci* or /devices/pci*).

-

To workaround this limitation, it is recommended to export the topology as a XML file generated by the administrator (with the lstopo program) and make it available to all users (see Importing and exporting topologies from/to XML files). It will offer all discovery information to any application without requiring any privileged access anymore. Only the necessary hardware characteristics will be exported, no sensitive information will be disclosed through this XML export.

-

This XML-based model also has the advantage of speeding up the discovery because reading a XML topology is usually much faster than querying the operating system again.

-

The utility hwloc-dump-hwdata is also involved in gathering privileged information at boot time and making it available to non-privileged users (note that this may require a specific SELinux MLS policy module). However, it only applies to Intel Xeon Phi processors for now (see Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?). See also HWLOC_DUMPED_HWDATA_DIR in Environment Variables for details about the location of dumped files.

-

-What should I do when hwloc reports "operating system" warnings?

-

When the operating system reports invalid locality information (because of either software or hardware bugs), hwloc may fail to insert some objects in the topology because they cannot fit in the already built tree of resources. If so, hwloc will report a warning like the following. The object causing this error is ignored, the discovery continues but the resulting topology will miss some objects and may be asymmetric (see also What happens if my topology is asymmetric?).

-
****************************************************************************
-* hwloc received invalid information from the operating system.
-*
-* L3 (cpuset 0x000003f0) intersects with NUMANode (P#0 cpuset 0x0000003f) without inclusion!
-* Error occurred in topology.c line 940
-*
-* Please report this error message to the hwloc user's mailing list,
-* along with the files generated by the hwloc-gather-topology script.
-*
-* hwloc will now ignore this invalid topology information and continue.
-****************************************************************************
-

These errors are common on large AMD platforms because of BIOS and/or Linux kernel bugs causing invalid L3 cache information. In the above example, the hardware reports a L3 cache that is shared by 2 cores in the first NUMA node and 4 cores in the second NUMA node. That's wrong, it should actually be shared by all 6 cores in a single NUMA node. The resulting topology will miss some L3 caches.

-

If your application does not care about cache sharing, or if you do not plan to request cache-aware binding in your process launcher, you may likely ignore this error (and hide it by setting HWLOC_HIDE_ERRORS=1 in your environment).

-

Some platforms report similar warnings about conflicting Packages and NUMANodes.

-

On x86 hosts, passing HWLOC_COMPONENTS=x86 in the environment may workaround some of these issues by switching to a different way to discover the topology.

-

Upgrading the BIOS and/or the operating system may help. Otherwise, as explained in the message, reporting this issue to the hwloc developers (by sending the tarball that is generated by the hwloc-gather-topology script on this platform) is a good way to make sure that this is a software (operating system) or hardware bug (BIOS, etc).

-

See also Questions and Bugs. Opening an issue on GitHub automatically displays hints on what information you should provide when reporting such bugs.

-

-Why does Valgrind complain about hwloc memory leaks?

-

If you are debugging your application with Valgrind, you want to avoid memory leak reports that are caused by hwloc and not by your program.

-

hwloc itself is often checked with Valgrind to make sure it does not leak memory. However, some global variables in hwloc dependencies are never freed. For instance libz allocates its global state once at startup and never frees it so that it may be reused later. Some libxml2 global state is also never freed because hwloc does not know whether it can safely ask libxml2 to free it (the application may also be using libxml2 outside of hwloc).

-

These unfreed variables cause leak reports in Valgrind. hwloc installs a Valgrind suppressions file to hide them. You should pass the following command-line option to Valgrind to use it:

  --suppressions=/path/to/hwloc-valgrind.supp
-

-

-

-

-Platform-specific

-

-How do I find the local MCDRAM NUMA node on Intel Xeon Phi processor?

-

Intel Xeon Phi processors introduced a new memory architecture by possibly having two distinct local memories: some normal memory (DDR) and some high-bandwidth on-package memory (MCDRAM). Processors can be configured in various clustering modes to have up to 4 Clusters. Moreover, each Cluster (quarter, half or whole processor) of the processor may have its own local parts of the DDR and of the MCDRAM. This memory and clustering configuration may be probed by looking at MemoryMode and ClusterMode attributes, see Hardware Platform Information and doc/examples/get-knl-modes.c in the source directory.

-

Starting with version 2.0, hwloc properly exposes this memory configuration. DDR and MCDRAM are attached as two memory children of the same parent, DDR first, and MCDRAM second if any. Depending on the processor configuration, that parent may be a Package, a Cache, or a Group object of type Cluster.

-

Hence cores may have one or two local NUMA nodes, listed by the core nodeset. An application may allocate local memory from a core by using that nodeset. The operating system will actually allocate from the DDR when possible, or fallback to the MCDRAM.

-

To allocate specifically on one of these memories, one should walk up the parent pointers until finding an object with some memory children. Looking at these memory children will give the DDR first, then the MCDRAM if any. Their nodeset may then be used for allocating or binding memory buffers.

-

One may also traverse the list of NUMA nodes until finding some whose cpuset matches the target core or PUs. The MCDRAM NUMA nodes may be identified thanks to the subtype field which is set to MCDRAM.

-

Command-line tools such as hwloc-bind may bind memory on the MCDRAM by using the hbm keyword. For instance, to bind on the first MCDRAM NUMA node:

-
$ hwloc-bind --membind --hbm numa:0 -- myprogram
-$ hwloc-bind --membind numa:0 -- myprogram
-

-Why do I need hwloc-dump-hwdata for memory on Intel Xeon Phi processor?

-

Intel Xeon Phi processors may use the on-package memory (MCDRAM) as either memory or a memory-side cache (reported as a L3 cache by hwloc by default, see HWLOC_KNL_MSCACHE_L3 in Environment Variables). There are also several clustering modes that significantly affect the memory organization (see How do I find the local MCDRAM NUMA node on Intel Xeon Phi processor? for more information about these modes). Details about these are currently only available to privileged users. Without them, hwloc relies on a heuristic for guessing the modes.

-

The hwloc-dump-hwdata utility may be used to dump this privileged binary information into human-readable and world-accessible files that the hwloc library will later load. The utility should usually run as root once during boot, in order to update dumped information (stored under /var/run/hwloc by default) in case the MCDRAM or clustering configuration changed between reboots.

-

When SELinux MLS policy is enabled, a specific hwloc policy module may be required so that all users get access to the dumped files (in /var/run/hwloc by default). One may use hwloc policy files from the SELinux Reference Policy at https://github.com/TresysTechnology/refpolicy-contrib (see also the documentation at https://github.com/TresysTechnology/refpolicy/wiki/GettingStarted).

-

hwloc-dump-hwdata requires dmi-sysfs kernel module loaded.

-

The utility is currently unneeded on platforms without Intel Xeon Phi processors.

-

See HWLOC_DUMPED_HWDATA_DIR in Environment Variables for details about the location of dumped files.

-

-How do I build for Intel Xeon Phi coprocessor?

-
Note
This section does not apply to standalone Intel Xeon Phi processors (Knights Landing and Knights Mill).
-

Intel Xeon Phi coprocessors (Knights Corner) usually runs a Linux environment but cross-compiling from the host is required. hwloc uses standard autotools options for cross-compiling.

-

If building with icc:

./configure CC="icc -mmic" --host=x86_64-k1om-linux --build=x86_64-unknown-linux-gnu
-

If building with the Xeon Phi-specific GCC that comes with the MPSS environment, for instance /usr/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc:

export PATH=$PATH:/usr/linux-k1om-4.7/bin/
-./configure --host=x86_64-k1om-linux --build=x86_64-unknown-linux-gnu
-

-How do I build hwloc for BlueGene/Q?

-

IBM BlueGene/Q machines run a standard Linux on the login/frontend nodes and a custom CNK (Compute Node Kernel) on the compute nodes.

-

To discover the topology of a login/frontend node, hwloc should be configured as usual, without any BlueGene/Q-specific option.

-

However, one would likely rather discover the topology of the compute nodes where parallel jobs are actually running. If so, hwloc must be cross-compiled with the following configuration line:

./configure --host=powerpc64-bgq-linux --disable-shared --enable-static \
-  CPPFLAGS='-I/bgsys/drivers/ppcfloor -I/bgsys/drivers/ppcfloor/spi/include/kernel/cnk/'
-

CPPFLAGS may have to be updated if your platform headers are installed in a different directory.

-

-How do I build hwloc for Windows?

-

hwloc releases are available as pre-built ZIPs for Windows on both 32bits and 64bits x86 platforms. They are built using MSYS2 and MinGW on a Windows host. Such an environment allows using the Unix-like configure, make and make install steps without having to tweak too many variables or options. One may look at contrib/ci.inria.fr/job-3-mingw.sh in the hwloc repository for an example used for nightly testing.

-

hwloc releases also contain a basic Microsoft Visual Studio solution under contrib/windows/.

-

-How to get useful topology information on NetBSD?

-

The NetBSD (and FreeBSD) backend uses x86-specific topology discovery (through the x86 component). This implementation requires CPU binding so as to query topology information from each individual logical processor. This means that hwloc cannot find any useful topology information unless user-level process binding is allowed by the NetBSD kernel. The security.models.extensions.user_set_cpu_affinity sysctl variable must be set to 1 to do so. Otherwise, only the number of logical processors will be detected.

-

-Why does binding fail on AIX?

-

The AIX operating system requires specific user capabilities for attaching processes to resource sets (CAP_NUMA_ATTACH). Otherwise functions such as hwloc_set_cpubind() fail (return -1 with errno set to EPERM).

-

This capability must also be inherited (through the additional CAP_PROPAGATE capability) if you plan to bind a process before forking another process, for instance with hwloc-bind.

-

These capabilities may be given by the administrator with:

chuser "capabilities=CAP_PROPAGATE,CAP_NUMA_ATTACH" <username>
-

-

-

-

-Compatibility between hwloc versions

-

-How do I handle API changes?

-

The hwloc interface is extended with every new major release. Any application using the hwloc API should be prepared to check at compile-time whether some features are available in the currently installed hwloc distribution.

-

For instance, to check whether the hwloc version is at least 2.0, you should use:

#include <hwloc.h>
-#if HWLOC_API_VERSION >= 0x00020000
-...
-#endif
-

To check for the API of release X.Y.Z at build time, you may compare HWLOC_API_VERSION with (X<<16)+(Y<<8)+Z.

-

For supporting older releases that do not have HWLOC_OBJ_NUMANODE and HWLOC_OBJ_PACKAGE yet, you may use:

-
#include <hwloc.h>
-#if HWLOC_API_VERSION < 0x00010b00
-#define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
-#define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
-#endif
-

Once a program is built against a hwloc library, it may also dynamically link with compatible libraries from other hwloc releases. The version of that runtime library may be queried with hwloc_get_api_version(). See How do I handle ABI breaks? for using this function for testing ABI compatibility.

-

-What is the difference between API and library version numbers?

-

HWLOC_API_VERSION is the version of the API. It changes when functions are added, modified, etc. However it does not necessarily change from one release to another. For instance, two releases of the same series (e.g. 2.0.3 and 2.0.4) usually have the same HWLOC_API_VERSION (0x00020000). However their HWLOC_VERSION strings are different ("2.0.3" and "2.0.4" respectively).

-

-How do I handle ABI breaks?

-

The hwloc interface was deeply modified in release 2.0 to fix several issues of the 1.x interface (see Upgrading to the hwloc 2.0 API and the NEWS file in the source directory for details). The ABI was broken, which means applications must be recompiled against the new 2.0 interface.

-

To check that you are not mixing old/recent headers with a recent/old runtime library, check the major revision number in the API version:

#include <hwloc.h>
-  unsigned version = hwloc_get_api_version();
-  if ((version >> 16) != (HWLOC_API_VERSION >> 16)) {
-    fprintf(stderr,
-           "%s compiled for hwloc API 0x%x but running on library API 0x%x.\n"
-           "You may need to point LD_LIBRARY_PATH to the right hwloc library.\n"
-           "Aborting since the new ABI is not backward compatible.\n",
-           callname, HWLOC_API_VERSION, version);
-    exit(EXIT_FAILURE);
-  }
-

To specifically detect v2.0 issues:

#include <hwloc.h>
-#if HWLOC_API_VERSION >= 0x00020000
-  /* headers are recent */
-  if (hwloc_get_api_version() < 0x20000)
-    ... error out, the hwloc runtime library is older than 2.0 ...
-#else
-  /* headers are pre-2.0 */
-  if (hwloc_get_api_version() >= 0x20000)
-    ... error out, the hwloc runtime library is more recent than 2.0 ...
-#endif
-

In theory, library sonames prevent linking with incompatible libraries. However custom hwloc installations or improperly configured build environments may still lead to such issues. Hence running one of the above (cheap) checks before initializing hwloc topology may be useful.

-

-Are XML topology files compatible between hwloc releases?

-

XML topology files are forward-compatible: a XML file may be loaded by a hwloc library that is more recent than the hwloc release that exported that file.

-

However, hwloc XMLs are not always backward-compatible: Topologies exported by hwloc 2.x cannot be imported by 1.x by default (see XML changes for working around such issues). There are also some corner cases where backward compatibility is not guaranteed because of changes between major releases (for instance 1.11 XMLs could not be imported in 1.10).

-

XMLs are exchanged at runtime between some components of the HPC software stack (for instance the resource managers and MPI processes). Building all these components on the same (cluster-wide) hwloc installation is a good way to avoid such incompatibilities.

-

-Are synthetic strings compatible between hwloc releases?

-

Synthetic strings (see Synthetic topologies) are forward-compatible: a synthetic string generated by a release may be imported by future hwloc libraries.

-

However they are often not backward-compatible because new details may have been added to synthetic descriptions in recent releases. Some flags may be given to hwloc_topology_export_synthetic() to avoid such details and stay backward compatible.

-

-Is it possible to share a shared-memory topology between different hwloc releases?

-

Shared-memory topologies (see Sharing topologies between processes) have strong requirements on compatibility between hwloc libraries. Adopting a shared-memory topology fails if it was exported by a non-compatible hwloc release. Releases with same major revision are usually compatible (e.g. hwloc 2.0.4 may adopt a topology exported by 2.0.3) but different major revisions may be incompatible (e.g. hwloc 2.1.0 cannot adopt from 2.0.x).

-

Topologies are shared at runtime between some components of the HPC software stack (for instance the resource managers and MPI processes). Building all these components on the same (system-wide) hwloc installation is a good way to avoid such incompatibilities.

-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00379.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00379.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00379.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00379.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,349 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): Upgrading to the hwloc 2.0 API - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
-
-
Upgrading to the hwloc 2.0 API
-
-
-

-

-

-

See Compatibility between hwloc versions for detecting the hwloc version that you are compiling and/or running against.

-

-

-

-

-New Organization of NUMA nodes and Memory

-

-Memory children

-

In hwloc v1.x, NUMA nodes were inside the tree, for instance Packages contained 2 NUMA nodes which contained a L3 and several cache.

-

Starting with hwloc v2.0, NUMA nodes are not in the main tree anymore. They are attached under objects as Memory Children on the side of normal children. This memory children list starts at obj->memory_first_child and its size is obj->memory_arity. Hence there can now exist two local NUMA nodes, for instance on Intel Xeon Phi processors.

-

The normal list of children (starting at obj->first_child, ending at obj->last_child, of size obj->arity, and available as the array obj->children) now only contains CPU-side objects: PUs, Cores, Packages, Caches, Groups, Machine and System. hwloc_get_next_child() may still be used to iterate over all children of all lists.

-

Hence the CPU-side hierarchy is built using normal children, while memory is attached to that hierarchy depending on its affinity.

-

-Examples

-
    -
  • -

    a UMA machine with 2 packages and a single NUMA node is now modeled as a "Machine" object with two "Package" children and one "NUMANode" memory children (displayed first in lstopo below):

    Machine (1024MB total)
    -  NUMANode L#0 (P#0 1024MB)
    -  Package L#0
    -    Core L#0 + PU L#0 (P#0)
    -    Core L#1 + PU L#1 (P#1)
    -  Package L#1
    -    Core L#2 + PU L#2 (P#2)
    -    Core L#3 + PU L#3 (P#3)
    -

    -
  • -
  • -

    a machine with 2 packages with one NUMA node and 2 cores in each is now:

    Machine (2048MB total)
    -  Package L#0
    -    NUMANode L#0 (P#0 1024MB)
    -    Core L#0 + PU L#0 (P#0)
    -    Core L#1 + PU L#1 (P#1)
    -  Package L#1
    -    NUMANode L#1 (P#1 1024MB)
    -    Core L#2 + PU L#2 (P#2)
    -    Core L#3 + PU L#3 (P#3)
    -

    -
  • -
  • -

    if there are two NUMA nodes per package, a Group object may be added to keep cores together with their local NUMA node:

    Machine (4096MB total)
    -  Package L#0
    -    Group0 L#0
    -      NUMANode L#0 (P#0 1024MB)
    -      Core L#0 + PU L#0 (P#0)
    -      Core L#1 + PU L#1 (P#1)
    -    Group0 L#1
    -      NUMANode L#1 (P#1 1024MB)
    -      Core L#2 + PU L#2 (P#2)
    -      Core L#3 + PU L#3 (P#3)
    -  Package L#1
    -    [...]
    -

    -
  • -
  • -if the platform has L3 caches whose localities are identical to NUMA nodes, Groups aren't needed:
    Machine (4096MB total)
    -  Package L#0
    -    L3 L#0 (16MB)
    -      NUMANode L#0 (P#0 1024MB)
    -      Core L#0 + PU L#0 (P#0)
    -      Core L#1 + PU L#1 (P#1)
    -    L3 L#1 (16MB)
    -      NUMANode L#1 (P#1 1024MB)
    -      Core L#2 + PU L#2 (P#2)
    -      Core L#3 + PU L#3 (P#3)
    -  Package L#1
    -    [...]
    -
  • -
-

-NUMA level and depth

-

NUMA nodes are not in "main" tree of normal objects anymore. Hence, they don't have a meaningful depth anymore (like I/O and Misc objects). They have a virtual (negative) depth (HWLOC_TYPE_DEPTH_NUMANODE) so that functions manipulating depths and level still work, and so that we can still iterate over the level of NUMA nodes just like for any other level.

-

For instance we can still use lines such as

int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NUMANODE);
-hwloc_obj_t obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, 4);
-hwloc_obj_t node = hwloc_get_next_obj_by_depth(topology, HWLOC_TYPE_DEPTH_NUMANODE, prev);
-

The NUMA depth should not be compared with others. An unmodified code that still compares NUMA and Package depths (to find out whether Packages contain NUMA or the contrary) would now always assume Packages contain NUMA (because the NUMA depth is negative).

-

However, the depth of the Normal parents of NUMA nodes may be used instead. In the last example above, NUMA nodes are attached to L3 caches, hence one may compare the depth of Packages and L3 to find out that NUMA nodes are contained in Packages. This depth of parents may be retrieved with hwloc_get_memory_parents_depth(). However, this function may return HWLOC_TYPE_DEPTH_MULTIPLE on future platforms if NUMA nodes are attached to different levels.

-

-Finding Local NUMA nodes and looking at Children and Parents

-

Applications that walked up/down to find NUMANode parent/children must now be updated. Instead of looking directly for a NUMA node, one should now look for an object that has some memory children. NUMA node(s) will be be attached there. For instance, when looking for a NUMA node above a given core core:

hwloc_obj_t parent = core->parent;
-while (parent && !parent->memory_arity)
-  parent = parent->parent; /* no memory child, walk up */
-if (parent)
-  /* use parent->memory_first_child (and its siblings if there are multiple local NUMA nodes) */
-

The list of local NUMA nodes (usually a single one) is also described by the nodeset attribute of each object (which contains the physical indexes of these nodes). Iterating over the NUMA level is also an easy way to find local NUMA nodes:

hwloc_obj_t tmp = NULL;
-while ((tmp = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NUMANODE, tmp)) != NULL) {
-  if (hwloc_bitmap_isset(obj->nodeset, tmp->os_index))
-    /* tmp is a NUMA node local to obj, use it */
-}
-

Similarly finding objects that are close to a given NUMA nodes should be updated too. Instead of looking at the NUMA node parents/children, one should now find a Normal parent above that NUMA node, and then look at its parents/children as usual:

hwloc_obj_t tmp = obj->parent;
-while (hwloc_obj_type_is_memory(tmp))
-  tmp = tmp->parent;
-/* now use tmp instead of obj */
-

To avoid such hwloc v2.x-specific and NUMA-specific cases in the code, a generic lookup for any kind of object, including NUMA nodes, might also be implemented by iterating over a level. For instance finding an object of type type which either contains or is included in object obj can be performed by traversing the level of that type and comparing CPU sets:

hwloc_obj_t tmp = NULL;
-while ((tmp = hwloc_get_next_obj_by_type(topology, type, tmp)) != NULL) {
-  if (hwloc_bitmap_intersects(tmp->cpuset, obj->cpuset))
-    /* tmp matches, use it */
-}
-

This generic lookup works whenever type or obj are Normal or Memory objects since both have CPU sets. Moreover, it is compatible with the hwloc v1.x API.

-

-

-

-

-4 Kinds of Objects and Children

-

-I/O and Misc children

-

I/O children are not in the main object children list anymore either. They are in the list starting at obj->io_first_child and whose size if obj->io_arity.

-

Misc children are not in the main object children list anymore. They are in the list starting at obj->misc_first_child nd whose size if obj->misc_arity.

-

See hwloc_obj for details about children lists.

-

hwloc_get_next_child() may still be used to iterate over all children of all lists.

-

-Kinds of objects

-

Given the above, objects may now be of 4 kinds:

    -
  • -Normal (everything not listed below, including Machine, Package, Core, PU, CPU Caches, etc);
  • -
  • -Memory (currently NUMA nodes or Memory-side Caches), attached to parents as Memory children;
  • -
  • -I/O (Bridges, PCI and OS devices), attached to parents as I/O children;
  • -
  • -Misc objects, attached to parents as Misc children.
  • -
-

See hwloc_obj for details about children lists.

-

For a given object type, the kind may be found with hwloc_obj_type_is_normal(), hwloc_obj_type_is_memory(), hwloc_obj_type_is_normal(), or comparing with HWLOC_OBJ_MISC.

-

Normal and Memory objects have (non-NULL) CPU sets and nodesets, while I/O and Misc objects don't have any sets (they are NULL).

-

-

-

-

-HWLOC_OBJ_CACHE replaced

-

Instead of a single HWLOC_OBJ_CACHE, there are now 8 types HWLOC_OBJ_L1CACHE, ..., HWLOC_OBJ_L5CACHE, HWLOC_OBJ_L1ICACHE, ..., HWLOC_OBJ_L3ICACHE.

-

Cache object attributes are unchanged.

-

hwloc_get_cache_type_depth() is not needed to disambiguate cache types anymore since new types can be passed to hwloc_get_type_depth() without ever getting HWLOC_TYPE_DEPTH_MULTIPLE anymore.

-

hwloc_obj_type_is_cache(), hwloc_obj_type_is_dcache() and hwloc_obj_type_is_icache() may be used to check whether a given type is a cache, data/unified cache or instruction cache.

-

-

-

-

-allowed_cpuset and allowed_nodeset only in the main topology

-

Objects do not have allowed_cpuset and allowed_nodeset anymore. They are only available for the entire topology using hwloc_topology_get_allowed_cpuset() and hwloc_topology_get_allowed_nodeset().

-

As usual, those are only needed when the INCLUDE_DISALLOWED topology flag is given, which means disallowed objects are kept in the topology. If so, one may find out whether some PUs inside an object is allowed by checking

hwloc_bitmap_intersects(obj->cpuset, hwloc_topology_get_allowed_cpuset(topology))
-

Replace cpusets with nodesets for NUMA nodes. To find out which ones, replace intersects() with and() to get the actual intersection.

-

-

-

-

-Object depths are now signed int

-

obj->depth as well as depths given to functions such as hwloc_get_obj_by_depth() or returned by hwloc_topology_get_depth() are now signed int.

-

Other depth such as cache-specific depth attribute are still unsigned.

-

-

-

-

-Memory attributes become NUMANode-specific

-

Memory attributes such as obj->memory.local_memory are now only available in NUMANode-specific attributes in obj->attr->numanode.local_memory.

-

obj->memory.total_memory is available in all objects as obj->total_memory.

-

See hwloc_obj_attr_u::hwloc_numanode_attr_s and hwloc_obj for details.

-

-

-

-

-Topology configuration changes

-

The old ignoring API as well as several configuration flags are replaced with the new filtering API, see hwloc_topology_set_type_filter() and its variants, and hwloc_type_filter_e for details.

-
    -
  • -

    hwloc_topology_ignore_type(), hwloc_topology_ignore_type_keep_structure() and hwloc_topology_ignore_all_keep_structure() are respectively superseded by

    hwloc_topology_set_type_filter(topology, type, HWLOC_TYPE_FILTER_KEEP_NONE);
    -hwloc_topology_set_type_filter(topology, type, HWLOC_TYPE_FILTER_KEEP_STRUCTURE);
    -hwloc_topology_set_all_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_STRUCTURE);
    -

    Also, the meaning of KEEP_STRUCTURE has changed (only entire levels may be ignored, instead of single objects), the old behavior is not available anymore.

    -

    -
  • -
  • -

    HWLOC_TOPOLOGY_FLAG_ICACHES is superseded by

    hwloc_topology_set_icache_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_ALL);
    -

    -
  • -
  • -

    HWLOC_TOPOLOGY_FLAG_WHOLE_IO, HWLOC_TOPOLOGY_FLAG_IO_DEVICES and HWLOC_TOPOLOGY_FLAG_IO_BRIDGES replaced.

    -

    To keep all I/O devices (PCI, Bridges, and OS devices), use:

    hwloc_topology_set_io_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_ALL);
    -

    To only keep important devices (Bridges with children, common PCI devices and OS devices):

    hwloc_topology_set_io_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_IMPORTANT);
    -

    -
  • -
-

-

-

-

-XML changes

-

2.0 XML files are not compatible with 1.x

-

2.0 can load 1.x files, but only NUMA distances are imported. Other distance matrices are ignored (they were never used by default anyway).

-

2.0 can export 1.x-compatible files, but only distances attached to the root object are exported (i.e. distances that cover the entire machine). Other distance matrices are dropped (they were never used by default anyway).

-

Users are advised to negociate hwloc versions between exporter and importer: If the importer isn't 2.x, the exporter should export to 1.x. Otherwise, things should work by default.

-

Hence hwloc_topology_export_xml() and hwloc_topology_export_xmlbuffer() have a new flags argument. to force a hwloc-1.x-compatible XML export.

    -
  • -If both always support 2.0, don't pass any flag.
  • -
  • -When the importer uses hwloc 1.x, export with HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1. Otherwise the importer will fail to import.
  • -
  • -When the exporter uses hwloc 1.x, it cannot pass any flag, and a 2.0 importer can import without problem.
  • -
-
#if HWLOC_API_VERSION >= 0x20000
-   if (need 1.x compatible XML export)
-      hwloc_topology_export_xml(...., HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1);
-   else /* need 2.x compatible XML export */
-      hwloc_topology_export_xml(...., 0);
-#else
-   hwloc_topology_export_xml(....);
-#endif
-

Additionally, hwloc_topology_diff_load_xml(), hwloc_topology_diff_load_xmlbuffer(), hwloc_topology_diff_export_xml(), hwloc_topology_diff_export_xmlbuffer() and hwloc_topology_diff_destroy() lost the topology argument: The first argument (topology) isn't needed anymore.

-

-

-

-

-Distances API totally rewritten

-

The new distances API is in hwloc/distances.h.

-

Distances are not accessible directly from objects anymore. One should first call hwloc_distances_get() (or a variant) to retrieve distances (possibly with one call to get the number of available distances structures, and another call to actually get them). Then it may consult these structures, and finally release them.

-

The set of object involved in a distances structure is specified by an array of objects, it may not always cover the entire machine or so.

-

-

-

-

-Return values of functions

-

Bitmap functions (and a couple other functions) can return errors (in theory).

-

Most bitmap functions may have to reallocate the internal bitmap storage. In v1.x, they would silently crash if realloc failed. In v2.0, they now return an int that can be negative on error. However, the preallocated storage is 512 bits, hence realloc will not even be used unless you run hwloc on machines with larger PU or NUMAnode indexes.

-

hwloc_obj_add_info(), hwloc_cpuset_from_nodeset() and hwloc_cpuset_from_nodeset() also return an int, which would be -1 in case of allocation errors.

-

-

-

-

-Misc API changes

- -

-

-

-

-API removals and deprecations

-
    -
  • -

    HWLOC_OBJ_SYSTEM removed: The root object is always HWLOC_OBJ_MACHINE

    -

    -
  • -
  • -

    _membind_nodeset() memory binding interfaces deprecated: One should use the variant without _nodeset suffix and pass the HWLOC_MEMBIND_BYNODESET flag.

    -

    -
  • -
  • -

    HWLOC_MEMBIND_REPLICATE removed: no supported operating system supports it anymore.

    -

    -
  • -
  • -

    hwloc_obj_snprintf() removed because it was long-deprecated by hwloc_obj_type_snprintf() and hwloc_obj_attr_snprintf().

    -

    -
  • -
  • -

    hwloc_obj_type_sscanf() deprecated, hwloc_obj_type_of_string() removed.

    -

    -
  • -
  • -

    hwloc_cpuset_from/to_nodeset_strict() deprecated: Now useless since all topologies are NUMA. Use the variant without the _strict suffix

    -

    -
  • -
  • -

    hwloc_distribute() and hwloc_distributev() removed, deprecated by hwloc_distrib().

    -

    -
  • -
  • -

    The Custom interface (hwloc_topology_set_custom(), etc.) was removed, as well as the corresponding command-line tools (hwloc-assembler, etc.). Topologies always start with object with valid cpusets and nodesets.

    -

    -
  • -
  • -

    obj->online_cpuset removed: Offline PUs are simply listed in the complete_cpuset as previously.

    -

    -
  • -
  • -

    obj->os_level removed.

    -

    -
  • -
-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00380.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00380.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00380.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00380.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): Network Locality (netloc) - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
-
-
Network Locality (netloc)
-
-
-

-

-

-

Portable abstraction of network topologies for high-performance computing.

-

The netloc documentation spans of these sections:

-

-

-

-

-Netloc Summary

-

The Portable Network Locality (netloc) software package provides network topology discovery tools, and an abstract representation of those networks topologies for a range of network types and configurations. It is provided as a companion to the Portable Hardware Locality (hwloc) package. These two software packages work together to provide a comprehensive view of the HPC system topology, spanning from the processor cores in one server to the cores in another - including the complex network(s) in between.

-

Towards this end, netloc is divided into two sets of components. The first tools are for the admin to extract the information about the topology of the machines with topology discovery tools for each network type and discovery technique (called readers). The second set of tools is for the user to exploit the collected information: to display the topology or create a topology-aware mapping of the processes of an application.

-
-netloc_design.png -
-

-

-

-

-Supported Networks

-

For now, only InfiniBand (See Setup) is supported, but it is planned to be extended it very soon.

-

-

-

-

-Netloc Installation

-

The generic installation procedure for both hwloc and netloc is described in Installation.

-

Note that netloc is currently not supported on as many platforms as the original hwloc project. netloc is enabled by default when supported, or can be disabled by passing --disable-netloc to the configure command-line.

-

-

-

-

-Setup

-

To use Netloc tools, we need two steps. The first step consists in getting information about network directly from tools distributed by manufacturers. For Infiniband, for instance, this operation needs privileges to access to the network device. For this step we have wrappers in Netloc that will call the right tools with the right options.

-

The second step will transform the raw files generated by manufacturer tools, into files in a format readable by Netloc tools, and that will not depend on network technologies.

-

To be clear, let's take an example with Infiniband. This first step is handled by netloc_ib_gather_raw that will call ibnetdiscover and ibroutes tools to generate the necessary raw data files. The step has to be run by an administrator, since the Infiniband tools need to access to the network device.

-
shell$ netloc_ib_gather_raw --help
-Usage: netloc_ib_gather_raw [options] <outdir>
-  Dumps topology information to <outdir>/ib-raw/
-  Subnets are guessed from the <outdir>/hwloc/ directory where
-  the hwloc XML exports of some nodes are stored.
-Options:
- --sudo
-    Pass sudo to internal ibnetdiscover and ibroute invocations.
-    Useful when the entire script cannot run as root.
- --hwloc-dir <dir>
-    Use <dir> instead of <outdir>/hwloc/ for hwloc XML exports.
- --force-subnet [<subnet>:]<board>:<port> to force the discovery
-    Do not guess subnets from hwloc XML exports.
-    Force discovery on local board <board> port <port>
-    and optionally force the subnet id <subnet>
-    instead of reading it from the first GID.
-    Examples: --force-subnet mlx4_0:1
-              --force-subnet fe80:0000:0000:0000:mlx4_0:1
- --ibnetdiscover /path/to/ibnetdiscover
- --ibroute /path/to/ibroute
-    Specify exact location of programs. Default is /usr/bin/<program>
- --sleep <n>
-    Sleep for <n> seconds between invocations of programs probing the network
- --ignore-errors
-    Ignore errors from ibnetdiscover and ibroute, assume their outputs are ok
- --force -f
-    Always rediscover to overwrite existing files without asking
- --verbose -v
-    Add verbose messages
- --dry-run
-    Do not actually run programs or modify anything
- --help -h
-    Show this help
-
-shell$ ./netloc_ib_gather_raw /home/netloc/data
-WARNING: Not running as root.
-Using /home/netloc/data/hwloc as hwloc lstopo XML directory.
-
-Exporting local node hwloc XML...
-  Running lstopo-no-graphics...
-
-Found 1 subnets in hwloc directory:
- Subnet fe80:0000:0000:0000 is locally accessible from board qib0 port 1.
-
-Looking at fe80:0000:0000:0000 (through local board qib0 port 1)...
- Running ibnetdiscover...
- Getting routes...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L112' LID 18...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L108' LID 20...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L102' LID 23...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L104' LID 25...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L106' LID 24...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L114' LID 22...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L116' LID 21...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L109' LID 12...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L111' LID 11...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L107' LID 13...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L103' LID 17...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L105' LID 16...
-  Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L113' LID 15...
-

The second step, that can be done by a regular user, is done by the tool netloc_ib_extract_dats.

-
shell$ netloc_ib_extract_dats --help
-Usage: netloc_ib_extract_dats <path to input raw data files> <output path> [--hwloc-dir
-<hwloc xml path>]
-        hwloc-dir can be an absolute path or a relative path from output path
-
-shell$ netloc_ib_extract_dats /home/netloc/data/ib-raw /home/netloc/data/netloc \
-  --hwloc-dir ../hwloc
-Read subnet: fe80:0000:0000:0000
-2 partitions found
-        'node'
-        'admin'
-

-

-

-

-Topology display

-

Netloc provides a tool, netloc_draw.html, that displays a topology in a web browser, by using a JSON file.

-

-Generate the JSON file

-

In order to display a topology, Netloc needs to generate a JSON file corresponding to a topology. For this operation, the user must run netloc_draw_to_json.

-
shell$ netloc_draw_to_json --help
-Usage: netloc_draw_to_json <path to topology directory>
-
-shell$ netloc_draw_to_json /home/netloc/data/netloc
-

The netloc_draw_to_json command will write a JSON file for each topology file found in the input directory. The output files, written also in the input directory, can be open by netloc_draw.html in a web browser.

-

-Using netloc_draw

-

Once the JSON file is opened, the rendering is generated by the Javascript vis library for computing the position of the nodes. From the interface, it is possible to search for a specific node, to color the nodes, to expand merged switches, to show statistics, to export as an image... The user can interact with the nodes by moving them. For now, there are bugs and other nodes might move too.

-

The placement of the nodes is done statically if the topology is detected as a tree. If not, vis.js will use physics to find good positions, and it can be very time consuming.

-
-netloc_draw.png -
-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00381.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00381.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/a00381.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/a00381.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ - - - - - - - -Hardware Locality (hwloc): Netloc with Scotch - - - - - - -
-
- - - - - - -
-
Hardware Locality (hwloc) -  2.1.0 -
-
-
- - - - - - -
-
-
-
Netloc with Scotch
-
-
-

-

-

-

Scotch is a toolbox for graph partitioning [XXX], that can do mapping between a communication graph and an architecture. Netloc interfaces with Scotch, by getting the topology of the machine and building the Scotch architecture. It is also possible to directly build a mapping file that can be given to mpirun.

-

-

-

-

-Introduction

-

Scotch is able to deal architectures to represent the topology of a complete machine. Scotch handles several types of topologies: complete graphs, hypercubes, fat trees, meshes, torus, and random graphs. Moreover, Scotch is able to manage parts of architectures that are called sub-architectures. Thus, from a complete architecture, we can create a sub-architecture that will represent the available resources of the complete machine.

-

-

-

-

-Setup

-

The first step in order to use Netloc tools is to discover the network. For this task, we provide tools called netloc_gather that are wrappers to the dedicated tools provided by the manufacturer of the network, that generate the raw data given by the devices. This task needs privileges to access to the network devices. Once, this task is completed, the raw data is converted in a generic format independent to the fabric by extract_dats. Figure 1 shows how the different modules of Netloc are linked, and what are the tools provided by Netloc.

-

-

-

-

-Tools and API

-

When the machine is discovered and all the needed files are generated as seen previously, a user can call the netlocscotch functions from the API and interact with Scotch.

-

-Build Scotch architectures

-

Netloc provides a function to export the built topology into the Scotch format. That will give the possibility to the user to play with the topology in Scotch. Since Netloc matches the discovered topology with known topologies, the Scotch architecture won’t be random graphs but known topologies also in Scotch that will lead to optimized graph algorithms. This function is called netlocscotch_build_arch.

-

When the network topology is a tree, the topology converted by netlocscotch is the complete topology of the machine containing intranode topologies from hwloc. In this case, merging the two levels results in a bigger tree. For other network topologies, the global graph created for Scotch is a generic graph since it not not (at this moment) possible to create nested known architectures.

-

-Build Scotch sub-architectures

-

Most of the time, the user does not have access to the complete machine. He uses a resource manager to run his application and he will gain access only to a set of nodes. In this case getting the Scotch architecture of the complete machine is not relevant. Fortunately, Netloc is also able to build a Scotch sub-architecture that will contain only the available nodes. For this operation the user needs to run a specific program, netloc_get_resources, that will record in a file, the lists of available nodes and available cores by using MPI and hwloc. From this file, the function netlocscotch_build_subarch will build the Scotch sub-architecture.

-

-Mapping of processes

-

A main goal in having all these data about the network topology, especially in Scotch structures, is to help the process placement. For that, we use the mapping of a process graph to the architecture provided by Scotch. As we have seen previously, Netloc is able to detect the structure of the topology and will build the adapted Scotch architecture that will be more efficient than a random structure.

-

In case, the network topology is not a tree, netlocscotch converts the complete topology into a generic graph. The drawback in that is the Scotch graph algorithms are less efficient. To overcome that, netlocscotch does two steps of mapping: first it maps the processes to the nodes, and then for each node maps the processes to the cores. We have to conduct tests to check if the method gives better results than using a generic graph directly.

-

The other input needed in Scotch is the process graph. Since we want to optimize the placement to decrease the communication time, a good metric for building the application graph is the amount of communications between all pairs of processes. Studies still have to be done to choose, in the most efficient way, what we take into account to define the amount of communications between the number of messages, the size of messages... This information will be transformed into a process graph.

-

Once we have a good mapping computed by Scotch, we can give it to the user, or Netloc can even generate the corresponding rank file useful to MPI.

-
- - - - diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/annotated.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/annotated.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/annotated.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/annotated.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): Data Structures @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
@@ -44,34 +45,34 @@
Here are the data structures with brief descriptions:
[detail level 123]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Chwloc_backendDiscovery backend structure
 Chwloc_cl_device_topology_amd
 Chwloc_componentGeneric component structure
 Chwloc_disc_componentDiscovery component structure
 Chwloc_disc_statusDiscovery status structure
 Chwloc_distances_sMatrix of distances between a set of objects
 Chwloc_info_sObject info
 Chwloc_objStructure of a topology object
 Chwloc_obj_attr_uObject type-specific Attributes
 Chwloc_bridge_attr_sBridge specific Object Attribues
 Chwloc_cache_attr_sCache-specific Object Attributes
 Chwloc_group_attr_sGroup-specific Object Attributes
 Chwloc_numanode_attr_sNUMA node-specific Object Attributes
 Chwloc_memory_page_type_sArray of local memory page types, NULL if no local memory and page_types is 0
 Chwloc_osdev_attr_sOS Device specific Object Attributes
 Chwloc_pcidev_attr_sPCI Device specific Object Attributes
 Chwloc_topology_cpubind_supportFlags describing actual PU binding support for this topology
 Chwloc_topology_diff_obj_attr_uOne object attribute difference
 Chwloc_topology_diff_obj_attr_generic_s
 Chwloc_topology_diff_obj_attr_string_sString attribute modification with an optional name
 Chwloc_topology_diff_obj_attr_uint64_sInteger attribute modification with an optional index
 Chwloc_topology_diff_uOne element of a difference list between two topologies
 Chwloc_topology_diff_generic_s
 Chwloc_topology_diff_obj_attr_s
 Chwloc_topology_diff_too_complex_s
 Chwloc_topology_discovery_supportFlags describing actual discovery support for this topology
 Chwloc_topology_membind_supportFlags describing actual memory binding support for this topology
 Chwloc_topology_supportSet of flags describing actual support for this topology
 Chwloc_backendDiscovery backend structure
 Chwloc_cl_device_topology_amd
 Chwloc_componentGeneric component structure
 Chwloc_disc_componentDiscovery component structure
 Chwloc_disc_statusDiscovery status structure
 Chwloc_distances_sMatrix of distances between a set of objects
 Chwloc_info_sObject info
 Chwloc_objStructure of a topology object
 Chwloc_obj_attr_uObject type-specific Attributes
 Chwloc_bridge_attr_sBridge specific Object Attribues
 Chwloc_cache_attr_sCache-specific Object Attributes
 Chwloc_group_attr_sGroup-specific Object Attributes
 Chwloc_numanode_attr_sNUMA node-specific Object Attributes
 Chwloc_memory_page_type_sArray of local memory page types, NULL if no local memory and page_types is 0
 Chwloc_osdev_attr_sOS Device specific Object Attributes
 Chwloc_pcidev_attr_sPCI Device specific Object Attributes
 Chwloc_topology_cpubind_supportFlags describing actual PU binding support for this topology
 Chwloc_topology_diff_obj_attr_uOne object attribute difference
 Chwloc_topology_diff_obj_attr_generic_s
 Chwloc_topology_diff_obj_attr_string_sString attribute modification with an optional name
 Chwloc_topology_diff_obj_attr_uint64_sInteger attribute modification with an optional index
 Chwloc_topology_diff_uOne element of a difference list between two topologies
 Chwloc_topology_diff_generic_s
 Chwloc_topology_diff_obj_attr_s
 Chwloc_topology_diff_too_complex_s
 Chwloc_topology_discovery_supportFlags describing actual discovery support for this topology
 Chwloc_topology_membind_supportFlags describing actual memory binding support for this topology
 Chwloc_topology_supportSet of flags describing actual support for this topology
@@ -79,7 +80,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/classes.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/classes.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/classes.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/classes.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): Data Structure Index @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
@@ -45,12 +46,41 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  h  
-
hwloc_component   hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s   hwloc_topology_cpubind_support   hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s   
hwloc_disc_component   hwloc_obj_attr_u::hwloc_numanode_attr_s   hwloc_topology_diff_u::hwloc_topology_diff_generic_s   hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s   
hwloc_backend   hwloc_disc_status   hwloc_obj   hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s   hwloc_topology_diff_u   
hwloc_obj_attr_u::hwloc_bridge_attr_s   hwloc_distances_s   hwloc_obj_attr_u   hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s   hwloc_topology_discovery_support   
hwloc_obj_attr_u::hwloc_cache_attr_s   hwloc_obj_attr_u::hwloc_group_attr_s   hwloc_obj_attr_u::hwloc_osdev_attr_s   hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s   hwloc_topology_membind_support   
hwloc_cl_device_topology_amd   hwloc_info_s   hwloc_obj_attr_u::hwloc_pcidev_attr_s   hwloc_topology_diff_obj_attr_u   hwloc_topology_support   
hwloc_component   hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s   hwloc_topology_cpubind_support   hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s   
hwloc_disc_component   hwloc_obj_attr_u::hwloc_numanode_attr_s   hwloc_topology_diff_u::hwloc_topology_diff_generic_s   hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s   
hwloc_backend   hwloc_disc_status   hwloc_obj   hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s   hwloc_topology_diff_u   
hwloc_obj_attr_u::hwloc_bridge_attr_s   hwloc_distances_s   hwloc_obj_attr_u   hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s   hwloc_topology_discovery_support   
hwloc_obj_attr_u::hwloc_cache_attr_s   hwloc_obj_attr_u::hwloc_group_attr_s   hwloc_obj_attr_u::hwloc_osdev_attr_s   hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s   hwloc_topology_membind_support   
hwloc_cl_device_topology_amd   hwloc_info_s   hwloc_obj_attr_u::hwloc_pcidev_attr_s   hwloc_topology_diff_obj_attr_u   hwloc_topology_support   
@@ -59,7 +89,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/dir_5cb306d949c7931a3b6c77517393dd34.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/dir_5cb306d949c7931a3b6c77517393dd34.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/dir_5cb306d949c7931a3b6c77517393dd34.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/dir_5cb306d949c7931a3b6c77517393dd34.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): hwloc Directory Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */ @@ -89,7 +88,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/dir_d44c64559bbebec7f509842c48db8b23.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/dir_d44c64559bbebec7f509842c48db8b23.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/dir_d44c64559bbebec7f509842c48db8b23.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/dir_d44c64559bbebec7f509842c48db8b23.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): include Directory Reference @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */ @@ -64,7 +65,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/dynsections.js hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/dynsections.js --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/dynsections.js 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/dynsections.js 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,120 @@ +/* + @licstart The following is the entire license notice for the + JavaScript code in this file. + + Copyright (C) 1997-2017 by Dimitri van Heesch + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + @licend The above is the entire license notice + for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + - + Hardware Locality (hwloc): Data Fields @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
@@ -42,522 +43,522 @@

- a -

- b -

- c -

- d -

- e -

- f -

- g -

- i -

- k -

- l -

- m -

- n -

- o -

- p -

- r -

- s -

- t -

- u -

- v -

@@ -565,7 +566,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/functions_vars.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/functions_vars.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/functions_vars.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/functions_vars.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): Data Fields - Variables @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@ - + +/* @license-end */
@@ -42,522 +43,522 @@

- a -

- b -

- c -

- d -

- e -

- f -

- g -

- i -

- k -

- l -

- m -

- n -

- o -

- p -

- r -

- s -

- t -

- u -

- v -

@@ -565,7 +566,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/index.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/index.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/index.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/index.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): Hardware Locality @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,23 +27,24 @@ - + +/* @license-end */ -
+
Hardware Locality

Portable abstraction of parallel architectures for high-performance computing

-
+

@@ -52,9 +53,9 @@

The Hardware Locality (hwloc) software project aims at easing the process of discovering hardware resources in parallel architectures. It offers command-line tools and a C API for consulting these resources, their locality, attributes, and interconnection. hwloc primarily aims at helping high-performance computing (HPC) applications, but is also applicable to any project seeking to exploit code and/or data locality on modern computing platforms.

hwloc is actually made of two subprojects distributed together:

See also the Related pages tab above for links to other sections. @@ -72,7 +73,7 @@

shell$ ./configure --prefix=...
 shell$ make
 shell$ make install
-

hwloc- and netloc-specific configure options and requirements are documented in sections hwloc Installation and Netloc Installation respectively.

+

hwloc- and netloc-specific configure options and requirements are documented in sections hwloc Installation and Netloc Installation respectively.

Also note that if you install supplemental libraries in non-standard locations, hwloc's configure script may not be able to find them without some help. You may need to specify additional CPPFLAGS, LDFLAGS, or PKG_CONFIG_PATH values on the configure command line.

For example, if libpciaccess was installed into /opt/pciaccess, hwloc's configure script may not find it be default. Try adding PKG_CONFIG_PATH to the ./configure command line, like this:

./configure PKG_CONFIG_PATH=/opt/pciaccess/lib/pkgconfig ...
@@ -92,13 +93,14 @@
 Questions and Bugs
 

Bugs should be reported in the tracker (https://github.com/open-mpi/hwloc/issues). Opening a new issue automatically displays lots of hints about how to debug and report issues.

Questions may be sent to the users or developers mailing lists (http://www.open-mpi.org/community/lists/hwloc.php).

-

There is also a #hwloc IRC channel on Freenode (irc.freenode.net).

-
+

There is also a #hwloc IRC channel on Freenode (irc.freenode.net).

+
+
diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/menudata.js hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/menudata.js --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/menudata.js 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/menudata.js 2020-03-30 18:07:31.000000000 +0000 @@ -1,3 +1,25 @@ +/* +@licstart The following is the entire license notice for the +JavaScript code in this file. + +Copyright (C) 1997-2019 by Dimitri van Heesch + +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as published by +the Free Software Foundation + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +@licend The above is the entire license notice +for the JavaScript code in this file +*/ var menudata={children:[ {text:"Main Page",url:"index.html"}, {text:"Related Pages",url:"pages.html"}, diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/modules.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/modules.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/modules.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/modules.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): Modules @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@ - + +/* @license-end */
@@ -44,56 +45,55 @@
Here is a list of all modules:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 API version
 Object Sets (hwloc_cpuset_t and hwloc_nodeset_t)
 Object Types
 Object Structure and Attributes
 Topology Creation and Destruction
 Object levels, depths and types
 Converting between Object Types and Attributes, and Strings
 Consulting and Adding Key-Value Info Attributes
 CPU binding
 Memory binding
 Changing the Source of Topology Discovery
 Topology Detection Configuration and Query
 Modifying a loaded Topology
 Finding Objects inside a CPU set
 Finding Objects covering at least CPU set
 Looking at Ancestor and Child Objects
 Kinds of object Type
 Looking at Cache Objects
 Finding objects, miscellaneous helpers
 Distributing items over a topology
 CPU and node sets of entire topologies
 Converting between CPU sets and node sets
 Finding I/O objects
 The bitmap API
 Exporting Topologies to XML
 Exporting Topologies to Synthetic
 Retrieve distances between objects
 Helpers for consulting distance matrices
 Add or remove distances between objects
 Linux-specific helpers
 Interoperability with Linux libnuma unsigned long masks
 Interoperability with Linux libnuma bitmask
 Interoperability with glibc sched affinity
 Interoperability with OpenCL
 Interoperability with the CUDA Driver API
 Interoperability with the CUDA Runtime API
 Interoperability with the NVIDIA Management Library
 Interoperability with OpenGL displays
 Interoperability with Intel Xeon Phi (MIC)
 Interoperability with OpenFabrics
 Topology differences
 Sharing topologies between processes
 Components and Plugins: Discovery components
 Components and Plugins: Discovery backends
 Components and Plugins: Generic components
 Components and Plugins: Core functions to be used by components
 Components and Plugins: Filtering objects
 Components and Plugins: helpers for PCI discovery
 Components and Plugins: finding PCI objects during other discoveries
 Netloc API
 API version
 Object Sets (hwloc_cpuset_t and hwloc_nodeset_t)Hwloc uses bitmaps to represent two distinct kinds of object sets: CPU sets (hwloc_cpuset_t) and NUMA node sets (hwloc_nodeset_t). These types are both typedefs to a common back end type (hwloc_bitmap_t), and therefore all the hwloc bitmap functions are applicable to both hwloc_cpuset_t and hwloc_nodeset_t (see The bitmap API)
 Object Types
 Object Structure and Attributes
 Topology Creation and Destruction
 Object levels, depths and typesBe sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers
 Converting between Object Types and Attributes, and Strings
 Consulting and Adding Key-Value Info Attributes
 CPU bindingSome operating systems only support binding threads or processes to a single PU. Others allow binding to larger sets such as entire Cores or Packages or even random sets of invididual PUs. In such operating system, the scheduler is free to run the task on one of these PU, then migrate it to another PU, etc. It is often useful to call hwloc_bitmap_singlify() on the target CPU set before passing it to the binding function to avoid these expensive migrations. See the documentation of hwloc_bitmap_singlify() for details
 Memory bindingMemory binding can be done three ways:
 Changing the Source of Topology DiscoveryIf none of the functions below is called, the default is to detect all the objects of the machine that the caller is allowed to access
 Topology Detection Configuration and QuerySeveral functions can optionally be called between hwloc_topology_init() and hwloc_topology_load() to configure how the detection should be performed, e.g. to ignore some objects types, define a synthetic topology, etc
 Modifying a loaded Topology
 Finding Objects inside a CPU set
 Finding Objects covering at least CPU set
 Looking at Ancestor and Child ObjectsBe sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers
 Kinds of object TypeEach object type is either Normal (i.e. hwloc_obj_type_is_normal() returns 1), or Memory (i.e. hwloc_obj_type_is_memory() returns 1) or I/O (i.e. hwloc_obj_type_is_io() returns 1) or Misc (i.e. equal to HWLOC_OBJ_MISC). It cannot be of more than one of these kinds
 Looking at Cache Objects
 Finding objects, miscellaneous helpersBe sure to see the figure in Terms and Definitions that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers
 Distributing items over a topology
 CPU and node sets of entire topologies
 Converting between CPU sets and node sets
 Finding I/O objects
 The bitmap APIThe hwloc_bitmap_t type represents a set of integers (positive or null). A bitmap may be of infinite size (all bits are set after some point). A bitmap may even be full if all bits are set
 Exporting Topologies to XML
 Exporting Topologies to Synthetic
 Retrieve distances between objects
 Helpers for consulting distance matrices
 Add or remove distances between objects
 Linux-specific helpersThis includes helpers for manipulating Linux kernel cpumap files, and hwloc equivalents of the Linux sched_setaffinity and sched_getaffinity system calls
 Interoperability with Linux libnuma unsigned long masksThis interface helps converting between Linux libnuma unsigned long masks and hwloc cpusets and nodesets
 Interoperability with Linux libnuma bitmaskThis interface helps converting between Linux libnuma bitmasks and hwloc cpusets and nodesets
 Interoperability with glibc sched affinityThis interface offers ways to convert between hwloc cpusets and glibc cpusets such as those manipulated by sched_getaffinity() or pthread_attr_setaffinity_np()
 Interoperability with OpenCLThis interface offers ways to retrieve topology information about OpenCL devices
 Interoperability with the CUDA Driver APIThis interface offers ways to retrieve topology information about CUDA devices when using the CUDA Driver API
 Interoperability with the CUDA Runtime APIThis interface offers ways to retrieve topology information about CUDA devices when using the CUDA Runtime API
 Interoperability with the NVIDIA Management LibraryThis interface offers ways to retrieve topology information about devices managed by the NVIDIA Management Library (NVML)
 Interoperability with OpenGL displaysThis interface offers ways to retrieve topology information about OpenGL displays
 Interoperability with OpenFabricsThis interface offers ways to retrieve topology information about OpenFabrics devices (InfiniBand, Omni-Path, usNIC, etc)
 Topology differencesApplications that manipulate many similar topologies, for instance one for each node of a homogeneous cluster, may want to compress topologies to reduce the memory footprint
 Sharing topologies between processesThese functions are used to share a topology between processes by duplicating it into a file-backed shared-memory buffer
 Components and Plugins: Discovery components
 Components and Plugins: Discovery backends
 Components and Plugins: Generic components
 Components and Plugins: Core functions to be used by components
 Components and Plugins: Filtering objects
 Components and Plugins: helpers for PCI discovery
 Components and Plugins: finding PCI objects during other discoveries
 Netloc API
@@ -101,7 +101,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/pages.html hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/pages.html --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/pages.html 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/pages.html 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ - + - + Hardware Locality (hwloc): Related Pages @@ -19,7 +19,7 @@
Hardware Locality (hwloc) -  2.1.0 +  2.2.0
@@ -27,14 +27,15 @@
- + +/* @license-end */
@@ -44,24 +45,24 @@ @@ -69,7 +70,7 @@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/tabs.css hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/tabs.css --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/html/tabs.css 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/html/tabs.css 2020-03-30 18:07:31.000000000 +0000 @@ -1 +1 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:transparent}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255,255,255,0.9);color:#283A5D;outline:none}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a:hover span.sub-arrow{border-color:#fff transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #fff}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255,255,255,0.9);color:#283A5D;outline:none}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a:hover span.sub-arrow{border-color:#fff transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #fff}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} Binary files /tmp/tmpaGyMG3/VapXCpg9HS/hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/hwloc-a4.pdf and /tmp/tmpaGyMG3/2l0cz8xaq9/hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/hwloc-a4.pdf differ Binary files /tmp/tmpaGyMG3/VapXCpg9HS/hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/hwloc-letter.pdf and /tmp/tmpaGyMG3/2l0cz8xaq9/hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/hwloc-letter.pdf differ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/hwloc.tag hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/hwloc.tag --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/hwloc.tag 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/hwloc.tag 2020-03-30 18:07:31.000000000 +0000 @@ -2,781 +2,781 @@ hwloc_backend - a00359.html + a00355.html unsigned phases - a00359.html + a00355.html aeca769840a6ff03e96462a9533adbccd unsigned long flags - a00359.html + a00355.html aaa8eafe495aadd81c2e3c4ec527c10ba int is_thissystem - a00359.html + a00355.html ab8806f6db077f1bb2e9d63ec99223f7a void * private_data - a00359.html + a00355.html a2ea5bd36b7f06efdb65b98b32af16c68 void(* disable - a00359.html + a00355.html a36c4fa86350525b46340c67b802c69c7 )(struct hwloc_backend *backend) int(* discover - a00359.html + a00355.html accff2cd8404be43c3b44cec05e6f609b )(struct hwloc_backend *backend, struct hwloc_disc_status *status) int(* get_pci_busid_cpuset - a00359.html + a00355.html aaac253491264c20930f44817270bc502 )(struct hwloc_backend *backend, struct hwloc_pcidev_attr_s *busid, hwloc_bitmap_t cpuset) hwloc_obj_attr_u::hwloc_bridge_attr_s - a00263.html + a00259.html struct hwloc_pcidev_attr_s pci - a00263.html + a00259.html ab5c564e7c95b747dae9eb84ec0a2c31e union hwloc_obj_attr_u::hwloc_bridge_attr_s::@0 upstream - a00263.html - a00ce9d99fc8792d1044fe25dc58605fe + a00259.html + ab62888c880f8bb730292722f5811958d hwloc_obj_bridge_type_t upstream_type - a00263.html + a00259.html a265dd2164aa2df4972e25a029da72125 unsigned short domain - a00263.html + a00259.html a2c31e565a5f0d23d0a0a3dd3ec8f4b17 unsigned char secondary_bus - a00263.html + a00259.html ae2d9dd73ef1d32045c584a8e66d2f83f unsigned char subordinate_bus - a00263.html + a00259.html af3f3f7d76bf03e8d2afa721c2b8d6771 struct hwloc_obj_attr_u::hwloc_bridge_attr_s::@1::@2 pci - a00263.html - a5a20be20e09d811d141b6332ff864706 + a00259.html + a2fdc40034b915d504724b35cc776a4ec union hwloc_obj_attr_u::hwloc_bridge_attr_s::@1 downstream - a00263.html - acaf1ae02e37182bbb6966f8c4f35e499 + a00259.html + a7d5db91d655ba23ffe9bda7a2cbcb9a8 hwloc_obj_bridge_type_t downstream_type - a00263.html + a00259.html ac6a169b672d0e9f75756fd5665828b93 unsigned depth - a00263.html + a00259.html a336c8b22893d5d734d8c9dfca4066b46 hwloc_obj_attr_u::hwloc_cache_attr_s - a00251.html + a00247.html hwloc_uint64_t size - a00251.html + a00247.html abe5e788943ed04302976740c829674c0 unsigned depth - a00251.html + a00247.html a5c8f7f39193736c2187ed626940835d5 unsigned linesize - a00251.html + a00247.html a801e8a668e28caf06c8b88e9ae5c10db int associativity - a00251.html + a00247.html ad06525e474d1e2d1423ed71bb998592d hwloc_obj_cache_type_t type - a00251.html + a00247.html ad8edc8ded2b7a70d6abbc874801930f4 hwloc_cl_device_topology_amd - a00307.html + a00303.html cl_uint type - a00307.html + a00303.html a8ec4ea89b862bb271845b48063f332b4 cl_uint data - a00307.html + a00303.html afbd6b814607b06fc5b2f36ad14420398 [5] struct hwloc_cl_device_topology_amd::@3 raw - a00307.html - ab3b58c076f09a6f66c3bef0288add64a + a00303.html + a7bba6ab297b6f44e43c5937b80b4cfb6 cl_char unused - a00307.html + a00303.html ac8650d7eea96eef290481fee980d1d47 [17] cl_char bus - a00307.html + a00303.html a4a23e3cc034b7ab105cab0e863dcab69 cl_char device - a00307.html + a00303.html a017033a953d71455b067007cabb92e9c cl_char function - a00307.html + a00303.html a77a67ac73cff98d330ef7258b240bac3 struct hwloc_cl_device_topology_amd::@4 pcie - a00307.html - abd362258740a00880a5598deb5a3e598 + a00303.html + a05e9a845012cd9d1f13a39cc35ab40a1 hwloc_component - a00363.html + a00359.html unsigned abi - a00363.html + a00359.html a3250bd6fc9713946991d805e48091b2e int(* init - a00363.html + a00359.html aea613546886d9b8221cadba920fe3ebc )(unsigned long flags) void(* finalize - a00363.html + a00359.html a4612015451a1c706e8ba19114cb8baae )(unsigned long flags) hwloc_component_type_t type - a00363.html + a00359.html a789208ada7e17492cfd3a5a88a6bb0ee unsigned long flags - a00363.html + a00359.html ab8043c5b4cc0e81aabba586ccb194335 void * data - a00363.html + a00359.html a4b8cffd1d943c29fdc102b841b8598d4 hwloc_disc_component - a00351.html + a00347.html const char * name - a00351.html + a00347.html a4064c3b5d9213027e87caebef380a840 unsigned phases - a00351.html + a00347.html a61ad3151efa02e3dbad5d919758f9c90 unsigned excluded_phases - a00351.html + a00347.html acbb9957914dbf7b8f504215aa0c8d3fe struct hwloc_backend *(* instantiate - a00351.html + a00347.html ab133956219739a1032a17131757d1961 )(struct hwloc_topology *topology, struct hwloc_disc_component *component, unsigned excluded_phases, const void *data1, const void *data2, const void *data3) unsigned priority - a00351.html + a00347.html ae86d283c272c5ae24073a235efbf6b59 unsigned enabled_by_default - a00351.html + a00347.html ace80cafe2b1732b047b3fc3da47e6517 hwloc_disc_status - a00355.html + a00351.html hwloc_disc_phase_t phase - a00355.html + a00351.html abaf7c8c082d43e133171f0723dbf824b unsigned excluded_phases - a00355.html + a00351.html a0f95fa42d46a6e7cf8dee8af12afee3a unsigned long flags - a00355.html + a00351.html ad8b123cecb945a9182eb824ccf8ef9d7 hwloc_distances_s - a00303.html + a00299.html unsigned nbobjs - a00303.html + a00299.html a4ca2af858cebbce7324ec49903d09474 hwloc_obj_t * objs - a00303.html + a00299.html af1e78b2d628d191fa6cae3fbfe891078 unsigned long kind - a00303.html + a00299.html aef9c83cf467da1b1fa4c36493febb3b5 hwloc_uint64_t * values - a00303.html + a00299.html ae43e19b2c743de05c93d71a30beaca75 hwloc_obj_attr_u::hwloc_group_attr_s - a00255.html + a00251.html unsigned depth - a00255.html + a00251.html ad914eac61c77481e1b7037877bcc5579 unsigned kind - a00255.html + a00251.html a3229f269c4cc7e63492c168535e4f0c1 unsigned subkind - a00255.html + a00251.html ad514d943960a4036ed5e44dc187c74ed unsigned char dont_merge - a00255.html + a00251.html afa253d4b70f92e940c226d61f192054f hwloc_info_s - a00283.html + a00279.html char * name - a00283.html + a00279.html a12ce1309e4381ae38b5c15d242a47124 char * value - a00283.html + a00279.html a788a0073bafe660645e7b69f31a43bbb hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s - a00247.html + a00243.html hwloc_uint64_t size - a00247.html + a00243.html a8ea7ebe9d91c7378bba03da57efc25cb hwloc_uint64_t count - a00247.html + a00243.html a98514e37d57a325b78e21ffd8d7419e0 hwloc_obj_attr_u::hwloc_numanode_attr_s - a00243.html + a00239.html hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s hwloc_uint64_t local_memory - a00243.html + a00239.html a6703cbf2afbf63c9d60c5ff4dc0c73aa unsigned page_types_len - a00243.html + a00239.html a513078122d403904e16723d30f583cb2 struct hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s * page_types - a00243.html - a66838d9d8a3934abca53089048dc28dd + a00239.html + a7e53c5024da2d7741a5cc1e7016bb8d2 hwloc_obj - a00235.html + a00231.html hwloc_obj_type_t type - a00235.html + a00231.html acc4f0803f244867e68fe0036800be5de char * subtype - a00235.html + a00231.html a5d4f97e76723a9ec8d38046f19e00d33 unsigned os_index - a00235.html + a00231.html a61a7a80a68eaccbaaa28269e678c81a9 char * name - a00235.html + a00231.html abb709ec38f2970677e4e57d1d30be96d hwloc_uint64_t total_memory - a00235.html + a00231.html a75603fc36c9284ba48ce814b772a58b6 union hwloc_obj_attr_u * attr - a00235.html + a00231.html accd40e29f71f19e88db62ea3df02adc8 int depth - a00235.html + a00231.html a4876fd165b4fff35521f07ebd85355ed unsigned logical_index - a00235.html + a00231.html a0d07fb7b8935e137c94d75a3eb492ae9 struct hwloc_obj * next_cousin - a00235.html + a00231.html a85a788017457129589318b6c39451acf struct hwloc_obj * prev_cousin - a00235.html + a00231.html ac715989f55ff5a0eb6be2969ee477ec0 struct hwloc_obj * parent - a00235.html + a00231.html adc494f6aed939992be1c55cca5822900 unsigned sibling_rank - a00235.html + a00231.html aaa6043eee6f55869933c1d974efd9acd struct hwloc_obj * next_sibling - a00235.html + a00231.html a7f2343ed476fe4942e6fffd4cade1b40 struct hwloc_obj * prev_sibling - a00235.html + a00231.html a7b89e8c189876c0158a9282aaaf17f50 int symmetric_subtree - a00235.html + a00231.html a0f41a1d67dc6b661906f2217563637f3 hwloc_cpuset_t cpuset - a00235.html + a00231.html a67925e0f2c47f50408fbdb9bddd0790f hwloc_cpuset_t complete_cpuset - a00235.html + a00231.html a91788a9da687beb7224cc1fd7b75208c hwloc_nodeset_t nodeset - a00235.html + a00231.html a08f0d0e16c619a6e653526cbee4ffea3 hwloc_nodeset_t complete_nodeset - a00235.html + a00231.html ac38c4012127525ef74c5615c526f4c2e struct hwloc_info_s * infos - a00235.html + a00231.html a8604654c38b7a720efae5025d3a96ee6 unsigned infos_count - a00235.html + a00231.html a9843acc28cfbba903b63ea14b137ff70 void * userdata - a00235.html + a00231.html a76fd3ac94401cf32dfccc3a3a8de68a5 hwloc_uint64_t gp_index - a00235.html + a00231.html a957984a355fa61c85f46605c336e7551 unsigned arity - a00235.html + a00231.html aac3f6da35c9b57599909a44ce2b716c1 struct hwloc_obj ** children - a00235.html + a00231.html a04d05403da37bfe17cd63b7c7dd07b1f struct hwloc_obj * first_child - a00235.html + a00231.html af51d08a0a79dba517c06c5afedc8d2dc struct hwloc_obj * last_child - a00235.html + a00231.html a84bd65634dbc55f4158b74443a9bd04f unsigned memory_arity - a00235.html + a00231.html a6f834ea4dd26553cdea601d2fae6d3b7 struct hwloc_obj * memory_first_child - a00235.html + a00231.html ac0e8200dba25b90d5954bd4ec61f97d3 unsigned io_arity - a00235.html + a00231.html a7b3b29f0be377c7d2d52262019fc7d11 struct hwloc_obj * io_first_child - a00235.html + a00231.html a8d14c88e1ebc4ae67cc69f9e928558b3 unsigned misc_arity - a00235.html + a00231.html a2bb7862ce722d7ceda23cfa153da165a struct hwloc_obj * misc_first_child - a00235.html + a00231.html a57812a313fe9b1a9500489f47c3011cc unsigned arity - a00235.html + a00231.html aac3f6da35c9b57599909a44ce2b716c1 struct hwloc_obj ** children - a00235.html + a00231.html a04d05403da37bfe17cd63b7c7dd07b1f struct hwloc_obj * first_child - a00235.html + a00231.html af51d08a0a79dba517c06c5afedc8d2dc struct hwloc_obj * last_child - a00235.html + a00231.html a84bd65634dbc55f4158b74443a9bd04f unsigned memory_arity - a00235.html + a00231.html a6f834ea4dd26553cdea601d2fae6d3b7 struct hwloc_obj * memory_first_child - a00235.html + a00231.html ac0e8200dba25b90d5954bd4ec61f97d3 unsigned io_arity - a00235.html + a00231.html a7b3b29f0be377c7d2d52262019fc7d11 struct hwloc_obj * io_first_child - a00235.html + a00231.html a8d14c88e1ebc4ae67cc69f9e928558b3 unsigned misc_arity - a00235.html + a00231.html a2bb7862ce722d7ceda23cfa153da165a struct hwloc_obj * misc_first_child - a00235.html + a00231.html a57812a313fe9b1a9500489f47c3011cc hwloc_obj_attr_u - a00239.html + a00235.html hwloc_obj_attr_u::hwloc_bridge_attr_s hwloc_obj_attr_u::hwloc_cache_attr_s hwloc_obj_attr_u::hwloc_group_attr_s @@ -786,608 +786,608 @@ struct hwloc_obj_attr_u::hwloc_numanode_attr_s numanode - a00239.html - a6daa8729a68a637e6c80e94361314a87 + a00235.html + ad066b9612802ffa01e132dc3a8e6cc86 struct hwloc_obj_attr_u::hwloc_cache_attr_s cache - a00239.html - ab5a8ae3bf490e6b1071fea53f7382836 + a00235.html + a23f553f3252c9d13f2338231cd354ea9 struct hwloc_obj_attr_u::hwloc_group_attr_s group - a00239.html - ae4ba157cc313e2cdd9a82f1c1df7aaa6 + a00235.html + a9eddbd69e34cd2ef6af6d2ac31b6eff3 struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev - a00239.html - a4203d713ce0f5beaa6ee0e9bdac70828 + a00235.html + a0b66da7ab072f7c016f8ed86701f5a7c struct hwloc_obj_attr_u::hwloc_bridge_attr_s bridge - a00239.html - adbdf280699dd84c7619cd8d9edc0d958 + a00235.html + a207e6359497b7116d6f4baa9e8bbeb43 struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev - a00239.html - a22904c25fe44b323bab5c9bc52660fca + a00235.html + aaf7a5c38b5185703ff18c46ad2761dcf hwloc_obj_attr_u::hwloc_osdev_attr_s - a00279.html + a00275.html hwloc_obj_osdev_type_t type - a00279.html + a00275.html a31e019e27e54ac6138d04be639bb96f9 hwloc_obj_attr_u::hwloc_pcidev_attr_s - a00259.html + a00255.html unsigned short domain - a00259.html + a00255.html a8fba44988deb98613c1505a4019a34dc unsigned char bus - a00259.html + a00255.html aae99e035e8d1387d7b8768aaa8eceb0a unsigned char dev - a00259.html + a00255.html a3d70c84a12f7e93d14c8d47bf4fd9dc5 unsigned char func - a00259.html + a00255.html a695f32df53f4ef728670bfcf31b74e0f unsigned short class_id - a00259.html + a00255.html aee735352d9f1686fd290fc6d6397c334 unsigned short vendor_id - a00259.html + a00255.html aad970ad19b62eb2d5df30e4802da4f4c unsigned short device_id - a00259.html + a00255.html a35b66064ab7d768caf7154e410caf0fa unsigned short subvendor_id - a00259.html + a00255.html a499db3d8cc89eaba04fcaef3df1cba97 unsigned short subdevice_id - a00259.html + a00255.html acac741aecd7a6db64f33409427e3971f unsigned char revision - a00259.html + a00255.html a13ad54c93d08d8ac808e4de9674c5ee7 float linkspeed - a00259.html + a00255.html a59b2fce35f7cbde86c4fd305d0ccda5f hwloc_topology_cpubind_support - a00291.html + a00287.html unsigned char set_thisproc_cpubind - a00291.html + a00287.html a9403d51657a4d546b3ea9553a2973a27 unsigned char get_thisproc_cpubind - a00291.html + a00287.html a77a09ddd78ee3e9ff5f532a6ac74f7eb unsigned char set_proc_cpubind - a00291.html + a00287.html aa166223d1c2a6de7256ab2d8b675a87e unsigned char get_proc_cpubind - a00291.html + a00287.html aae705bc447adc163ead377362c4dfe9f unsigned char set_thisthread_cpubind - a00291.html + a00287.html a57a89a4b5f1f74fa6cfe176f1e8b0798 unsigned char get_thisthread_cpubind - a00291.html + a00287.html a80d762e532d677dff262d83cc7bb1c60 unsigned char set_thread_cpubind - a00291.html + a00287.html a46fba33e307909ce256624687799dd6d unsigned char get_thread_cpubind - a00291.html + a00287.html a8dd4d8531ed2eebdce1507e7d104154e unsigned char get_thisproc_last_cpu_location - a00291.html + a00287.html ad2d5c94b738d92b7d2ede87e4e96321d unsigned char get_proc_last_cpu_location - a00291.html + a00287.html a2554620148b7992a5093f338f5ae254f unsigned char get_thisthread_last_cpu_location - a00291.html + a00287.html a6be1f042fdce6bf41b4ea39f6f193808 hwloc_topology_diff_u::hwloc_topology_diff_generic_s - a00339.html + a00335.html hwloc_topology_diff_type_t type - a00339.html + a00335.html a373005489fcddeba6319163e60263ae8 union hwloc_topology_diff_u * next - a00339.html + a00335.html a720aa94eb73cddfd8d6bf9fcbbfc035e hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s - a00323.html + a00319.html hwloc_topology_diff_obj_attr_type_t type - a00323.html + a00319.html a43f8133b7c30129b002c2d295e6580fc hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s - a00343.html + a00339.html hwloc_topology_diff_type_t type - a00343.html + a00339.html a70a118ad288bd98f18c8ce6dc52e2d10 union hwloc_topology_diff_u * next - a00343.html + a00339.html acb9170a8eb3392656d70f7f3ef3e3eed int obj_depth - a00343.html + a00339.html a82c1d4bab80b9e0bf301a9d8291893e0 unsigned obj_index - a00343.html + a00339.html adb9f4d414470b6670cde8d90759a6c1c union hwloc_topology_diff_obj_attr_u diff - a00343.html + a00339.html a91f0645f9062e892652357cd141c8ebb hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s - a00331.html + a00327.html hwloc_topology_diff_obj_attr_type_t type - a00331.html + a00327.html a784ab5827c1bf531b86d1f02f199d04d char * name - a00331.html + a00327.html a7ef48c66ccddf34d90edb4e4314b41c6 char * oldvalue - a00331.html + a00327.html a33cc281d4417129064295a6ae7b79818 char * newvalue - a00331.html + a00327.html a75f37f4add21cece50fee2701c3b77db hwloc_topology_diff_obj_attr_u - a00319.html + a00315.html hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s generic - a00319.html - a68039c178e9961023345e0728382773b + a00315.html + aeb449c0e04b14ebf8c3126756b6364f9 struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s uint64 - a00319.html - abb15bfa7039ca8c97cd7ddfbdf779efa + a00315.html + a4608ade88460f5f208887775e5a69a0a struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s string - a00319.html - a518a48e13168c31957589ce78820163e + a00315.html + a42fa15c37f1f59ef638066c4c62c3154 hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s - a00327.html + a00323.html hwloc_topology_diff_obj_attr_type_t type - a00327.html + a00323.html afe262b9aa558fe7bfecbd37a7a129197 hwloc_uint64_t index - a00327.html + a00323.html adb772c3f1761ecadf496c80ae14afce3 hwloc_uint64_t oldvalue - a00327.html + a00323.html a44c0894dce563335d347fde6595c49c9 hwloc_uint64_t newvalue - a00327.html + a00323.html ae63aa59ad65aa783b730a4f213304eb4 hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s - a00347.html + a00343.html hwloc_topology_diff_type_t type - a00347.html + a00343.html a92084295a4d6faf17a95a7eea526ddbd union hwloc_topology_diff_u * next - a00347.html + a00343.html a375afbaa043b109be689a7d9a3c7d153 int obj_depth - a00347.html + a00343.html a94c6498caeaafbb79927395d918d6cb3 unsigned obj_index - a00347.html + a00343.html a6dc6b3c4adb10db74d993e37afaa0580 hwloc_topology_diff_u - a00335.html + a00331.html hwloc_topology_diff_u::hwloc_topology_diff_generic_s hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s struct hwloc_topology_diff_u::hwloc_topology_diff_generic_s generic - a00335.html - af1882d9c9d37c735a0e9b04069fab01f + a00331.html + a0dd2cbfba0eca2fc7a2645668bcae0f8 struct hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s obj_attr - a00335.html - a7245713f0f49e9f08fda28401a4f98fd + a00331.html + a01dca644feea48448b36baa60cf4c07f struct hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s too_complex - a00335.html - adaaabee4029a455119ec3695c19632d6 + a00331.html + af7dc1148eb656c56e9678218cafd027b hwloc_topology_discovery_support - a00287.html + a00283.html unsigned char pu - a00287.html + a00283.html ad7bb4ecf7a82f5a04fc632e9592ad3ab unsigned char numa - a00287.html + a00283.html a955f96066cb9e4cd34e2a3710ad43e80 unsigned char numa_memory - a00287.html + a00283.html af193eb858e40e12ef4923f5ed0e1f11a unsigned char disallowed_pu - a00287.html + a00283.html af3c97b28781a2972cf8eaaf94a6617da unsigned char disallowed_numa - a00287.html + a00283.html a970e65235873bcdb9669a9805161ce03 hwloc_topology_membind_support - a00295.html + a00291.html unsigned char set_thisproc_membind - a00295.html + a00291.html a36b3e388df9c6a249427cab7e3724749 unsigned char get_thisproc_membind - a00295.html + a00291.html a3fd51e6fa5f0dd800322301b46b08559 unsigned char set_proc_membind - a00295.html + a00291.html a756f44912894b176bf979a1b65f12aac unsigned char get_proc_membind - a00295.html + a00291.html a9880cd2d605e316fc020167c49ca69ad unsigned char set_thisthread_membind - a00295.html + a00291.html a0697af2e41f2e82b8ce71e3cc13f7eac unsigned char get_thisthread_membind - a00295.html + a00291.html a63b0b2e26157b472f5717ee93cc7c535 unsigned char set_area_membind - a00295.html + a00291.html a476c06f96b65c08b287cf2369966123b unsigned char get_area_membind - a00295.html + a00291.html a0a84e24a06f2fa487fe8c9605c6f68b3 unsigned char alloc_membind - a00295.html + a00291.html ae551abb27d2aa9ce008583488b845b98 unsigned char firsttouch_membind - a00295.html + a00291.html a221098c339dbfab27bd2c9f5d32f123b unsigned char bind_membind - a00295.html + a00291.html ae7cdb1f1b5f0242a69f85b5a5538c764 unsigned char interleave_membind - a00295.html + a00291.html a3c44c6012860bbeba8a0f4c19710858d unsigned char nexttouch_membind - a00295.html + a00291.html ab0921af6e0cd6975812a80b8e5c7435c unsigned char migrate_membind - a00295.html + a00291.html aafa7683871a6a760246f9b35209caec5 unsigned char get_area_memlocation - a00295.html + a00291.html a30173553a68e0a4dd1672d26f8e892b1 hwloc_topology_support - a00299.html + a00295.html struct hwloc_topology_discovery_support * discovery - a00299.html + a00295.html aea3fbd7653d987d81f848636c420504d struct hwloc_topology_cpubind_support * cpubind - a00299.html + a00295.html adef2bb91f74c3e70a2a071393caf5f56 struct hwloc_topology_membind_support * membind - a00299.html + a00295.html ac6eb62ae8bc0a68dce679a7107a36194 @@ -1395,25 +1395,25 @@ hwlocality_api_version API version - a00182.html + a00179.html #define HWLOC_API_VERSION - a00182.html + a00179.html ga8f4dfb8eef138af55dd1a0fa802e5476 #define HWLOC_COMPONENT_ABI - a00182.html + a00179.html gaac5bc1f46f55e10ef0141a68ce70e21f unsigned hwloc_get_api_version - a00182.html + a00179.html ga9c0b50c98add1adf57ed1ce85bb5190d (void) @@ -1421,32 +1421,32 @@ hwlocality_object_sets Object Sets (hwloc_cpuset_t and hwloc_nodeset_t) - a00183.html + a00180.html hwloc_bitmap_t hwloc_cpuset_t - a00183.html + a00180.html ga4bbf39b68b6f568fb92739e7c0ea7801 hwloc_const_bitmap_t hwloc_const_cpuset_t - a00183.html + a00180.html ga1f784433e9b606261f62d1134f6a3b25 hwloc_bitmap_t hwloc_nodeset_t - a00183.html + a00180.html ga37e35730fa7e775b5bb0afe893d6d508 hwloc_const_bitmap_t hwloc_const_nodeset_t - a00183.html + a00180.html ga2f5276235841ad66a79bedad16a5a10c @@ -1454,266 +1454,253 @@ hwlocality_object_types Object Types - a00184.html + a00181.html #define - HWLOC_OBJ_TYPE_MIN - a00184.html - ga808910b696c26ac41d0abfa61a6bd564 + HWLOC_TYPE_UNORDERED + a00181.html + ga3b6e4128e9fe773863b123fa6e4a080b enum hwloc_obj_cache_type_e hwloc_obj_cache_type_t - a00184.html - gab6e1e7efedae8b341f3ee14fbe53d66c + a00181.html + ga552ec74296a024237f474acec98694c0 enum hwloc_obj_bridge_type_e hwloc_obj_bridge_type_t - a00184.html - ga0a947e8c5adcc729b126bd09c01a0153 + a00181.html + gab34362c7a23296c3f12c5756747abda3 enum hwloc_obj_osdev_type_e hwloc_obj_osdev_type_t - a00184.html - ga90c1e82a60ba5871d07645169e636987 + a00181.html + gaa9a6941ef7b1c169412518d7ef71b3d2 hwloc_obj_type_t - a00184.html + a00181.html gacd37bb612667dc437d66bfb175a8dc55 HWLOC_OBJ_MACHINE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a3f4e83ffc4a259354959ae8a9eaa2a80 HWLOC_OBJ_PACKAGE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55ab16ab8c0dbffc234921d86f3dfb63129 HWLOC_OBJ_CORE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55ac793958f330bca371aa1535de8aff45f HWLOC_OBJ_PU - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55abca6887e80cb291353b0a0c1da83f661 HWLOC_OBJ_L1CACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a56389b8eb2e2f74f288bb657c4e72140 HWLOC_OBJ_L2CACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a18f61d19fe9f4bcea978fcc68bc078fb HWLOC_OBJ_L3CACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a25fae0e0514c90e3973a29866a5a837d HWLOC_OBJ_L4CACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a54923bfa13df9d7e6d6dd0d5baff5f72 HWLOC_OBJ_L5CACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a67194c9de5e3e581c64c11d2eb1c109d HWLOC_OBJ_L1ICACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55afa834a85d9e53836cf0db6d0bd8329b4 HWLOC_OBJ_L2ICACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a10713b7e561b8cc32544cd31b1c17f8d HWLOC_OBJ_L3ICACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55ac22850c717f07bf7ffb316fadd08d218 HWLOC_OBJ_GROUP - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a5269ef95be72f88465559d35c9b7ad56 HWLOC_OBJ_NUMANODE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a9d917a3e5497950c6d8948b8e183db5a HWLOC_OBJ_BRIDGE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a6825f10895fea60aca7a6ba9fe273db0 HWLOC_OBJ_PCI_DEVICE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a5d8117a54df1fbd3606ab19e42cb0ea9 HWLOC_OBJ_OS_DEVICE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a51e7280240fd9f25589cbbe538bdb075 HWLOC_OBJ_MISC - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a19f8a6953fa91efc76bcbcdf2d22de4d HWLOC_OBJ_MEMCACHE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55a0ed5bd98974729a0c476c39e917dabd6 HWLOC_OBJ_DIE - a00184.html + a00181.html ggacd37bb612667dc437d66bfb175a8dc55af78bb6cde53aaaaa162a7dc420c409da hwloc_obj_cache_type_e - a00184.html + a00181.html ga791c9875c8fe20f3e1e5871e0657e59b HWLOC_OBJ_CACHE_UNIFIED - a00184.html + a00181.html gga791c9875c8fe20f3e1e5871e0657e59ba3900b3b2db54941aac249e5a638a2d7a HWLOC_OBJ_CACHE_DATA - a00184.html + a00181.html gga791c9875c8fe20f3e1e5871e0657e59bacac60ecad4206f85aeb79bef1604b488 HWLOC_OBJ_CACHE_INSTRUCTION - a00184.html + a00181.html gga791c9875c8fe20f3e1e5871e0657e59ba6f98b0d422b38ba90c5f5c79a11b0658 hwloc_obj_bridge_type_e - a00184.html + a00181.html ga48a4803c72574191d7ead1c62aaf9860 HWLOC_OBJ_BRIDGE_HOST - a00184.html + a00181.html gga48a4803c72574191d7ead1c62aaf9860a2c7660f3864ad2810c1e72aad285e574 HWLOC_OBJ_BRIDGE_PCI - a00184.html + a00181.html gga48a4803c72574191d7ead1c62aaf9860a8f3b4cecf3dab6073d74696d10863c60 hwloc_obj_osdev_type_e - a00184.html + a00181.html ga64f5d539df299c97ae80ce53fc4b56c0 HWLOC_OBJ_OSDEV_BLOCK - a00184.html + a00181.html gga64f5d539df299c97ae80ce53fc4b56c0a689b0488c3c0d08d116751c6b9cb8871 HWLOC_OBJ_OSDEV_GPU - a00184.html + a00181.html gga64f5d539df299c97ae80ce53fc4b56c0aa3a09798ef2836abb236dc3a645ffc90 HWLOC_OBJ_OSDEV_NETWORK - a00184.html + a00181.html gga64f5d539df299c97ae80ce53fc4b56c0ab715d81155f771573c8682dffc65021b HWLOC_OBJ_OSDEV_OPENFABRICS - a00184.html + a00181.html gga64f5d539df299c97ae80ce53fc4b56c0a52157d03694fdae82dddd57ca8c973b6 HWLOC_OBJ_OSDEV_DMA - a00184.html + a00181.html gga64f5d539df299c97ae80ce53fc4b56c0a827ad1643360711a8b6c6af671366791 HWLOC_OBJ_OSDEV_COPROC - a00184.html + a00181.html gga64f5d539df299c97ae80ce53fc4b56c0a46f8927e1c3e137eaa86cc8f6861fb83 - - - hwloc_compare_types_e - a00184.html - ga46323568968005137c32f6a1cd405b74 - - - - HWLOC_TYPE_UNORDERED - a00184.html - gga46323568968005137c32f6a1cd405b74a2f8297ea36eba46e7596e810a67298fb - - int hwloc_compare_types - a00184.html + a00181.html ga1820ea0dfd8e9dca28f9ea7624df5ae2 (hwloc_obj_type_t type1, hwloc_obj_type_t type2) @@ -1721,14 +1708,14 @@ hwlocality_objects Object Structure and Attributes - a00185.html + a00182.html hwloc_obj hwloc_obj_attr_u hwloc_info_s struct hwloc_obj * hwloc_obj_t - a00185.html + a00182.html ga79b8ab56877ef99ac59b833203391c7d @@ -1736,53 +1723,53 @@ hwlocality_creation Topology Creation and Destruction - a00186.html + a00183.html struct hwloc_topology * hwloc_topology_t - a00186.html + a00183.html ga9d1e76ee15a7dee158b786c30b6a6e38 int hwloc_topology_init - a00186.html + a00183.html ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa (hwloc_topology_t *topologyp) int hwloc_topology_load - a00186.html + a00183.html gabdf58d87ad77f6615fccdfe0535ff826 (hwloc_topology_t topology) void hwloc_topology_destroy - a00186.html + a00183.html ga9f34a640b6fd28d23699d4d084667b15 (hwloc_topology_t topology) int hwloc_topology_dup - a00186.html + a00183.html ga62a161fc5e6f120344dc69a7bee4e587 (hwloc_topology_t *newtopology, hwloc_topology_t oldtopology) int hwloc_topology_abi_check - a00186.html + a00183.html ga0647ae66458fe68172eb5a320042f870 (hwloc_topology_t topology) void hwloc_topology_check - a00186.html + a00183.html gaf6746bc3a558ef1ac8348b4491d091b5 (hwloc_topology_t topology) @@ -1790,150 +1777,150 @@ hwlocality_levels Object levels, depths and types - a00187.html + a00184.html hwloc_get_type_depth_e - a00187.html + a00184.html gaf4e663cf42bbe20756b849c6293ef575 HWLOC_TYPE_DEPTH_UNKNOWN - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575a0565ab92ab72cb0cec91e23003294aad HWLOC_TYPE_DEPTH_MULTIPLE - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575ae99465995cacde6c210d5fc2e409798c HWLOC_TYPE_DEPTH_NUMANODE - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575a245c34ec9884c2cf5de5049b2153ed9c HWLOC_TYPE_DEPTH_BRIDGE - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575af93b50182973e4a718d9d4db9e253a90 HWLOC_TYPE_DEPTH_PCI_DEVICE - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575ad8b1516e699b57ce1c8d107fbd2f674c HWLOC_TYPE_DEPTH_OS_DEVICE - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575afe9a2131073eebbe129d4aa2928d3f46 HWLOC_TYPE_DEPTH_MISC - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575a96436a392b4cdcaa1a29bc65351b373f HWLOC_TYPE_DEPTH_MEMCACHE - a00187.html + a00184.html ggaf4e663cf42bbe20756b849c6293ef575a8b8d7d300c018c0eb65e6c9a9f162101 int hwloc_topology_get_depth - a00187.html + a00184.html gae54d1782ca9b54bea915f5c18a9158fa (hwloc_topology_t restrict topology) int hwloc_get_type_depth - a00187.html + a00184.html ga8bec782e21be313750da70cf7428b374 (hwloc_topology_t topology, hwloc_obj_type_t type) int hwloc_get_memory_parents_depth - a00187.html + a00184.html gae85786340b88e24835f8c403a1e2e54b (hwloc_topology_t topology) static int hwloc_get_type_or_below_depth - a00187.html + a00184.html ga8125328e69eba709c33ea8055c12589b (hwloc_topology_t topology, hwloc_obj_type_t type) static int hwloc_get_type_or_above_depth - a00187.html + a00184.html ga8a9ee573b7d2190272095d10712a7cca (hwloc_topology_t topology, hwloc_obj_type_t type) hwloc_obj_type_t hwloc_get_depth_type - a00187.html + a00184.html ga506b0682b98aa264d53e934d2e9badb0 (hwloc_topology_t topology, int depth) unsigned hwloc_get_nbobjs_by_depth - a00187.html + a00184.html ga1d5ceafe8130fe6e8657bf0bc666ba50 (hwloc_topology_t topology, int depth) static int hwloc_get_nbobjs_by_type - a00187.html + a00184.html ga789a3f65aedff644be64a18526a03065 (hwloc_topology_t topology, hwloc_obj_type_t type) static hwloc_obj_t hwloc_get_root_obj - a00187.html + a00184.html ga2d4b12fc187dfc53b35f2fa21d21044d (hwloc_topology_t topology) hwloc_obj_t hwloc_get_obj_by_depth - a00187.html + a00184.html ga391f6b2613f0065673eaa4069b93d4e0 (hwloc_topology_t topology, int depth, unsigned idx) static hwloc_obj_t hwloc_get_obj_by_type - a00187.html + a00184.html ga6f414dd80a2b943967a0ac92da3181a2 (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx) static hwloc_obj_t hwloc_get_next_obj_by_depth - a00187.html + a00184.html gac140a9b939d9fa0b30c4a910efcb0656 (hwloc_topology_t topology, int depth, hwloc_obj_t prev) static hwloc_obj_t hwloc_get_next_obj_by_type - a00187.html + a00184.html ga759e88eaf5a230ad283e9d4c42486735 (hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev) @@ -1941,39 +1928,39 @@ hwlocality_object_strings Converting between Object Types and Attributes, and Strings - a00188.html + a00185.html const char * hwloc_obj_type_string - a00188.html + a00185.html ga5ca0bf94bbbb080d0eff17a57bd90422 (hwloc_obj_type_t type) int hwloc_obj_type_snprintf - a00188.html + a00185.html gadb8765c260edea80c52cd06a76639ba4 (char *restrict string, size_t size, hwloc_obj_t obj, int verbose) int hwloc_obj_attr_snprintf - a00188.html + a00185.html ga870e876931c282a1c7aee2f031912ce3 (char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, int verbose) int hwloc_type_sscanf - a00188.html + a00185.html ga510f21b066fba2dab12b8c9b173b1dfd (const char *string, hwloc_obj_type_t *typep, union hwloc_obj_attr_u *attrp, size_t attrsize) int hwloc_type_sscanf_as_depth - a00188.html + a00185.html ga52c63cd7203e55b804c1314affc9bd12 (const char *string, hwloc_obj_type_t *typep, hwloc_topology_t topology, int *depthp) @@ -1981,18 +1968,18 @@ hwlocality_info_attr Consulting and Adding Key-Value Info Attributes - a00189.html + a00186.html static const char * hwloc_obj_get_info_by_name - a00189.html + a00186.html gab358661a92bb27d8542b255cc9f6f25e (hwloc_obj_t obj, const char *name) int hwloc_obj_add_info - a00189.html + a00186.html gace7654bb8a9002caae1a4b8a59e7452e (hwloc_obj_t obj, const char *name, const char *value) @@ -2000,91 +1987,91 @@ hwlocality_cpubinding CPU binding - a00190.html + a00187.html hwloc_cpubind_flags_t - a00190.html + a00187.html ga217dc8d373f8958cc93c154ebce1c71c HWLOC_CPUBIND_PROCESS - a00190.html + a00187.html gga217dc8d373f8958cc93c154ebce1c71ca2e0dd0128dac6b03408c7dd170477fdc HWLOC_CPUBIND_THREAD - a00190.html + a00187.html gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421 HWLOC_CPUBIND_STRICT - a00190.html + a00187.html gga217dc8d373f8958cc93c154ebce1c71ca679a7e0f0c7ee06b123565f90d98e7fa HWLOC_CPUBIND_NOMEMBIND - a00190.html + a00187.html gga217dc8d373f8958cc93c154ebce1c71ca41ce440443cc3087caed95ab60edcad6 int hwloc_set_cpubind - a00190.html + a00187.html ga80bc07473a8edf840cae17bd7ec21d48 (hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags) int hwloc_get_cpubind - a00190.html + a00187.html gacba7ecb979baf824d5240fa2cb2a8be6 (hwloc_topology_t topology, hwloc_cpuset_t set, int flags) int hwloc_set_proc_cpubind - a00190.html + a00187.html ga296db8a3c6d49b51fb83d6f3e45c02a6 (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags) int hwloc_get_proc_cpubind - a00190.html + a00187.html gac82de91f788fa82dacf99c6e0d4b7158 (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags) int hwloc_set_thread_cpubind - a00190.html + a00187.html gae42c01b2addcfbf6048b9a516dd7a906 (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags) int hwloc_get_thread_cpubind - a00190.html + a00187.html gaf13f765642b5d0d9a9813e6bb043671b (hwloc_topology_t topology, hwloc_thread_t thread, hwloc_cpuset_t set, int flags) int hwloc_get_last_cpu_location - a00190.html + a00187.html gafdb374627358bf09203b5a4215b13032 (hwloc_topology_t topology, hwloc_cpuset_t set, int flags) int hwloc_get_proc_last_cpu_location - a00190.html + a00187.html ga910a05c2d47f68a3155bf176b50fa555 (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags) @@ -2092,167 +2079,167 @@ hwlocality_membinding Memory binding - a00191.html + a00188.html hwloc_membind_policy_t - a00191.html + a00188.html gac9764f79505775d06407b40f5e4661e8 HWLOC_MEMBIND_DEFAULT - a00191.html + a00188.html ggac9764f79505775d06407b40f5e4661e8a18675bb80ebc1bce5b652e9de8f3998c HWLOC_MEMBIND_FIRSTTOUCH - a00191.html + a00188.html ggac9764f79505775d06407b40f5e4661e8a979c7aa78dd32780858f30f47a72cca0 HWLOC_MEMBIND_BIND - a00191.html + a00188.html ggac9764f79505775d06407b40f5e4661e8ad811fa4b2a6002c4d63695a408ffde2c HWLOC_MEMBIND_INTERLEAVE - a00191.html + a00188.html ggac9764f79505775d06407b40f5e4661e8ae370075e5af016d42310f87ea5af236b HWLOC_MEMBIND_NEXTTOUCH - a00191.html + a00188.html ggac9764f79505775d06407b40f5e4661e8aecdd4164d647708fbb51a00d98dbb138 HWLOC_MEMBIND_MIXED - a00191.html + a00188.html ggac9764f79505775d06407b40f5e4661e8a3185bd869b67817fb2bd5164bf360402 hwloc_membind_flags_t - a00191.html + a00188.html gab00475fd98815bf4fb9aaf752030e7d2 HWLOC_MEMBIND_PROCESS - a00191.html + a00188.html ggab00475fd98815bf4fb9aaf752030e7d2a1b1b74aef138f64aff214a8cbdfe8eb4 HWLOC_MEMBIND_THREAD - a00191.html + a00188.html ggab00475fd98815bf4fb9aaf752030e7d2a1dc7dd5cdcd5796893a325a524555298 HWLOC_MEMBIND_STRICT - a00191.html + a00188.html ggab00475fd98815bf4fb9aaf752030e7d2a0335311a0ee04166df2888d52b4a42c6 HWLOC_MEMBIND_MIGRATE - a00191.html + a00188.html ggab00475fd98815bf4fb9aaf752030e7d2aa6e49e54f52827cb143cc869cfd748af HWLOC_MEMBIND_NOCPUBIND - a00191.html + a00188.html ggab00475fd98815bf4fb9aaf752030e7d2aad6b9eaf2ee324ca58dc8f58094b9997 HWLOC_MEMBIND_BYNODESET - a00191.html + a00188.html ggab00475fd98815bf4fb9aaf752030e7d2a71f19fe4505f1c083dc8e6f7bdea6256 int hwloc_set_membind - a00191.html + a00188.html ga020951efa0ce3862bd4faec295501a7f (hwloc_topology_t topology, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) int hwloc_get_membind - a00191.html + a00188.html gae21f0a1a884929c784bebf070252aa56 (hwloc_topology_t topology, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags) int hwloc_set_proc_membind - a00191.html + a00188.html gabc91ff16f7e41047924e3a4ae6d9da7e (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) int hwloc_get_proc_membind - a00191.html + a00188.html ga1730ceb18ec6ee3b7bd3d0db81f07dc8 (hwloc_topology_t topology, hwloc_pid_t pid, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags) int hwloc_set_area_membind - a00191.html + a00188.html gaf881faefe20701229f07dd7dbd0125ed (hwloc_topology_t topology, const void *addr, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) int hwloc_get_area_membind - a00191.html + a00188.html gaa87e0a6946ff145914fdf0b1c60567f8 (hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, hwloc_membind_policy_t *policy, int flags) int hwloc_get_area_memlocation - a00191.html + a00188.html ga537c7508a4e2d1db05673ec5be6e805c (hwloc_topology_t topology, const void *addr, size_t len, hwloc_bitmap_t set, int flags) void * hwloc_alloc - a00191.html + a00188.html ga972b335a86a7d5e7b34bce2b243c41bc (hwloc_topology_t topology, size_t len) void * hwloc_alloc_membind - a00191.html + a00188.html ga04736461780fadcf193af218c0122273 (hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) static void * hwloc_alloc_membind_policy - a00191.html + a00188.html gab1b77b8408bacaf03c7e8878f7577922 (hwloc_topology_t topology, size_t len, hwloc_const_bitmap_t set, hwloc_membind_policy_t policy, int flags) int hwloc_free - a00191.html + a00188.html ga32dbd4f54e9e4a7179f2dde37ffe6ad7 (hwloc_topology_t topology, void *addr, size_t len) @@ -2260,52 +2247,52 @@ hwlocality_setsource Changing the Source of Topology Discovery - a00192.html + a00189.html hwloc_topology_components_flag_e - a00192.html + a00189.html ga949f656c779208a36790feba24048b7e HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST - a00192.html + a00189.html gga949f656c779208a36790feba24048b7ea33eec25d29253a2aba21dd3c731b416e int hwloc_topology_set_pid - a00192.html + a00189.html ga341fc17b5867a4715570baab131f68cd (hwloc_topology_t restrict topology, hwloc_pid_t pid) int hwloc_topology_set_synthetic - a00192.html + a00189.html ga4fab186bb6181a00bcf585825fddd38d (hwloc_topology_t restrict topology, const char *restrict description) int hwloc_topology_set_xml - a00192.html + a00189.html ga879439b7ee99407ee911b3ac64e9a25e (hwloc_topology_t restrict topology, const char *restrict xmlpath) int hwloc_topology_set_xmlbuffer - a00192.html + a00189.html ga2745616b65595e1c1e579ecc7e461fa8 (hwloc_topology_t restrict topology, const char *restrict buffer, int size) int hwloc_topology_set_components - a00192.html + a00189.html ga9ad41adf418cee1c0ee32ba9bd4a3d36 (hwloc_topology_t restrict topology, unsigned long flags, const char *restrict name) @@ -2313,7 +2300,7 @@ hwlocality_configuration Topology Detection Configuration and Query - a00193.html + a00190.html hwloc_topology_discovery_support hwloc_topology_cpubind_support hwloc_topology_membind_support @@ -2321,140 +2308,140 @@ hwloc_topology_flags_e - a00193.html + a00190.html gada025d3ec20b4b420f8038d23d6e7bde HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED - a00193.html + a00190.html ggada025d3ec20b4b420f8038d23d6e7bdea10907044bbb306fd0dc76acf046d9258 HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM - a00193.html + a00190.html ggada025d3ec20b4b420f8038d23d6e7bdea6ecb6abc6a0bb75e81564f8bca85783b HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES - a00193.html + a00190.html ggada025d3ec20b4b420f8038d23d6e7bdea1b66bbd66e900e5c837f71defb32ad89 hwloc_type_filter_e - a00193.html + a00190.html ga9a5a1f0140cd1952544477833733195b HWLOC_TYPE_FILTER_KEEP_ALL - a00193.html + a00190.html gga9a5a1f0140cd1952544477833733195bafda7b59e6810dfe778d8f9a4cc1e350e HWLOC_TYPE_FILTER_KEEP_NONE - a00193.html + a00190.html gga9a5a1f0140cd1952544477833733195ba4f835955414de92c77d99b8419d4647a HWLOC_TYPE_FILTER_KEEP_STRUCTURE - a00193.html + a00190.html gga9a5a1f0140cd1952544477833733195ba7664716643bf1db83e631eed34f659e4 HWLOC_TYPE_FILTER_KEEP_IMPORTANT - a00193.html + a00190.html gga9a5a1f0140cd1952544477833733195ba63fd24954e18c83ff7eae9588759adb5 int hwloc_topology_set_flags - a00193.html + a00190.html gaaeed4df656979e5f16befea9d29b814b (hwloc_topology_t topology, unsigned long flags) unsigned long hwloc_topology_get_flags - a00193.html + a00190.html ga09318f81c1d4713be907d64748a6f93c (hwloc_topology_t topology) int hwloc_topology_is_thissystem - a00193.html + a00190.html ga68ffdcfd9175cdf40709801092f18017 (hwloc_topology_t restrict topology) const struct hwloc_topology_support * hwloc_topology_get_support - a00193.html + a00190.html gab8c76173c4a8ce1a9a9366012b1388e6 (hwloc_topology_t restrict topology) int hwloc_topology_set_type_filter - a00193.html + a00190.html gad894e70f15f8d4aada7be8d1aba38b7e (hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e filter) int hwloc_topology_get_type_filter - a00193.html + a00190.html ga137ad1178f7a79f2383974d983083401 (hwloc_topology_t topology, hwloc_obj_type_t type, enum hwloc_type_filter_e *filter) int hwloc_topology_set_all_types_filter - a00193.html + a00190.html ga9eb8dc3b106f84921bf5789101e97e24 (hwloc_topology_t topology, enum hwloc_type_filter_e filter) int hwloc_topology_set_cache_types_filter - a00193.html + a00190.html ga30bd6d330fe3c8f0cbaad724d114ee20 (hwloc_topology_t topology, enum hwloc_type_filter_e filter) int hwloc_topology_set_icache_types_filter - a00193.html + a00190.html ga37c7b2e599ed3cd76ad9164630024f30 (hwloc_topology_t topology, enum hwloc_type_filter_e filter) int hwloc_topology_set_io_types_filter - a00193.html + a00190.html ga0ab38705357bc1203abe829da8a12ad3 (hwloc_topology_t topology, enum hwloc_type_filter_e filter) void hwloc_topology_set_userdata - a00193.html + a00190.html ga2cc7b7b155cba58dda203e54f1637b9c (hwloc_topology_t topology, const void *userdata) void * hwloc_topology_get_userdata - a00193.html + a00190.html ga91f992f8d6c4905b2d3c4f43e509c2a3 (hwloc_topology_t topology) @@ -2462,108 +2449,108 @@ hwlocality_tinker Modifying a loaded Topology - a00194.html + a00191.html hwloc_restrict_flags_e - a00194.html + a00191.html ga9d80f08eb25b7ac22f1b998dc8bf521f HWLOC_RESTRICT_FLAG_REMOVE_CPULESS - a00194.html + a00191.html gga9d80f08eb25b7ac22f1b998dc8bf521fa80eeb9cbba401ab050f8fb4573725891 HWLOC_RESTRICT_FLAG_BYNODESET - a00194.html + a00191.html gga9d80f08eb25b7ac22f1b998dc8bf521fae4c5b1b87232f2d8a60559e77ac65a68 HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS - a00194.html + a00191.html gga9d80f08eb25b7ac22f1b998dc8bf521faf5ba49808855704bfe9cb9fe7347f93b HWLOC_RESTRICT_FLAG_ADAPT_MISC - a00194.html + a00191.html gga9d80f08eb25b7ac22f1b998dc8bf521fa699969227a09bbc1a7de51dc9fb7be4b HWLOC_RESTRICT_FLAG_ADAPT_IO - a00194.html + a00191.html gga9d80f08eb25b7ac22f1b998dc8bf521faa95d6985e36ec1e55f68b210297a85cb hwloc_allow_flags_e - a00194.html + a00191.html ga38b1be3922094d880f6e76bf56c973d6 HWLOC_ALLOW_FLAG_ALL - a00194.html + a00191.html gga38b1be3922094d880f6e76bf56c973d6aca107692455774f9d323d21b8abfce72 HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS - a00194.html + a00191.html gga38b1be3922094d880f6e76bf56c973d6a88c50088c09dcf1e1a496c0817556fb9 HWLOC_ALLOW_FLAG_CUSTOM - a00194.html + a00191.html gga38b1be3922094d880f6e76bf56c973d6a489c8c1b67ce7e0b8cf7a665852760e1 int hwloc_topology_restrict - a00194.html + a00191.html ga6db81ed13ac0a9d70cc80372ab537815 (hwloc_topology_t restrict topology, hwloc_const_bitmap_t set, unsigned long flags) int hwloc_topology_allow - a00194.html + a00191.html gaf955b190c0299dcfb5bc985d777f92a1 (hwloc_topology_t restrict topology, hwloc_const_cpuset_t cpuset, hwloc_const_nodeset_t nodeset, unsigned long flags) hwloc_obj_t hwloc_topology_insert_misc_object - a00194.html + a00191.html gad980782ade737900c5cf208946768c30 (hwloc_topology_t topology, hwloc_obj_t parent, const char *name) hwloc_obj_t hwloc_topology_alloc_group_object - a00194.html + a00191.html ga4cea4741165faf5323931a9ed8786ef7 (hwloc_topology_t topology) hwloc_obj_t hwloc_topology_insert_group_object - a00194.html + a00191.html ga1fc6012b3e1c249b83f48cb7bcacaa5b (hwloc_topology_t topology, hwloc_obj_t group) int hwloc_obj_add_other_obj_sets - a00194.html + a00191.html gad458715d3335df44849216cc123d1055 (hwloc_obj_t dst, hwloc_obj_t src) @@ -2571,67 +2558,67 @@ hwlocality_helper_find_inside Finding Objects inside a CPU set - a00195.html + a00192.html static hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset - a00195.html + a00192.html ga547325a4193dbc215d07c23097519d79 (hwloc_topology_t topology, hwloc_const_cpuset_t set) int hwloc_get_largest_objs_inside_cpuset - a00195.html + a00192.html ga34ca563fa3a6a4e05268f36a87668511 (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t *restrict objs, int max) static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth - a00195.html + a00192.html ga63e3784e7c60fbae5073428cb98ac787 (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev) static hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type - a00195.html + a00192.html gafe859176cf9233f215fea0e87cef47e7 (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev) static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_depth - a00195.html + a00192.html gaec86f1f88832836e3f9338e246ea5862 (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, unsigned idx) static hwloc_obj_t hwloc_get_obj_inside_cpuset_by_type - a00195.html + a00192.html ga2edf924e5a0cca9cb22f65cc77c6ddb5 (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, unsigned idx) static unsigned hwloc_get_nbobjs_inside_cpuset_by_depth - a00195.html + a00192.html gaa43c64512ddb33fd181990c4261cec7d (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth) static int hwloc_get_nbobjs_inside_cpuset_by_type - a00195.html + a00192.html ga133c40415de008518608f8bff52a5ab9 (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type) static int hwloc_get_obj_index_inside_cpuset - a00195.html + a00192.html ga4c3a20d61e9beb06c667b21688c772c5 (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t obj) @@ -2639,32 +2626,32 @@ hwlocality_helper_find_covering Finding Objects covering at least CPU set - a00196.html + a00193.html static hwloc_obj_t hwloc_get_child_covering_cpuset - a00196.html + a00193.html ga0e66aa2dc6b2527cfd10723af646c9d7 (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t parent) static hwloc_obj_t hwloc_get_obj_covering_cpuset - a00196.html + a00193.html ga41acdcdbb8b95d70ecf6c572a3f67dca (hwloc_topology_t topology, hwloc_const_cpuset_t set) static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth - a00196.html + a00193.html gaba4b6d86eba1169ced4b0e941d2bb5f0 (hwloc_topology_t topology, hwloc_const_cpuset_t set, int depth, hwloc_obj_t prev) static hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type - a00196.html + a00193.html ga91cfae08b092e7966002e15d1e987213 (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev) @@ -2672,39 +2659,39 @@ hwlocality_helper_ancestors Looking at Ancestor and Child Objects - a00197.html + a00194.html static hwloc_obj_t hwloc_get_ancestor_obj_by_depth - a00197.html + a00194.html ga9f8c93fde236e9642a96957af01a11cb (hwloc_topology_t topology, int depth, hwloc_obj_t obj) static hwloc_obj_t hwloc_get_ancestor_obj_by_type - a00197.html + a00194.html ga70f0c7583291da707c15ae4daa850f41 (hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t obj) static hwloc_obj_t hwloc_get_common_ancestor_obj - a00197.html + a00194.html gab1fa883021928b5c476911c4102e9be3 (hwloc_topology_t topology, hwloc_obj_t obj1, hwloc_obj_t obj2) static int hwloc_obj_is_in_subtree - a00197.html + a00194.html ga408cf74f5bf9ed497911a320c7f8cc56 (hwloc_topology_t topology, hwloc_obj_t obj, hwloc_obj_t subtree_root) static hwloc_obj_t hwloc_get_next_child - a00197.html + a00194.html ga12d8565a3436c565e791ed02a0353621 (hwloc_topology_t topology, hwloc_obj_t parent, hwloc_obj_t prev) @@ -2712,46 +2699,46 @@ hwlocality_helper_types Kinds of object Type - a00198.html + a00195.html int hwloc_obj_type_is_normal - a00198.html + a00195.html ga52ef38431eba383b048b98c669b59a16 (hwloc_obj_type_t type) int hwloc_obj_type_is_io - a00198.html + a00195.html gac8a954ed37a4376097234c828068cbef (hwloc_obj_type_t type) int hwloc_obj_type_is_memory - a00198.html + a00195.html ga1d074390c8a3dc3088d84f73fb73f966 (hwloc_obj_type_t type) int hwloc_obj_type_is_cache - a00198.html + a00195.html ga2ed589bea28711e80b92066510a5607d (hwloc_obj_type_t type) int hwloc_obj_type_is_dcache - a00198.html + a00195.html ga395e48cd221d107e5891689624e1aec4 (hwloc_obj_type_t type) int hwloc_obj_type_is_icache - a00198.html + a00195.html ga8abcee67b9b074332c1866405a3648a9 (hwloc_obj_type_t type) @@ -2759,25 +2746,25 @@ hwlocality_helper_find_cache Looking at Cache Objects - a00199.html + a00196.html static int hwloc_get_cache_type_depth - a00199.html + a00196.html gad108a09ce400222fe45545257d575489 (hwloc_topology_t topology, unsigned cachelevel, hwloc_obj_cache_type_t cachetype) static hwloc_obj_t hwloc_get_cache_covering_cpuset - a00199.html + a00196.html gac4cd480a5deaa4ada047fdd11ae4c070 (hwloc_topology_t topology, hwloc_const_cpuset_t set) static hwloc_obj_t hwloc_get_shared_cache_covering_obj - a00199.html + a00196.html ga36f48c32837c7a70b424706e213dcd71 (hwloc_topology_t topology, hwloc_obj_t obj) @@ -2785,39 +2772,46 @@ hwlocality_helper_find_misc Finding objects, miscellaneous helpers - a00200.html + a00197.html + + int + hwloc_bitmap_singlify_per_core + a00197.html + ga050646458efc8ca1120d9f124c5ad861 + (hwloc_topology_t topology, hwloc_bitmap_t cpuset, unsigned which) + static hwloc_obj_t hwloc_get_pu_obj_by_os_index - a00200.html + a00197.html ga751c238a4931db5cc0ca3181b7dd7479 (hwloc_topology_t topology, unsigned os_index) static hwloc_obj_t hwloc_get_numanode_obj_by_os_index - a00200.html + a00197.html gab89d9ed9edfaa3dd526fb6ee1a1618ea (hwloc_topology_t topology, unsigned os_index) unsigned hwloc_get_closest_objs - a00200.html + a00197.html ga2cd22a34360643f7f5bad09576dec205 (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *restrict objs, unsigned max) static hwloc_obj_t hwloc_get_obj_below_by_type - a00200.html + a00197.html ga7a0c1046851f7a88bd52f5a1d4ba0a97 (hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t type2, unsigned idx2) static hwloc_obj_t hwloc_get_obj_below_array_by_type - a00200.html + a00197.html gacb51295ff3fbd3a96f990f20c6492b1d (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv) @@ -2825,24 +2819,24 @@ hwlocality_helper_distribute Distributing items over a topology - a00201.html + a00198.html hwloc_distrib_flags_e - a00201.html + a00198.html ga8b835295a52b6768a5e6c8abb1f9c54d HWLOC_DISTRIB_FLAG_REVERSE - a00201.html + a00198.html gga8b835295a52b6768a5e6c8abb1f9c54da2ca08404bfbebe9ed5f34c3d7635425a static int hwloc_distrib - a00201.html + a00198.html ga7b0c28f797c2ff17fa2f244ebbd55b33 (hwloc_topology_t topology, hwloc_obj_t *roots, unsigned n_roots, hwloc_cpuset_t *set, unsigned n, int until, unsigned long flags) @@ -2850,46 +2844,46 @@ hwlocality_helper_topology_sets CPU and node sets of entire topologies - a00202.html + a00199.html hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset - a00202.html + a00199.html gaee30e03391c1ed7dfd617fb5c7bbb033 (hwloc_topology_t topology) hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset - a00202.html + a00199.html ga79212faa07b70dd26588941b17d9fa82 (hwloc_topology_t topology) hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset - a00202.html + a00199.html ga517d5d68ec9f24583d8933aab713be8e (hwloc_topology_t topology) hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset - a00202.html + a00199.html ga773fd98949461ef4c1e3170bb0c0418f (hwloc_topology_t topology) hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset - a00202.html + a00199.html ga3fd37303e99ace8b0d0ea03f95f8c514 (hwloc_topology_t topology) hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset - a00202.html + a00199.html ga21a4d7237a11e76b912ed4524ab78cbd (hwloc_topology_t topology) @@ -2897,18 +2891,18 @@ hwlocality_helper_nodeset_convert Converting between CPU sets and node sets - a00203.html + a00200.html static int hwloc_cpuset_to_nodeset - a00203.html + a00200.html ga185751c1653fedbeb7cc480840f38cde (hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset) static int hwloc_cpuset_from_nodeset - a00203.html + a00200.html gad5ee8691e08a3538ea7633344c00456d (hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset) @@ -2916,53 +2910,53 @@ hwlocality_advanced_io Finding I/O objects - a00204.html + a00201.html static hwloc_obj_t hwloc_get_non_io_ancestor_obj - a00204.html + a00201.html gaf139bb61375178e90cc3f1835b452ab6 (hwloc_topology_t topology, hwloc_obj_t ioobj) static hwloc_obj_t hwloc_get_next_pcidev - a00204.html + a00201.html ga66470dabce9db19a57c5940a909d0baa (hwloc_topology_t topology, hwloc_obj_t prev) static hwloc_obj_t hwloc_get_pcidev_by_busid - a00204.html + a00201.html gacdbaf0db98872e224b7883a84bfb0455 (hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func) static hwloc_obj_t hwloc_get_pcidev_by_busidstring - a00204.html + a00201.html ga23a978469353134b3104b846fe2efceb (hwloc_topology_t topology, const char *busid) static hwloc_obj_t hwloc_get_next_osdev - a00204.html + a00201.html ga8b4584c8949e2c5f1c97ba7fe92b8145 (hwloc_topology_t topology, hwloc_obj_t prev) static hwloc_obj_t hwloc_get_next_bridge - a00204.html + a00201.html ga9dba22a3f4f701f2a46780ba9a0bbbe7 (hwloc_topology_t topology, hwloc_obj_t prev) static int hwloc_bridge_covers_pcibus - a00204.html + a00201.html ga0d92a9462a3d317f29ecb4442a307fb1 (hwloc_obj_t bridge, unsigned domain, unsigned bus) @@ -2970,389 +2964,389 @@ hwlocality_bitmap The bitmap API - a00205.html + a00202.html #define hwloc_bitmap_foreach_begin - a00205.html + a00202.html ga3f6861045a8029ade373510ffa727d2a (id, bitmap) #define hwloc_bitmap_foreach_end - a00205.html + a00202.html gafcf3246db406218d4e155735b3fa6528 () struct hwloc_bitmap_s * hwloc_bitmap_t - a00205.html + a00202.html gaa3c2bf4c776d603dcebbb61b0c923d84 const struct hwloc_bitmap_s * hwloc_const_bitmap_t - a00205.html + a00202.html gae991a108af01d408be2776c5b2c467b2 hwloc_bitmap_t hwloc_bitmap_alloc - a00205.html + a00202.html gadece3d1eb5199fc2fb99bc7dcf1ccc05 (void) hwloc_bitmap_t hwloc_bitmap_alloc_full - a00205.html + a00202.html ga02853b4a224970587b9d7a0e20d857c0 (void) void hwloc_bitmap_free - a00205.html + a00202.html ga156130d85b3a0674d6e0e6770fe68fbe (hwloc_bitmap_t bitmap) hwloc_bitmap_t hwloc_bitmap_dup - a00205.html + a00202.html gae679434c1a5f41d3560a8a7e2c1b0dee (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_copy - a00205.html + a00202.html ga72a29824798b48784b8217471ec8f14c (hwloc_bitmap_t dst, hwloc_const_bitmap_t src) int hwloc_bitmap_snprintf - a00205.html + a00202.html ga9511644657030a021dce9941e3cda583 (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap) int hwloc_bitmap_asprintf - a00205.html + a00202.html ga0fece972134fdecf2da9bc7a11dd827e (char **strp, hwloc_const_bitmap_t bitmap) int hwloc_bitmap_sscanf - a00205.html + a00202.html ga064a85c643a364b60acbfa0f3663fc18 (hwloc_bitmap_t bitmap, const char *restrict string) int hwloc_bitmap_list_snprintf - a00205.html + a00202.html ga3d06e6447edeb61e56a9ad83f31f0a37 (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap) int hwloc_bitmap_list_asprintf - a00205.html + a00202.html ga39c0f1b02053de66d205c9f8260b3665 (char **strp, hwloc_const_bitmap_t bitmap) int hwloc_bitmap_list_sscanf - a00205.html + a00202.html gaf9314311d482c621e17c6a53a9fe993e (hwloc_bitmap_t bitmap, const char *restrict string) int hwloc_bitmap_taskset_snprintf - a00205.html + a00202.html ga5beb68a987fe48e5c5edef06ab260e14 (char *restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap) int hwloc_bitmap_taskset_asprintf - a00205.html + a00202.html ga391312513f17c985d871f18367c59512 (char **strp, hwloc_const_bitmap_t bitmap) int hwloc_bitmap_taskset_sscanf - a00205.html + a00202.html ga4f23db5041240e03e348752f8bd6ec2d (hwloc_bitmap_t bitmap, const char *restrict string) void hwloc_bitmap_zero - a00205.html + a00202.html gaa97c5217613c8cae9862287170ea2132 (hwloc_bitmap_t bitmap) void hwloc_bitmap_fill - a00205.html + a00202.html ga07b2de8786b3cdb22f21d9dd42588275 (hwloc_bitmap_t bitmap) int hwloc_bitmap_only - a00205.html + a00202.html ga10be0840cdeb7ce26d862819dd303baa (hwloc_bitmap_t bitmap, unsigned id) int hwloc_bitmap_allbut - a00205.html + a00202.html ga06d505f8a1c0a536614f65f503ee6d93 (hwloc_bitmap_t bitmap, unsigned id) int hwloc_bitmap_from_ulong - a00205.html + a00202.html gad59b0ebeb29c1bfabbb2a379e55c1159 (hwloc_bitmap_t bitmap, unsigned long mask) int hwloc_bitmap_from_ith_ulong - a00205.html + a00202.html ga4947c46d47bcfcd3faf3f59569be3e37 (hwloc_bitmap_t bitmap, unsigned i, unsigned long mask) int hwloc_bitmap_from_ulongs - a00205.html + a00202.html gabcfef22f6fc4d4b33f068dd91a1c38f5 (hwloc_bitmap_t bitmap, unsigned nr, const unsigned long *masks) int hwloc_bitmap_set - a00205.html + a00202.html ga062dbff93baeff3b425a7260c5463646 (hwloc_bitmap_t bitmap, unsigned id) int hwloc_bitmap_set_range - a00205.html + a00202.html ga9c9a8433732fb9f24899e7aa4c014d7e (hwloc_bitmap_t bitmap, unsigned begin, int end) int hwloc_bitmap_set_ith_ulong - a00205.html + a00202.html ga3daeed965c35c6d2fd4820a318219985 (hwloc_bitmap_t bitmap, unsigned i, unsigned long mask) int hwloc_bitmap_clr - a00205.html + a00202.html gaf20bb350b6844d08931a064a73f86743 (hwloc_bitmap_t bitmap, unsigned id) int hwloc_bitmap_clr_range - a00205.html + a00202.html ga833776709df94d727f8c22304b3388cf (hwloc_bitmap_t bitmap, unsigned begin, int end) int hwloc_bitmap_singlify - a00205.html + a00202.html gaa611a77c092e679246afdf9a60d5db8b (hwloc_bitmap_t bitmap) unsigned long hwloc_bitmap_to_ulong - a00205.html + a00202.html gab6a6bae22a33ec6adfc169a953c13e6c (hwloc_const_bitmap_t bitmap) unsigned long hwloc_bitmap_to_ith_ulong - a00205.html + a00202.html gac92e6404f648d6b99d2c626b05b2ffa4 (hwloc_const_bitmap_t bitmap, unsigned i) int hwloc_bitmap_to_ulongs - a00205.html + a00202.html gacd215a2348732de25d94a4ecd76d528c (hwloc_const_bitmap_t bitmap, unsigned nr, unsigned long *masks) int hwloc_bitmap_nr_ulongs - a00205.html + a00202.html gac0744734d761d65c977aece565364908 (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_isset - a00205.html + a00202.html ga11340dd487f110bb84f0a6e4ae90bd06 (hwloc_const_bitmap_t bitmap, unsigned id) int hwloc_bitmap_iszero - a00205.html + a00202.html ga5b64be28f5a7176ed8ad0d6a90bdf108 (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_isfull - a00205.html + a00202.html ga5fdcb8c19c336511c37076d649e74af4 (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_first - a00205.html + a00202.html ga3ec1ced43afadf8c0a7197320bc016ed (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_next - a00205.html + a00202.html gaab7240b4b644693b775dad17b44ffd68 (hwloc_const_bitmap_t bitmap, int prev) int hwloc_bitmap_last - a00205.html + a00202.html ga3d9b08b060a59bbab5a4ea6d0a1ed7a6 (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_weight - a00205.html + a00202.html ga0200466842c0e1f5da75e84dde460b10 (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_first_unset - a00205.html + a00202.html gae408841487b288e148a478ba0465c99e (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_next_unset - a00205.html + a00202.html ga9653af34d1460ef106b7df25af4cdca8 (hwloc_const_bitmap_t bitmap, int prev) int hwloc_bitmap_last_unset - a00205.html + a00202.html ga45d49aeb45c7da631b1480a93dc3fc92 (hwloc_const_bitmap_t bitmap) int hwloc_bitmap_or - a00205.html + a00202.html ga120b8aefb9ce7ef349929656359b1859 (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) int hwloc_bitmap_and - a00205.html + a00202.html ga674533016ffed922a28b4f0b49b82cd4 (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) int hwloc_bitmap_andnot - a00205.html + a00202.html ga7ca5c72db65406b85aca032c8a990f9e (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) int hwloc_bitmap_xor - a00205.html + a00202.html ga205508218e09cb9befd0687f16409f09 (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) int hwloc_bitmap_not - a00205.html + a00202.html ga84cfdb4f8ab8c1f7e097728e613a2a3f (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap) int hwloc_bitmap_intersects - a00205.html + a00202.html gaefa070f9232857ba5a57297ea9a08ea2 (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) int hwloc_bitmap_isincluded - a00205.html + a00202.html ga0526e03db81956fb02acc8260b66d6a4 (hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap) int hwloc_bitmap_isequal - a00205.html + a00202.html ga32376b1405e57472b73c3aa53bb39663 (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) int hwloc_bitmap_compare_first - a00205.html + a00202.html gaa39cda1510ab721b5c012c76ead72365 (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) int hwloc_bitmap_compare - a00205.html + a00202.html ga14cdbc0ef0a705e84999bd48a2e649f3 (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) @@ -3360,66 +3354,66 @@ hwlocality_xmlexport Exporting Topologies to XML - a00206.html + a00203.html hwloc_topology_export_xml_flags_e - a00206.html + a00203.html ga0eb99636aff71fe2704e1fa0ffe8c18d HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1 - a00206.html + a00203.html gga0eb99636aff71fe2704e1fa0ffe8c18dae7d6d96546131ef0043867b836b02e0f int hwloc_topology_export_xml - a00206.html + a00203.html ga333f79975b4eeb28a3d8fad3373583ce (hwloc_topology_t topology, const char *xmlpath, unsigned long flags) int hwloc_topology_export_xmlbuffer - a00206.html + a00203.html gad33b7f7c11db10459505a3b1634fd3f1 (hwloc_topology_t topology, char **xmlbuffer, int *buflen, unsigned long flags) void hwloc_free_xmlbuffer - a00206.html + a00203.html ga293e4a6489f15fd16ad22a5734561cf1 (hwloc_topology_t topology, char *xmlbuffer) void hwloc_topology_set_userdata_export_callback - a00206.html + a00203.html ga9d6ff0f7a8dd45be9aa8575ef31978cc (hwloc_topology_t topology, void(*export_cb)(void *reserved, hwloc_topology_t topology, hwloc_obj_t obj)) int hwloc_export_obj_userdata - a00206.html + a00203.html gaa541bdd628416dbbe97d0df69d3de958 (void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length) int hwloc_export_obj_userdata_base64 - a00206.html + a00203.html ga1b7358137cec27bd073f58a606ecbaba (void *reserved, hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length) void hwloc_topology_set_userdata_import_callback - a00206.html + a00203.html ga5ac6917ea7289955fb1ffda4353af9b0 (hwloc_topology_t topology, void(*import_cb)(hwloc_topology_t topology, hwloc_obj_t obj, const char *name, const void *buffer, size_t length)) @@ -3427,42 +3421,42 @@ hwlocality_syntheticexport Exporting Topologies to Synthetic - a00207.html + a00204.html hwloc_topology_export_synthetic_flags_e - a00207.html + a00204.html ga7ac6f97cc40bd50c40285084f869ba63 HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_EXTENDED_TYPES - a00207.html + a00204.html gga7ac6f97cc40bd50c40285084f869ba63a3b3bd4ba2ef9990810865e561034ccc9 HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS - a00207.html + a00204.html gga7ac6f97cc40bd50c40285084f869ba63aaa2702ffba050bab079b3041aec737d4 HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1 - a00207.html + a00204.html gga7ac6f97cc40bd50c40285084f869ba63a7896bdf4ccfcdcd09a9f76c0f5e3a5b8 HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_IGNORE_MEMORY - a00207.html + a00204.html gga7ac6f97cc40bd50c40285084f869ba63a22c57cf18e1da4a6c584fb783b552f9f int hwloc_topology_export_synthetic - a00207.html + a00204.html ga24b7864a1c588309c4749f621f03b4c7 (hwloc_topology_t topology, char *buffer, size_t buflen, unsigned long flags) @@ -3470,84 +3464,84 @@ hwlocality_distances_get Retrieve distances between objects - a00208.html + a00205.html hwloc_distances_s hwloc_distances_kind_e - a00208.html + a00205.html gab1bb10d3adb85b52cdc6fe5a7f74f108 HWLOC_DISTANCES_KIND_FROM_OS - a00208.html + a00205.html ggab1bb10d3adb85b52cdc6fe5a7f74f108a90dc38248c8d5392d4dd3e88f391e984 HWLOC_DISTANCES_KIND_FROM_USER - a00208.html + a00205.html ggab1bb10d3adb85b52cdc6fe5a7f74f108a0148d7f9be833a04f5a55455437c227b HWLOC_DISTANCES_KIND_MEANS_LATENCY - a00208.html + a00205.html ggab1bb10d3adb85b52cdc6fe5a7f74f108afd6a3503fbc8f7c1a31235373cefc4c6 HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH - a00208.html + a00205.html ggab1bb10d3adb85b52cdc6fe5a7f74f108a41b19f141a3c0ffe85f9affaca4b0293 HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES - a00208.html + a00205.html ggab1bb10d3adb85b52cdc6fe5a7f74f108aa6cf2b6dfcf148b65952f811814efbe1 int hwloc_distances_get - a00208.html + a00205.html ga613e6b2a5d0f06626ee8d0c12fa46691 (hwloc_topology_t topology, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags) int hwloc_distances_get_by_depth - a00208.html + a00205.html ga5d1d35eccfcc2ebcef71a10972ce9b03 (hwloc_topology_t topology, int depth, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags) int hwloc_distances_get_by_type - a00208.html + a00205.html gaaa6bfbc20072a4f4de132eec859067f6 (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned *nr, struct hwloc_distances_s **distances, unsigned long kind, unsigned long flags) int hwloc_distances_get_by_name - a00208.html + a00205.html gaa457f35b8745ca41ec17797c0d7b20f0 (hwloc_topology_t topology, const char *name, unsigned *nr, struct hwloc_distances_s **distances, unsigned long flags) const char * hwloc_distances_get_name - a00208.html + a00205.html gaa6f9697028c589cef0458edef5fe273f (hwloc_topology_t topology, struct hwloc_distances_s *distances) void hwloc_distances_release - a00208.html + a00205.html ga1dd78c1f9acd54f26aba0e284e97e51d (hwloc_topology_t topology, struct hwloc_distances_s *distances) @@ -3555,18 +3549,18 @@ hwlocality_distances_consult Helpers for consulting distance matrices - a00209.html + a00206.html static int hwloc_distances_obj_index - a00209.html + a00206.html gab9e770c7d56c5d6040f26bd1dc8854cd (struct hwloc_distances_s *distances, hwloc_obj_t obj) static int hwloc_distances_obj_pair_values - a00209.html + a00206.html ga3c665b23056e3269f777b21a67148c82 (struct hwloc_distances_s *distances, hwloc_obj_t obj1, hwloc_obj_t obj2, hwloc_uint64_t *value1to2, hwloc_uint64_t *value2to1) @@ -3574,58 +3568,58 @@ hwlocality_distances_add Add or remove distances between objects - a00210.html + a00207.html hwloc_distances_add_flag_e - a00210.html + a00207.html ga22428b6bab271411e3834e6b4ca22e37 HWLOC_DISTANCES_ADD_FLAG_GROUP - a00210.html + a00207.html gga22428b6bab271411e3834e6b4ca22e37a7f6baba797d70538d03c9d13052c62ab HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE - a00210.html + a00207.html gga22428b6bab271411e3834e6b4ca22e37a5233ccf631c3bc53dd5c3e7a5d5c9b77 int hwloc_distances_add - a00210.html + a00207.html gac5a71d96cd86efe31d6f8d282aae3d97 (hwloc_topology_t topology, unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values, unsigned long kind, unsigned long flags) int hwloc_distances_remove - a00210.html + a00207.html gac188d9b64d9560255ce5f6d0a20f9c0a (hwloc_topology_t topology) int hwloc_distances_remove_by_depth - a00210.html + a00207.html gaa642a4c1a21c84f38ae23fca8a27845d (hwloc_topology_t topology, int depth) static int hwloc_distances_remove_by_type - a00210.html + a00207.html ga93db53773c96f5b83815e8441e2ebb93 (hwloc_topology_t topology, hwloc_obj_type_t type) int hwloc_distances_release_remove - a00210.html + a00207.html ga80bbf6f0db9af48c61780dd5152664c2 (hwloc_topology_t topology, struct hwloc_distances_s *distances) @@ -3633,32 +3627,32 @@ hwlocality_linux Linux-specific helpers - a00211.html + a00208.html int hwloc_linux_set_tid_cpubind - a00211.html + a00208.html ga630e699c56b5f3d2e534b475944c216e (hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set) int hwloc_linux_get_tid_cpubind - a00211.html + a00208.html gaddcb985cb56337a4d6693cee72e7bf94 (hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set) int hwloc_linux_get_tid_last_cpu_location - a00211.html + a00208.html gacc7945c2d06c6db1e58f8fd953009134 (hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set) int hwloc_linux_read_path_as_cpumask - a00211.html + a00208.html gaf72d83e273803226ce772973e37b85de (const char *path, hwloc_bitmap_t set) @@ -3666,32 +3660,32 @@ hwlocality_linux_libnuma_ulongs Interoperability with Linux libnuma unsigned long masks - a00212.html + a00209.html static int hwloc_cpuset_to_linux_libnuma_ulongs - a00212.html + a00209.html gae577962390f84b0b12f503314ab0f972 (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, unsigned long *mask, unsigned long *maxnode) static int hwloc_nodeset_to_linux_libnuma_ulongs - a00212.html + a00209.html ga585ccf818d2f217f4e53f9c6506c3128 (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, unsigned long *mask, unsigned long *maxnode) static int hwloc_cpuset_from_linux_libnuma_ulongs - a00212.html + a00209.html ga0e9d051e068940f722f6fdc61814149d (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const unsigned long *mask, unsigned long maxnode) static int hwloc_nodeset_from_linux_libnuma_ulongs - a00212.html + a00209.html gad8491c672eb2594cc5e7b0a026867192 (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const unsigned long *mask, unsigned long maxnode) @@ -3699,32 +3693,32 @@ hwlocality_linux_libnuma_bitmask Interoperability with Linux libnuma bitmask - a00213.html + a00210.html static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask - a00213.html + a00210.html gad8769b4544c0aeef154fc8223144e343 (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset) static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask - a00213.html + a00210.html gadfaa14c1bec76965ac2e05f0c3f3473b (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset) static int hwloc_cpuset_from_linux_libnuma_bitmask - a00213.html + a00210.html ga37c8421110b1842414809019098794ef (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const struct bitmask *bitmask) static int hwloc_nodeset_from_linux_libnuma_bitmask - a00213.html + a00210.html gaaca6bff3086aad5bdbd2f4c5f0ad14cc (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const struct bitmask *bitmask) @@ -3732,18 +3726,18 @@ hwlocality_glibc_sched Interoperability with glibc sched affinity - a00214.html + a00211.html static int hwloc_cpuset_to_glibc_sched_affinity - a00214.html + a00211.html ga88699a0c86c66a9b7baa3468cd9d24c3 (hwloc_topology_t topology, hwloc_const_cpuset_t hwlocset, cpu_set_t *schedset, size_t schedsetsize) static int hwloc_cpuset_from_glibc_sched_affinity - a00214.html + a00211.html ga8ec807ec17de57fa77aa5cfd6c8e4bfb (hwloc_topology_t topology, hwloc_cpuset_t hwlocset, const cpu_set_t *schedset, size_t schedsetsize) @@ -3751,32 +3745,32 @@ hwlocality_opencl Interoperability with OpenCL - a00215.html + a00212.html static int hwloc_opencl_get_device_pci_busid - a00215.html + a00212.html gab89e4d20f8a353299351b41849e35ac9 (cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func) static int hwloc_opencl_get_device_cpuset - a00215.html + a00212.html gacc32737d4648d16b0d292438f210ec90 (hwloc_topology_t topology, cl_device_id device, hwloc_cpuset_t set) static hwloc_obj_t hwloc_opencl_get_device_osdev_by_index - a00215.html + a00212.html gae39352d124cb330eb37b84b418ed6cc5 (hwloc_topology_t topology, unsigned platform_index, unsigned device_index) static hwloc_obj_t hwloc_opencl_get_device_osdev - a00215.html + a00212.html gadabfa6516aa12e5d8f79b9b4dd9f3cf8 (hwloc_topology_t topology, cl_device_id device) @@ -3784,39 +3778,39 @@ hwlocality_cuda Interoperability with the CUDA Driver API - a00216.html + a00213.html static int hwloc_cuda_get_device_pci_ids - a00216.html + a00213.html ga1084285e8ff8b7df91c28917637481c6 (hwloc_topology_t topology, CUdevice cudevice, int *domain, int *bus, int *dev) static int hwloc_cuda_get_device_cpuset - a00216.html + a00213.html gaec41c6b4dc3361156beb7dea2a74f5a3 (hwloc_topology_t topology, CUdevice cudevice, hwloc_cpuset_t set) static hwloc_obj_t hwloc_cuda_get_device_pcidev - a00216.html + a00213.html ga11fed607fa404e29e8da010f3ec128e4 (hwloc_topology_t topology, CUdevice cudevice) static hwloc_obj_t hwloc_cuda_get_device_osdev - a00216.html + a00213.html ga252cb72175f1a2d682f883a0add80a66 (hwloc_topology_t topology, CUdevice cudevice) static hwloc_obj_t hwloc_cuda_get_device_osdev_by_index - a00216.html + a00213.html ga12ee892994ed037e8f64bbffda02cf2e (hwloc_topology_t topology, unsigned idx) @@ -3824,32 +3818,32 @@ hwlocality_cudart Interoperability with the CUDA Runtime API - a00217.html + a00214.html static int hwloc_cudart_get_device_pci_ids - a00217.html + a00214.html gad8b701d9a34923e34bd58defd4c1e704 (hwloc_topology_t topology, int idx, int *domain, int *bus, int *dev) static int hwloc_cudart_get_device_cpuset - a00217.html + a00214.html ga187ca00c6e12800a25151ce331620980 (hwloc_topology_t topology, int idx, hwloc_cpuset_t set) static hwloc_obj_t hwloc_cudart_get_device_pcidev - a00217.html + a00214.html gaeda4e6efbb36b518b2c286434ad23bb2 (hwloc_topology_t topology, int idx) static hwloc_obj_t hwloc_cudart_get_device_osdev_by_index - a00217.html + a00214.html gac0f3eeaf7712919f298097b1a21307b0 (hwloc_topology_t topology, unsigned idx) @@ -3857,25 +3851,25 @@ hwlocality_nvml Interoperability with the NVIDIA Management Library - a00218.html + a00215.html static int hwloc_nvml_get_device_cpuset - a00218.html + a00215.html ga26cf0036d09ec4d7cb692380fac9659d (hwloc_topology_t topology, nvmlDevice_t device, hwloc_cpuset_t set) static hwloc_obj_t hwloc_nvml_get_device_osdev_by_index - a00218.html + a00215.html gacd50fd0e2766ee05bc13234b46714756 (hwloc_topology_t topology, unsigned idx) static hwloc_obj_t hwloc_nvml_get_device_osdev - a00218.html + a00215.html gaf176159b5760a191871eff23f5a69ee9 (hwloc_topology_t topology, nvmlDevice_t device) @@ -3883,70 +3877,51 @@ hwlocality_gl Interoperability with OpenGL displays - a00219.html + a00216.html static hwloc_obj_t hwloc_gl_get_display_osdev_by_port_device - a00219.html + a00216.html ga4d66a77e4fe4051d6e5b772c1b8fcec5 (hwloc_topology_t topology, unsigned port, unsigned device) static hwloc_obj_t hwloc_gl_get_display_osdev_by_name - a00219.html + a00216.html ga2d36ef441d1dfddf49cfb5c01bd58d8e (hwloc_topology_t topology, const char *name) static int hwloc_gl_get_display_by_osdev - a00219.html + a00216.html ga936665ab5f0d29a081c4b78d11f4ad07 (hwloc_topology_t topology, hwloc_obj_t osdev, unsigned *port, unsigned *device) - hwlocality_intel_mic - Interoperability with Intel Xeon Phi (MIC) - a00220.html - - static int - hwloc_intel_mic_get_device_cpuset - a00220.html - ga91bafa51abe81527f72437e24ad5944e - (hwloc_topology_t topology, int idx, hwloc_cpuset_t set) - - - static hwloc_obj_t - hwloc_intel_mic_get_device_osdev_by_index - a00220.html - gabce0465e853de74be84cafcb96dd48ab - (hwloc_topology_t topology, unsigned idx) - - - hwlocality_openfabrics Interoperability with OpenFabrics - a00221.html + a00217.html static int hwloc_ibv_get_device_cpuset - a00221.html + a00217.html ga3ea0d838c1e7f1671b35687aae2da6ae (hwloc_topology_t topology, struct ibv_device *ibdev, hwloc_cpuset_t set) static hwloc_obj_t hwloc_ibv_get_device_osdev_by_name - a00221.html + a00217.html ga31d794567f4420bbdc8baa7bf8bf6138 (hwloc_topology_t topology, const char *ibname) static hwloc_obj_t hwloc_ibv_get_device_osdev - a00221.html + a00217.html ga7324cdfd5db6ed2669c051ef7e1b64e1 (hwloc_topology_t topology, struct ibv_device *ibdev) @@ -3954,133 +3929,133 @@ hwlocality_diff Topology differences - a00222.html + a00218.html hwloc_topology_diff_obj_attr_u hwloc_topology_diff_u enum hwloc_topology_diff_obj_attr_type_e hwloc_topology_diff_obj_attr_type_t - a00222.html - ga5f2dd099de2cacdc0d0d4858154b971a + a00218.html + ga74a3fefbaa17582fea86d76b312d6254 enum hwloc_topology_diff_type_e hwloc_topology_diff_type_t - a00222.html - ga4b86adb00c8b2d09ebc4ef8f3bfd92b2 + a00218.html + ga8470f631b7365c839d3e40d38c5b6291 union hwloc_topology_diff_u * hwloc_topology_diff_t - a00222.html - ga2cf1b17332fe5d95f2198f6340cfd288 + a00218.html + ga1bd6363f26f7961f83153aaa484a9b85 hwloc_topology_diff_obj_attr_type_e - a00222.html + a00218.html ga86f044210b0a9e9fa83acbdbbf7e05fd HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE - a00222.html + a00218.html gga86f044210b0a9e9fa83acbdbbf7e05fdabc7f0c7ed0b6864e902f4b70f2c7bc94 HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME - a00222.html + a00218.html gga86f044210b0a9e9fa83acbdbbf7e05fda94a8f37c51d62d15ac6192665dd49310 HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO - a00222.html + a00218.html gga86f044210b0a9e9fa83acbdbbf7e05fda63430bf932434bc456282f636d39c2c2 hwloc_topology_diff_type_e - a00222.html + a00218.html ga38b28b7423b85a3321e6d0062d5f83d0 HWLOC_TOPOLOGY_DIFF_OBJ_ATTR - a00222.html + a00218.html gga38b28b7423b85a3321e6d0062d5f83d0accbcaee230f79989debb284c8626f0c0 HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX - a00222.html + a00218.html gga38b28b7423b85a3321e6d0062d5f83d0a3dc01fdeff355efe3fb2516bb454a147 hwloc_topology_diff_apply_flags_e - a00222.html + a00218.html gada4c1273ce020afaf02b649496f7edf5 HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE - a00222.html + a00218.html ggada4c1273ce020afaf02b649496f7edf5a821a160512d67ea0dd05dab873d2fc54 int hwloc_topology_diff_build - a00222.html + a00218.html ga8a1754f69fbb31364ea3ea2c39827c9f (hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff) int hwloc_topology_diff_apply - a00222.html + a00218.html gae7b350d7e7478a4c6047b08aa6544f40 (hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags) int hwloc_topology_diff_destroy - a00222.html + a00218.html ga5dcff18f80583ac6505a94ba2877fd1b (hwloc_topology_diff_t diff) int hwloc_topology_diff_load_xml - a00222.html + a00218.html ga2cd902ce8766e90d4f2523a8e87640e9 (const char *xmlpath, hwloc_topology_diff_t *diff, char **refname) int hwloc_topology_diff_export_xml - a00222.html + a00218.html ga8a14dd7d01efbdd97af7fe85e8b84b20 (hwloc_topology_diff_t diff, const char *refname, const char *xmlpath) int hwloc_topology_diff_load_xmlbuffer - a00222.html + a00218.html gad693810a5c51628529b9dd56f040fb81 (const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname) int hwloc_topology_diff_export_xmlbuffer - a00222.html + a00218.html gaa2f0918df60c1c4a0bef9411f7d92a13 (hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen) @@ -4088,25 +4063,25 @@ hwlocality_shmem Sharing topologies between processes - a00223.html + a00219.html int hwloc_shmem_topology_get_length - a00223.html + a00219.html ga772ab52750cdd0eec85128df24888001 (hwloc_topology_t topology, size_t *lengthp, unsigned long flags) int hwloc_shmem_topology_write - a00223.html + a00219.html ga61b20e346fc76f76420e3a88cc80a671 (hwloc_topology_t topology, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags) int hwloc_shmem_topology_adopt - a00223.html + a00219.html ga21545bd0f09d9b554c8e60a630e0e629 (hwloc_topology_t *topologyp, int fd, hwloc_uint64_t fileoffset, void *mmap_address, size_t length, unsigned long flags) @@ -4114,101 +4089,101 @@ hwlocality_disc_components Components and Plugins: Discovery components - a00224.html + a00220.html hwloc_disc_component hwlocality_disc_backends Components and Plugins: Discovery backends - a00225.html + a00221.html hwloc_disc_status hwloc_backend enum hwloc_disc_phase_e hwloc_disc_phase_t - a00225.html - ga3beef9f01f1c08c5700aec066fcec025 + a00221.html + ga600bba1a62022d5f516800649b1edb61 hwloc_disc_phase_e - a00225.html + a00221.html ga8c314121c2fc478161bcce758688b9a1 HWLOC_DISC_PHASE_GLOBAL - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1ab41c626c79e9ccb1e7d41e7076972283 HWLOC_DISC_PHASE_CPU - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1a6360474df197027761a69bd5fc620250 HWLOC_DISC_PHASE_MEMORY - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1ac4264a243844c5fbbff495cdb1b4d51d HWLOC_DISC_PHASE_PCI - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1a677c52064dd987af4988346319b3675a HWLOC_DISC_PHASE_IO - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1aa8e10626cba9af72f5605a1acbdc0015 HWLOC_DISC_PHASE_MISC - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1a8a7cde9bff0ab0d085b102a3e934939b HWLOC_DISC_PHASE_ANNOTATE - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1a68ca5c7ad75a6d9e5355689411621773 HWLOC_DISC_PHASE_TWEAK - a00225.html + a00221.html gga8c314121c2fc478161bcce758688b9a1ada3ed3f00e74909353d6ea4a96cde5ad hwloc_disc_status_flag_e - a00225.html + a00221.html gaae1b38cf9b12e489884ce2a07275964b HWLOC_DISC_STATUS_FLAG_GOT_ALLOWED_RESOURCES - a00225.html + a00221.html ggaae1b38cf9b12e489884ce2a07275964ba205d644d54a0840bd9165fce7d19e6b1 struct hwloc_backend * hwloc_backend_alloc - a00225.html + a00221.html gadb068565ab6043cbe4d16bfcce067a61 (struct hwloc_topology *topology, struct hwloc_disc_component *component) int hwloc_backend_enable - a00225.html + a00221.html ga4715779d7191833e9b1a7490989a7497 (struct hwloc_backend *backend) @@ -4216,31 +4191,31 @@ hwlocality_generic_components Components and Plugins: Generic components - a00226.html + a00222.html hwloc_component enum hwloc_component_type_e hwloc_component_type_t - a00226.html - ga0aebfa65317af10bb18d7d35f6dc05b8 + a00222.html + ga31a5a455f4e666b936f0a9e8fb9a0f47 hwloc_component_type_e - a00226.html + a00222.html ga397a1bf7d21dd073320ad0045340f463 HWLOC_COMPONENT_TYPE_DISC - a00226.html + a00222.html gga397a1bf7d21dd073320ad0045340f463a5d6e561f467fe9795a29e7368b613900 HWLOC_COMPONENT_TYPE_XML - a00226.html + a00222.html gga397a1bf7d21dd073320ad0045340f463adea00cd839c2141c032e1569fd5592bd @@ -4248,74 +4223,74 @@ hwlocality_components_core_funcs Components and Plugins: Core functions to be used by components - a00227.html + a00223.html void(* hwloc_report_error_t - a00227.html + a00223.html ga1ac8191022b0d3b1bf0070e11d1f1155 )(const char *msg, int line) struct hwloc_obj * hwloc_insert_object_by_cpuset - a00227.html + a00223.html gafd853fd67e12c32916201d8303ef39d2 (struct hwloc_topology *topology, hwloc_obj_t obj) void hwloc_report_os_error - a00227.html + a00223.html ga3ae154590328522a864f4a7fb453b562 (const char *msg, int line) int hwloc_hide_errors - a00227.html + a00223.html gab527c1e0f243f057d31a724794ad9f88 (void) struct hwloc_obj * hwloc__insert_object_by_cpuset - a00227.html + a00223.html ga9f789a1bd5d5d45e1c0e26305164248b (struct hwloc_topology *topology, hwloc_obj_t root, hwloc_obj_t obj, hwloc_report_error_t report_error) void hwloc_insert_object_by_parent - a00227.html + a00223.html ga0ef97debde503b56367689b07bb3e901 (struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj) hwloc_obj_t hwloc_alloc_setup_object - a00227.html + a00223.html ga0b5c75b2dc37cea2e8a29c4812baf4b3 (hwloc_topology_t topology, hwloc_obj_type_t type, unsigned os_index) int hwloc_obj_add_children_sets - a00227.html + a00223.html ga754b61041ceee9685534a2c5d3cd0156 (hwloc_obj_t obj) int hwloc_topology_reconnect - a00227.html + a00223.html ga120d8bd74922e1030b621409a6b0be61 (hwloc_topology_t topology, unsigned long flags) static int hwloc_plugin_check_namespace - a00227.html + a00223.html gac2eaed287bb215cf0bd33014e9e1d374 (const char *pluginname, const char *symbol) @@ -4323,32 +4298,32 @@ hwlocality_components_filtering Components and Plugins: Filtering objects - a00228.html + a00224.html static int hwloc_filter_check_pcidev_subtype_important - a00228.html + a00224.html ga60203db6459ebf275bf48c40a37661a0 (unsigned classid) static int hwloc_filter_check_osdev_subtype_important - a00228.html + a00224.html gac7d57a6d669820f360cf2a070a396560 (hwloc_obj_osdev_type_t subtype) static int hwloc_filter_check_keep_object_type - a00228.html + a00224.html ga2f402a43025a8a91e8513be1a15e4635 (hwloc_topology_t topology, hwloc_obj_type_t type) static int hwloc_filter_check_keep_object - a00228.html + a00224.html ga4d2fdce071e5646ef147c9ff1539d1c9 (hwloc_topology_t topology, hwloc_obj_t obj) @@ -4356,46 +4331,46 @@ hwlocality_components_pcidisc Components and Plugins: helpers for PCI discovery - a00229.html + a00225.html unsigned hwloc_pcidisc_find_cap - a00229.html + a00225.html ga706f71cfea09d547d2cbafa642d6e03b (const unsigned char *config, unsigned cap) int hwloc_pcidisc_find_linkspeed - a00229.html + a00225.html ga51d1ebcbf9729987c9d17df3aa57d209 (const unsigned char *config, unsigned offset, float *linkspeed) hwloc_obj_type_t hwloc_pcidisc_check_bridge_type - a00229.html + a00225.html ga6c55fb80c3d0c8c8e61078b3f38adde8 (unsigned device_class, const unsigned char *config) int hwloc_pcidisc_find_bridge_buses - a00229.html + a00225.html ga95acf6822a49447c11067d0b843965ba (unsigned domain, unsigned bus, unsigned dev, unsigned func, unsigned *secondary_busp, unsigned *subordinate_busp, const unsigned char *config) void hwloc_pcidisc_tree_insert_by_busid - a00229.html + a00225.html gab76ddc4f55db8101ef0d44317965128c (struct hwloc_obj **treep, struct hwloc_obj *obj) int hwloc_pcidisc_tree_attach - a00229.html + a00225.html gabda1d6c1799e50b9226f8a4da9bd29ea (struct hwloc_topology *topology, struct hwloc_obj *tree) @@ -4403,11 +4378,11 @@ hwlocality_components_pcifind Components and Plugins: finding PCI objects during other discoveries - a00230.html + a00226.html struct hwloc_obj * hwloc_pci_find_parent_by_busid - a00230.html + a00226.html ga7964833550947636ab8975909de3fa98 (struct hwloc_topology *topology, unsigned domain, unsigned bus, unsigned dev, unsigned func) @@ -4415,64 +4390,64 @@ netloc_api Netloc API - a00231.html + a00227.html NETLOC_SUCCESS - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea4deb864e4b46fe70b83c3220442a627c NETLOC_ERROR - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea4b33f8da6efc963562a93569ac8b349a NETLOC_ERROR_NOTDIR - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea6e4322619d38dec18dbd16a606b14aa8 NETLOC_ERROR_NOENT - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea81bc77a77d1a42054dc64b11a4cc8612 NETLOC_ERROR_EMPTY - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea0dc7c18a5a3d027bf3f835eacdbed932 NETLOC_ERROR_MULTIPLE - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea4485021555c6cb24d5f6e391b1bd6dee NETLOC_ERROR_NOT_IMPL - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea4a55d10dfc1eb5c84027de7d48dfac4d NETLOC_ERROR_EXISTS - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea67dfc8498fa899900e2231fad4538556 NETLOC_ERROR_NOT_FOUND - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea61b43e2553779d3610f894fd6698a6ee NETLOC_ERROR_MAX - a00231.html + a00227.html gga61dadd085c1777f559549e05962b2c9ea39974c6110bed527cb7658672b8eeeb9 @@ -4480,215 +4455,214 @@ hwloc_intro Hardware Locality (hwloc) Introduction - a00364 - hwloc_summary - hwloc_installation - cli_examples - interface - portability - interface_example - history - further_reading + a00360 + hwloc_summary + hwloc_installation + cli_examples + interface + portability + interface_example + history + further_reading termsanddefs Terms and Definitions - a00365 - termsanddefs_objects - termsanddefs_indexes - termsanddefs_tree + a00361 + termsanddefs_objects + termsanddefs_indexes + termsanddefs_tree tools Command-Line Tools - a00366 - cli_lstopo - cli_hwloc_bind - cli_hwloc_calc - cli_hwloc_info - cli_hwloc_distrib - cli_hwloc_ps - cli_hwloc_annotate - cli_hwloc_diffpatchcompress - cli_hwloc_dump_hwdata - cli_hwloc_gather + a00362 + cli_lstopo + cli_hwloc_bind + cli_hwloc_calc + cli_hwloc_info + cli_hwloc_distrib + cli_hwloc_ps + cli_hwloc_annotate + cli_hwloc_diffpatchcompress + cli_hwloc_dump_hwdata + cli_hwloc_gather envvar Environment Variables - a00367 + a00363 cpu_mem_bind CPU and Memory Binding Overview - a00368 + a00364 iodevices I/O Devices - a00369 - iodevices_enabling - iodevices_objects - iodevices_osdev - iodevices_pci - iodevices_consult - iodevices_examples + a00365 + iodevices_enabling + iodevices_objects + iodevices_osdev + iodevices_pci + iodevices_consult + iodevices_examples miscobjs Miscellaneous objects - a00370 - miscobjs_auto - miscobjs_annotate + a00366 + miscobjs_auto + miscobjs_annotate attributes Object attributes - a00371 - attributes_normal - attributes_info - attributes_info_platform - attributes_info_os - attributes_info_hwloc - attributes_info_cpu - attributes_info_osdev - attributes_info_otherobjs - attributes_info_user + a00367 + attributes_normal + attributes_info + attributes_info_platform + attributes_info_os + attributes_info_hwloc + attributes_info_cpu + attributes_info_osdev + attributes_info_otherobjs + attributes_info_user xml Importing and exporting topologies from/to XML files - a00372 - xml_backends - xml_errors + a00368 + xml_backends + xml_errors synthetic Synthetic topologies - a00373 - synthetic_string - synthetic_use - synthetic_export + a00369 + synthetic_string + synthetic_use + synthetic_export interoperability Interoperability With Other Software - a00374 + a00370 threadsafety Thread Safety - a00375 + a00371 plugins Components and plugins - a00376 - plugins_default - plugins_select - plugins_load - plugins_list + a00372 + plugins_default + plugins_select + plugins_load + plugins_list embed Embedding hwloc in Other Software - a00377 - embedding_m4 - embedding_example + a00373 + embedding_m4 + embedding_example faq Frequently Asked Questions - a00378 - faq1 - faq_why - faq_indexes - faq_structural - faq_onedim - faq_groups - faq_asymmetric - faq_nosmt - faq_smt - faq2 - faq_xml - faq_multitopo - faq_diff - faq_annotate - faq3 - faq_slow_lstopo - faq_privileged - faq_os_error - faq_valgrind - faq4 - faq_knl_numa - faq_knl_dump - faq_phi - faq_bgq - faq_windows - faq_netbsd_bind - faq_aix_bind - faq5 - faq_version_api - faq_version - faq_version_abi - faq_version_xml - faq_version_synthetic - faq_version_shmem + a00374 + faq1 + faq_why + faq_indexes + faq_structural + faq_onedim + faq_groups + faq_asymmetric + faq_nosmt + faq_smt + faq2 + faq_xml + faq_multitopo + faq_diff + faq_annotate + faq3 + faq_slow_lstopo + faq_privileged + faq_os_error + faq_valgrind + faq4 + faq_knl_numa + faq_knl_dump + faq_bgq + faq_windows + faq_netbsd_bind + faq_aix_bind + faq5 + faq_version_api + faq_version + faq_version_abi + faq_version_xml + faq_version_synthetic + faq_version_shmem upgrade_to_api_2x Upgrading to the hwloc 2.0 API - a00379 - upgrade_to_api_2x_memory - upgrade_to_api_2x_memory_children - upgrade_to_api_2x_memory_examples - upgrade_to_api_2x_numa_level - upgrade_to_api_2x_memory_find - upgrade_to_api_2x_children - upgrade_to_api_2x_io_misc_children - upgrade_to_api_2x_kinds_subsec - upgrade_to_api_2x_cache - upgrade_to_api_2x_allowed - upgrade_to_api_2x_depth - upgrade_to_api_2x_memory_attrs - upgrade_to_api_2x_config - upgrade_to_api_2x_xml - upgrade_to_api_2x_distances - upgrade_to_api_2x_return - upgrade_to_api_2x_misc - upgrade_to_api_2x_removals + a00375 + upgrade_to_api_2x_memory + upgrade_to_api_2x_memory_children + upgrade_to_api_2x_memory_examples + upgrade_to_api_2x_numa_level + upgrade_to_api_2x_memory_find + upgrade_to_api_2x_children + upgrade_to_api_2x_io_misc_children + upgrade_to_api_2x_kinds_subsec + upgrade_to_api_2x_cache + upgrade_to_api_2x_allowed + upgrade_to_api_2x_depth + upgrade_to_api_2x_memory_attrs + upgrade_to_api_2x_config + upgrade_to_api_2x_xml + upgrade_to_api_2x_distances + upgrade_to_api_2x_return + upgrade_to_api_2x_misc + upgrade_to_api_2x_removals netloc_intro Network Locality (netloc) - a00380 - netloc_summary - supportednetworks - netloc_installation - netloc_setup - netloc_draw - netloc_draw_setup - netloc_draw_tool + a00376 + netloc_summary + supportednetworks + netloc_installation + netloc_setup + netloc_draw + netloc_draw_setup + netloc_draw_tool netloc_scotch Netloc with Scotch - a00381 - scotch_intro - scotch_setup - scotch_tools_api - netlocscotch_arch - netlocscotch_subarch - netlocscotch_mapping + a00377 + scotch_intro + scotch_setup + scotch_tools_api + netlocscotch_arch + netlocscotch_subarch + netlocscotch_mapping index Hardware Locality index - common_introduction - common_installation - basic_installation - gitclone_installation - bugs + common_introduction + common_installation + basic_installation + gitclone_installation + bugs diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_advanced_io.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_advanced_io.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_advanced_io.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_advanced_io.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_advanced_io" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_advanced_io" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -43,7 +43,7 @@ .PP Get the next bridge in the system\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the first bridge if \fCprev\fP is \fCNULL\fP\&. .RE @@ -54,7 +54,7 @@ .PP Get the next OS device in the system\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the first OS device if \fCprev\fP is \fCNULL\fP\&. .RE @@ -65,7 +65,7 @@ .PP Get the next PCI device in the system\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the first PCI device if \fCprev\fP is \fCNULL\fP\&. .RE @@ -76,7 +76,7 @@ .PP Get the first non-I/O ancestor object\&. Given the I/O object \fCioobj\fP, find the smallest non-I/O ancestor object\&. This object (normal or memory) may then be used for binding because it has non-NULL CPU and node sets and because its locality is the same as \fCioobj\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The resulting object is usually a normal object but it could also be a memory object (e\&.g\&. NUMA node) in future platforms if I/O objects ever get attached to memory instead of CPUs\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_api_version.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_api_version.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_api_version.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_api_version.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_api_version" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_api_version" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -35,7 +35,7 @@ .PP Users may check for available features at build time using this number (see \fBHow do I handle API changes?\fP)\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This should not be confused with HWLOC_VERSION, the library version\&. Two stable releases of the same series usually have the same \fBHWLOC_API_VERSION\fP even if their HWLOC_VERSION are different\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_bitmap.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_bitmap.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_bitmap.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_bitmap.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_bitmap" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_bitmap" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -185,8 +185,8 @@ .in -1c .SH "Detailed Description" .PP -The \fBhwloc_bitmap_t\fP type represents a set of integers (positive or null)\&. A bitmap may be of infinite size (all bits are set after some point)\&. A bitmap may even be full if all bits are set\&. -.PP +The \fBhwloc_bitmap_t\fP type represents a set of integers (positive or null)\&. A bitmap may be of infinite size (all bits are set after some point)\&. A bitmap may even be full if all bits are set\&. + Bitmaps are used by hwloc for sets of OS processors (which may actually be hardware threads) as by \fBhwloc_cpuset_t\fP (a typedef for \fBhwloc_bitmap_t\fP), or sets of NUMA memory nodes as \fBhwloc_nodeset_t\fP (also a typedef for \fBhwloc_bitmap_t\fP)\&. Those are used for cpuset and nodeset fields in the \fBhwloc_obj\fP structure, see \fBObject Sets (hwloc_cpuset_t and hwloc_nodeset_t)\fP\&. .PP \fIBoth CPU and node sets are always indexed by OS physical number\&.\fP However users should usually not build CPU and node sets manually (e\&.g\&. with \fBhwloc_bitmap_set()\fP)\&. One should rather use existing object sets and combine them with \fBhwloc_bitmap_or()\fP, etc\&. For instance, binding the current thread on a pair of cores may be performed with: @@ -201,7 +201,7 @@ .fi .PP .PP -\fBNote:\fP +\fBNote\fP .RS 4 Most functions below return an int that may be negative in case of error\&. The usual error case would be an internal failure to realloc/extend the storage of the bitmap (\fCerrno\fP would be set to \fCENOMEM\fP)\&. .PP @@ -224,7 +224,7 @@ .PP End of loop macro iterating on a bitmap\&. Needs a terminating ';'\&. .PP -\fBSee also:\fP +\fBSee also\fP .RS 4 \fBhwloc_bitmap_foreach_begin()\fP .RE @@ -251,7 +251,7 @@ .PP Allocate a new empty bitmap\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 A valid bitmap or \fCNULL\fP\&. .RE @@ -274,7 +274,7 @@ .PP Stringify a bitmap into a newly allocated string\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 on error\&. .RE @@ -293,7 +293,7 @@ .PP Compare bitmaps \fCbitmap1\fP and \fCbitmap2\fP in lexicographic order\&. Lexicographic comparison of bitmaps, starting for their highest indexes\&. Compare last indexes first, then second, etc\&. The empty bitmap is considered lower than anything\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if \fCbitmap1\fP is considered smaller than \fCbitmap2\fP\&. .PP @@ -304,7 +304,7 @@ .PP For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110)\&. Comparing 00101 and 01010 returns -1 too\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This is different from the non-existing hwloc_bitmap_compare_last() which would only compare the highest index of each bitmap\&. .RE @@ -315,7 +315,7 @@ .PP Compare bitmaps \fCbitmap1\fP and \fCbitmap2\fP using their lowest index\&. A bitmap is considered smaller if its least significant bit is smaller\&. The empty bitmap is considered higher than anything (because its least significant bit does not exist)\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if \fCbitmap1\fP is considered smaller than \fCbitmap2\fP\&. .PP @@ -324,7 +324,7 @@ .PP For instance comparing binary bitmaps 0011 and 0110 returns -1 (hence 0011 is considered smaller than 0110) because least significant bit of 0011 (0001) is smaller than least significant bit of 0110 (0010)\&. Comparing 01001 and 00110 would also return -1 for the same reason\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 if bitmaps are considered equal, even if they are not strictly equal\&. They just need to have the same least significant bit\&. For instance, comparing binary bitmaps 0010 and 0110 returns 0 because they have the same least significant bit\&. .RE @@ -347,7 +347,7 @@ .PP Compute the first index (least significant bit) in bitmap \fCbitmap\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if no index is set in \fCbitmap\fP\&. .RE @@ -358,7 +358,7 @@ .PP Compute the first unset index (least significant bit) in bitmap \fCbitmap\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if no index is unset in \fCbitmap\fP\&. .RE @@ -385,7 +385,7 @@ .PP Test whether bitmaps \fCbitmap1\fP and \fCbitmap2\fP intersects\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if bitmaps intersect, 0 otherwise\&. .RE @@ -396,7 +396,7 @@ .PP Test whether bitmap \fCbitmap1\fP is equal to bitmap \fCbitmap2\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if bitmaps are equal, 0 otherwise\&. .RE @@ -407,12 +407,12 @@ .PP Test whether bitmap \fCbitmap\fP is completely full\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if bitmap is full, 0 otherwise\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 A full bitmap is always infinitely set\&. .RE @@ -423,12 +423,12 @@ .PP Test whether bitmap \fCsub_bitmap\fP is part of bitmap \fCsuper_bitmap\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if \fCsub_bitmap\fP is included in \fCsuper_bitmap\fP, 0 otherwise\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 The empty bitmap is considered included in any other bitmap\&. .RE @@ -439,7 +439,7 @@ .PP Test whether index \fCid\fP is part of bitmap \fCbitmap\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if the bit at index \fCid\fP is set in bitmap \fCbitmap\fP, 0 otherwise\&. .RE @@ -450,7 +450,7 @@ .PP Test whether bitmap \fCbitmap\fP is empty\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if bitmap is empty, 0 otherwise\&. .RE @@ -461,7 +461,7 @@ .PP Compute the last index (most significant bit) in bitmap \fCbitmap\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if no index is set in \fCbitmap\fP, or if \fCbitmap\fP is infinitely set\&. .RE @@ -472,7 +472,7 @@ .PP Compute the last unset index (most significant bit) in bitmap \fCbitmap\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if no index is unset in \fCbitmap\fP, or if \fCbitmap\fP is infinitely set\&. .RE @@ -483,7 +483,7 @@ .PP Stringify a bitmap into a newly allocated list string\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 on error\&. .RE @@ -498,7 +498,7 @@ .PP If \fCbuflen\fP is 0, \fCbuf\fP may safely be \fCNULL\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of character that were actually written if not truncating, or that would have been written (not including the ending \\0)\&. .RE @@ -513,7 +513,7 @@ .PP Compute the next index in bitmap \fCbitmap\fP which is after index \fCprev\fP\&. If \fCprev\fP is -1, the first index is returned\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if no index with higher index is set in \fCbitmap\fP\&. .RE @@ -524,7 +524,7 @@ .PP Compute the next unset index in bitmap \fCbitmap\fP which is after index \fCprev\fP\&. If \fCprev\fP is -1, the first unset index is returned\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if no index with higher index is unset in \fCbitmap\fP\&. .RE @@ -541,7 +541,7 @@ .PP When called on the output of \fBhwloc_topology_get_topology_cpuset()\fP, the returned number is large enough for all cpusets of the topology\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if \fCbitmap\fP is infinite\&. .RE @@ -572,7 +572,7 @@ .PP Keep a single index among those set in bitmap \fCbitmap\fP\&. May be useful before binding so that the process does not have a chance of migrating between multiple logical CPUs in the original mask\&. Instead of running the task on any PU inside the given CPU set, the operating system scheduler will be forced to run it on a single of these PUs\&. It avoids a migration overhead and cache-line ping-pongs between PUs\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function is NOT meant to distribute multiple processes within a single CPU set\&. It always return the same single bit when called multiple times on the same input set\&. \fBhwloc_distrib()\fP may be used for generating CPU sets to distribute multiple tasks below a single multi-PU object\&. .PP @@ -587,7 +587,7 @@ .PP If \fCbuflen\fP is 0, \fCbuf\fP may safely be \fCNULL\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of character that were actually written if not truncating, or that would have been written (not including the ending \\0)\&. .RE @@ -602,7 +602,7 @@ .PP Stringify a bitmap into a newly allocated taskset-specific string\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 on error\&. .RE @@ -617,7 +617,7 @@ .PP If \fCbuflen\fP is 0, \fCbuf\fP may safely be \fCNULL\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of character that were actually written if not truncating, or that would have been written (not including the ending \\0)\&. .RE @@ -640,7 +640,7 @@ .PP Convert the first \fCnr\fP subsets of bitmap \fCbitmap\fP into the array of \fCnr\fP unsigned long \fCmasks\fP\&. \fCnr\fP may be determined earlier with \fBhwloc_bitmap_nr_ulongs()\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 .RE @@ -651,7 +651,7 @@ .PP Compute the 'weight' of bitmap \fCbitmap\fP (i\&.e\&., number of indexes that are in the bitmap)\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of indexes that are in the bitmap\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_core_funcs.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_core_funcs.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_core_funcs.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_core_funcs.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_components_core_funcs" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_components_core_funcs" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -111,7 +111,7 @@ .PP Make sure that plugins can lookup core symbols\&. This is a sanity check to avoid lazy-lookup failures when libhwloc is loaded within a plugin, and later tries to load its own plugins\&. This may fail (and abort the program) if libhwloc symbols are in a private namespace\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 on success\&. .PP @@ -120,7 +120,7 @@ .PP Plugins should call this function in their init() callback to avoid later crashes if lazy symbol resolution is used by the upper layer that loaded hwloc (e\&.g\&. OpenCL implementations using dlopen with RTLD_LAZY)\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The build system must define HWLOC_INSIDE_PLUGIN if and only if building the caller as a plugin\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_filtering.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_filtering.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_filtering.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_filtering.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_components_filtering" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_components_filtering" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -32,7 +32,7 @@ .PP Check whether the given object should be filtered-out\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if the object type should be kept, 0 otherwise\&. .RE @@ -43,7 +43,7 @@ .PP Check whether a non-I/O object type should be filtered-out\&. Cannot be used for I/O objects\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if the object type should be kept, 0 otherwise\&. .RE @@ -54,7 +54,7 @@ .PP Check whether the given OS device subtype is important\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if important, 0 otherwise\&. .RE @@ -65,7 +65,7 @@ .PP Check whether the given PCI device classid is important\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if important, 0 otherwise\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcidisc.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcidisc.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcidisc.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcidisc.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_components_pcidisc" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_components_pcidisc" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcifind.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcifind.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcifind.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_components_pcifind.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_components_pcifind" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_components_pcifind" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_configuration.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_configuration.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_configuration.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_configuration.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_configuration" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_configuration" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -75,6 +75,8 @@ .SH "Detailed Description" .PP Several functions can optionally be called between \fBhwloc_topology_init()\fP and \fBhwloc_topology_load()\fP to configure how the detection should be performed, e\&.g\&. to ignore some objects types, define a synthetic topology, etc\&. + + .SH "Enumeration Type Documentation" .PP .SS "enum \fBhwloc_topology_flags_e\fP" @@ -143,7 +145,7 @@ .PP Get OR'ed flags of a topology\&. Get the OR'ed set of \fBhwloc_topology_flags_e\fP of a topology\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the flags previously set with \fBhwloc_topology_set_flags()\fP\&. .RE @@ -168,7 +170,7 @@ .PP Does the topology context come from this system? .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if this topology context was built using the system running this program\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cpubinding.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cpubinding.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cpubinding.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cpubinding.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_cpubinding" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_cpubinding" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -43,8 +43,8 @@ .in -1c .SH "Detailed Description" .PP -Some operating systems only support binding threads or processes to a single PU\&. Others allow binding to larger sets such as entire Cores or Packages or even random sets of invididual PUs\&. In such operating system, the scheduler is free to run the task on one of these PU, then migrate it to another PU, etc\&. It is often useful to call \fBhwloc_bitmap_singlify()\fP on the target CPU set before passing it to the binding function to avoid these expensive migrations\&. See the documentation of \fBhwloc_bitmap_singlify()\fP for details\&. -.PP +Some operating systems only support binding threads or processes to a single PU\&. Others allow binding to larger sets such as entire Cores or Packages or even random sets of invididual PUs\&. In such operating system, the scheduler is free to run the task on one of these PU, then migrate it to another PU, etc\&. It is often useful to call \fBhwloc_bitmap_singlify()\fP on the target CPU set before passing it to the binding function to avoid these expensive migrations\&. See the documentation of \fBhwloc_bitmap_singlify()\fP for details\&. + Some operating systems do not provide all hwloc-supported mechanisms to bind processes, threads, etc\&. \fBhwloc_topology_get_support()\fP may be used to query about the actual CPU binding support in the currently used operating system\&. .PP When the requested binding operation is not available and the \fBHWLOC_CPUBIND_STRICT\fP flag was passed, the function returns -1\&. \fCerrno\fP is set to \fCENOSYS\fP when it is not possible to bind the requested kind of object processes/threads\&. errno is set to \fCEXDEV\fP when the requested cpuset can not be enforced (e\&.g\&. some systems only allow one CPU, and some other systems only allow one NUMA node)\&. @@ -67,12 +67,12 @@ .fi .PP .PP -\fBSee also:\fP +\fBSee also\fP .RS 4 Some example codes are available under doc/examples/ in the source tree\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 To unbind, just call the binding function with either a full cpuset or a cpuset equal to the system cpuset\&. .PP @@ -91,7 +91,7 @@ .PP The default (0) is to bind the current process, assumed to be single-threaded, in a non-strict way\&. This is the most portable way to bind as all operating systems usually provide it\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Not all systems support all kinds of binding\&. See the 'Detailed Description' section of \fBCPU binding\fP for a description of errors that can occur\&. .RE @@ -110,14 +110,14 @@ \fB\fIHWLOC_CPUBIND_STRICT \fP\fP Request for strict binding from the OS\&. By default, when the designated CPUs are all busy while other CPUs are idle, operating systems may execute the thread/process on those other CPUs instead of the designated CPUs, to let them progress anyway\&. Strict binding means that the thread/process will _never_ execute on other cpus than the designated CPUs, even when those are busy with other tasks and other CPUs are idle\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Depending on the operating system, strict binding may not be possible (e\&.g\&., the OS does not implement it) or not allowed (e\&.g\&., for an administrative reasons), and the function will fail in that case\&. .RE .PP When retrieving the binding of a process, this flag checks whether all its threads actually have the same binding\&. If the flag is not given, the binding of each thread will be accumulated\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This flag is meaningless when retrieving the binding of a thread\&. .RE @@ -145,7 +145,7 @@ .PP Get the current physical binding of process \fCpid\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_pid_t\fP is \fCpid_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .PP @@ -160,7 +160,7 @@ .PP Get the last physical CPU where a process ran\&. The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_pid_t\fP is \fCpid_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .PP @@ -175,7 +175,7 @@ .PP Get the current physical binding of thread \fCtid\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_thread_t\fP is \fCpthread_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .PP @@ -188,7 +188,7 @@ .PP Bind current process or thread on cpus given in physical bitmap \fCset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 with errno set to ENOSYS if the action is not supported .PP @@ -201,7 +201,7 @@ .PP Bind a process \fCpid\fP on cpus given in physical bitmap \fCset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_pid_t\fP is \fCpid_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .PP @@ -216,7 +216,7 @@ .PP Bind a thread \fCthread\fP on cpus given in physical bitmap \fCset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_thread_t\fP is \fCpthread_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_creation.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_creation.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_creation.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_creation.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_creation" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_creation" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -53,14 +53,14 @@ .PP If all libraries/programs use the same hwloc installation, this function always returns success\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 \fC0\fP on success\&. .PP \fC-1\fP with \fCerrno\fP set to \fCEINVAL\fP if incompatible\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 If sharing between processes with \fBhwloc_shmem_topology_write()\fP, the relevant check is already performed inside \fBhwloc_shmem_topology_adopt()\fP\&. .RE @@ -71,12 +71,12 @@ .PP Run internal checks on a topology structure\&. The program aborts if an inconsistency is detected in the given topology\&. .PP -\fBParameters:\fP +\fBParameters\fP .RS 4 \fItopology\fP is the topology to be checked .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 This routine is only useful to developers\&. .PP @@ -89,7 +89,7 @@ .PP Terminate and free a topology context\&. .PP -\fBParameters:\fP +\fBParameters\fP .RS 4 \fItopology\fP is the topology to be freed .RE @@ -102,7 +102,7 @@ .PP This is useful for keeping a backup while modifying a topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Object userdata is not duplicated since hwloc does not know what it point to\&. The objects of both old and new topologies will point to the same userdata\&. .RE @@ -113,12 +113,12 @@ .PP Allocate a topology context\&. .PP -\fBParameters:\fP +\fBParameters\fP .RS 4 \fItopologyp\fP is assigned a pointer to the new allocated context\&. .RE .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 on success, -1 on error\&. .RE @@ -129,17 +129,17 @@ .PP Build the actual topology\&. Build the actual topology once initialized with \fBhwloc_topology_init()\fP and tuned with \fBTopology Detection Configuration and Query\fP and \fBChanging the Source of Topology Discovery\fP routines\&. No other routine may be called earlier using this topology context\&. .PP -\fBParameters:\fP +\fBParameters\fP .RS 4 \fItopology\fP is the topology to be loaded with objects\&. .RE .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 on success, -1 on error\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 On failure, the topology is reinitialized\&. It should be either destroyed with \fBhwloc_topology_destroy()\fP or configured and loaded again\&. .PP @@ -148,7 +148,7 @@ The binding of the current thread or process may temporarily change during this call but it will be restored before it returns\&. .RE .PP -\fBSee also:\fP +\fBSee also\fP .RS 4 \fBTopology Detection Configuration and Query\fP and \fBChanging the Source of Topology Discovery\fP .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cuda.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cuda.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cuda.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cuda.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_cuda" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_cuda" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -28,6 +28,8 @@ .SH "Detailed Description" .PP This interface offers ways to retrieve topology information about CUDA devices when using the CUDA Driver API\&. + + .SH "Function Documentation" .PP .SS "static int hwloc_cuda_get_device_cpuset (\fBhwloc_topology_t\fP topology, CUdevice cudevice, \fBhwloc_cpuset_t\fP set)\fC [inline]\fP, \fC [static]\fP" @@ -47,7 +49,7 @@ .PP Topology \fCtopology\fP and device \fCcudevice\fP must match the local machine\&. I/O devices detection and the CUDA component must be enabled in the topology\&. If not, the locality of the object may still be found using \fBhwloc_cuda_get_device_cpuset()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function cannot work if PCI devices are filtered out\&. .PP @@ -62,7 +64,7 @@ .PP The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection and the CUDA component must be enabled in the topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cudart.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cudart.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cudart.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_cudart.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_cudart" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_cudart" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -25,6 +25,8 @@ .SH "Detailed Description" .PP This interface offers ways to retrieve topology information about CUDA devices when using the CUDA Runtime API\&. + + .SH "Function Documentation" .PP .SS "static int hwloc_cudart_get_device_cpuset (\fBhwloc_topology_t\fP topology, int idx, \fBhwloc_cpuset_t\fP set)\fC [inline]\fP, \fC [static]\fP" @@ -44,7 +46,7 @@ .PP The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection and the CUDA component must be enabled in the topology\&. If not, the locality of the object may still be found using \fBhwloc_cudart_get_device_cpuset()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_diff.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_diff.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_diff.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_diff.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_diff" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_diff" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -69,8 +69,8 @@ .in -1c .SH "Detailed Description" .PP -Applications that manipulate many similar topologies, for instance one for each node of a homogeneous cluster, may want to compress topologies to reduce the memory footprint\&. -.PP +Applications that manipulate many similar topologies, for instance one for each node of a homogeneous cluster, may want to compress topologies to reduce the memory footprint\&. + This file offers a way to manipulate the difference between topologies and export/import it to/from XML\&. Compression may therefore be achieved by storing one topology entirely while the others are only described by their differences with the former\&. The actual topology can be reconstructed when actually needed by applying the precomputed difference to the reference topology\&. .PP This interface targets very similar nodes\&. Only very simple differences between topologies are actually supported, for instance a change in the memory size, the name of the object, or some info attribute\&. More complex differences such as adding or removing objects cannot be represented in the difference structures and therefore return errors\&. Differences between object sets or topology-wide allowed sets, cannot be represented either\&. @@ -78,15 +78,15 @@ It means that there is no need to apply the difference when looking at the tree organization (how many levels, how many objects per level, what kind of objects, CPU and node sets, etc) and when binding to objects\&. However the difference must be applied when looking at object attributes such as the name, the memory size or info attributes\&. .SH "Typedef Documentation" .PP -.SS "typedef enum \fBhwloc_topology_diff_obj_attr_type_e\fP \fBhwloc_topology_diff_obj_attr_type_t\fP" +.SS "typedef enum \fBhwloc_topology_diff_obj_attr_type_e\fP \fBhwloc_topology_diff_obj_attr_type_t\fP" .PP Type of one object attribute difference\&. -.SS "typedef union \fBhwloc_topology_diff_u\fP * \fBhwloc_topology_diff_t\fP" +.SS "typedef union \fBhwloc_topology_diff_u\fP * \fBhwloc_topology_diff_t\fP" .PP One element of a difference list between two topologies\&. -.SS "typedef enum \fBhwloc_topology_diff_type_e\fP \fBhwloc_topology_diff_type_t\fP" +.SS "typedef enum \fBhwloc_topology_diff_type_e\fP \fBhwloc_topology_diff_type_t\fP" .PP Type of one element of a difference list\&. @@ -142,7 +142,7 @@ .PP If the difference cannot be applied entirely, all previous applied elements are unapplied before returning\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 on success\&. .PP @@ -157,7 +157,7 @@ .PP If the difference between 2 objects is too complex to be represented (for instance if some objects have different types, or different numbers of children), a special diff entry of type \fBHWLOC_TOPOLOGY_DIFF_TOO_COMPLEX\fP is queued\&. The computation of the diff does not continue below these objects\&. So each such diff entry means that the difference between two subtrees could not be computed\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 if the difference can be represented properly\&. .PP @@ -168,7 +168,7 @@ -1 on any other error\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fCflags\fP is currently not used\&. It should be 0\&. .PP @@ -195,7 +195,7 @@ .PP The returned buffer ends with a \\0 that is included in the returned length\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The XML buffer should later be freed with \fBhwloc_free_xmlbuffer()\fP\&. .RE @@ -206,7 +206,7 @@ .PP Load a list of topology differences from a XML file\&. If not \fCNULL\fP, \fCrefname\fP will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file\&. This identifier is usually the name of the other XML file that contains the reference topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 the pointer returned in refname should later be freed by the caller\&. .RE @@ -217,7 +217,7 @@ .PP Load a list of topology differences from a XML buffer\&. If not \fCNULL\fP, \fCrefname\fP will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file\&. This identifier is usually the name of the other XML file that contains the reference topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 the pointer returned in refname should later be freed by the caller\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_backends.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_backends.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_backends.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_backends.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_disc_backends" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_disc_backends" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -48,7 +48,7 @@ .SH "Typedef Documentation" .PP -.SS "typedef enum \fBhwloc_disc_phase_e\fP \fBhwloc_disc_phase_t\fP" +.SS "typedef enum \fBhwloc_disc_phase_e\fP \fBhwloc_disc_phase_t\fP" .PP Discovery phase\&. diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_components.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_components.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_components.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_disc_components.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_disc_components" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_disc_components" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_add.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_add.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_add.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_add.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_distances_add" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_distances_add" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_consult.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_consult.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_consult.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_consult.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_distances_consult" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_distances_consult" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -26,7 +26,7 @@ .PP Find the index of an object in a distances structure\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if object \fCobj\fP is not involved in structure \fCdistances\fP\&. .RE @@ -37,7 +37,7 @@ .PP Find the values between two objects in a distance matrices\&. The distance from \fCobj1\fP to \fCobj2\fP is stored in the value pointed by \fCvalue1to2\fP and reciprocally\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if object \fCobj1\fP or \fCobj2\fP is not involved in structure \fCdistances\fP\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_get.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_get.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_get.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_distances_get.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_distances_get" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_distances_get" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -108,7 +108,7 @@ .PP Release a distance matrix structure previously returned by \fBhwloc_distances_get()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function is not required if the structure is removed with \fBhwloc_distances_release_remove()\fP\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_generic_components.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_generic_components.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_generic_components.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_generic_components.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_generic_components" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_generic_components" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -32,7 +32,7 @@ .SH "Typedef Documentation" .PP -.SS "typedef enum \fBhwloc_component_type_e\fP \fBhwloc_component_type_t\fP" +.SS "typedef enum \fBhwloc_component_type_e\fP \fBhwloc_component_type_t\fP" .PP Generic component type\&. diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_gl.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_gl.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_gl.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_gl.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_gl" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_gl" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -21,8 +21,8 @@ .in -1c .SH "Detailed Description" .PP -This interface offers ways to retrieve topology information about OpenGL displays\&. -.PP +This interface offers ways to retrieve topology information about OpenGL displays\&. + Only the NVIDIA display locality information is currently available, using the NV-CONTROL X11 extension and the NVCtrl library\&. .SH "Function Documentation" .PP @@ -39,7 +39,7 @@ .PP The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection and the GL component must be enabled in the topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&. .RE @@ -52,7 +52,7 @@ .PP The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection and the GL component must be enabled in the topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_glibc_sched.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_glibc_sched.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_glibc_sched.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_glibc_sched.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_glibc_sched" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_glibc_sched" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -18,9 +18,11 @@ .in -1c .SH "Detailed Description" .PP -This interface offers ways to convert between hwloc cpusets and glibc cpusets such as those manipulated by sched_getaffinity() or pthread_attr_setaffinity_np()\&. +This interface offers ways to convert between hwloc cpusets and glibc cpusets such as those manipulated by sched_getaffinity() or pthread_attr_setaffinity_np()\&. + + .PP -\fBNote:\fP +\fBNote\fP .RS 4 Topology \fCtopology\fP must match the current machine\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_ancestors.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_ancestors.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_ancestors.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_ancestors.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_ancestors" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_ancestors" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -28,6 +28,8 @@ .SH "Detailed Description" .PP Be sure to see the figure in \fBTerms and Definitions\fP that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers\&. + + .SH "Function Documentation" .PP .SS "static \fBhwloc_obj_t\fP hwloc_get_ancestor_obj_by_depth (\fBhwloc_topology_t\fP topology, int depth, \fBhwloc_obj_t\fP obj)\fC [inline]\fP, \fC [static]\fP" @@ -35,7 +37,7 @@ .PP Returns the ancestor object of \fCobj\fP at depth \fCdepth\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fCdepth\fP should not be the depth of PU or NUMA objects since they are ancestors of no objects (except Misc or I/O)\&. This function rather expects an intermediate level depth, such as the depth of Packages, Cores, or Caches\&. .RE @@ -46,7 +48,7 @@ .PP Returns the ancestor object of \fCobj\fP with type \fCtype\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fCtype\fP should not be \fBHWLOC_OBJ_PU\fP or \fBHWLOC_OBJ_NUMANODE\fP since these objects are ancestors of no objects (except Misc or I/O)\&. This function rather expects an intermediate object type, such as \fBHWLOC_OBJ_PACKAGE\fP, \fBHWLOC_OBJ_CORE\fP, etc\&. .RE @@ -69,7 +71,7 @@ .PP Returns true if \fCobj\fP is inside the subtree beginning with ancestor object \fCsubtree_root\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function cannot work if \fCobj\fP and \fCsubtree_root\fP objects do not have CPU sets (I/O or Misc objects)\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_distribute.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_distribute.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_distribute.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_distribute.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_distribute" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_distribute" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -50,7 +50,7 @@ .PP \fCflags\fP should be 0 or a OR'ed set of \fBhwloc_distrib_flags_e\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function requires the \fCroots\fP objects to have a CPU set\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_cache.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_cache.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_cache.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_cache.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_find_cache" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_find_cache" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -29,7 +29,7 @@ .PP Get the first data (or unified) cache covering a cpuset \fCset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 \fCNULL\fP if no cache matches\&. .RE @@ -54,7 +54,7 @@ .PP Get the first data (or unified) cache shared between an object and somebody else\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 \fCNULL\fP if no cache matches or if an invalid object is given\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_covering.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_covering.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_covering.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_covering.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_find_covering" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_find_covering" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -32,12 +32,12 @@ .PP Get the child covering at least CPU set \fCset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 \fCNULL\fP if no child matches or if \fCset\fP is empty\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function cannot work if parent does not have a CPU set (I/O or Misc objects)\&. .RE @@ -48,7 +48,7 @@ .PP Iterate through same-depth objects covering at least CPU set \fCset\fP\&. If object \fCprev\fP is \fCNULL\fP, return the first object at depth \fCdepth\fP covering at least part of CPU set \fCset\fP\&. The next invokation should pass the previous return value in \fCprev\fP so as to obtain the next object covering at least another part of \fCset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function cannot work if objects at the given depth do not have CPU sets (I/O or Misc objects)\&. .RE @@ -61,7 +61,7 @@ .PP If there are no or multiple depths for type \fCtype\fP, \fCNULL\fP is returned\&. The caller may fallback to \fBhwloc_get_next_obj_covering_cpuset_by_depth()\fP for each depth\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function cannot work if objects of the given type do not have CPU sets (I/O or Misc objects)\&. .RE @@ -72,7 +72,7 @@ .PP Get the lowest object covering at least CPU set \fCset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 \fCNULL\fP if no object matches or if \fCset\fP is empty\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_inside.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_inside.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_inside.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_inside.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_find_inside" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_find_inside" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -47,7 +47,7 @@ .PP Get the first largest object included in the given cpuset \fCset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the first object that is included in \fCset\fP and whose parent is not\&. .RE @@ -58,7 +58,7 @@ .PP Get the set of largest objects covering exactly a given cpuset \fCset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of objects returned in \fCobjs\fP\&. .RE @@ -69,7 +69,7 @@ .PP Return the number of objects at depth \fCdepth\fP included in CPU set \fCset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set)\&. .PP @@ -82,7 +82,7 @@ .PP Return the number of objects of type \fCtype\fP included in CPU set \fCset\fP\&. If no object for that type exists inside CPU set \fCset\fP, 0 is returned\&. If there are several levels with objects of that type inside CPU set \fCset\fP, -1 is returned\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set)\&. .PP @@ -95,7 +95,7 @@ .PP Return the next object at depth \fCdepth\fP included in CPU set \fCset\fP\&. If \fCprev\fP is \fCNULL\fP, return the first object at depth \fCdepth\fP included in \fCset\fP\&. The next invokation should pass the previous return value in \fCprev\fP so as to obtain the next object in \fCset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set)\&. .PP @@ -108,7 +108,7 @@ .PP Return the next object of type \fCtype\fP included in CPU set \fCset\fP\&. If there are multiple or no depth for given type, return \fCNULL\fP and let the caller fallback to \fBhwloc_get_next_obj_inside_cpuset_by_depth()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set)\&. .PP @@ -121,7 +121,7 @@ .PP Return the logical index among the objects included in CPU set \fCset\fP\&. Consult all objects in the same level as \fCobj\fP and inside CPU set \fCset\fP in the logical order, and return the index of \fCobj\fP within them\&. If \fCset\fP covers the entire topology, this is the logical index of \fCobj\fP\&. Otherwise, this is similar to a logical index within the part of the topology defined by CPU set \fCset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set)\&. .PP @@ -134,7 +134,7 @@ .PP Return the (logically) \fCidx\fP -th object at depth \fCdepth\fP included in CPU set \fCset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set)\&. .PP @@ -147,7 +147,7 @@ .PP Return the \fCidx\fP -th object of type \fCtype\fP included in CPU set \fCset\fP\&. If there are multiple or no depth for given type, return \fCNULL\fP and let the caller fallback to \fBhwloc_get_obj_inside_cpuset_by_depth()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Objects with empty CPU sets are ignored (otherwise they would be considered included in any given set)\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_misc.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_misc.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_misc.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_find_misc.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_find_misc" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_find_misc" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -10,6 +10,9 @@ .in +1c .ti -1c +.RI "int \fBhwloc_bitmap_singlify_per_core\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_bitmap_t\fP cpuset, unsigned which)" +.br +.ti -1c .RI "static \fBhwloc_obj_t\fP \fBhwloc_get_pu_obj_by_os_index\fP (\fBhwloc_topology_t\fP topology, unsigned os_index)" .br .ti -1c @@ -28,21 +31,38 @@ .SH "Detailed Description" .PP Be sure to see the figure in \fBTerms and Definitions\fP that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers\&. + + .SH "Function Documentation" .PP +.SS "int hwloc_bitmap_singlify_per_core (\fBhwloc_topology_t\fP topology, \fBhwloc_bitmap_t\fP cpuset, unsigned which)" + +.PP +Remove simultaneous multithreading PUs from a CPU set\&. For each core in \fCtopology\fP, if \fCcpuset\fP contains some PUs of that core, modify \fCcpuset\fP to only keep a single PU for that core\&. +.PP +\fCwhich\fP specifies which PU will be kept\&. PU are considered in physical index order\&. If 0, for each core, the function keeps the first PU that was originally set in \fCcpuset\fP\&. +.PP +If \fCwhich\fP is larger than the number of PUs in a core there were originally set in \fCcpuset\fP, no PU is kept for that core\&. +.PP +\fBNote\fP +.RS 4 +PUs that are not below a Core object are ignored (for instance if the topology does not contain any Core object)\&. None of them is removed from \fCcpuset\fP\&. +.RE +.PP + .SS "unsigned hwloc_get_closest_objs (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP src, \fBhwloc_obj_t\fP *restrict objs, unsigned max)" .PP Do a depth-first traversal of the topology to find and sort\&. all objects that are at the same depth than \fCsrc\fP\&. Report in \fCobjs\fP up to \fCmax\fP physically closest ones to \fCsrc\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of objects returned in \fCobjs\fP\&. .PP 0 if \fCsrc\fP is an I/O object\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function requires the \fCsrc\fP object to have a CPU set\&. .RE @@ -63,7 +83,7 @@ .PP For instance, if nr is 3, typev contains NODE, PACKAGE and CORE, and idxv contains 0, 1 and 2, return the third core object below the second package below the first NUMA node\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function requires all these objects and the root object to have a CPU set\&. .RE @@ -76,7 +96,7 @@ .PP For instance, if type1 is PACKAGE, idx1 is 2, type2 is CORE and idx2 is 3, return the fourth core object below the third package\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function requires these objects to have a CPU set\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_nodeset_convert.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_nodeset_convert.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_nodeset_convert.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_nodeset_convert.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_nodeset_convert" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_nodeset_convert" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -24,13 +24,19 @@ .SS "static int hwloc_cpuset_from_nodeset (\fBhwloc_topology_t\fP topology, \fBhwloc_cpuset_t\fP _cpuset, \fBhwloc_const_nodeset_t\fP nodeset)\fC [inline]\fP, \fC [static]\fP" .PP -Convert a NUMA node set into a CPU set and handle non-NUMA cases\&. If the topology contains no NUMA nodes, the machine is considered as a single memory node, and the following behavior is used: If \fCnodeset\fP is empty, \fCcpuset\fP will be emptied as well\&. Otherwise \fCcpuset\fP will be entirely filled\&. This is useful for manipulating memory binding sets\&. +Convert a NUMA node set into a CPU set\&. For each NUMA node included in the input \fCnodeset\fP, set the corresponding local PUs in the output \fC_cpuset\fP\&. +.PP +If some CPUs have no local NUMA nodes, this function never sets their indexes in the output CPU set, even if a full node set is given in input\&. +.PP +Hence the entire topology node set is converted into the set of all CPUs that have some local NUMA nodes\&. .SS "static int hwloc_cpuset_to_nodeset (\fBhwloc_topology_t\fP topology, \fBhwloc_const_cpuset_t\fP _cpuset, \fBhwloc_nodeset_t\fP nodeset)\fC [inline]\fP, \fC [static]\fP" .PP -Convert a CPU set into a NUMA node set and handle non-NUMA cases\&. If some NUMA nodes have no CPUs at all, this function never sets their indexes in the output node set, even if a full CPU set is given in input\&. +Convert a CPU set into a NUMA node set\&. For each PU included in the input \fC_cpuset\fP, set the corresponding local NUMA node(s) in the output \fCnodeset\fP\&. +.PP +If some NUMA nodes have no CPUs at all, this function never sets their indexes in the output node set, even if a full CPU set is given in input\&. .PP -If the topology contains no NUMA nodes, the machine is considered as a single memory node, and the following behavior is used: If \fCcpuset\fP is empty, \fCnodeset\fP will be emptied as well\&. Otherwise \fCnodeset\fP will be entirely filled\&. +Hence the entire topology CPU set is converted into the set of all nodes that have some local CPUs\&. .SH "Author" .PP Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&. diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_topology_sets.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_topology_sets.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_topology_sets.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_topology_sets.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_topology_sets" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_topology_sets" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -38,12 +38,12 @@ .PP Get allowed CPU set\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the CPU set of allowed logical processors of the system\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 If the topology flag \fBHWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED\fP was not set, this is identical to \fBhwloc_topology_get_topology_cpuset()\fP, which means all PUs are allowed\&. .PP @@ -58,12 +58,12 @@ .PP Get allowed node set\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the node set of allowed memory of the system\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 If the topology flag \fBHWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED\fP was not set, this is identical to \fBhwloc_topology_get_topology_nodeset()\fP, which means all NUMA nodes are allowed\&. .PP @@ -78,12 +78,12 @@ .PP Get complete CPU set\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the complete CPU set of logical processors of the system\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 The returned cpuset is not newly allocated and should thus not be changed or freed; \fBhwloc_bitmap_dup()\fP must be used to obtain a local copy\&. .PP @@ -96,12 +96,12 @@ .PP Get complete node set\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the complete node set of memory of the system\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 The returned nodeset is not newly allocated and should thus not be changed or freed; \fBhwloc_bitmap_dup()\fP must be used to obtain a local copy\&. .PP @@ -114,12 +114,12 @@ .PP Get topology CPU set\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the CPU set of logical processors of the system for which hwloc provides topology information\&. This is equivalent to the cpuset of the system object\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 The returned cpuset is not newly allocated and should thus not be changed or freed; \fBhwloc_bitmap_dup()\fP must be used to obtain a local copy\&. .PP @@ -132,12 +132,12 @@ .PP Get topology node set\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the node set of memory of the system for which hwloc provides topology information\&. This is equivalent to the nodeset of the system object\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 The returned nodeset is not newly allocated and should thus not be changed or freed; \fBhwloc_bitmap_dup()\fP must be used to obtain a local copy\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_types.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_types.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_types.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_helper_types.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_helper_types" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_helper_types" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -31,6 +31,8 @@ .SH "Detailed Description" .PP Each object type is either Normal (i\&.e\&. \fBhwloc_obj_type_is_normal()\fP returns 1), or Memory (i\&.e\&. \fBhwloc_obj_type_is_memory()\fP returns 1) or I/O (i\&.e\&. \fBhwloc_obj_type_is_io()\fP returns 1) or Misc (i\&.e\&. equal to \fBHWLOC_OBJ_MISC\fP)\&. It cannot be of more than one of these kinds\&. + + .SH "Function Documentation" .PP .SS "int hwloc_obj_type_is_cache (\fBhwloc_obj_type_t\fP type)" @@ -38,7 +40,7 @@ .PP Check whether an object type is a CPU Cache (Data, Unified or Instruction)\&. Memory-side caches are not CPU caches\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if an object of type \fCtype\fP is a Cache, 0 otherwise\&. .RE @@ -49,7 +51,7 @@ .PP Check whether an object type is a CPU Data or Unified Cache\&. Memory-side caches are not CPU caches\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if an object of type \fCtype\fP is a CPU Data or Unified Cache, 0 otherwise\&. .RE @@ -60,7 +62,7 @@ .PP Check whether an object type is a CPU Instruction Cache,\&. Memory-side caches are not CPU caches\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if an object of type \fCtype\fP is a CPU Instruction Cache, 0 otherwise\&. .RE @@ -71,7 +73,7 @@ .PP Check whether an object type is I/O\&. I/O objects are objects attached to their parents in the I/O children list\&. This current includes Bridges, PCI and OS devices\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if an object of type \fCtype\fP is a I/O object, 0 otherwise\&. .RE @@ -82,7 +84,7 @@ .PP Check whether an object type is Memory\&. Memory objects are objects attached to their parents in the Memory children list\&. This current includes NUMA nodes and Memory-side caches\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if an object of type \fCtype\fP is a Memory object, 0 otherwise\&. .RE @@ -95,7 +97,7 @@ .PP They are attached to parent as Normal children, not as Memory, I/O or Misc children\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 1 if an object of type \fCtype\fP is a Normal object, 0 otherwise\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_info_attr.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_info_attr.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_info_attr.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_info_attr.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_info_attr" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_info_attr" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -28,12 +28,12 @@ .PP The input strings are copied before being added in the object infos\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 \fC0\fP on success, \fC-1\fP on error\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function may be used to enforce object colors in the lstopo graphical output by using 'lstopoStyle' as a name and 'Background=#rrggbb' as a value\&. See CUSTOM COLORS in the lstopo(1) manpage for details\&. .PP @@ -46,7 +46,7 @@ .PP Search the given key name in object infos and return the corresponding value\&. If multiple keys match the given name, only the first one is returned\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 \fCNULL\fP if no such key exists\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_intel_mic.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_intel_mic.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_intel_mic.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_intel_mic.3 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -.TH "hwlocality_intel_mic" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- -.ad l -.nh -.SH NAME -hwlocality_intel_mic -.SH SYNOPSIS -.br -.PP -.SS "Functions" - -.in +1c -.ti -1c -.RI "static int \fBhwloc_intel_mic_get_device_cpuset\fP (\fBhwloc_topology_t\fP topology, int idx, \fBhwloc_cpuset_t\fP set)" -.br -.ti -1c -.RI "static \fBhwloc_obj_t\fP \fBhwloc_intel_mic_get_device_osdev_by_index\fP (\fBhwloc_topology_t\fP topology, unsigned idx)" -.br -.in -1c -.SH "Detailed Description" -.PP -This interface offers ways to retrieve topology information about Intel Xeon Phi (MIC) devices\&. -.SH "Function Documentation" -.PP -.SS "static int hwloc_intel_mic_get_device_cpuset (\fBhwloc_topology_t\fP topology, int idx, \fBhwloc_cpuset_t\fP set)\fC [inline]\fP, \fC [static]\fP" - -.PP -Get the CPU set of logical processors that are physically close to MIC device whose index is \fCidx\fP\&. Return the CPU set describing the locality of the MIC device whose index is \fCidx\fP\&. -.PP -Topology \fCtopology\fP and device index \fCidx\fP must match the local machine\&. I/O devices detection is not needed in the topology\&. -.PP -The function only returns the locality of the device\&. If more information about the device is needed, OS objects should be used instead, see \fBhwloc_intel_mic_get_device_osdev_by_index()\fP\&. -.PP -This function is currently only implemented in a meaningful way for Linux; other systems will simply get a full cpuset\&. -.SS "static \fBhwloc_obj_t\fP hwloc_intel_mic_get_device_osdev_by_index (\fBhwloc_topology_t\fP topology, unsigned idx)\fC [inline]\fP, \fC [static]\fP" - -.PP -Get the hwloc OS device object corresponding to the MIC device for the given index\&. Return the OS device object describing the MIC device whose index is \fCidx\fP\&. Return NULL if there is none\&. -.PP -The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection must be enabled in the topology\&. -.PP -\fBNote:\fP -.RS 4 -The corresponding PCI device object can be obtained by looking at the OS device parent object\&. -.RE -.PP - -.SH "Author" -.PP -Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&. diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_levels.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_levels.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_levels.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_levels.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_levels" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_levels" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -59,6 +59,8 @@ .SH "Detailed Description" .PP Be sure to see the figure in \fBTerms and Definitions\fP that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers\&. + + .SH "Enumeration Type Documentation" .PP .SS "enum \fBhwloc_get_type_depth_e\fP" @@ -95,9 +97,9 @@ .SS "\fBhwloc_obj_type_t\fP hwloc_get_depth_type (\fBhwloc_topology_t\fP topology, int depth)" .PP -Returns the type of objects at depth \fCdepth\fP\&. \fCdepth\fP should between 0 and \fBhwloc_topology_get_depth()\fP-1\&. +Returns the type of objects at depth \fCdepth\fP\&. \fCdepth\fP should between 0 and \fBhwloc_topology_get_depth()\fP-1, or a virtual depth such as \fBHWLOC_TYPE_DEPTH_NUMANODE\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 (hwloc_obj_type_t)-1 if depth \fCdepth\fP does not exist\&. .RE @@ -110,7 +112,7 @@ .PP If all Memory objects are attached to Normal parents at the same depth, this parent depth may be compared to other as usual, for instance for knowing whether NUMA nodes is attached above or below Packages\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 The depth of Normal parents of all memory children if all these parents have the same depth\&. For instance the depth of the Package level if all NUMA nodes are attached to Package objects\&. .PP @@ -157,7 +159,7 @@ .PP If a NUMA node, I/O or Misc object type is given, the function returns a virtual value because these objects are stored in special levels that are not CPU-related\&. This virtual depth may be passed to other hwloc functions such as \fBhwloc_get_obj_by_depth()\fP but it should not be considered as an actual depth by the application\&. In particular, it should not be compared with any other object depth or with the entire topology depth\&. .PP -\fBSee also:\fP +\fBSee also\fP .RS 4 \fBhwloc_get_memory_parents_depth()\fP\&. .PP @@ -186,7 +188,7 @@ .PP Get the depth of the hierarchical tree of objects\&. This is the depth of \fBHWLOC_OBJ_PU\fP objects plus one\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 NUMA nodes, I/O and Misc objects are ignored when computing the depth of the tree (they are placed on special levels)\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_linux" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_linux" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -25,6 +25,8 @@ .SH "Detailed Description" .PP This includes helpers for manipulating Linux kernel cpumap files, and hwloc equivalents of the Linux sched_setaffinity and sched_getaffinity system calls\&. + + .SH "Function Documentation" .PP .SS "int hwloc_linux_get_tid_cpubind (\fBhwloc_topology_t\fP topology, pid_t tid, \fBhwloc_cpuset_t\fP set)" @@ -32,7 +34,7 @@ .PP Get the current binding of thread \fCtid\fP\&. The behavior is exactly the same as the Linux sched_getaffinity system call, but uses a hwloc cpuset\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This is equivalent to calling \fBhwloc_get_proc_cpubind()\fP with \fBHWLOC_CPUBIND_THREAD\fP as flags\&. .RE @@ -43,7 +45,7 @@ .PP Get the last physical CPU where thread \fCtid\fP ran\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This is equivalent to calling \fBhwloc_get_proc_last_cpu_location()\fP with \fBHWLOC_CPUBIND_THREAD\fP as flags\&. .RE @@ -54,7 +56,7 @@ .PP Convert a linux kernel cpumask file \fCpath\fP into a hwloc bitmap \fCset\fP\&. Might be used when reading CPU set from sysfs attributes such as topology and caches for processors, or local_cpus for devices\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function ignores the HWLOC_FSROOT environment variable\&. .RE @@ -65,7 +67,7 @@ .PP Bind a thread \fCtid\fP on cpus given in cpuset \fCset\fP\&. The behavior is exactly the same as the Linux sched_setaffinity system call, but uses a hwloc cpuset\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This is equivalent to calling \fBhwloc_set_proc_cpubind()\fP with HWLOC_CPUBIND_THREAD as flags\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_bitmask.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_bitmask.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_bitmask.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_bitmask.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_linux_libnuma_bitmask" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_linux_libnuma_bitmask" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -24,9 +24,11 @@ .in -1c .SH "Detailed Description" .PP -This interface helps converting between Linux libnuma bitmasks and hwloc cpusets and nodesets\&. +This interface helps converting between Linux libnuma bitmasks and hwloc cpusets and nodesets\&. + + .PP -\fBNote:\fP +\fBNote\fP .RS 4 Topology \fCtopology\fP must match the current machine\&. .PP @@ -40,14 +42,14 @@ .PP Convert libnuma bitmask \fCbitmask\fP into hwloc CPU set \fCcpuset\fP\&. This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter\&. -.SS "static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask (\fBhwloc_topology_t\fP topology, \fBhwloc_const_cpuset_t\fP cpuset)\fC [static]\fP" +.SS "static struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask (\fBhwloc_topology_t\fP topology, \fBhwloc_const_cpuset_t\fP cpuset)\fC [inline]\fP, \fC [static]\fP" .PP Convert hwloc CPU set \fCcpuset\fP into the returned libnuma bitmask\&. The returned bitmask should later be freed with numa_bitmask_free\&. .PP This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 newly allocated struct bitmask\&. .RE @@ -57,14 +59,14 @@ .PP Convert libnuma bitmask \fCbitmask\fP into hwloc NUMA node set \fCnodeset\fP\&. This function may be used after calling many numa_ functions that use a struct bitmask as an output parameter\&. -.SS "static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask (\fBhwloc_topology_t\fP topology, \fBhwloc_const_nodeset_t\fP nodeset)\fC [static]\fP" +.SS "static struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask (\fBhwloc_topology_t\fP topology, \fBhwloc_const_nodeset_t\fP nodeset)\fC [inline]\fP, \fC [static]\fP" .PP Convert hwloc NUMA node set \fCnodeset\fP into the returned libnuma bitmask\&. The returned bitmask should later be freed with numa_bitmask_free\&. .PP This function may be used before calling many numa_ functions that use a struct bitmask as an input parameter\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 newly allocated struct bitmask\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_ulongs.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_ulongs.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_ulongs.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_linux_libnuma_ulongs.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_linux_libnuma_ulongs" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_linux_libnuma_ulongs" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -24,9 +24,11 @@ .in -1c .SH "Detailed Description" .PP -This interface helps converting between Linux libnuma unsigned long masks and hwloc cpusets and nodesets\&. +This interface helps converting between Linux libnuma unsigned long masks and hwloc cpusets and nodesets\&. + + .PP -\fBNote:\fP +\fBNote\fP .RS 4 Topology \fCtopology\fP must match the current machine\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_membinding.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_membinding.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_membinding.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_membinding.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_membinding" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_membinding" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -55,8 +55,9 @@ .in -1c .SH "Detailed Description" .PP -Memory binding can be done three ways: -.PP +Memory binding can be done three ways: + + .IP "\(bu" 2 explicit memory allocation thanks to \fBhwloc_alloc_membind()\fP and friends: the binding will have effect on the memory allocated by these functions\&. .IP "\(bu" 2 @@ -84,12 +85,12 @@ .PP Memory binding by CPU set cannot work for CPU-less NUMA memory nodes\&. Binding by nodeset should therefore be preferred whenever possible\&. .PP -\fBSee also:\fP +\fBSee also\fP .RS 4 Some example codes are available under doc/examples/ in the source tree\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 On some operating systems, memory binding affects the CPU binding; see \fBHWLOC_MEMBIND_NOCPUBIND\fP .RE @@ -139,7 +140,7 @@ .in +1c .TP \fB\fIHWLOC_MEMBIND_DEFAULT \fP\fP -Reset the memory allocation policy to the system default\&. Depending on the operating system, this may correspond to \fBHWLOC_MEMBIND_FIRSTTOUCH\fP (Linux), or \fBHWLOC_MEMBIND_BIND\fP (AIX, HP-UX, Solaris, Windows)\&. This policy is never returned by get membind functions\&. The nodeset argument is ignored\&. +Reset the memory allocation policy to the system default\&. Depending on the operating system, this may correspond to \fBHWLOC_MEMBIND_FIRSTTOUCH\fP (Linux, FreeBSD), or \fBHWLOC_MEMBIND_BIND\fP (AIX, HP-UX, Solaris, Windows)\&. This policy is never returned by get membind functions\&. The nodeset argument is ignored\&. .TP \fB\fIHWLOC_MEMBIND_FIRSTTOUCH \fP\fP Allocate each memory page individually on the local NUMA node of the thread that touches it\&. The given nodeset should usually be \fBhwloc_topology_get_topology_nodeset()\fP so that the touching thread may run and allocate on any node in the system\&. @@ -164,7 +165,7 @@ .PP Allocate some memory\&. This is equivalent to malloc(), except that it tries to allocate page-aligned memory from the OS\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The allocated memory should be freed with \fBhwloc_free()\fP\&. .RE @@ -175,7 +176,7 @@ .PP Allocate some memory on NUMA memory nodes specified by \fCset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 NULL with errno set to ENOSYS if the action is not supported and \fBHWLOC_MEMBIND_STRICT\fP is given .PP @@ -186,7 +187,7 @@ .PP If \fBHWLOC_MEMBIND_BYNODESET\fP is specified, set is considered a nodeset\&. Otherwise it's a cpuset\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The allocated memory should be freed with \fBhwloc_free()\fP\&. .RE @@ -263,7 +264,7 @@ .PP If any other flags are specified, -1 is returned and errno is set to EINVAL\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_pid_t\fP is \fCpid_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .RE @@ -274,7 +275,7 @@ .PP Bind the already-allocated memory identified by (addr, len) to the NUMA node(s) specified by \fCset\fP\&. If \fBHWLOC_MEMBIND_BYNODESET\fP is specified, set is considered a nodeset\&. Otherwise it's a cpuset\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 if \fClen\fP is 0\&. .PP @@ -291,7 +292,7 @@ .PP If \fBHWLOC_MEMBIND_BYNODESET\fP is specified, set is considered a nodeset\&. Otherwise it's a cpuset\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 with errno set to ENOSYS if the action is not supported .PP @@ -304,14 +305,14 @@ .PP Set the default memory binding policy of the specified process to prefer the NUMA node(s) specified by \fCset\fP\&. If \fBHWLOC_MEMBIND_BYNODESET\fP is specified, set is considered a nodeset\&. Otherwise it's a cpuset\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 with errno set to ENOSYS if the action is not supported .PP -1 with errno set to EXDEV if the binding cannot be enforced .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_pid_t\fP is \fCpid_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_nvml.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_nvml.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_nvml.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_nvml.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_nvml" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_nvml" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -22,6 +22,8 @@ .SH "Detailed Description" .PP This interface offers ways to retrieve topology information about devices managed by the NVIDIA Management Library (NVML)\&. + + .SH "Function Documentation" .PP .SS "static int hwloc_nvml_get_device_cpuset (\fBhwloc_topology_t\fP topology, nvmlDevice_t device, \fBhwloc_cpuset_t\fP set)\fC [inline]\fP, \fC [static]\fP" @@ -41,7 +43,7 @@ .PP Topology \fCtopology\fP and device \fCdevice\fP must match the local machine\&. I/O devices detection and the NVML component must be enabled in the topology\&. If not, the locality of the object may still be found using \fBhwloc_nvml_get_device_cpuset()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out)\&. .RE @@ -54,7 +56,7 @@ .PP The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection and the NVML component must be enabled in the topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_objects.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_objects.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_objects.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_objects.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_objects" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_objects" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_sets.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_sets.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_sets.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_sets.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_object_sets" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_object_sets" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -24,8 +24,8 @@ .in -1c .SH "Detailed Description" .PP -Hwloc uses bitmaps to represent two distinct kinds of object sets: CPU sets (\fBhwloc_cpuset_t\fP) and NUMA node sets (\fBhwloc_nodeset_t\fP)\&. These types are both typedefs to a common back end type (\fBhwloc_bitmap_t\fP), and therefore all the hwloc bitmap functions are applicable to both \fBhwloc_cpuset_t\fP and \fBhwloc_nodeset_t\fP (see \fBThe bitmap API\fP)\&. -.PP +Hwloc uses bitmaps to represent two distinct kinds of object sets: CPU sets (\fBhwloc_cpuset_t\fP) and NUMA node sets (\fBhwloc_nodeset_t\fP)\&. These types are both typedefs to a common back end type (\fBhwloc_bitmap_t\fP), and therefore all the hwloc bitmap functions are applicable to both \fBhwloc_cpuset_t\fP and \fBhwloc_nodeset_t\fP (see \fBThe bitmap API\fP)\&. + The rationale for having two different types is that even though the actions one wants to perform on these types are the same (e\&.g\&., enable and disable individual items in the set/mask), they're used in very different contexts: one for specifying which processors to use and one for specifying which NUMA nodes to use\&. Hence, the name difference is really just to reflect the intent of where the type is used\&. .SH "Typedef Documentation" .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_strings.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_strings.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_strings.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_strings.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_object_strings" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_object_strings" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -39,7 +39,7 @@ .PP If \fCsize\fP is 0, \fCstring\fP may safely be \fCNULL\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of character that were actually written if not truncating, or that would have been written (not including the ending \\0)\&. .RE @@ -58,7 +58,7 @@ .PP If \fCsize\fP is 0, \fCstring\fP may safely be \fCNULL\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the number of character that were actually written if not truncating, or that would have been written (not including the ending \\0)\&. .RE @@ -81,12 +81,12 @@ .PP \fCattrp\fP is only filled if not \fCNULL\fP and if its size specified in \fCattrsize\fP is large enough\&. It should be at least as large as union \fBhwloc_obj_attr_u\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 if a type was correctly identified, otherwise -1\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function is guaranteed to match any string returned by \fBhwloc_obj_type_string()\fP or \fBhwloc_obj_type_snprintf()\fP\&. .PP @@ -105,7 +105,7 @@ .PP The matched object type is set in \fCtypep\fP if \fCtypep\fP is non \fCNULL\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function is similar to \fBhwloc_type_sscanf()\fP followed by \fBhwloc_get_type_depth()\fP but it also automatically disambiguates multiple group levels etc\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_types.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_types.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_types.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_object_types.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_object_types" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_object_types" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -10,7 +10,7 @@ .in +1c .ti -1c -.RI "#define \fBHWLOC_OBJ_TYPE_MIN\fP \fBHWLOC_OBJ_MACHINE\fP" +.RI "#define \fBHWLOC_TYPE_UNORDERED\fP" .br .in -1c .SS "Typedefs" @@ -41,9 +41,6 @@ .ti -1c .RI "enum \fBhwloc_obj_osdev_type_e\fP { \fBHWLOC_OBJ_OSDEV_BLOCK\fP, \fBHWLOC_OBJ_OSDEV_GPU\fP, \fBHWLOC_OBJ_OSDEV_NETWORK\fP, \fBHWLOC_OBJ_OSDEV_OPENFABRICS\fP, \fBHWLOC_OBJ_OSDEV_DMA\fP, \fBHWLOC_OBJ_OSDEV_COPROC\fP }" .br -.ti -1c -.RI "enum \fBhwloc_compare_types_e\fP { \fBHWLOC_TYPE_UNORDERED\fP }" -.br .in -1c .SS "Functions" @@ -57,41 +54,26 @@ .SH "Macro Definition Documentation" .PP -.SS "#define HWLOC_OBJ_TYPE_MIN \fBHWLOC_OBJ_MACHINE\fP" +.SS "#define HWLOC_TYPE_UNORDERED" .PP -Type of topology object\&. -.PP -\fBNote:\fP -.RS 4 -Do not rely on the ordering or completeness of the values as new ones may be defined in the future! If you need to compare types, use \fBhwloc_compare_types()\fP instead\&.Sentinel value -.RE -.PP - +Value returned by \fBhwloc_compare_types()\fP when types can not be compared\&. .SH "Typedef Documentation" .PP -.SS "typedef enum \fBhwloc_obj_bridge_type_e\fP \fBhwloc_obj_bridge_type_t\fP" +.SS "typedef enum \fBhwloc_obj_bridge_type_e\fP \fBhwloc_obj_bridge_type_t\fP" .PP Type of one side (upstream or downstream) of an I/O bridge\&. -.SS "typedef enum \fBhwloc_obj_cache_type_e\fP \fBhwloc_obj_cache_type_t\fP" +.SS "typedef enum \fBhwloc_obj_cache_type_e\fP \fBhwloc_obj_cache_type_t\fP" .PP Cache type\&. -.SS "typedef enum \fBhwloc_obj_osdev_type_e\fP \fBhwloc_obj_osdev_type_t\fP" +.SS "typedef enum \fBhwloc_obj_osdev_type_e\fP \fBhwloc_obj_osdev_type_t\fP" .PP Type of a OS device\&. .SH "Enumeration Type Documentation" .PP -.SS "enum \fBhwloc_compare_types_e\fP" - -.PP -\fBEnumerator\fP -.in +1c -.TP -\fB\fIHWLOC_TYPE_UNORDERED \fP\fP -Value returned by \fBhwloc_compare_types()\fP when types can not be compared\&. .SS "enum \fBhwloc_obj_bridge_type_e\fP" .PP @@ -149,6 +131,15 @@ .SS "enum \fBhwloc_obj_type_t\fP" .PP +Type of topology object\&. +.PP +\fBNote\fP +.RS 4 +Do not rely on the ordering or completeness of the values as new ones may be defined in the future! If you need to compare types, use \fBhwloc_compare_types()\fP instead\&. +.RE +.PP + +.PP \fBEnumerator\fP .in +1c .TP @@ -203,7 +194,7 @@ NUMA nodes have a special depth \fBHWLOC_TYPE_DEPTH_NUMANODE\fP instead of a normal depth just like other objects in the main tree\&. .TP \fB\fIHWLOC_OBJ_BRIDGE \fP\fP -Bridge (filtered out by default)\&. Any bridge that connects the host or an I/O bus, to another I/O bus\&. They are not added to the topology unless I/O discovery is enabled with \fBhwloc_topology_set_flags()\fP\&. I/O objects are not listed in the main children list, but rather in the dedicated io children list\&. I/O objects have NULL CPU and node sets\&. +Bridge (filtered out by default)\&. Any bridge (or PCI switch) that connects the host or an I/O bus, to another I/O bus\&. They are not added to the topology unless I/O discovery is enabled with \fBhwloc_topology_set_flags()\fP\&. I/O objects are not listed in the main children list, but rather in the dedicated io children list\&. I/O objects have NULL CPU and node sets\&. .TP \fB\fIHWLOC_OBJ_PCI_DEVICE \fP\fP PCI device (filtered out by default)\&. They are not added to the topology unless I/O discovery is enabled with \fBhwloc_topology_set_flags()\fP\&. I/O objects are not listed in the main children list, but rather in the dedicated io children list\&. I/O objects have NULL CPU and node sets\&. @@ -230,7 +221,7 @@ .PP Compare the depth of two object types\&. Types shouldn't be compared as they are, since newer ones may be added in the future\&. This function returns less than, equal to, or greater than zero respectively if \fCtype1\fP objects usually include \fCtype2\fP objects, are the same as \fCtype2\fP objects, or are included in \fCtype2\fP objects\&. If the types can not be compared (because neither is usually contained in the other), \fBHWLOC_TYPE_UNORDERED\fP is returned\&. Object types containing CPUs can always be compared (usually, a system contains machines which contain nodes which contain packages which contain caches, which contain cores, which contain processors)\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fBHWLOC_OBJ_PU\fP will always be the deepest, while \fBHWLOC_OBJ_MACHINE\fP is always the highest\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_opencl.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_opencl.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_opencl.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_opencl.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_opencl" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_opencl" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -24,8 +24,8 @@ .in -1c .SH "Detailed Description" .PP -This interface offers ways to retrieve topology information about OpenCL devices\&. -.PP +This interface offers ways to retrieve topology information about OpenCL devices\&. + Only AMD and NVIDIA OpenCL implementations currently offer useful locality information about their devices\&. .SH "Function Documentation" .PP @@ -48,7 +48,7 @@ .PP Topology \fCtopology\fP and device \fCdevice\fP must match the local machine\&. I/O devices detection and the OpenCL component must be enabled in the topology\&. If not, the locality of the object may still be found using \fBhwloc_opencl_get_device_cpuset()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This function cannot work if PCI devices are filtered out\&. .PP @@ -63,7 +63,7 @@ .PP The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection and the OpenCL component must be enabled in the topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_openfabrics.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_openfabrics.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_openfabrics.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_openfabrics.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_openfabrics" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_openfabrics" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -22,6 +22,8 @@ .SH "Detailed Description" .PP This interface offers ways to retrieve topology information about OpenFabrics devices (InfiniBand, Omni-Path, usNIC, etc)\&. + + .SH "Function Documentation" .PP .SS "static int hwloc_ibv_get_device_cpuset (\fBhwloc_topology_t\fP topology, struct ibv_device * ibdev, \fBhwloc_cpuset_t\fP set)\fC [inline]\fP, \fC [static]\fP" @@ -41,7 +43,7 @@ .PP Topology \fCtopology\fP and device \fCibdev\fP must match the local machine\&. I/O devices detection must be enabled in the topology\&. If not, the locality of the object may still be found using \fBhwloc_ibv_get_device_cpuset()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object\&. .RE @@ -54,7 +56,7 @@ .PP The topology \fCtopology\fP does not necessarily have to match the current machine\&. For instance the topology may be an XML import of a remote host\&. I/O devices detection must be enabled in the topology\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The corresponding PCI device object can be obtained by looking at the OS device parent object\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_setsource.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_setsource.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_setsource.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_setsource.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_setsource" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_setsource" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -34,8 +34,8 @@ .in -1c .SH "Detailed Description" .PP -If none of the functions below is called, the default is to detect all the objects of the machine that the caller is allowed to access\&. -.PP +If none of the functions below is called, the default is to detect all the objects of the machine that the caller is allowed to access\&. + This default behavior may also be modified through environment variables if the application did not modify it already\&. Setting HWLOC_XMLFILE in the environment enforces the discovery from a XML file as if \fBhwloc_topology_set_xml()\fP had been called\&. Setting HWLOC_SYNTHETIC enforces a synthetic topology as if \fBhwloc_topology_set_synthetic()\fP had been called\&. .PP Finally, HWLOC_THISSYSTEM enforces the return value of \fBhwloc_topology_is_thissystem()\fP\&. @@ -68,7 +68,7 @@ .PP Change which process the topology is viewed from\&. On some systems, processes may have different views of the machine, for instance the set of allowed CPUs\&. By default, hwloc exposes the view from the current process\&. Calling \fBhwloc_topology_set_pid()\fP permits to make it expose the topology of the machine from the point of view of another process\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fChwloc_pid_t\fP is \fCpid_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&. .PP @@ -87,7 +87,7 @@ .PP Note that this function does not actually load topology information; it just tells hwloc where to load it from\&. You'll still need to invoke \fBhwloc_topology_load()\fP to actually load the topology information\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 For convenience, this backend provides empty binding hooks which just return success\&. .PP @@ -102,12 +102,12 @@ .PP Note that this function does not actually load topology information; it just tells hwloc where to load it from\&. You'll still need to invoke \fBhwloc_topology_load()\fP to actually load the topology information\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 with errno set to EINVAL on failure to read the XML file\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 See also \fBhwloc_topology_set_userdata_import_callback()\fP for importing application-specific object userdata\&. .PP @@ -124,12 +124,12 @@ .PP Note that this function does not actually load topology information; it just tells hwloc where to load it from\&. You'll still need to invoke \fBhwloc_topology_load()\fP to actually load the topology information\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 with errno set to EINVAL on failure to read the XML buffer\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 See also \fBhwloc_topology_set_userdata_import_callback()\fP for importing application-specific object userdata\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_shmem.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_shmem.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_shmem.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_shmem.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_shmem" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_shmem" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -21,8 +21,8 @@ .in -1c .SH "Detailed Description" .PP -These functions are used to share a topology between processes by duplicating it into a file-backed shared-memory buffer\&. -.PP +These functions are used to share a topology between processes by duplicating it into a file-backed shared-memory buffer\&. + The master process must first get the required shared-memory size for storing this topology with \fBhwloc_shmem_topology_get_length()\fP\&. .PP Then it must find a virtual memory area of that size that is available in all processes (identical virtual addresses in all processes)\&. On Linux, this can be done by comparing holes found in /proc//maps for each process\&. @@ -45,7 +45,7 @@ .PP The file pointed by descriptor \fCfd\fP, the offset \fCfileoffset\fP, the requested mapping virtual address \fCmmap_address\fP and the length \fClength\fP must be identical to what was given to \fBhwloc_shmem_topology_write()\fP earlier\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Flags \fCflags\fP are currently unused, must be 0\&. .PP @@ -54,7 +54,7 @@ This function takes care of calling \fBhwloc_topology_abi_check()\fP\&. .RE .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 with errno set to EBUSY if the virtual memory mapping defined by \fCmmap_address\fP and \fClength\fP isn't available in the process\&. .PP @@ -69,7 +69,7 @@ .PP Get the required shared memory length for storing a topology\&. This length (in bytes) must be used in \fBhwloc_shmem_topology_write()\fP and \fBhwloc_shmem_topology_adopt()\fP later\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Flags \fCflags\fP are currently unused, must be 0\&. .RE @@ -84,14 +84,14 @@ .PP The mapping length \fClength\fP must have been previously obtained with \fBhwloc_shmem_topology_get_length()\fP and the topology must not have been modified in the meantime\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Flags \fCflags\fP are currently unused, must be 0\&. .PP The object userdata pointer is duplicated but the pointed buffer is not\&. However the caller may also allocate it manually in shared memory to share it as well\&. .RE .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 with errno set to EBUSY if the virtual memory mapping defined by \fCmmap_address\fP and \fClength\fP isn't available in the process\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_syntheticexport.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_syntheticexport.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_syntheticexport.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_syntheticexport.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_syntheticexport" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_syntheticexport" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -55,14 +55,14 @@ .PP \fCflags\fP is a OR'ed set of \fBhwloc_topology_export_synthetic_flags_e\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 The number of characters that were written, not including the terminating \\0\&. .PP -1 if the topology could not be exported, for instance if it is not symmetric\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 I/O and Misc children are ignored, the synthetic string only describes normal children\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_tinker.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_tinker.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_tinker.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_tinker.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_tinker" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_tinker" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -70,10 +70,10 @@ .in +1c .TP \fB\fIHWLOC_RESTRICT_FLAG_REMOVE_CPULESS \fP\fP -Remove all objects that became CPU-less\&. By default, only objects that contain no PU and no memory are removed\&. +Remove all objects that became CPU-less\&. By default, only objects that contain no PU and no memory are removed\&. This flag may not be used with \fBHWLOC_RESTRICT_FLAG_BYNODESET\fP\&. .TP \fB\fIHWLOC_RESTRICT_FLAG_BYNODESET \fP\fP -Restrict by nodeset instead of CPU set\&. Only keep objects whose nodeset is included or partially included in the given set\&. This flag may not be used with \fBHWLOC_RESTRICT_FLAG_BYNODESET\fP\&. +Restrict by nodeset instead of CPU set\&. Only keep objects whose nodeset is included or partially included in the given set\&. This flag may not be used with \fBHWLOC_RESTRICT_FLAG_REMOVE_CPULESS\fP\&. .TP \fB\fIHWLOC_RESTRICT_FLAG_REMOVE_MEMLESS \fP\fP Remove all objects that became Memory-less\&. By default, only objects that contain no PU and no memory are removed\&. This flag may only be used with \fBHWLOC_RESTRICT_FLAG_BYNODESET\fP\&. @@ -112,7 +112,7 @@ .PP \fCflags\fP must be set to one flag among \fBhwloc_allow_flags_e\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Removing objects from a topology should rather be performed with \fBhwloc_topology_restrict()\fP\&. .RE @@ -133,7 +133,7 @@ .PP The core will setup the other sets after actual insertion\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 The inserted object if it was properly inserted\&. .PP @@ -156,7 +156,7 @@ .PP The new leaf object will not have any \fCcpuset\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 the newly-created object .PP @@ -165,7 +165,7 @@ \fCNULL\fP if Misc objects are filtered-out of the topology (\fBHWLOC_TYPE_FILTER_KEEP_NONE\fP)\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 If \fCname\fP contains some non-printable characters, they will be dropped when exporting to XML, see \fBhwloc_topology_export_xml()\fP in \fBhwloc/export\&.h\fP\&. .RE @@ -180,12 +180,12 @@ .PP \fCflags\fP is a OR'ed set of \fBhwloc_restrict_flags_e\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 This call may not be reverted by restricting back to a larger set\&. Once dropped during restriction, objects may not be brought back, except by loading another topology with \fBhwloc_topology_load()\fP\&. .RE .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 on success\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_xmlexport.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_xmlexport.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_xmlexport.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwlocality_xmlexport.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwlocality_xmlexport" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwlocality_xmlexport" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -88,12 +88,12 @@ .PP \fCflags\fP is a OR'ed set of \fBhwloc_topology_export_xml_flags_e\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if a failure occured\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 See also \fBhwloc_topology_set_userdata_export_callback()\fP for exporting application-specific object userdata\&. .PP @@ -118,12 +118,12 @@ .PP \fCflags\fP is a OR'ed set of \fBhwloc_topology_export_xml_flags_e\fP\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 -1 if a failure occured\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 See also \fBhwloc_topology_set_userdata_export_callback()\fP for exporting application-specific object userdata\&. .PP @@ -144,7 +144,7 @@ .PP \fCexport_cb\fP may be set to \fCNULL\fP if userdata should not be exported to XML\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 The topology-specific userdata pointer is ignored when exporting to XML\&. .RE @@ -161,7 +161,7 @@ .PP \fCimport_cb\fP may be \fCNULL\fP if userdata should be ignored during import\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 \fCbuffer\fP contains \fClength\fP characters followed by a null byte ('\\0')\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_backend.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_backend.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_backend.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_backend.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_backend" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_backend" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_bitmap_singlify_per_core.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_bitmap_singlify_per_core.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_bitmap_singlify_per_core.3 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_bitmap_singlify_per_core.3 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1 @@ +.so man3/hwlocality_helper_find_misc.3 diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_cl_device_topology_amd.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_cl_device_topology_amd.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_cl_device_topology_amd.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_cl_device_topology_amd.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_cl_device_topology_amd" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_cl_device_topology_amd" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -55,9 +55,9 @@ .SS "cl_char hwloc_cl_device_topology_amd::function" -.SS "struct { \&.\&.\&. } hwloc_cl_device_topology_amd::pcie" +.SS "struct { \&.\&.\&. } hwloc_cl_device_topology_amd::pcie" -.SS "struct { \&.\&.\&. } hwloc_cl_device_topology_amd::raw" +.SS "struct { \&.\&.\&. } hwloc_cl_device_topology_amd::raw" .SS "cl_uint hwloc_cl_device_topology_amd::type" diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_compare_types_e.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_compare_types_e.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_compare_types_e.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_compare_types_e.3 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -.so man3/hwlocality_object_types.3 diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_component.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_component.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_component.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_component.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_component" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_component" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -52,7 +52,7 @@ .PP \fCflags\fP is always 0 for now\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 If the component uses ltdl for loading its own plugins, it should load/unload them only in \fBinit()\fP and \fBfinalize()\fP, to avoid race conditions with hwloc's use of ltdl\&. .RE @@ -71,12 +71,12 @@ .PP \fCflags\fP is always 0 for now\&. .PP -\fBReturns:\fP +\fBReturns\fP .RS 4 0 on success, or a negative code on error\&. .RE .PP -\fBNote:\fP +\fBNote\fP .RS 4 If the component uses ltdl for loading its own plugins, it should load/unload them only in \fBinit()\fP and \fBfinalize()\fP, to avoid race conditions with hwloc's use of ltdl\&. .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_component.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_component.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_component.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_component.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_disc_component" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_disc_component" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_status.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_status.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_status.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_disc_status.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_disc_status" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_disc_status" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_distances_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_distances_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_distances_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_distances_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_distances_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_distances_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_info_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_info_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_info_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_info_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_info_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_info_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -24,7 +24,7 @@ .PP -\fBSee also:\fP +\fBSee also\fP .RS 4 \fBConsulting and Adding Key-Value Info Attributes\fP .RE diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_cpuset.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_cpuset.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_cpuset.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_cpuset.3 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -.so man3/hwlocality_intel_mic.3 diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_osdev_by_index.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_osdev_by_index.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_osdev_by_index.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intel_mic_get_device_osdev_by_index.3 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -.so man3/hwlocality_intel_mic.3 diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intro.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intro.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intro.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_intro.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,9 +1,9 @@ -.TH "hwloc_intro" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_intro" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME -hwloc_introHardware Locality (hwloc) Introduction - \- +hwloc_intro \- Hardware Locality (hwloc) Introduction + .SH "Portable abstraction of hierarchical architectures for high-performance computing" .PP .PP @@ -98,7 +98,7 @@ .IP "\(bu" 2 libudev on Linux for easier discovery of OS device information (otherwise hwloc will try to manually parse udev raw files)\&. The relevant development package is usually \fClibudev-devel\fP or \fClibudev-dev\fP\&. .IP "\(bu" 2 -libtool's ltdl library for dynamic plugin loading\&. The relevant development package is usually \fClibtool-ltdl-devel\fP or \fClibltdl-dev\fP\&. +libtool's ltdl library for dynamic plugin loading if the native dlopen cannot be used\&. The relevant development package is usually \fClibtool-ltdl-devel\fP or \fClibltdl-dev\fP\&. .PP .PP PCI and XML support may be statically built inside the main hwloc library, or as separate dynamically-loaded plugins (see the \fBComponents and plugins\fP section)\&. diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -167,7 +167,7 @@ .PP The complete CPU set of logical processors of this object,\&. This may include not only the same as the cpuset field, but also some CPUs for which topology information is unknown or incomplete, some offlines CPUs, and the CPUs that are ignored when the \fBHWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED\fP flag is not set\&. Thus no corresponding PU object may be found in the topology, because the precise position is undefined\&. It is however known that it would be somewhere under this object\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Its value must not be changed, \fBhwloc_bitmap_dup()\fP must be used instead\&. .RE @@ -180,7 +180,7 @@ .PP If there are no NUMA nodes in the machine, all the memory is close to this object, so only the first bit is set in \fCcomplete_nodeset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 Its value must not be changed, \fBhwloc_bitmap_dup()\fP must be used instead\&. .RE @@ -193,7 +193,7 @@ .PP If the \fBHWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED\fP configuration flag is set, some of these CPUs may not be allowed for binding, see \fBhwloc_topology_get_allowed_cpuset()\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 All objects have non-NULL CPU and node sets except Misc and I/O objects\&. .PP @@ -278,7 +278,7 @@ .PP If there are no NUMA nodes in the machine, all the memory is close to this object, so only the first bit may be set in \fCnodeset\fP\&. .PP -\fBNote:\fP +\fBNote\fP .RS 4 All objects have non-NULL CPU and node sets except Misc and I/O objects\&. .PP diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -57,17 +57,17 @@ Object type-specific Attributes\&. .SH "Field Documentation" .PP -.SS "struct \fBhwloc_obj_attr_u::hwloc_bridge_attr_s\fP hwloc_obj_attr_u::bridge" +.SS "struct \fBhwloc_obj_attr_u::hwloc_bridge_attr_s\fP hwloc_obj_attr_u::bridge" -.SS "struct \fBhwloc_obj_attr_u::hwloc_cache_attr_s\fP hwloc_obj_attr_u::cache" +.SS "struct \fBhwloc_obj_attr_u::hwloc_cache_attr_s\fP hwloc_obj_attr_u::cache" -.SS "struct \fBhwloc_obj_attr_u::hwloc_group_attr_s\fP hwloc_obj_attr_u::group" +.SS "struct \fBhwloc_obj_attr_u::hwloc_group_attr_s\fP hwloc_obj_attr_u::group" -.SS "struct \fBhwloc_obj_attr_u::hwloc_numanode_attr_s\fP hwloc_obj_attr_u::numanode" +.SS "struct \fBhwloc_obj_attr_u::hwloc_numanode_attr_s\fP hwloc_obj_attr_u::numanode" -.SS "struct \fBhwloc_obj_attr_u::hwloc_osdev_attr_s\fP hwloc_obj_attr_u::osdev" +.SS "struct \fBhwloc_obj_attr_u::hwloc_osdev_attr_s\fP hwloc_obj_attr_u::osdev" -.SS "struct \fBhwloc_obj_attr_u::hwloc_pcidev_attr_s\fP hwloc_obj_attr_u::pcidev" +.SS "struct \fBhwloc_obj_attr_u::hwloc_pcidev_attr_s\fP hwloc_obj_attr_u::pcidev" .SH "Author" diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_bridge_attr_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_bridge_attr_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_bridge_attr_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_bridge_attr_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u::hwloc_bridge_attr_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u::hwloc_bridge_attr_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -60,11 +60,11 @@ .SS "unsigned short hwloc_obj_attr_u::hwloc_bridge_attr_s::domain" -.SS "union { \&.\&.\&. } hwloc_obj_attr_u::hwloc_bridge_attr_s::downstream" +.SS "union { \&.\&.\&. } hwloc_obj_attr_u::hwloc_bridge_attr_s::downstream" .SS "\fBhwloc_obj_bridge_type_t\fP hwloc_obj_attr_u::hwloc_bridge_attr_s::downstream_type" -.SS "struct { \&.\&.\&. } hwloc_obj_attr_u::hwloc_bridge_attr_s::pci" +.SS "struct { \&.\&.\&. } hwloc_obj_attr_u::hwloc_bridge_attr_s::pci" .SS "struct \fBhwloc_pcidev_attr_s\fP hwloc_obj_attr_u::hwloc_bridge_attr_s::pci" @@ -72,7 +72,7 @@ .SS "unsigned char hwloc_obj_attr_u::hwloc_bridge_attr_s::subordinate_bus" -.SS "union { \&.\&.\&. } hwloc_obj_attr_u::hwloc_bridge_attr_s::upstream" +.SS "union { \&.\&.\&. } hwloc_obj_attr_u::hwloc_bridge_attr_s::upstream" .SS "\fBhwloc_obj_bridge_type_t\fP hwloc_obj_attr_u::hwloc_bridge_attr_s::upstream_type" diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_cache_attr_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_cache_attr_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_cache_attr_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_cache_attr_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u::hwloc_cache_attr_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u::hwloc_cache_attr_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_group_attr_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_group_attr_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_group_attr_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_group_attr_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u::hwloc_group_attr_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u::hwloc_group_attr_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u::hwloc_numanode_attr_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u::hwloc_numanode_attr_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -37,7 +37,7 @@ .PP Local memory (in bytes) -.SS "struct \fBhwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s\fP * hwloc_obj_attr_u::hwloc_numanode_attr_s::page_types" +.SS "struct \fBhwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s\fP * hwloc_obj_attr_u::hwloc_numanode_attr_s::page_types" .SS "unsigned hwloc_obj_attr_u::hwloc_numanode_attr_s::page_types_len" diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s_hwloc_memory_page_type_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s_hwloc_memory_page_type_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s_hwloc_memory_page_type_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_numanode_attr_s_hwloc_memory_page_type_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u::hwloc_numanode_attr_s::hwloc_memory_page_type_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_osdev_attr_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_osdev_attr_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_osdev_attr_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_osdev_attr_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u::hwloc_osdev_attr_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u::hwloc_osdev_attr_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_pcidev_attr_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_pcidev_attr_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_pcidev_attr_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_obj_attr_u_hwloc_pcidev_attr_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_obj_attr_u::hwloc_pcidev_attr_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_obj_attr_u::hwloc_pcidev_attr_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/HWLOC_OBJ_TYPE_MIN.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/HWLOC_OBJ_TYPE_MIN.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/HWLOC_OBJ_TYPE_MIN.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/HWLOC_OBJ_TYPE_MIN.3 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -.so man3/hwlocality_object_types.3 diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_cpubind_support.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_cpubind_support.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_cpubind_support.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_cpubind_support.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_cpubind_support" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_cpubind_support" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_obj_attr_u" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_obj_attr_u" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -39,11 +39,11 @@ One object attribute difference\&. .SH "Field Documentation" .PP -.SS "struct \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s\fP hwloc_topology_diff_obj_attr_u::generic" +.SS "struct \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s\fP hwloc_topology_diff_obj_attr_u::generic" -.SS "struct \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s\fP hwloc_topology_diff_obj_attr_u::string" +.SS "struct \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s\fP hwloc_topology_diff_obj_attr_u::string" -.SS "struct \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s\fP hwloc_topology_diff_obj_attr_u::uint64" +.SS "struct \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s\fP hwloc_topology_diff_obj_attr_u::uint64" .SH "Author" diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_generic_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_generic_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_generic_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_generic_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_string_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_string_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_string_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_string_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_uint64_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_uint64_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_uint64_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_obj_attr_u_hwloc_topology_diff_obj_attr_uint64_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_u" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_u" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME @@ -39,11 +39,11 @@ One element of a difference list between two topologies\&. .SH "Field Documentation" .PP -.SS "struct \fBhwloc_topology_diff_u::hwloc_topology_diff_generic_s\fP hwloc_topology_diff_u::generic" +.SS "struct \fBhwloc_topology_diff_u::hwloc_topology_diff_generic_s\fP hwloc_topology_diff_u::generic" -.SS "struct \fBhwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s\fP hwloc_topology_diff_u::obj_attr" +.SS "struct \fBhwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s\fP hwloc_topology_diff_u::obj_attr" -.SS "struct \fBhwloc_topology_diff_u::hwloc_topology_diff_too_complex_s\fP hwloc_topology_diff_u::too_complex" +.SS "struct \fBhwloc_topology_diff_u::hwloc_topology_diff_too_complex_s\fP hwloc_topology_diff_u::too_complex" .SH "Author" diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_generic_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_generic_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_generic_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_generic_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_u::hwloc_topology_diff_generic_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_u::hwloc_topology_diff_generic_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_obj_attr_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_obj_attr_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_obj_attr_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_obj_attr_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_too_complex_s.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_too_complex_s.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_too_complex_s.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_diff_u_hwloc_topology_diff_too_complex_s.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_discovery_support.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_discovery_support.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_discovery_support.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_discovery_support.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_discovery_support" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_discovery_support" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_membind_support.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_membind_support.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_membind_support.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_membind_support.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_membind_support" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_membind_support" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_support.3 hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_support.3 --- hwloc-contrib-2.1.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_support.3 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/doxygen-doc/man/man3/hwloc_topology_support.3 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "hwloc_topology_support" 3 "Mon Sep 30 2019" "Version 2.1.0" "Hardware Locality (hwloc)" \" -*- nroff -*- +.TH "hwloc_topology_support" 3 "Mon Mar 30 2020" "Version 2.2.0" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME diff -Nru hwloc-contrib-2.1.0+dfsg/doc/examples/Makefile.in hwloc-contrib-2.2.0+dfsg/doc/examples/Makefile.in --- hwloc-contrib-2.1.0+dfsg/doc/examples/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/examples/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -505,6 +505,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -519,6 +520,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/hwloc.doxy hwloc-contrib-2.2.0+dfsg/doc/hwloc.doxy --- hwloc-contrib-2.1.0+dfsg/doc/hwloc.doxy 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/hwloc.doxy 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2013 Université Bordeaux * Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -157,7 +157,7 @@ The relevant development package is usually libudev-devel or libudev-dev. -
  • libtool's ltdl library for dynamic plugin loading. +
  • libtool's ltdl library for dynamic plugin loading if the native dlopen cannot be used. The relevant development package is usually libtool-ltdl-devel or libltdl-dev.
  • @@ -724,7 +724,7 @@ It could also have siblings if there were multiple local NUMA nodes, or cousins if other NUMA nodes were attached somewhere else in the machine. -I/O or Misc object could be attached in a similar manner. +I/O or Misc objects could be attached in a similar manner. @@ -1064,7 +1064,7 @@ Domain/bus specifications should usually match entire hierarchies of buses behind a bridge (including primary, secondary and subordinate buses). - For instance, if hostbridge 0000:00 contains other bridges creating buses 0000:01 to 0000:09, + For instance, if hostbridge 0000:00 is above other bridges/switches with buses 0000:01 to 0000:09, the variable should be HWLOC_PCI_LOCALITY="0000:00-09 ". It supersedes the old HWLOC_PCI_0000_00_LOCALCPUS=<cpuset> which only works when hostbridges exist in the topology. @@ -1351,7 +1351,7 @@ Note that I/O discovery requires significant help from the operating system. The pciaccess library (the development package is usually libpciaccess-devel -or libpciaccess-dev) is needed to fully detect PCI devices and bridges. +or libpciaccess-dev) is needed to fully detect PCI devices and bridges/switches. On Linux, PCI discovery may still be performed even if libpciaccess cannot be used. But it misses PCI device names. Moreover, some operating systems require privileges for probing PCI devices, @@ -1376,14 +1376,14 @@ See \ref iodevices_osdev.
  • ::HWLOC_OBJ_PCI_DEVICE and ::HWLOC_OBJ_BRIDGE build up -a PCI hierarchy made of devices and bridges. +a PCI hierarchy made of bridges (that may be actually be switches) and devices. See \ref iodevices_pci.
  • Any of these types may be filtered individually with hwloc_topology_set_type_filter(). hwloc tries to attach these new objects to normal objects (usually NUMA nodes) to match their actual physical location. -For instance, if a I/O Hub is physically connected to a package, +For instance, if a I/O hub (or root complex) is physically connected to a package, the corresponding hwloc bridge object (and its PCI bridges and devices children) is inserted as a child of the corresponding hwloc Package object. These children are not in the normal children list but rather in the I/O-specific @@ -1470,9 +1470,6 @@ (OpenCL component)
  • cuda0 for the first NVIDIA CUDA device (CUDA component, using the NVIDIA CUDA Library)
  • -
  • mic0 for the first Intel Xeon Phi (MIC) coprocessor - (Linux component)
  • -
  • DMA engine channel (::HWLOC_OBJ_OSDEV_DMA)
      @@ -1502,7 +1499,7 @@ (unless the Bridge object type is filtered-out). Each hostbridge contains one or several children, either other bridges -(usually PCI to PCI) or PCI devices (::HWLOC_OBJ_PCI_DEVICE). +(usually PCI to PCI switches) or PCI devices (::HWLOC_OBJ_PCI_DEVICE). The number of bridges between the hostbridge and a PCI device depends on the machine. @@ -1888,23 +1885,6 @@ and size of the shared memory in each multiprocessor of a CUDA device. Sizes are in kB. -
      MICSerialNumber (MIC coprocessor OS device)
      -
      - The serial number of an Intel Xeon Phi (MIC) coprocessor. - hwloc may run either inside the coprocessor itself, or on the host processor. - That attribute is set in both cases, so that the exact same coprocessor may be - identified from both point of views, even if there are multiple nodes with - multiple MICs. - When running hwloc on the host, each hwloc OS device object that - corresponds to a Xeon Phi gets such an attribute. - When running hwloc inside a Xeon Phi coprocessor, the root of the topology - (Machine object) gets this attribute. -
      -
      MICFamily, MICSKU, MICActiveCores, MICMemorySize (MIC coprocessor OS device)
      -
      The family, SKU (model), - number of active cores, and memory size (in kB) - of an Intel Xeon Phi (MIC) coprocessor. -
      Address, Port (Network interface OS devices)
      The MAC address and the port number of a software network interface, such as eth4 on Linux. @@ -1994,7 +1974,7 @@ XML topologies may then be reloaded later with hwloc_topology_set_xml() and hwloc_topology_set_xmlbuffer(). The HWLOC_XMLFILE environment variable also tells hwloc to load the topology -from the given XML file. +from the given XML file (see \ref envvar). \note Loading XML topologies disables binding because the loaded topology may not correspond to the physical machine that loads it. @@ -2301,14 +2281,6 @@ information (if I/O device discovery is enabled).
      -
      Intel Xeon Phi (MIC)
      -
      - hwloc/intel-mic.h helps interoperability with Intel Xeon Phi (MIC) - coprocessors by returning the list of processors near these devices. - It may also return the corresponding OS device hwloc object for further - information (if I/O device discovery is enabled). -
      -
      OpenCL
      hwloc/opencl.h enables interoperability with the OpenCL interface. @@ -2738,7 +2710,7 @@ build setup by calling an m4 macro (see below). Although hwloc dynamic shared object plugins may be used in embedded -mode, the embedder project will have to manually setup libltdl in its +mode, the embedder project will have to manually setup dlopen or libltdl in its build system so that hwloc can load its plugins at run time. Also, embedders should be aware of complications that can arise due to public and private linker namespaces (e.g., if the embedder project is @@ -2746,7 +2718,7 @@ load its plugins, such loading may fail since the hwloc plugins can't find the hwloc symbols they need). The embedder project is strongly advised not to use hwloc's -dynamically loading plugins / libltdl capability. +dynamically loading plugins / dlopen / libltdl capability. \htmlonly @@ -2816,7 +2788,7 @@ hwloc's types and public symbols with "foo_"; meaning that function hwloc_init() becomes foo_hwloc_init(). Enum values are prefixed with an upper-case translation if the prefix supplied; - HWLOC_OBJ_CORE becomes FOO_HWLOC_OBJ_CORE. This is recommended + HWLOC_OBJ_CORE becomes FOO_hwloc_OBJ_CORE. This is recommended behavior if you are including hwloc in middleware -- it is possible that your software will be combined with other software that links to another copy of hwloc. If both uses of hwloc utilize different @@ -3564,27 +3536,6 @@ about the location of dumped files. -\subsection faq_phi How do I build for Intel Xeon Phi coprocessor? - -\note This section does not apply to standalone Intel Xeon Phi processors (Knights Landing and Knights Mill). - -Intel Xeon Phi coprocessors (Knights Corner) usually runs a Linux environment -but cross-compiling from the host is required. -hwloc uses standard autotools options for cross-compiling. - -If building with icc: -\verbatim -./configure CC="icc -mmic" --host=x86_64-k1om-linux --build=x86_64-unknown-linux-gnu -\endverbatim - -If building with the Xeon Phi-specific GCC that comes with the MPSS environment, -for instance /usr/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc: -\verbatim -export PATH=$PATH:/usr/linux-k1om-4.7/bin/ -./configure --host=x86_64-k1om-linux --build=x86_64-unknown-linux-gnu -\endverbatim - - \subsection faq_bgq How do I build hwloc for BlueGene/Q? IBM BlueGene/Q machines run a standard Linux on the login/frontend nodes diff -Nru hwloc-contrib-2.1.0+dfsg/doc/images/diagram.eps hwloc-contrib-2.2.0+dfsg/doc/images/diagram.eps --- hwloc-contrib-2.1.0+dfsg/doc/images/diagram.eps 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/images/diagram.eps 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ %!PS-Adobe-3.0 EPSF-3.0 %%Title: images/diagram.fig -%%Creator: fig2dev Version 3.2.7a -%%CreationDate: 2019-09-23 15:52:40 +%%Creator: fig2dev Version 3.2.7b +%%CreationDate: 2020-03-23 10:56:37 %%BoundingBox: 0 0 720 705 %%Magnification: 1.0000 %%EndComments diff -Nru hwloc-contrib-2.1.0+dfsg/doc/Makefile.am hwloc-contrib-2.2.0+dfsg/doc/Makefile.am --- hwloc-contrib-2.1.0+dfsg/doc/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -80,7 +80,6 @@ $(hwloc_include_dir)/hwloc/cudart.h \ $(hwloc_include_dir)/hwloc/nvml.h \ $(hwloc_include_dir)/hwloc/gl.h \ - $(hwloc_include_dir)/hwloc/intel-mic.h \ $(hwloc_include_dir)/hwloc/openfabrics-verbs.h \ $(srcdir)/netloc.doxy \ $(hwloc_include_dir)/netloc.h @@ -304,7 +303,6 @@ $(DOX_MAN_DIR)/man3/hwloc_obj_osdev_type_e.3 \ $(DOX_MAN_DIR)/man3/hwloc_obj_osdev_type_t.3 \ $(DOX_MAN_DIR)/man3/hwloc_compare_types.3 \ - $(DOX_MAN_DIR)/man3/hwloc_compare_types_e.3 \ $(DOX_MAN_DIR)/man3/HWLOC_TYPE_UNORDERED.3 man3_objectsdir = $(man3dir) @@ -602,6 +600,7 @@ man3_helper_find_miscdir = $(man3dir) man3_helper_find_misc_DATA = \ $(DOX_MAN_DIR)/man3/hwlocality_helper_find_misc.3 \ + $(DOX_MAN_DIR)/man3/hwloc_bitmap_singlify_per_core.3 \ $(DOX_MAN_DIR)/man3/hwloc_get_pu_obj_by_os_index.3 \ $(DOX_MAN_DIR)/man3/hwloc_get_next_child.3 \ $(DOX_MAN_DIR)/man3/hwloc_get_closest_objs.3 \ @@ -717,10 +716,7 @@ $(DOX_MAN_DIR)/man3/hwlocality_gl.3 \ $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_osdev_by_port_device.3 \ $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_osdev_by_name.3 \ - $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_by_osdev.3 \ - $(DOX_MAN_DIR)/man3/hwlocality_intel_mic.3 \ - $(DOX_MAN_DIR)/man3/hwloc_intel_mic_get_device_cpuset.3 \ - $(DOX_MAN_DIR)/man3/hwloc_intel_mic_get_device_osdev_by_index.3 + $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_by_osdev.3 man3_glibc_scheddir = $(man3dir) man3_glibc_sched_DATA = \ diff -Nru hwloc-contrib-2.1.0+dfsg/doc/Makefile.in hwloc-contrib-2.2.0+dfsg/doc/Makefile.in --- hwloc-contrib-2.1.0+dfsg/doc/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/doc/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -324,6 +324,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -338,6 +339,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -551,7 +553,6 @@ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/cudart.h \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/nvml.h \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/gl.h \ -@HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/intel-mic.h \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/openfabrics-verbs.h \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(srcdir)/netloc.doxy \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/netloc.h @@ -649,7 +650,6 @@ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_obj_osdev_type_e.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_obj_osdev_type_t.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_compare_types.3 \ -@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_compare_types_e.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/HWLOC_TYPE_UNORDERED.3 @HWLOC_INSTALL_DOXYGEN_TRUE@man3_objectsdir = $(man3dir) @@ -947,6 +947,7 @@ @HWLOC_INSTALL_DOXYGEN_TRUE@man3_helper_find_miscdir = $(man3dir) @HWLOC_INSTALL_DOXYGEN_TRUE@man3_helper_find_misc_DATA = \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwlocality_helper_find_misc.3 \ +@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_bitmap_singlify_per_core.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_get_pu_obj_by_os_index.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_get_next_child.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_get_closest_objs.3 \ @@ -1062,10 +1063,7 @@ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwlocality_gl.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_osdev_by_port_device.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_osdev_by_name.3 \ -@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_by_osdev.3 \ -@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwlocality_intel_mic.3 \ -@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_intel_mic_get_device_cpuset.3 \ -@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_intel_mic_get_device_osdev_by_index.3 +@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_gl_get_display_by_osdev.3 @HWLOC_INSTALL_DOXYGEN_TRUE@man3_glibc_scheddir = $(man3dir) @HWLOC_INSTALL_DOXYGEN_TRUE@man3_glibc_sched_DATA = \ diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/bitmap.c hwloc-contrib-2.2.0+dfsg/hwloc/bitmap.c --- hwloc-contrib-2.1.0+dfsg/hwloc/bitmap.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/bitmap.c 2020-03-30 18:07:31.000000000 +0000 @@ -505,14 +505,16 @@ if (begin != -1) { /* finishing a range */ - hwloc_bitmap_set_range(set, begin, val); + if (hwloc_bitmap_set_range(set, begin, val) < 0) + goto failed; begin = -1; } else if (*next == '-') { /* starting a new range */ if (*(next+1) == '\0') { /* infinite range */ - hwloc_bitmap_set_range(set, val, -1); + if (hwloc_bitmap_set_range(set, val, -1) < 0) + goto failed; break; } else { /* normal range */ diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/components.c hwloc-contrib-2.2.0+dfsg/hwloc/components.c --- hwloc-contrib-2.1.0+dfsg/hwloc/components.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/components.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2012 Université Bordeaux * See COPYING in top-level directory. */ @@ -63,14 +63,128 @@ #ifdef HWLOC_HAVE_PLUGINS +#ifdef HWLOC_HAVE_LTDL +/* ltdl-based plugin load */ #include +typedef lt_dlhandle hwloc_dlhandle; +#define hwloc_dlinit lt_dlinit +#define hwloc_dlexit lt_dlexit +#define hwloc_dlopenext lt_dlopenext +#define hwloc_dlclose lt_dlclose +#define hwloc_dlerror lt_dlerror +#define hwloc_dlsym lt_dlsym +#define hwloc_dlforeachfile lt_dlforeachfile + +#else /* !HWLOC_HAVE_LTDL */ +/* no-ltdl plugin load relies on less portable libdl */ +#include +typedef void * hwloc_dlhandle; +static __hwloc_inline int hwloc_dlinit(void) { return 0; } +static __hwloc_inline int hwloc_dlexit(void) { return 0; } +#define hwloc_dlclose dlclose +#define hwloc_dlerror dlerror +#define hwloc_dlsym dlsym + +#include +#include +#include +#include + +static hwloc_dlhandle hwloc_dlopenext(const char *_filename) +{ + hwloc_dlhandle handle; + char *filename = NULL; + (void) asprintf(&filename, "%s.so", _filename); + if (!filename) + return NULL; + handle = dlopen(filename, RTLD_NOW|RTLD_LOCAL); + free(filename); + return handle; +} + +static int +hwloc_dlforeachfile(const char *_paths, + int (*func)(const char *filename, void *data), + void *data) +{ + char *paths = NULL, *path; + + paths = strdup(_paths); + if (!paths) + return -1; + + path = paths; + while (*path) { + char *colon; + DIR *dir; + struct dirent *dirent; + + colon = strchr(path, ':'); + if (colon) + *colon = '\0'; + + if (hwloc_plugins_verbose) + fprintf(stderr, " Looking under %s\n", path); + + dir = opendir(path); + if (!dir) + goto next; + + while ((dirent = readdir(dir)) != NULL) { + char *abs_name, *suffix; + struct stat stbuf; + int err; + + err = asprintf(&abs_name, "%s/%s", path, dirent->d_name); + if (err < 0) + continue; + + err = stat(abs_name, &stbuf); + if (err < 0) { + free(abs_name); + continue; + } + if (!S_ISREG(stbuf.st_mode)) { + free(abs_name); + continue; + } + + /* Only keep .so files, and remove that suffix to get the component basename */ + suffix = strrchr(abs_name, '.'); + if (!suffix || strcmp(suffix, ".so")) { + free(abs_name); + continue; + } + *suffix = '\0'; + + err = func(abs_name, data); + if (err) { + free(abs_name); + continue; + } + + free(abs_name); + } + + closedir(dir); + + next: + if (!colon) + break; + path = colon+1; + } + + free(paths); + return 0; +} +#endif /* !HWLOC_HAVE_LTDL */ /* array of pointers to dynamically loaded plugins */ static struct hwloc__plugin_desc { char *name; struct hwloc_component *component; char *filename; - lt_dlhandle handle; + hwloc_dlhandle handle; struct hwloc__plugin_desc *next; } *hwloc_plugins = NULL; @@ -78,9 +192,10 @@ hwloc__dlforeach_cb(const char *filename, void *_data __hwloc_attribute_unused) { const char *basename; - lt_dlhandle handle; + hwloc_dlhandle handle; struct hwloc_component *component; struct hwloc__plugin_desc *desc, **prevdesc; + char *componentsymbolname; if (hwloc_plugins_verbose) fprintf(stderr, "Plugin dlforeach found `%s'\n", filename); @@ -98,33 +213,40 @@ } /* dlopen and get the component structure */ - handle = lt_dlopenext(filename); + handle = hwloc_dlopenext(filename); if (!handle) { if (hwloc_plugins_verbose) - fprintf(stderr, "Failed to load plugin: %s\n", lt_dlerror()); + fprintf(stderr, "Failed to load plugin: %s\n", hwloc_dlerror()); goto out; } -{ - char componentsymbolname[strlen(basename)+10+1]; + componentsymbolname = malloc(strlen(basename)+10+1); + if (!componentsymbolname) { + if (hwloc_plugins_verbose) + fprintf(stderr, "Failed to allocation component `%s' symbol\n", + basename); + goto out_with_handle; + } sprintf(componentsymbolname, "%s_component", basename); - component = lt_dlsym(handle, componentsymbolname); + component = hwloc_dlsym(handle, componentsymbolname); if (!component) { if (hwloc_plugins_verbose) fprintf(stderr, "Failed to find component symbol `%s'\n", componentsymbolname); + free(componentsymbolname); goto out_with_handle; } if (component->abi != HWLOC_COMPONENT_ABI) { if (hwloc_plugins_verbose) fprintf(stderr, "Plugin symbol ABI %u instead of %d\n", component->abi, HWLOC_COMPONENT_ABI); + free(componentsymbolname); goto out_with_handle; } if (hwloc_plugins_verbose) fprintf(stderr, "Plugin contains expected symbol `%s'\n", componentsymbolname); -} + free(componentsymbolname); if (HWLOC_COMPONENT_TYPE_DISC == component->type) { if (strncmp(basename, "hwloc_", 6)) { @@ -167,7 +289,7 @@ return 0; out_with_handle: - lt_dlclose(handle); + hwloc_dlclose(handle); out: return 0; } @@ -183,7 +305,7 @@ desc = hwloc_plugins; while (desc) { next = desc->next; - lt_dlclose(desc->handle); + hwloc_dlclose(desc->handle); free(desc->name); free(desc->filename); free(desc); @@ -191,7 +313,7 @@ } hwloc_plugins = NULL; - lt_dlexit(); + hwloc_dlexit(); } static int @@ -207,7 +329,7 @@ hwloc_plugins_blacklist = getenv("HWLOC_PLUGINS_BLACKLIST"); - err = lt_dlinit(); + err = hwloc_dlinit(); if (err) goto out; @@ -219,7 +341,7 @@ if (hwloc_plugins_verbose) fprintf(stderr, "Starting plugin dlforeach in %s\n", path); - err = lt_dlforeachfile(path, hwloc__dlforeach_cb, NULL); + err = hwloc_dlforeachfile(path, hwloc__dlforeach_cb, NULL); if (err) goto out_with_init; @@ -680,7 +802,8 @@ while (*curenv) { s = strcspn(curenv, HWLOC_COMPONENT_SEPS); if (s) { - char c, *name; + char c; + const char *name; if (!strncmp(curenv, HWLOC_COMPONENT_STOP_NAME, s)) { tryall = 0; diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/distances.c hwloc-contrib-2.2.0+dfsg/hwloc/distances.c --- hwloc-contrib-2.1.0+dfsg/hwloc/distances.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/distances.c 2020-03-30 18:07:31.000000000 +0000 @@ -323,6 +323,8 @@ return 0; err_with_dist: + if (name) + free(dist->name); free(dist); err: free(different_types); diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/Makefile.am hwloc-contrib-2.2.0+dfsg/hwloc/Makefile.am --- hwloc-contrib-2.1.0+dfsg/hwloc/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2018 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2012 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright © 2011-2012 Oracle and/or its affiliates. All rights reserved. @@ -21,9 +21,9 @@ pluginsdir = @HWLOC_PLUGINS_DIR@ plugins_LTLIBRARIES = -plugins_ldflags = -module -avoid-version -lltdl +plugins_ldflags = -module -avoid-version $(HWLOC_DL_LIBS) $(HWLOC_LTDL_LIBS) # Beware that files are not rebuilt automatically when reconfiguring with different paths in these flags. -AM_CPPFLAGS += -DHWLOC_PLUGINS_PATH=\"$(HWLOC_PLUGINS_PATH)\" -DRUNSTATEDIR=\"$(HWLOC_runstatedir)\" +AM_CPPFLAGS += -DHWLOC_PLUGINS_PATH="\"$(HWLOC_PLUGINS_PATH)\"" -DRUNSTATEDIR="\"$(HWLOC_runstatedir)\"" # Sources and ldflags @@ -199,12 +199,10 @@ # Installable library libhwloc_la_SOURCES = $(sources) -libhwloc_la_LDFLAGS = $(ldflags) -version-info $(libhwloc_so_version) $(HWLOC_LIBS) $(HWLOC_LDFLAGS) +libhwloc_la_LDFLAGS = $(ldflags) -version-info $(libhwloc_so_version) $(HWLOC_LIBS) $(HWLOC_DL_LIBS) $(HWLOC_LTDL_LIBS) $(HWLOC_LDFLAGS) if HWLOC_HAVE_PLUGINS -AM_CPPFLAGS += $(LTDLINCL) libhwloc_la_LDFLAGS += -export-dynamic -libhwloc_la_LIBADD = $(LIBLTDL) endif # Embedded library (note the lack of a .so version number -- that diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/Makefile.in hwloc-contrib-2.2.0+dfsg/hwloc/Makefile.in --- hwloc-contrib-2.1.0+dfsg/hwloc/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2018 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2012 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright © 2011-2012 Oracle and/or its affiliates. All rights reserved. @@ -126,9 +126,8 @@ @HWLOC_HAVE_X86_CPUID_TRUE@am__append_25 = topology-x86.c @HWLOC_HAVE_GCC_TRUE@am__append_26 = -no-undefined @HWLOC_HAVE_WINDOWS_TRUE@am__append_27 = -Xlinker --output-def -Xlinker .libs/libhwloc.def -@HWLOC_HAVE_PLUGINS_TRUE@am__append_28 = $(LTDLINCL) -@HWLOC_HAVE_PLUGINS_TRUE@am__append_29 = -export-dynamic -@HWLOC_BUILD_STANDALONE_TRUE@am__append_30 = hwloc.dtd hwloc2.dtd hwloc2-diff.dtd +@HWLOC_HAVE_PLUGINS_TRUE@am__append_28 = -export-dynamic +@HWLOC_BUILD_STANDALONE_TRUE@am__append_29 = hwloc.dtd hwloc2.dtd hwloc2-diff.dtd subdir = hwloc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ @@ -254,7 +253,7 @@ $(hwloc_xml_libxml_la_LDFLAGS) $(LDFLAGS) -o $@ @HWLOC_HAVE_LIBXML2_TRUE@@HWLOC_XML_LIBXML_BUILD_STATIC_FALSE@am_hwloc_xml_libxml_la_rpath = -rpath \ @HWLOC_HAVE_LIBXML2_TRUE@@HWLOC_XML_LIBXML_BUILD_STATIC_FALSE@ $(pluginsdir) -libhwloc_la_DEPENDENCIES = +libhwloc_la_LIBADD = am__libhwloc_la_SOURCES_DIST = topology.c traversal.c distances.c \ components.c bind.c bitmap.c pci-common.c diff.c shmem.c \ misc.c base64.c topology-noos.c topology-synthetic.c \ @@ -469,6 +468,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -483,6 +483,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -629,10 +630,10 @@ AM_CFLAGS = $(HWLOC_CFLAGS) # Beware that files are not rebuilt automatically when reconfiguring with different paths in these flags. AM_CPPFLAGS = $(HWLOC_CPPFLAGS) -DHWLOC_INSIDE_LIBHWLOC \ - -DHWLOC_PLUGINS_PATH=\"$(HWLOC_PLUGINS_PATH)\" \ - -DRUNSTATEDIR=\"$(HWLOC_runstatedir)\" $(am__append_28) + -DHWLOC_PLUGINS_PATH="\"$(HWLOC_PLUGINS_PATH)\"" \ + -DRUNSTATEDIR="\"$(HWLOC_runstatedir)\"" AM_LDFLAGS = $(HWLOC_LDFLAGS) -EXTRA_DIST = dolib.c $(am__append_30) +EXTRA_DIST = dolib.c $(am__append_29) # If we're in standalone mode, build the installable library. # Otherwise, build the embedded library. @@ -641,7 +642,7 @@ pluginsdir = @HWLOC_PLUGINS_DIR@ plugins_LTLIBRARIES = $(am__append_2) $(am__append_4) $(am__append_6) \ $(am__append_8) $(am__append_10) $(am__append_12) -plugins_ldflags = -module -avoid-version -lltdl +plugins_ldflags = -module -avoid-version $(HWLOC_DL_LIBS) $(HWLOC_LTDL_LIBS) # Sources and ldflags sources = topology.c traversal.c distances.c components.c bind.c \ @@ -682,8 +683,8 @@ # Installable library libhwloc_la_SOURCES = $(sources) libhwloc_la_LDFLAGS = $(ldflags) -version-info $(libhwloc_so_version) \ - $(HWLOC_LIBS) $(HWLOC_LDFLAGS) $(am__append_29) -@HWLOC_HAVE_PLUGINS_TRUE@libhwloc_la_LIBADD = $(LIBLTDL) + $(HWLOC_LIBS) $(HWLOC_DL_LIBS) $(HWLOC_LTDL_LIBS) \ + $(HWLOC_LDFLAGS) $(am__append_28) # Embedded library (note the lack of a .so version number -- that # intentionally only appears in the installable library). Also note @@ -1123,9 +1124,9 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HWLOC_HAVE_WINDOWS_FALSE@uninstall-local: @HWLOC_HAVE_MS_LIB_FALSE@clean-local: @HWLOC_HAVE_WINDOWS_FALSE@clean-local: +@HWLOC_HAVE_WINDOWS_FALSE@uninstall-local: @HWLOC_HAVE_WINDOWS_FALSE@install-exec-hook: clean: clean-am diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/pci-common.c hwloc-contrib-2.2.0+dfsg/hwloc/pci-common.c --- hwloc-contrib-2.1.0+dfsg/hwloc/pci-common.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/pci-common.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -366,7 +366,7 @@ struct hwloc_obj **dstnextp; struct hwloc_obj **srcnextp; struct hwloc_obj *child; - unsigned short current_domain; + unsigned current_domain; unsigned char current_bus; unsigned char current_subordinate; diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology.c hwloc-contrib-2.2.0+dfsg/hwloc/topology.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2009 CNRS * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2012 Université Bordeaux + * Copyright © 2009-2012, 2020 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -33,6 +33,9 @@ #ifdef HAVE_MACH_MACH_INIT_H #include #endif +#ifdef HAVE_MACH_INIT_H +#include +#endif #ifdef HAVE_MACH_MACH_HOST_H #include #endif @@ -123,15 +126,25 @@ #endif #if defined(HAVE_SYSCTL) -int hwloc_get_sysctl(int name[], unsigned namelen, int *ret) +int hwloc_get_sysctl(int name[], unsigned namelen, int64_t *ret) { - int n; + union { + int32_t i32; + int64_t i64; + } n; size_t size = sizeof(n); if (sysctl(name, namelen, &n, &size, NULL, 0)) return -1; - if (size != sizeof(n)) - return -1; - *ret = n; + switch (size) { + case sizeof(n.i32): + *ret = n.i32; + break; + case sizeof(n.i64): + *ret = n.i64; + break; + default: + return -1; + } return 0; } #endif @@ -178,8 +191,10 @@ n = nn; #elif defined(HAVE_SYSCTL) && HAVE_DECL_CTL_HW && HAVE_DECL_HW_NCPU static int name[2] = {CTL_HW, HW_NCPU}; - if (hwloc_get_sysctl(name, sizeof(name)/sizeof(*name), &n)) + int64_t nn; + if (hwloc_get_sysctl(name, sizeof(name)/sizeof(*name), &nn)) n = -1; + n = nn; #else #ifdef __GNUC__ #warning No known way to discover number of available processors on this system @@ -188,6 +203,46 @@ #endif return n; } + +int64_t +hwloc_fallback_memsize(void) { + int64_t size; +#if defined(HAVE_HOST_INFO) && HAVE_HOST_INFO + struct host_basic_info info; + mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT; + host_info(mach_host_self(), HOST_BASIC_INFO, (integer_t*) &info, &count); + size = info.memory_size; +#elif defined(HAVE_SYSCTL) && HAVE_DECL_CTL_HW && (HAVE_DECL_HW_REALMEM64 || HAVE_DECL_HW_MEMSIZE64 || HAVE_DECL_HW_PHYSMEM64 || HAVE_DECL_HW_USERMEM64 || HAVE_DECL_HW_REALMEM || HAVE_DECL_HW_MEMSIZE || HAVE_DECL_HW_PHYSMEM || HAVE_DECL_HW_USERMEM) +#if HAVE_DECL_HW_MEMSIZE64 + static int name[2] = {CTL_HW, HW_MEMSIZE64}; +#elif HAVE_DECL_HW_REALMEM64 + static int name[2] = {CTL_HW, HW_REALMEM64}; +#elif HAVE_DECL_HW_PHYSMEM64 + static int name[2] = {CTL_HW, HW_PHYSMEM64}; +#elif HAVE_DECL_HW_USERMEM64 + static int name[2] = {CTL_HW, HW_USERMEM64}; +#elif HAVE_DECL_HW_MEMSIZE + static int name[2] = {CTL_HW, HW_MEMSIZE}; +#elif HAVE_DECL_HW_REALMEM + static int name[2] = {CTL_HW, HW_REALMEM}; +#elif HAVE_DECL_HW_PHYSMEM + static int name[2] = {CTL_HW, HW_PHYSMEM}; +#elif HAVE_DECL_HW_USERMEM + static int name[2] = {CTL_HW, HW_USERMEM}; +#endif + if (hwloc_get_sysctl(name, sizeof(name)/sizeof(*name), &size)) + size = -1; +#elif defined(HAVE_SYSCTLBYNAME) + if (hwloc_get_sysctlbyname("hw.memsize", &size) && + hwloc_get_sysctlbyname("hw.realmem", &size) && + hwloc_get_sysctlbyname("hw.physmem", &size) && + hwloc_get_sysctlbyname("hw.usermem", &size)) + size = -1; +#else + size = -1; +#endif + return size; +} #endif /* !HWLOC_WIN_SYS */ /* @@ -2043,15 +2098,17 @@ if (obj->type == HWLOC_OBJ_NUMANODE) { obj->total_memory += obj->attr->numanode.local_memory; - /* By the way, sort the page_type array. - * Cannot do it on insert since some backends (e.g. XML) add page_types after inserting the object. - */ - qsort(obj->attr->numanode.page_types, obj->attr->numanode.page_types_len, sizeof(*obj->attr->numanode.page_types), hwloc_memory_page_type_compare); - /* Ignore 0-size page_types, they are at the end */ - for(i=obj->attr->numanode.page_types_len; i>=1; i--) - if (obj->attr->numanode.page_types[i-1].size) - break; - obj->attr->numanode.page_types_len = i; + if (obj->attr->numanode.page_types_len) { + /* By the way, sort the page_type array. + * Cannot do it on insert since some backends (e.g. XML) add page_types after inserting the object. + */ + qsort(obj->attr->numanode.page_types, obj->attr->numanode.page_types_len, sizeof(*obj->attr->numanode.page_types), hwloc_memory_page_type_compare); + /* Ignore 0-size page_types, they are at the end */ + for(i=obj->attr->numanode.page_types_len; i>=1; i--) + if (obj->attr->numanode.page_types[i-1].size) + break; + obj->attr->numanode.page_types_len = i; + } } } @@ -2966,7 +3023,8 @@ if (hwloc_type_cmp(top_obj, objs[i]) == HWLOC_OBJ_EQUAL) { /* Take it, add main children. */ taken_objs[n_taken_objs++] = objs[i]; - memcpy(&new_objs[n_new_objs], objs[i]->children, objs[i]->arity * sizeof(new_objs[0])); + if (objs[i]->arity) + memcpy(&new_objs[n_new_objs], objs[i]->children, objs[i]->arity * sizeof(new_objs[0])); n_new_objs += objs[i]->arity; } else { /* Leave it. */ @@ -4113,6 +4171,7 @@ /* cpuset to clear */ if (flags & HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS) { hwloc_obj_t pu = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, 0); + assert(pu); do { /* PU will be removed if cpuset gets or was empty */ if (hwloc_bitmap_iszero(pu->cpuset) @@ -4148,6 +4207,7 @@ /* nodeset to clear */ if (flags & HWLOC_RESTRICT_FLAG_REMOVE_CPULESS) { hwloc_obj_t node = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, 0); + assert(node); do { /* node will be removed if nodeset gets or was empty */ if (hwloc_bitmap_iszero(node->cpuset) @@ -4242,6 +4302,9 @@ goto error; } topology->binding_hooks.get_allowed_resources(topology); + /* make sure the backend returned something sane (Linux cpusets may return offline PUs in some cases) */ + hwloc_bitmap_and(topology->allowed_cpuset, topology->allowed_cpuset, hwloc_get_root_obj(topology)->cpuset); + hwloc_bitmap_and(topology->allowed_nodeset, topology->allowed_nodeset, hwloc_get_root_obj(topology)->nodeset); break; } case HWLOC_ALLOW_FLAG_CUSTOM: { diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-freebsd.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-freebsd.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-freebsd.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-freebsd.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2010, 2012 Université Bordeaux + * Copyright © 2009-2020 Inria. All rights reserved. + * Copyright © 2009-2010, 2012, 2020 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -12,13 +12,20 @@ #include #include #include +#include #include +#include +#include +#include #ifdef HAVE_PTHREAD_NP_H #include #endif #ifdef HAVE_SYS_CPUSET_H #include #endif +#ifdef HAVE_SYS_DOMAINSET_H +#include +#endif #ifdef HAVE_SYS_SYSCTL_H #include #endif @@ -57,7 +64,6 @@ if (cpuset_setaffinity(level, which, id, sizeof(cset), &cset)) return -1; - return 0; } @@ -109,6 +115,123 @@ return hwloc_freebsd_get_sth_affinity(topology, CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, hwloc_cpuset, flags); } +#ifdef HAVE_SYS_DOMAINSET_H + +static void +hwloc_freebsd_bsd2hwloc_membind(hwloc_nodeset_t hwloc_nodeset, const domainset_t *mask) +{ + unsigned node; + hwloc_bitmap_zero(hwloc_nodeset); + for (node = 0; node < DOMAINSET_SETSIZE; node++) + if (CPU_ISSET(node, mask)) + hwloc_bitmap_set(hwloc_nodeset, node); +} + +static void +hwloc_freebsd_hwloc2bsd_membind(hwloc_const_nodeset_t hwloc_nodeset, domainset_t *mask) +{ + unsigned node; + DOMAINSET_ZERO(mask); + for (node = 0; node < DOMAINSET_SETSIZE; node++) + if (hwloc_bitmap_isset(hwloc_nodeset, node)) + CPU_SET(node, mask); +} + +static int +hwloc_freebsd_set_sth_domain(hwloc_topology_t topology __hwloc_attribute_unused, cpulevel_t level, cpuwhich_t which, id_t id, hwloc_const_nodeset_t hwloc_nodeset, hwloc_membind_policy_t policy) +{ + domainset_t mask; + int freebsdpolicy; + + hwloc_freebsd_hwloc2bsd_membind(hwloc_nodeset, &mask); + + switch (policy) { + case HWLOC_MEMBIND_DEFAULT: + case HWLOC_MEMBIND_FIRSTTOUCH: + freebsdpolicy = DOMAINSET_POLICY_FIRSTTOUCH; + break; + case HWLOC_MEMBIND_BIND: + freebsdpolicy = DOMAINSET_POLICY_PREFER; + break; + case HWLOC_MEMBIND_INTERLEAVE: + freebsdpolicy = DOMAINSET_POLICY_INTERLEAVE; + break; + default: + errno = ENOSYS; + return -1; + } + + if (cpuset_setdomain(level, which, id, sizeof(mask), &mask, freebsdpolicy)) + return -1; + + return 0; +} + +static int +hwloc_freebsd_get_sth_domain(hwloc_topology_t topology __hwloc_attribute_unused, cpulevel_t level, cpuwhich_t which, id_t id, hwloc_nodeset_t hwloc_nodeset, hwloc_membind_policy_t *policy) +{ + domainset_t mask; + int freebsdpolicy; + + if (cpuset_getdomain(level, which, id, sizeof(mask), &mask, &freebsdpolicy)) + return -1; + + hwloc_freebsd_bsd2hwloc_membind(hwloc_nodeset, &mask); + switch (freebsdpolicy) { + case DOMAINSET_POLICY_FIRSTTOUCH: + *policy = HWLOC_MEMBIND_FIRSTTOUCH; + break; + case DOMAINSET_POLICY_PREFER: + *policy = HWLOC_MEMBIND_BIND; + break; + case DOMAINSET_POLICY_ROUNDROBIN: /*same as INTERLEAVE with page-granularity*/ + case DOMAINSET_POLICY_INTERLEAVE: + *policy = HWLOC_MEMBIND_INTERLEAVE; + break; + default: + errno = ENOSYS; + return -1; + } + return 0; +} + +static int +hwloc_freebsd_set_thisproc_membind(hwloc_topology_t topology, hwloc_const_nodeset_t hwloc_nodeset, hwloc_membind_policy_t policy, int flags __hwloc_attribute_unused) +{ + return hwloc_freebsd_set_sth_domain(topology, CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, hwloc_nodeset, policy); +} + +static int +hwloc_freebsd_get_thisproc_membind(hwloc_topology_t topology, hwloc_nodeset_t hwloc_nodeset, hwloc_membind_policy_t *policy, int flags __hwloc_attribute_unused) +{ + return hwloc_freebsd_get_sth_domain(topology, CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, hwloc_nodeset, policy); +} + +static int +hwloc_freebsd_set_thisthread_membind(hwloc_topology_t topology, hwloc_const_nodeset_t hwloc_nodeset, hwloc_membind_policy_t policy, int flags __hwloc_attribute_unused) +{ + return hwloc_freebsd_set_sth_domain(topology, CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, hwloc_nodeset, policy); +} + +static int +hwloc_freebsd_get_thisthread_membind(hwloc_topology_t topology, hwloc_nodeset_t hwloc_nodeset, hwloc_membind_policy_t *policy, int flags __hwloc_attribute_unused) +{ + return hwloc_freebsd_get_sth_domain(topology, CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, hwloc_nodeset, policy); +} + +static int +hwloc_freebsd_set_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_nodeset_t hwloc_nodeset, hwloc_membind_policy_t policy, int flags __hwloc_attribute_unused) +{ + return hwloc_freebsd_set_sth_domain(topology, CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, hwloc_nodeset, policy); +} + +static int +hwloc_freebsd_get_proc_membind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_nodeset_t hwloc_nodeset, hwloc_membind_policy_t *policy, int flags __hwloc_attribute_unused) +{ + return hwloc_freebsd_get_sth_domain(topology, CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, hwloc_nodeset, policy); +} +#endif + #ifdef hwloc_thread_t #if HAVE_DECL_PTHREAD_SETAFFINITY_NP @@ -164,19 +287,228 @@ #endif #endif -#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) -static void -hwloc_freebsd_node_meminfo_info(struct hwloc_topology *topology) -{ - int mib[2] = { CTL_HW, HW_PHYSMEM }; - unsigned long physmem; - size_t len = sizeof(physmem); - sysctl(mib, 2, &physmem, &len, NULL, 0); - topology->machine_memory.local_memory = physmem; - /* we don't know anything about NUMA nodes in this backend. - * let another backend or the core move that memory to the right NUMA node */ +static int +hwloc_freebsd_get_last_cpu_location(int *name, hwloc_cpuset_t set, long thr_id){ + size_t len, old_len, i, cnt; + int err; + struct kinfo_proc *p, *newp; + len = 0; + err = sysctl(name, 4, NULL, &len, NULL, 0); + if (err < 0 || len == 0) + return -1; + p = NULL; + do { + len *= 2; + newp = realloc(p, len); + if (newp == NULL) { + free(p); + return -1; + } + p = newp; + old_len = len; + err = sysctl(name, 4, p, &len, NULL, 0); + } while (err < 0 && errno == ENOMEM && old_len == len); + if (err < 0) { + free(p); + return -1; + } + cnt = len / sizeof(*p); + hwloc_bitmap_zero(set); + for (i = 0; i < cnt; i++) { + if(thr_id != 0 && thr_id != p[i].ki_tid) + continue; + if(p[i].ki_oncpu == -1) + hwloc_bitmap_set(set, p[i].ki_lastcpu); + else + hwloc_bitmap_set(set, p[i].ki_oncpu); + } + return 0; +} + +static int +hwloc_freebsd_get_thisproc_last_cpu_location(hwloc_topology_t topology __hwloc_attribute_unused, hwloc_cpuset_t set, int flags __hwloc_attribute_unused) { + int name[4]; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; + name[3] = getpid(); + return hwloc_freebsd_get_last_cpu_location(name, set, 0); +} + +static int +hwloc_freebsd_get_proc_last_cpu_location(hwloc_topology_t topology __hwloc_attribute_unused, hwloc_pid_t pid, hwloc_cpuset_t set, int flags __hwloc_attribute_unused) { + int name[4]; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; + name[3] = pid; + return hwloc_freebsd_get_last_cpu_location(name, set, 0); +} + +static int +hwloc_freebsd_get_thisthread_last_cpu_location(hwloc_topology_t topology __hwloc_attribute_unused, hwloc_cpuset_t set, int flags __hwloc_attribute_unused) { + long thr_id; + int name[4]; + int err; + err = thr_self(&thr_id); + if (err < 0 && errno == EFAULT) + return -1; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; + name[3] = getpid(); + return hwloc_freebsd_get_last_cpu_location(name, set, thr_id); +} + +static int +set_locality_info(hwloc_topology_t topology, int ndomains, hwloc_obj_t *nodes){ + char *locality, *ptr; + size_t len_locality; + int missing = 0; + char nb[12]; + uint64_t *distances = malloc(sizeof(uint64_t) * ndomains * ndomains); + if(distances == NULL){ + free(nodes); + return -1; + } + + if(sysctlbyname("vm.phys_locality", NULL, &len_locality, NULL, 0) == -1){ + free(distances); + free(nodes); + return -1; + } + locality = malloc(len_locality); + if (!locality) { + free(distances); + free(nodes); + return -1; + } + if (sysctlbyname("vm.phys_locality", locality, &len_locality, NULL, 0) == -1) { + free(distances); + free(nodes); + free(locality); + return -1; + } + for(int i = 0 ; i < ndomains ; i++){ + sprintf(nb, "%d:", i); + ptr = strstr(locality, nb); + ptr = ptr + 2; + for(int j = 0 ; j < ndomains ; j++){ + int tmp = atoi(ptr); + if(tmp == -1) + missing = 1; + else + distances[ndomains*i + j] = tmp; + ptr++; + ptr = strchr(ptr, ' '); + } + } + + if(missing == 1){ + free(nodes); + free(distances); + } else + hwloc_internal_distances_add(topology, "NUMA:FreeBSD", ndomains, nodes, distances, HWLOC_DISTANCES_KIND_FROM_OS|HWLOC_DISTANCES_KIND_MEANS_LATENCY, HWLOC_DISTANCES_ADD_FLAG_GROUP); + return 0; +} + +static hwloc_uint64_t* +get_memory_domain_info(int ndomains){ + char *segs; + char *ptr; + size_t len_segs; + long start = 0; + long end = 0; + long domain = 0; + hwloc_uint64_t *domains_memory = malloc(ndomains * sizeof(hwloc_uint64_t)); + if(domains_memory == NULL) + return NULL; + memset(domains_memory, 0, ndomains * sizeof(hwloc_uint64_t)); + + if(sysctlbyname("vm.phys_segs", NULL, &len_segs, NULL, 0) == -1){ + free(domains_memory); + return NULL; + } + segs = malloc(len_segs); + if(!segs){ + free(domains_memory); + return NULL; + } + if (sysctlbyname("vm.phys_segs", segs, &len_segs, NULL, 0) == -1) { + free(segs); + free(domains_memory); + return NULL; + } + + ptr = strstr(segs, "start"); + while(ptr){ + start = strtoul(ptr+11, NULL, 16); + ptr = strstr(ptr, "end"); + end = strtoul(ptr+11, NULL, 16); + ptr = strstr(ptr, "domain"); + domain = strtoul(ptr+11, NULL, 10); + ptr = strstr(ptr, "start"); + domains_memory[domain] += ( end - start ); + } + + free(segs); + + return domains_memory; +} + +static int +hwloc_look_freebsd_domains(struct hwloc_topology *topology){ + unsigned ndomains, i; + size_t len_ndomains; + int err = 0; + hwloc_obj_t *nodes; + + len_ndomains = sizeof(ndomains); + if(sysctlbyname("vm.ndomains", &ndomains, &len_ndomains, NULL, 0) == -1) + return -1; + + hwloc_uint64_t *domains_memory = get_memory_domain_info(ndomains); + nodes = malloc(sizeof(hwloc_obj_t) * ndomains); + if(nodes == NULL || domains_memory == NULL){ + free(domains_memory); + free(nodes); + return -1; + } + + for ( i = 0 ; i < ndomains ; i++ ){ + hwloc_obj_t obj; + cpuset_t cset; + CPU_ZERO(&cset); + obj = hwloc_alloc_setup_object(topology, HWLOC_OBJ_NUMANODE, ( unsigned ) i); + if(obj != NULL) { + obj->nodeset = hwloc_bitmap_alloc(); + hwloc_bitmap_set(obj->nodeset, i); + + obj->cpuset = hwloc_bitmap_alloc(); + err = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_DOMAIN, i, sizeof(cset), &cset); + hwloc_freebsd_bsd2hwloc(obj->cpuset, &cset); + + obj->attr->numanode.local_memory = domains_memory[i]; + + if (nodes) + nodes[i] = obj; + hwloc_insert_object_by_cpuset(topology, obj); + } else { + free(nodes); + nodes = NULL; + } + } + if(nodes != NULL) + set_locality_info(topology, ndomains, nodes); + + /* nodes is either freed or given to the core in set_locality_info() */ + free(domains_memory); + + topology->support.discovery->numa = 1; + topology->support.discovery->numa_memory = 1; + + return err; } -#endif static int hwloc_look_freebsd(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus) @@ -186,28 +518,28 @@ * However we don't enforce topology->is_thissystem so that * we may still force use this backend when debugging with !thissystem. */ - struct hwloc_topology *topology = backend->topology; - assert(dstatus->phase == HWLOC_DISC_PHASE_CPU); - - if (!topology->levels[0][0]->cpuset) { - /* Nobody (even the x86 backend) created objects yet, setup basic objects */ - int nbprocs = hwloc_fallback_nbprocessors(0); - if (nbprocs >= 1) - topology->support.discovery->pu = 1; - else - nbprocs = 1; - hwloc_alloc_root_sets(topology->levels[0][0]); - hwloc_setup_pu_level(topology, nbprocs); + if (dstatus->phase == HWLOC_DISC_PHASE_CPU) { + if (!topology->levels[0][0]->cpuset) { + /* Nobody (even the x86 backend) created objects yet, setup basic objects */ + int nbprocs = hwloc_fallback_nbprocessors(0); + if (nbprocs >= 1) + topology->support.discovery->pu = 1; + else + nbprocs = 1; + hwloc_alloc_root_sets(topology->levels[0][0]); + hwloc_setup_pu_level(topology, nbprocs); + } + } else if (dstatus->phase == HWLOC_DISC_PHASE_MEMORY) { + int64_t memsize; + hwloc_look_freebsd_domains(topology); + memsize = hwloc_fallback_memsize(); + if (memsize > 0) + topology->machine_memory.local_memory = memsize; + hwloc_obj_add_info(topology->levels[0][0], "Backend", "FreeBSD"); + hwloc_add_uname_info(topology, NULL); } - - /* Add FreeBSD specific information */ -#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) - hwloc_freebsd_node_meminfo_info(topology); -#endif - hwloc_obj_add_info(topology->levels[0][0], "Backend", "FreeBSD"); - hwloc_add_uname_info(topology, NULL); return 0; } @@ -223,6 +555,14 @@ hooks->set_proc_cpubind = hwloc_freebsd_set_proc_cpubind; hooks->get_proc_cpubind = hwloc_freebsd_get_proc_cpubind; #ifdef hwloc_thread_t +#ifdef HAVE_SYS_DOMAINSET_H + hooks->set_thisproc_membind = hwloc_freebsd_set_thisproc_membind; + hooks->get_thisproc_membind = hwloc_freebsd_get_thisproc_membind; + hooks->set_thisthread_membind = hwloc_freebsd_set_thisthread_membind; + hooks->get_thisthread_membind = hwloc_freebsd_get_thisthread_membind; + hooks->set_proc_membind = hwloc_freebsd_set_proc_membind; + hooks->get_proc_membind = hwloc_freebsd_get_proc_membind; +#endif #if HAVE_DECL_PTHREAD_SETAFFINITY_NP hooks->set_thread_cpubind = hwloc_freebsd_set_thread_cpubind; #endif @@ -231,7 +571,9 @@ #endif #endif #endif - /* TODO: get_last_cpu_location: find out ki_lastcpu */ + hooks->get_thisproc_last_cpu_location = hwloc_freebsd_get_thisproc_last_cpu_location; + hooks->get_proc_last_cpu_location = hwloc_freebsd_get_proc_last_cpu_location; + hooks->get_thisthread_last_cpu_location = hwloc_freebsd_get_thisthread_last_cpu_location; } static struct hwloc_backend * @@ -252,7 +594,7 @@ static struct hwloc_disc_component hwloc_freebsd_disc_component = { "freebsd", - HWLOC_DISC_PHASE_CPU, + HWLOC_DISC_PHASE_CPU|HWLOC_DISC_PHASE_MEMORY, HWLOC_DISC_PHASE_GLOBAL, hwloc_freebsd_component_instantiate, 50, diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-linux.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-linux.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-linux.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-linux.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2013, 2015 Université Bordeaux * Copyright © 2009-2018 Cisco Systems, Inc. All rights reserved. * Copyright © 2015 Intel, Inc. All rights reserved. @@ -258,7 +258,7 @@ # endif #endif static __hwloc_inline long hwloc_get_mempolicy(int *mode __hwloc_attribute_unused, - const unsigned long *nodemask __hwloc_attribute_unused, + unsigned long *nodemask __hwloc_attribute_unused, unsigned long maxnode __hwloc_attribute_unused, void *addr __hwloc_attribute_unused, int flags __hwloc_attribute_unused) @@ -2205,8 +2205,14 @@ unsigned infos_count; }; +enum hwloc_linux_cgroup_type_e { + HWLOC_LINUX_CGROUP2, + HWLOC_LINUX_CGROUP1, + HWLOC_LINUX_CPUSET +}; + static void -hwloc_find_linux_cpuset_mntpnt(char **cgroup_mntpnt, char **cpuset_mntpnt, const char *root_path) +hwloc_find_linux_cgroup_mntpnt(enum hwloc_linux_cgroup_type_e *cgtype, char **mntpnt, const char *root_path, int fsroot_fd) { char *mount_path; struct mntent mntent; @@ -2215,8 +2221,7 @@ int err; size_t bufsize; - *cgroup_mntpnt = NULL; - *cpuset_mntpnt = NULL; + *mntpnt = NULL; if (root_path) { /* setmntent() doesn't support openat(), so use the root_path directly */ @@ -2241,14 +2246,51 @@ */ bufsize = hwloc_getpagesize()*4; buf = malloc(bufsize); - if (!buf) + if (!buf) { + endmntent(fd); return; + } while (getmntent_r(fd, &mntent, buf, bufsize)) { - if (!strcmp(mntent.mnt_type, "cpuset")) { + + if (!strcmp(mntent.mnt_type, "cgroup2")) { + char ctrls[1024]; /* there are about ten controllers with 10-char names */ + char ctrlpath[256]; + hwloc_debug("Found cgroup2 mount point on %s\n", mntent.mnt_dir); + /* read controllers */ + snprintf(ctrlpath, sizeof(ctrlpath), "%s/cgroup.controllers", mntent.mnt_dir); + err = hwloc_read_path_by_length(ctrlpath, ctrls, sizeof(ctrls), fsroot_fd); + if (!err) { + /* look for cpuset separated by spaces */ + char *ctrl, *_ctrls = ctrls; + char *tmp; + int cpuset_ctrl = 0; + tmp = strchr(ctrls, '\n'); + if (tmp) + *tmp = '\0'; + hwloc_debug("Looking for `cpuset' controller in list `%s'\n", ctrls); + while ((ctrl = strsep(&_ctrls, " ")) != NULL) { + if (!strcmp(ctrl, "cpuset")) { + cpuset_ctrl = 1; + break; + } + } + if (cpuset_ctrl) { + hwloc_debug("Found cgroup2/cpuset mount point on %s\n", mntent.mnt_dir); + *cgtype = HWLOC_LINUX_CGROUP2; + *mntpnt = strdup(mntent.mnt_dir); + break; + } + } else { + hwloc_debug("Failed to read cgroup2 controllers from `%s'\n", ctrlpath); + } + + } else if (!strcmp(mntent.mnt_type, "cpuset")) { hwloc_debug("Found cpuset mount point on %s\n", mntent.mnt_dir); - *cpuset_mntpnt = strdup(mntent.mnt_dir); + *cgtype = HWLOC_LINUX_CPUSET; + *mntpnt = strdup(mntent.mnt_dir); break; + } else if (!strcmp(mntent.mnt_type, "cgroup")) { /* found a cgroup mntpnt */ char *opt, *opts = mntent.mnt_opts; @@ -2264,13 +2306,16 @@ if (!cpuset_opt) continue; if (noprefix_opt) { - hwloc_debug("Found cgroup emulating a cpuset mount point on %s\n", mntent.mnt_dir); - *cpuset_mntpnt = strdup(mntent.mnt_dir); + hwloc_debug("Found cgroup1 emulating a cpuset mount point on %s\n", mntent.mnt_dir); + *cgtype = HWLOC_LINUX_CPUSET; + *mntpnt = strdup(mntent.mnt_dir); + break; } else { - hwloc_debug("Found cgroup/cpuset mount point on %s\n", mntent.mnt_dir); - *cgroup_mntpnt = strdup(mntent.mnt_dir); + hwloc_debug("Found cgroup1/cpuset mount point on %s\n", mntent.mnt_dir); + *cgtype = HWLOC_LINUX_CGROUP1; + *mntpnt = strdup(mntent.mnt_dir); + break; } - break; } } @@ -2285,7 +2330,7 @@ * containing . */ static char * -hwloc_read_linux_cpuset_name(int fsroot_fd, hwloc_pid_t pid) +hwloc_read_linux_cgroup_name(int fsroot_fd, hwloc_pid_t pid) { #define CPUSET_NAME_LEN 128 char cpuset_name[CPUSET_NAME_LEN]; @@ -2293,7 +2338,24 @@ int err; char *tmp; - /* check whether a cgroup-cpuset is enabled */ + /* try to read from /proc/XXXX/cpuset */ + if (!pid) + err = hwloc_read_path_by_length("/proc/self/cpuset", cpuset_name, sizeof(cpuset_name), fsroot_fd); + else { + char path[] = "/proc/XXXXXXXXXXX/cpuset"; + snprintf(path, sizeof(path), "/proc/%d/cpuset", pid); + err = hwloc_read_path_by_length(path, cpuset_name, sizeof(cpuset_name), fsroot_fd); + } + if (!err) { + /* found a cpuset, return the name */ + tmp = strchr(cpuset_name, '\n'); + if (tmp) + *tmp = '\0'; + hwloc_debug("Found cgroup name `%s'\n", cpuset_name); + return strdup(cpuset_name); + } + + /* try to read from /proc/XXXX/cgroup */ if (!pid) file = hwloc_fopen("/proc/self/cgroup", "r", fsroot_fd); else { @@ -2306,53 +2368,38 @@ #define CGROUP_LINE_LEN 256 char line[CGROUP_LINE_LEN]; while (fgets(line, sizeof(line), file)) { - char *end, *colon = strchr(line, ':'); + char *end, *path, *colon; + colon = strchr(line, ':'); if (!colon) continue; - if (strncmp(colon, ":cpuset:", 8)) + if (!strncmp(colon, ":cpuset:", 8)) /* cgroup v1 cpuset-specific hierarchy */ + path = colon + 8; + else if (!strncmp(colon, "::", 2)) /* cgroup v2 unified hierarchy */ + path = colon + 2; + else continue; - /* found a cgroup-cpuset line, return the name */ + /* found a cgroup with cpusets, return the name */ fclose(file); - end = strchr(colon, '\n'); + end = strchr(path, '\n'); if (end) *end = '\0'; - hwloc_debug("Found cgroup-cpuset %s\n", colon+8); - return strdup(colon+8); + hwloc_debug("Found cgroup-cpuset %s\n", path); + return strdup(path); } fclose(file); } - /* check whether a cpuset is enabled */ - if (!pid) - err = hwloc_read_path_by_length("/proc/self/cpuset", cpuset_name, sizeof(cpuset_name), fsroot_fd); - else { - char path[] = "/proc/XXXXXXXXXXX/cpuset"; - snprintf(path, sizeof(path), "/proc/%d/cpuset", pid); - err = hwloc_read_path_by_length(path, cpuset_name, sizeof(cpuset_name), fsroot_fd); - } - if (err < 0) { - /* found nothing */ - hwloc_debug("%s", "No cgroup or cpuset found\n"); - return NULL; - } - - /* found a cpuset, return the name */ - tmp = strchr(cpuset_name, '\n'); - if (tmp) - *tmp = '\0'; - hwloc_debug("Found cpuset %s\n", cpuset_name); - return strdup(cpuset_name); + /* found nothing */ + hwloc_debug("%s", "No cgroup or cpuset found\n"); + return NULL; } -/* - * Then, the cpuset description is available from either the cgroup or - * the cpuset filesystem (usually mounted in / or /dev) where there - * are cgroup/cpuset.{cpus,mems} or cpuset/{cpus,mems} files. - */ static void -hwloc_admin_disable_set_from_cpuset(int root_fd, - const char *cgroup_mntpnt, const char *cpuset_mntpnt, const char *cpuset_name, +hwloc_admin_disable_set_from_cgroup(int root_fd, + enum hwloc_linux_cgroup_type_e cgtype, + const char *mntpnt, + const char *cpuset_name, const char *attr_name, hwloc_bitmap_t admin_enabled_set) { @@ -2360,24 +2407,31 @@ char cpuset_filename[CPUSET_FILENAME_LEN]; int err; - if (cgroup_mntpnt) { - /* try to read the cpuset from cgroup */ - snprintf(cpuset_filename, CPUSET_FILENAME_LEN, "%s%s/cpuset.%s", cgroup_mntpnt, cpuset_name, attr_name); - hwloc_debug("Trying to read cgroup file <%s>\n", cpuset_filename); - } else if (cpuset_mntpnt) { + switch (cgtype) { + case HWLOC_LINUX_CGROUP2: + /* try to read the cpuset from cgroup2. use the last "effective" mask to get a AND of parent masks */ + snprintf(cpuset_filename, CPUSET_FILENAME_LEN, "%s%s/cpuset.%s.effective", mntpnt, cpuset_name, attr_name); + hwloc_debug("Trying to read cgroup2 file <%s>\n", cpuset_filename); + break; + case HWLOC_LINUX_CGROUP1: + /* try to read the cpuset from cgroup1. no need to use "effective_cpus/mems" since we'll remove offline CPUs in the core */ + snprintf(cpuset_filename, CPUSET_FILENAME_LEN, "%s%s/cpuset.%s", mntpnt, cpuset_name, attr_name); + hwloc_debug("Trying to read cgroup1 file <%s>\n", cpuset_filename); + break; + case HWLOC_LINUX_CPUSET: /* try to read the cpuset directly */ - snprintf(cpuset_filename, CPUSET_FILENAME_LEN, "%s%s/%s", cpuset_mntpnt, cpuset_name, attr_name); + snprintf(cpuset_filename, CPUSET_FILENAME_LEN, "%s%s/%s", mntpnt, cpuset_name, attr_name); hwloc_debug("Trying to read cpuset file <%s>\n", cpuset_filename); + break; } err = hwloc__read_path_as_cpulist(cpuset_filename, admin_enabled_set, root_fd); - if (err < 0) { hwloc_debug("failed to read cpuset '%s' attribute '%s'\n", cpuset_name, attr_name); hwloc_bitmap_fill(admin_enabled_set); - } else { - hwloc_debug_bitmap("cpuset includes %s\n", admin_enabled_set); + return; } + hwloc_debug_bitmap("cpuset includes %s\n", admin_enabled_set); } static void @@ -2405,6 +2459,7 @@ hwloc_parse_hugepages_info(struct hwloc_linux_backend_data_s *data, const char *dirpath, struct hwloc_numanode_attr_s *memory, + unsigned allocated_page_types, uint64_t *remaining_local_memory) { DIR *dir; @@ -2419,6 +2474,14 @@ int err; if (strncmp(dirent->d_name, "hugepages-", 10)) continue; + if (index_ >= allocated_page_types) { + /* we must increase the page_types array */ + struct hwloc_memory_page_type_s *tmp = realloc(memory->page_types, allocated_page_types * 2 * sizeof(*tmp)); + if (!tmp) + break; + memory->page_types = tmp; + allocated_page_types *= 2; + } memory->page_types[index_].size = strtoul(dirent->d_name+10, NULL, 0) * 1024ULL; err = snprintf(path, sizeof(path), "%s/%s/nr_hugepages", dirpath, dirent->d_name); if ((size_t) err < sizeof(path) @@ -2446,7 +2509,14 @@ err = hwloc_stat("/sys/kernel/mm/hugepages", &st, data->root_fd); if (!err) { - types = 1 + st.st_nlink-2; + types = 1 /* normal non-huge size */ + st.st_nlink - 2 /* ignore . and .. */; + if (types < 3) + /* some buggy filesystems (e.g. btrfs when reading from fsroot) + * return wrong st_nlink for directories (always 1 for btrfs). + * use 3 as a sane default (default page + 2 huge sizes). + * hwloc_parse_hugepages_info() will extend it if needed. + */ + types = 3; has_sysfs_hugepages = 1; } @@ -2464,7 +2534,8 @@ if (has_sysfs_hugepages) { /* read from node%d/hugepages/hugepages-%skB/nr_hugepages */ - hwloc_parse_hugepages_info(data, "/sys/kernel/mm/hugepages", memory, &remaining_local_memory); + hwloc_parse_hugepages_info(data, "/sys/kernel/mm/hugepages", memory, types, &remaining_local_memory); + /* memory->page_types_len may have changed */ } /* use remaining memory as normal pages */ @@ -2488,7 +2559,14 @@ sprintf(path, "%s/node%d/hugepages", syspath, node); err = hwloc_stat(path, &st, data->root_fd); if (!err) { - types = 1 + st.st_nlink-2; + types = 1 /* normal non-huge size */ + st.st_nlink - 2 /* ignore . and .. */; + if (types < 3) + /* some buggy filesystems (e.g. btrfs when reading from fsroot) + * return wrong st_nlink for directories (always 1 for btrfs). + * use 3 as a sane default (default page + 2 huge sizes). + * hwloc_parse_hugepages_info() will extend it if needed. + */ + types = 3; has_sysfs_hugepages = 1; } @@ -2507,7 +2585,8 @@ if (has_sysfs_hugepages) { /* read from node%d/hugepages/hugepages-%skB/nr_hugepages */ - hwloc_parse_hugepages_info(data, path, memory, &remaining_local_memory); + hwloc_parse_hugepages_info(data, path, memory, types, &remaining_local_memory); + /* memory->page_types_len may have changed */ } /* use remaining memory as normal pages */ @@ -2697,7 +2776,7 @@ { size_t cb = 0; uint32_t *tmp = hwloc_read_raw(p, p1, &cb, root_fd); - if (sizeof(*buf) != cb) { + if ((NULL == tmp) || sizeof(*buf) != cb) { errno = EINVAL; free(tmp); /* tmp is either NULL or contains useless things */ return -1; @@ -5053,24 +5132,6 @@ *************************************/ static void -hwloc__linux_get_mic_sn(struct hwloc_topology *topology, struct hwloc_linux_backend_data_s *data) -{ - char line[64], *tmp, *end; - if (hwloc_read_path_by_length("/proc/elog", line, sizeof(line), data->root_fd) < 0) - return; - if (strncmp(line, "Card ", 5)) - return; - tmp = line + 5; - end = strchr(tmp, ':'); - if (!end) - return; - *end = '\0'; - - if (tmp[0]) - hwloc_obj_add_info(hwloc_get_root_obj(topology), "MICSerialNumber", tmp); -} - -static void hwloc_gather_system_info(struct hwloc_topology *topology, struct hwloc_linux_backend_data_s *data) { @@ -5220,17 +5281,17 @@ static void hwloc_linux__get_allowed_resources(hwloc_topology_t topology, const char *root_path, int root_fd, char **cpuset_namep) { - char *cpuset_mntpnt, *cgroup_mntpnt, *cpuset_name = NULL; + enum hwloc_linux_cgroup_type_e cgtype; + char *mntpnt, *cpuset_name = NULL; - hwloc_find_linux_cpuset_mntpnt(&cgroup_mntpnt, &cpuset_mntpnt, root_path); - if (cgroup_mntpnt || cpuset_mntpnt) { - cpuset_name = hwloc_read_linux_cpuset_name(root_fd, topology->pid); + hwloc_find_linux_cgroup_mntpnt(&cgtype, &mntpnt, root_path, root_fd); + if (mntpnt) { + cpuset_name = hwloc_read_linux_cgroup_name(root_fd, topology->pid); if (cpuset_name) { - hwloc_admin_disable_set_from_cpuset(root_fd, cgroup_mntpnt, cpuset_mntpnt, cpuset_name, "cpus", topology->allowed_cpuset); - hwloc_admin_disable_set_from_cpuset(root_fd, cgroup_mntpnt, cpuset_mntpnt, cpuset_name, "mems", topology->allowed_nodeset); + hwloc_admin_disable_set_from_cgroup(root_fd, cgtype, mntpnt, cpuset_name, "cpus", topology->allowed_cpuset); + hwloc_admin_disable_set_from_cgroup(root_fd, cgtype, mntpnt, cpuset_name, "mems", topology->allowed_nodeset); } - free(cgroup_mntpnt); - free(cpuset_mntpnt); + free(mntpnt); } *cpuset_namep = cpuset_name; } @@ -5450,8 +5511,6 @@ free(cpuset_name); } - hwloc__linux_get_mic_sn(topology, data); - /* data->utsname was filled with real uname or \0, we can safely pass it */ hwloc_add_uname_info(topology, &data->utsname); @@ -5511,7 +5570,7 @@ hwloc_bitmap_t cpuset; const char *tmp; hwloc_obj_t parent; - char *devicesubdir; + const char *devicesubdir; int err; if (osdev_flags & HWLOC_LINUXFS_OSDEV_FLAG_UNDER_BUS) @@ -5553,16 +5612,17 @@ /* iterate through busid to find the last one (previous ones are bridges) */ foundpci = 0; nextpci: - if (sscanf(tmp+1, "%x:%x:%x.%x", &_pcidomain, &_pcibus, &_pcidev, &_pcifunc) == 4) { + /* tmp points to a PCI [domain:]bus:device.function */ + if (sscanf(tmp, "%x:%x:%x.%x", &_pcidomain, &_pcibus, &_pcidev, &_pcifunc) == 4) { foundpci = 1; pcidomain = _pcidomain; pcibus = _pcibus; pcidev = _pcidev; pcifunc = _pcifunc; - tmp += 13; + tmp = strchr(tmp+4, ':')+9; /* tmp points to at least 4 digits for domain, then a ':' */ goto nextpci; } - if (sscanf(tmp+1, "%x:%x.%x", &_pcibus, &_pcidev, &_pcifunc) == 3) { + if (sscanf(tmp, "%x:%x.%x", &_pcibus, &_pcidev, &_pcifunc) == 3) { foundpci = 1; pcidomain = 0; pcibus = _pcibus; @@ -5651,7 +5711,7 @@ char blocktype[64] = ""; unsigned sectorsize = 0; unsigned major_id, minor_id; - char *devicesubdir; + const char *devicesubdir; char *tmp; if (osdev_flags & HWLOC_LINUXFS_OSDEV_FLAG_UNDER_BUS) @@ -6136,95 +6196,6 @@ return 0; } -static void -hwloc_linuxfs_mic_class_fillinfos(int root_fd, - struct hwloc_obj *obj, const char *osdevpath) -{ - char path[296]; /* osdevpath <= 256 */ - char family[64]; - char sku[64]; - char sn[64]; - char string[21]; - - obj->subtype = strdup("MIC"); - - snprintf(path, sizeof(path), "%s/family", osdevpath); - if (!hwloc_read_path_by_length(path, family, sizeof(family), root_fd)) { - char *eol = strchr(family, '\n'); - if (eol) - *eol = 0; - hwloc_obj_add_info(obj, "MICFamily", family); - } - - snprintf(path, sizeof(path), "%s/sku", osdevpath); - if (!hwloc_read_path_by_length(path, sku, sizeof(sku), root_fd)) { - char *eol = strchr(sku, '\n'); - if (eol) - *eol = 0; - hwloc_obj_add_info(obj, "MICSKU", sku); - } - - snprintf(path, sizeof(path), "%s/serialnumber", osdevpath); - if (!hwloc_read_path_by_length(path, sn, sizeof(sn), root_fd)) { - char *eol; - eol = strchr(sn, '\n'); - if (eol) - *eol = 0; - hwloc_obj_add_info(obj, "MICSerialNumber", sn); - } - - snprintf(path, sizeof(path), "%s/active_cores", osdevpath); - if (!hwloc_read_path_by_length(path, string, sizeof(string), root_fd)) { - unsigned long count = strtoul(string, NULL, 16); - snprintf(string, sizeof(string), "%lu", count); - hwloc_obj_add_info(obj, "MICActiveCores", string); - } - - snprintf(path, sizeof(path), "%s/memsize", osdevpath); - if (!hwloc_read_path_by_length(path, string, sizeof(string), root_fd)) { - unsigned long count = strtoul(string, NULL, 16); - snprintf(string, sizeof(string), "%lu", count); - hwloc_obj_add_info(obj, "MICMemorySize", string); - } -} - -static int -hwloc_linuxfs_lookup_mic_class(struct hwloc_backend *backend, unsigned osdev_flags) -{ - struct hwloc_linux_backend_data_s *data = backend->private_data; - int root_fd = data->root_fd; - unsigned idx; - DIR *dir; - struct dirent *dirent; - - dir = hwloc_opendir("/sys/class/mic", root_fd); - if (!dir) - return 0; - - while ((dirent = readdir(dir)) != NULL) { - char path[256]; - hwloc_obj_t obj, parent; - - if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) - continue; - if (sscanf(dirent->d_name, "mic%u", &idx) != 1) - continue; - - snprintf(path, sizeof(path), "/sys/class/mic/mic%u", idx); - parent = hwloc_linuxfs_find_osdev_parent(backend, root_fd, path, osdev_flags); - if (!parent) - continue; - - obj = hwloc_linux_add_os_device(backend, parent, HWLOC_OBJ_OSDEV_COPROC, dirent->d_name); - - hwloc_linuxfs_mic_class_fillinfos(root_fd, obj, path); - } - - closedir(dir); - - return 0; -} - static int hwloc_linuxfs_lookup_drm_class(struct hwloc_backend *backend, unsigned osdev_flags) { @@ -6537,16 +6508,18 @@ size_t ret; int fd, err; - if (sscanf(dirent->d_name, "%04x:%02x:%02x.%01x", &domain, &bus, &dev, &func) != 4) + if (sscanf(dirent->d_name, "%x:%02x:%02x.%01x", &domain, &bus, &dev, &func) != 4) continue; +#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN if (domain > 0xffff) { static int warned = 0; - if (!warned) - fprintf(stderr, "Ignoring PCI device with non-16bit domain\n"); + if (!warned && !hwloc_hide_errors()) + fprintf(stderr, "Ignoring PCI device with non-16bit domain.\nPass --enable-32bits-pci-domain to configure to support such devices\n(warning: it would break the library ABI, don't enable unless really needed).\n"); warned = 1; continue; } +#endif /* initialize the config space in case we fail to read it (missing permissions, etc). */ memset(config_space_cache, 0xff, CONFIG_SPACE_CACHESIZE); @@ -6784,7 +6757,6 @@ hwloc_linuxfs_lookup_dax_class(backend, osdev_flags); hwloc_linuxfs_lookup_net_class(backend, osdev_flags); hwloc_linuxfs_lookup_infiniband_class(backend, osdev_flags); - hwloc_linuxfs_lookup_mic_class(backend, osdev_flags); if (ofilter != HWLOC_TYPE_FILTER_KEEP_IMPORTANT) { hwloc_linuxfs_lookup_drm_class(backend, osdev_flags); hwloc_linuxfs_lookup_dma_class(backend, osdev_flags); diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-netbsd.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-netbsd.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-netbsd.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-netbsd.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2012 Aleksej Saushev, The NetBSD Foundation * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2010 Université Bordeaux + * Copyright © 2009-2010, 2020 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -133,18 +133,6 @@ return hwloc_netbsd_get_thread_cpubind(topology, pthread_self(), hwloc_cpuset, flags); } -#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) -static void -hwloc_netbsd_node_meminfo_info(struct hwloc_topology *topology) -{ - int mib[2] = { CTL_HW, HW_PHYSMEM64 }; - unsigned long physmem; - size_t len = sizeof(physmem); - sysctl(mib, 2, &physmem, &len, NULL, 0); - topology->machine_memory.local_memory = physmem; -} -#endif - static int hwloc_look_netbsd(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus) { @@ -155,6 +143,7 @@ */ struct hwloc_topology *topology = backend->topology; + int64_t memsize; assert(dstatus->phase == HWLOC_DISC_PHASE_CPU); @@ -169,10 +158,11 @@ hwloc_setup_pu_level(topology, nbprocs); } + memsize = hwloc_fallback_memsize(); + if (memsize > 0) + topology->machine_memory.local_memory = memsize;; + /* Add NetBSD specific information */ -#if (defined HAVE_SYSCTL) && (defined HAVE_SYS_SYSCTL_H) - hwloc_netbsd_node_meminfo_info(topology); -#endif hwloc_obj_add_info(topology->levels[0][0], "Backend", "NetBSD"); hwloc_add_uname_info(topology, NULL); return 0; diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-noos.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-noos.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-noos.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-noos.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2009 CNRS * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2012 Université Bordeaux + * Copyright © 2009-2012, 2020 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -20,22 +20,27 @@ */ struct hwloc_topology *topology = backend->topology; - int nbprocs; + int64_t memsize; assert(dstatus->phase == HWLOC_DISC_PHASE_CPU); - if (topology->levels[0][0]->cpuset) - /* somebody discovered things */ - return -1; - - nbprocs = hwloc_fallback_nbprocessors(0); - if (nbprocs >= 1) - topology->support.discovery->pu = 1; - else - nbprocs = 1; + if (!topology->levels[0][0]->cpuset) { + int nbprocs; + /* Nobody (even the x86 backend) created objects yet, setup basic objects */ + + nbprocs = hwloc_fallback_nbprocessors(0); + if (nbprocs >= 1) + topology->support.discovery->pu = 1; + else + nbprocs = 1; + hwloc_alloc_root_sets(topology->levels[0][0]); + hwloc_setup_pu_level(topology, nbprocs); + } + + memsize = hwloc_fallback_memsize(); + if (memsize > 0) + topology->machine_memory.local_memory = memsize;; - hwloc_alloc_root_sets(topology->levels[0][0]); - hwloc_setup_pu_level(topology, nbprocs); hwloc_add_uname_info(topology, NULL); return 0; } diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-pci.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-pci.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-pci.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-pci.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2011, 2013 Université Bordeaux * Copyright © 2014-2018 Cisco Systems, Inc. All rights reserved. * Copyright © 2015 Research Organization for Information Science @@ -200,13 +200,15 @@ dev = pcidev->dev; func = pcidev->func; +#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN if (domain > 0xffff) { static int warned = 0; - if (!warned) - fprintf(stderr, "Ignoring PCI device with non-16bit domain\n"); + if (!warned && !hwloc_hide_errors()) + fprintf(stderr, "Ignoring PCI device with non-16bit domain.\nPass --enable-32bits-pci-domain to configure to support such devices\n(warning: it would break the library ABI, don't enable unless really needed).\n"); warned = 1; continue; } +#endif /* initialize the config space in case we fail to read it (missing permissions, etc). */ memset(config_space_cache, 0xff, CONFIG_SPACE_CACHESIZE); diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-solaris.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-solaris.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-solaris.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-solaris.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * Copyright © 2011 Oracle and/or its affiliates. All rights reserved. @@ -646,7 +646,7 @@ hwloc_debug("cpu%u\n", cpuid); hwloc_bitmap_set(topology->levels[0][0]->complete_cpuset, cpuid); - stat = (kstat_named_t *) kstat_data_lookup(ksp, "state"); + stat = (kstat_named_t *) kstat_data_lookup(ksp, (char *) "state"); if (!stat) hwloc_debug("could not read state for CPU%u: %s\n", cpuid, strerror(errno)); else if (stat->data_type != KSTAT_DATA_CHAR) @@ -693,7 +693,7 @@ if (look_chips) do { /* Get Chip ID */ - stat = (kstat_named_t *) kstat_data_lookup(ksp, "chip_id"); + stat = (kstat_named_t *) kstat_data_lookup(ksp, (char *) "chip_id"); if (!stat) { if (Lpkg_num) @@ -743,7 +743,7 @@ if (look_cores) do { /* Get Core ID */ - stat = (kstat_named_t *) kstat_data_lookup(ksp, "core_id"); + stat = (kstat_named_t *) kstat_data_lookup(ksp, (char *) "core_id"); if (!stat) { if (Lcore_num) @@ -800,7 +800,7 @@ fprintf(stderr, "kstat_read failed for module %s name %s instance %d: %s\n", ksp->ks_module, ksp->ks_name, ksp->ks_instance, strerror(errno)); continue; } - stat = (kstat_named_t *) kstat_data_lookup(ksp, "cpus"); + stat = (kstat_named_t *) kstat_data_lookup(ksp, (char *) "cpus"); if (stat) { hwloc_debug("found kstat module %s name %s instance %d cpus type %d\n", ksp->ks_module, ksp->ks_name, ksp->ks_instance, stat->data_type); if (stat->data_type == KSTAT_DATA_STRING) { diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-synthetic.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-synthetic.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-synthetic.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-synthetic.c 2020-03-30 18:07:31.000000000 +0000 @@ -1503,6 +1503,7 @@ signed pdepth; node = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, 0); + assert(node); assert(hwloc__obj_type_is_normal(node->parent->type)); /* only depth-1 memory children for now */ pdepth = node->parent->depth; diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-windows.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-windows.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-windows.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-windows.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2012 Université Bordeaux + * Copyright © 2009-2020 Inria. All rights reserved. + * Copyright © 2009-2012, 2020 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -232,6 +232,10 @@ { HMODULE kernel32; +#if HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE +#pragma GCC diagnostic ignored "-Wcast-function-type" +#endif + kernel32 = LoadLibrary("kernel32.dll"); if (kernel32) { GetActiveProcessorGroupCountProc = @@ -270,6 +274,10 @@ if (psapi) QueryWorkingSetExProc = (PFN_QUERYWORKINGSETEX) GetProcAddress(psapi, "QueryWorkingSetEx"); } + +#if HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE +#pragma GCC diagnostic warning "-Wcast-function-type" +#endif } /* @@ -1199,3 +1207,9 @@ return n; } + +int64_t +hwloc_fallback_memsize(void) { + /* Unused */ + return -1; +} diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-xml.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-xml.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-xml.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-xml.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux * Copyright © 2009-2018 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -107,7 +107,8 @@ struct hwloc_xml_backend_data_s *data, struct hwloc_obj *obj, const char *name, const char *value, - hwloc__xml_import_state_t state) + hwloc__xml_import_state_t state, + int *ignore) { if (!strcmp(name, "type")) { /* already handled */ @@ -252,11 +253,20 @@ case HWLOC_OBJ_PCI_DEVICE: case HWLOC_OBJ_BRIDGE: { unsigned domain, bus, dev, func; - if (sscanf(value, "%04x:%02x:%02x.%01x", + if (sscanf(value, "%x:%02x:%02x.%01x", &domain, &bus, &dev, &func) != 4) { if (hwloc__xml_verbose()) fprintf(stderr, "%s: ignoring invalid pci_busid format string %s\n", state->global->msgprefix, value); + *ignore = 1; +#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN + } else if (domain > 0xffff) { + static int warned = 0; + if (!warned && !hwloc_hide_errors()) + fprintf(stderr, "Ignoring PCI device with non-16bit domain.\nPass --enable-32bits-pci-domain to configure to support such devices\n(warning: it would break the library ABI, don't enable unless really needed).\n"); + warned = 1; + *ignore = 1; +#endif } else { obj->attr->pcidev.domain = domain; obj->attr->pcidev.bus = bus; @@ -278,7 +288,7 @@ case HWLOC_OBJ_PCI_DEVICE: case HWLOC_OBJ_BRIDGE: { unsigned classid, vendor, device, subvendor, subdevice, revision; - if (sscanf(value, "%04x [%04x:%04x] [%04x:%04x] %02x", + if (sscanf(value, "%x [%04x:%04x] [%04x:%04x] %02x", &classid, &vendor, &device, &subvendor, &subdevice, &revision) != 6) { if (hwloc__xml_verbose()) fprintf(stderr, "%s: ignoring invalid pci_type format string %s\n", @@ -342,11 +352,20 @@ switch (obj->type) { case HWLOC_OBJ_BRIDGE: { unsigned domain, secbus, subbus; - if (sscanf(value, "%04x:[%02x-%02x]", + if (sscanf(value, "%x:[%02x-%02x]", &domain, &secbus, &subbus) != 3) { if (hwloc__xml_verbose()) fprintf(stderr, "%s: ignoring invalid bridge_pci format string %s\n", state->global->msgprefix, value); + *ignore = 1; +#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN + } else if (domain > 0xffff) { + static int warned = 0; + if (!warned && !hwloc_hide_errors()) + fprintf(stderr, "Ignoring bridge to PCI with non-16bit domain.\nPass --enable-32bits-pci-domain to configure to support such devices\n(warning: it would break the library ABI, don't enable unless really needed).\n"); + warned = 1; + *ignore = 1; +#endif } else { obj->attr->bridge.downstream.pci.domain = domain; obj->attr->bridge.downstream.pci.secondary_bus = secbus; @@ -426,6 +445,7 @@ memory->page_types = malloc(sizeof(*memory->page_types)); memory->page_types_len = 1; } + assert(memory->page_types); memory->page_types[0].size = lvalue << 10; } else if (hwloc__xml_verbose()) { fprintf(stderr, "%s: ignoring huge_page_size_kB attribute for non-NUMAnode non-root object\n", @@ -440,6 +460,7 @@ memory->page_types = malloc(sizeof(*memory->page_types)); memory->page_types_len = 1; } + assert(memory->page_types); memory->page_types[0].count = lvalue; } else if (hwloc__xml_verbose()) { fprintf(stderr, "%s: ignoring huge_page_free attribute for non-NUMAnode non-root object\n", @@ -835,7 +856,7 @@ state->global->msgprefix, attrname); goto error_with_object; } - hwloc__xml_import_object_attr(topology, data, obj, attrname, attrvalue, state); + hwloc__xml_import_object_attr(topology, data, obj, attrname, attrvalue, state, &ignored); } } @@ -1140,15 +1161,23 @@ ret = -1; } - if (ret < 0) - goto error; + if (ret < 0) { + if (parent && !ignored) + goto error; + else + goto error_with_object; + } state->global->close_child(&childstate); tag = NULL; ret = state->global->find_child(state, &childstate, &tag); - if (ret < 0) - goto error; + if (ret < 0) { + if (parent && !ignored) + goto error; + else + goto error_with_object; + } if (!ret) break; } @@ -1548,7 +1577,7 @@ memset(&diff->obj_attr.diff, 0, sizeof(diff->obj_attr.diff)); diff->obj_attr.diff.generic.type = obj_attr_type; - switch (atoi(obj_attr_type_s)) { + switch (obj_attr_type) { case HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE: diff->obj_attr.diff.uint64.oldvalue = strtoull(obj_attr_oldvalue_s, NULL, 0); diff->obj_attr.diff.uint64.newvalue = strtoull(obj_attr_newvalue_s, NULL, 0); @@ -1732,7 +1761,7 @@ goto failed; } else { if (hwloc__xml_verbose()) - fprintf(stderr, "%s: ignoring unknown tag `%s' after root object, expected `distances2'\n", + fprintf(stderr, "%s: ignoring unknown tag `%s' after root object.\n", data->msgprefix, tag); goto done; } @@ -1778,6 +1807,8 @@ if (nbobjs == data->nbnumanodes) { hwloc_obj_t *objs = malloc(nbobjs*sizeof(hwloc_obj_t)); uint64_t *values = malloc(nbobjs*nbobjs*sizeof(*values)); + assert(data->nbnumanodes > 0); /* v1dist->nbobjs is >0 after import */ + assert(data->first_numanode); if (objs && values) { hwloc_obj_t node; unsigned i; @@ -2051,13 +2082,17 @@ state->new_prop(state, "online_cpuset", setstring); free(setstring); - if (v1export || !obj->parent) { + if (v1export) { hwloc_bitmap_t allowed_cpuset = hwloc_bitmap_dup(obj->cpuset); hwloc_bitmap_and(allowed_cpuset, allowed_cpuset, topology->allowed_cpuset); hwloc_bitmap_asprintf(&setstring, allowed_cpuset); state->new_prop(state, "allowed_cpuset", setstring); free(setstring); hwloc_bitmap_free(allowed_cpuset); + } else if (!obj->parent) { + hwloc_bitmap_asprintf(&setstring, topology->allowed_cpuset); + state->new_prop(state, "allowed_cpuset", setstring); + free(setstring); } } @@ -2072,13 +2107,17 @@ state->new_prop(state, "complete_nodeset", setstring); free(setstring); - if (v1export || !obj->parent) { + if (v1export) { hwloc_bitmap_t allowed_nodeset = hwloc_bitmap_dup(obj->nodeset); hwloc_bitmap_and(allowed_nodeset, allowed_nodeset, topology->allowed_nodeset); hwloc_bitmap_asprintf(&setstring, allowed_nodeset); state->new_prop(state, "allowed_nodeset", setstring); free(setstring); hwloc_bitmap_free(allowed_nodeset); + } else if (!obj->parent) { + hwloc_bitmap_asprintf(&setstring, topology->allowed_nodeset); + state->new_prop(state, "allowed_nodeset", setstring); + free(setstring); } } @@ -2921,6 +2960,7 @@ int encoded; size_t encoded_length; const char *realname; + assert(name); if (!strncmp(name, "base64", 6)) { encoded = 1; encoded_length = BASE64_ENCODED_LENGTH(length); diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/topology-xml-nolibxml.c hwloc-contrib-2.2.0+dfsg/hwloc/topology-xml-nolibxml.c --- hwloc-contrib-2.1.0+dfsg/hwloc/topology-xml-nolibxml.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/topology-xml-nolibxml.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -34,7 +34,7 @@ typedef struct hwloc__nolibxml_import_state_data_s { char *tagbuffer; /* buffer containing the next tag */ char *attrbuffer; /* buffer containing the next attribute of the current node */ - char *tagname; /* tag name of the current node */ + const char *tagname; /* tag name of the current node */ int closed; /* set if the current node is auto-closing */ } __hwloc_attribute_may_alias * hwloc__nolibxml_import_state_data_t; @@ -137,7 +137,7 @@ return 0; /* normal tag */ - tag = nchildstate->tagname = buffer; + nchildstate->tagname = tag = buffer; /* find the end, mark it and return it */ end = strchr(buffer, '>'); @@ -260,7 +260,7 @@ unsigned major, minor; char *end; char *buffer = nbdata->buffer; - char *tagname; + const char *tagname; HWLOC_BUILD_ASSERT(sizeof(*nstate) <= sizeof(state->data)); diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc/traversal.c hwloc-contrib-2.2.0+dfsg/hwloc/traversal.c --- hwloc-contrib-2.1.0+dfsg/hwloc/traversal.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc/traversal.c 2020-03-30 18:07:31.000000000 +0000 @@ -673,3 +673,31 @@ return ret; } + +int hwloc_bitmap_singlify_per_core(hwloc_topology_t topology, hwloc_bitmap_t cpuset, unsigned which) +{ + hwloc_obj_t core = NULL; + while ((core = hwloc_get_next_obj_covering_cpuset_by_type(topology, cpuset, HWLOC_OBJ_CORE, core)) != NULL) { + /* this core has some PUs in the cpuset, find the index-th one */ + unsigned i = 0; + int pu = -1; + do { + pu = hwloc_bitmap_next(core->cpuset, pu); + if (pu == -1) { + /* no which-th PU in cpuset and core, remove the entire core */ + hwloc_bitmap_andnot(cpuset, cpuset, core->cpuset); + break; + } + if (hwloc_bitmap_isset(cpuset, pu)) { + if (i == which) { + /* remove the entire core except that exact pu */ + hwloc_bitmap_andnot(cpuset, cpuset, core->cpuset); + hwloc_bitmap_set(cpuset, pu); + break; + } + i++; + } + } while (1); + } + return 0; +} diff -Nru hwloc-contrib-2.1.0+dfsg/hwloc.pc.in hwloc-contrib-2.2.0+dfsg/hwloc.pc.in --- hwloc-contrib-2.1.0+dfsg/hwloc.pc.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/hwloc.pc.in 2020-03-30 18:07:31.000000000 +0000 @@ -9,4 +9,4 @@ Requires.private: @HWLOC_REQUIRES@ Cflags: -I${includedir} Libs: -L${libdir} -lhwloc -Libs.private: @HWLOC_LIBS@ @HWLOC_LIBS_PRIVATE@ +Libs.private: @HWLOC_LIBS@ @HWLOC_DL_LIBS@ @HWLOC_LTDL_LIBS@ @HWLOC_LIBS_PRIVATE@ diff -Nru hwloc-contrib-2.1.0+dfsg/include/hwloc/autogen/config.h.in hwloc-contrib-2.2.0+dfsg/include/hwloc/autogen/config.h.in --- hwloc-contrib-2.1.0+dfsg/include/hwloc/autogen/config.h.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/hwloc/autogen/config.h.in 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* -*- c -*- * Copyright © 2009 CNRS - * Copyright © 2009-2018 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -217,6 +217,9 @@ #endif /* HWLOC_HAVE_WINDOWS_H */ +/* Define to 1 if --enable-32bits-pci-domain is called. */ +#undef HWLOC_HAVE_32BITS_PCI_DOMAIN + /* Whether we need to re-define all the hwloc public symbols or not */ #undef HWLOC_SYM_TRANSFORM diff -Nru hwloc-contrib-2.1.0+dfsg/include/hwloc/helper.h hwloc-contrib-2.2.0+dfsg/include/hwloc/helper.h --- hwloc-contrib-2.1.0+dfsg/include/hwloc/helper.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/hwloc/helper.h 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -672,6 +672,24 @@ * package has fewer caches than its peers. */ +/** \brief Remove simultaneous multithreading PUs from a CPU set. + * + * For each core in \p topology, if \p cpuset contains some PUs of that core, + * modify \p cpuset to only keep a single PU for that core. + * + * \p which specifies which PU will be kept. + * PU are considered in physical index order. + * If 0, for each core, the function keeps the first PU that was originally set in \p cpuset. + * + * If \p which is larger than the number of PUs in a core there were originally set in \p cpuset, + * no PU is kept for that core. + * + * \note PUs that are not below a Core object are ignored + * (for instance if the topology does not contain any Core object). + * None of them is removed from \p cpuset. + */ +HWLOC_DECLSPEC int hwloc_bitmap_singlify_per_core(hwloc_topology_t topology, hwloc_bitmap_t cpuset, unsigned which); + /** \brief Returns the object of type ::HWLOC_OBJ_PU with \p os_index. * * This function is useful for converting a CPU set into the PU @@ -998,15 +1016,16 @@ * @{ */ -/** \brief Convert a CPU set into a NUMA node set and handle non-NUMA cases +/** \brief Convert a CPU set into a NUMA node set + * + * For each PU included in the input \p _cpuset, set the corresponding + * local NUMA node(s) in the output \p nodeset. * * If some NUMA nodes have no CPUs at all, this function never sets their * indexes in the output node set, even if a full CPU set is given in input. * - * If the topology contains no NUMA nodes, the machine is considered - * as a single memory node, and the following behavior is used: - * If \p cpuset is empty, \p nodeset will be emptied as well. - * Otherwise \p nodeset will be entirely filled. + * Hence the entire topology CPU set is converted into the set of all nodes + * that have some local CPUs. */ static __hwloc_inline int hwloc_cpuset_to_nodeset(hwloc_topology_t topology, hwloc_const_cpuset_t _cpuset, hwloc_nodeset_t nodeset) @@ -1021,13 +1040,16 @@ return 0; } -/** \brief Convert a NUMA node set into a CPU set and handle non-NUMA cases +/** \brief Convert a NUMA node set into a CPU set + * + * For each NUMA node included in the input \p nodeset, set the corresponding + * local PUs in the output \p _cpuset. + * + * If some CPUs have no local NUMA nodes, this function never sets their + * indexes in the output CPU set, even if a full node set is given in input. * - * If the topology contains no NUMA nodes, the machine is considered - * as a single memory node, and the following behavior is used: - * If \p nodeset is empty, \p cpuset will be emptied as well. - * Otherwise \p cpuset will be entirely filled. - * This is useful for manipulating memory binding sets. + * Hence the entire topology node set is converted into the set of all CPUs + * that have some local NUMA nodes. */ static __hwloc_inline int hwloc_cpuset_from_nodeset(hwloc_topology_t topology, hwloc_cpuset_t _cpuset, hwloc_const_nodeset_t nodeset) diff -Nru hwloc-contrib-2.1.0+dfsg/include/hwloc/intel-mic.h hwloc-contrib-2.2.0+dfsg/include/hwloc/intel-mic.h --- hwloc-contrib-2.1.0+dfsg/include/hwloc/intel-mic.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/hwloc/intel-mic.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -/* - * Copyright © 2013-2016 Inria. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and Intel Xeon Phi (MIC). - * - * Applications that use both hwloc and Intel Xeon Phi (MIC) may want to - * include this file so as to get topology information for MIC devices. - */ - -#ifndef HWLOC_INTEL_MIC_H -#define HWLOC_INTEL_MIC_H - -#include "hwloc.h" -#include "hwloc/autogen/config.h" -#include "hwloc/helper.h" - -#ifdef HWLOC_LINUX_SYS -#include "hwloc/linux.h" - -#include -#include -#endif - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_intel_mic Interoperability with Intel Xeon Phi (MIC) - * - * This interface offers ways to retrieve topology information about - * Intel Xeon Phi (MIC) devices. - * - * @{ - */ - -/** \brief Get the CPU set of logical processors that are physically - * close to MIC device whose index is \p idx. - * - * Return the CPU set describing the locality of the MIC device whose index is \p idx. - * - * Topology \p topology and device index \p idx must match the local machine. - * I/O devices detection is not needed in the topology. - * - * The function only returns the locality of the device. - * If more information about the device is needed, OS objects should - * be used instead, see hwloc_intel_mic_get_device_osdev_by_index(). - * - * This function is currently only implemented in a meaningful way for - * Linux; other systems will simply get a full cpuset. - */ -static __hwloc_inline int -hwloc_intel_mic_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused, - int idx __hwloc_attribute_unused, - hwloc_cpuset_t set) -{ -#ifdef HWLOC_LINUX_SYS - /* If we're on Linux, use the sysfs mechanism to get the local cpus */ -#define HWLOC_INTEL_MIC_DEVICE_SYSFS_PATH_MAX 128 - char path[HWLOC_INTEL_MIC_DEVICE_SYSFS_PATH_MAX]; - DIR *sysdir = NULL; - struct dirent *dirent; - unsigned pcibus, pcidev, pcifunc; - - if (!hwloc_topology_is_thissystem(topology)) { - errno = EINVAL; - return -1; - } - - sprintf(path, "/sys/class/mic/mic%d", idx); - sysdir = opendir(path); - if (!sysdir) - return -1; - - while ((dirent = readdir(sysdir)) != NULL) { - if (sscanf(dirent->d_name, "pci_%02x:%02x.%02x", &pcibus, &pcidev, &pcifunc) == 3) { - sprintf(path, "/sys/class/mic/mic%d/pci_%02x:%02x.%02x/local_cpus", idx, pcibus, pcidev, pcifunc); - if (hwloc_linux_read_path_as_cpumask(path, set) < 0 - || hwloc_bitmap_iszero(set)) - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); - break; - } - } - - closedir(sysdir); -#else - /* Non-Linux systems simply get a full cpuset */ - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); -#endif - return 0; -} - -/** \brief Get the hwloc OS device object corresponding to the - * MIC device for the given index. - * - * Return the OS device object describing the MIC device whose index is \p idx. - * Return NULL if there is none. - * - * The topology \p topology does not necessarily have to match the current - * machine. For instance the topology may be an XML import of a remote host. - * I/O devices detection must be enabled in the topology. - * - * \note The corresponding PCI device object can be obtained by looking - * at the OS device parent object. - */ -static __hwloc_inline hwloc_obj_t -hwloc_intel_mic_get_device_osdev_by_index(hwloc_topology_t topology, - unsigned idx) -{ - hwloc_obj_t osdev = NULL; - while ((osdev = hwloc_get_next_osdev(topology, osdev)) != NULL) { - if (HWLOC_OBJ_OSDEV_COPROC == osdev->attr->osdev.type - && osdev->name - && !strncmp("mic", osdev->name, 3) - && atoi(osdev->name + 3) == (int) idx) - return osdev; - } - return NULL; -} - -/** @} */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_INTEL_MIC_H */ diff -Nru hwloc-contrib-2.1.0+dfsg/include/hwloc/opencl.h hwloc-contrib-2.2.0+dfsg/include/hwloc/opencl.h --- hwloc-contrib-2.1.0+dfsg/include/hwloc/opencl.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/hwloc/opencl.h 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2012-2018 Inria. All rights reserved. + * Copyright © 2012-2019 Inria. All rights reserved. * Copyright © 2013, 2018 Université Bordeaux. All right reserved. * See COPYING in top-level directory. */ @@ -52,6 +52,7 @@ /* needs "cl_nv_device_attribute_query" device extension, but not strictly required for clGetDeviceInfo() */ #define HWLOC_CL_DEVICE_PCI_BUS_ID_NV 0x4008 #define HWLOC_CL_DEVICE_PCI_SLOT_ID_NV 0x4009 +#define HWLOC_CL_DEVICE_PCI_DOMAIN_ID_NV 0x400A /** \defgroup hwlocality_opencl Interoperability with OpenCL @@ -74,7 +75,7 @@ unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func) { hwloc_cl_device_topology_amd amdtopo; - cl_uint nvbus, nvslot; + cl_uint nvbus, nvslot, nvdomain; cl_int clret; clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_TOPOLOGY_AMD, sizeof(amdtopo), &amdtopo, NULL); @@ -91,8 +92,12 @@ if (CL_SUCCESS == clret) { clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_PCI_SLOT_ID_NV, sizeof(nvslot), &nvslot, NULL); if (CL_SUCCESS == clret) { - /* FIXME: PCI bus only uses 8bit, assume nvidia hardcodes the domain in higher bits */ - *domain = nvbus >> 8; + clret = clGetDeviceInfo(device, HWLOC_CL_DEVICE_PCI_DOMAIN_ID_NV, sizeof(nvdomain), &nvdomain, NULL); + if (CL_SUCCESS == clret) { /* available since CUDA 10.2 */ + *domain = nvdomain; + } else { + *domain = 0; + } *bus = nvbus & 0xff; /* non-documented but used in many other projects */ *dev = nvslot >> 3; diff -Nru hwloc-contrib-2.1.0+dfsg/include/hwloc/plugins.h hwloc-contrib-2.2.0+dfsg/include/hwloc/plugins.h --- hwloc-contrib-2.1.0+dfsg/include/hwloc/plugins.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/hwloc/plugins.h 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2013-2019 Inria. All rights reserved. + * Copyright © 2013-2020 Inria. All rights reserved. * Copyright © 2016 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -17,7 +17,11 @@ #ifdef HWLOC_INSIDE_PLUGIN /* needed for hwloc_plugin_check_namespace() */ +#ifdef HWLOC_HAVE_LTDL #include +#else +#include +#endif #endif @@ -418,14 +422,22 @@ hwloc_plugin_check_namespace(const char *pluginname __hwloc_attribute_unused, const char *symbol __hwloc_attribute_unused) { #ifdef HWLOC_INSIDE_PLUGIN - lt_dlhandle handle; void *sym; - handle = lt_dlopen(NULL); +#ifdef HWLOC_HAVE_LTDL + lt_dlhandle handle = lt_dlopen(NULL); +#else + void *handle = dlopen(NULL, RTLD_NOW|RTLD_LOCAL); +#endif if (!handle) /* cannot check, assume things will work */ return 0; +#ifdef HWLOC_HAVE_LTDL sym = lt_dlsym(handle, symbol); lt_dlclose(handle); +#else + sym = dlsym(handle, symbol); + dlclose(handle); +#endif if (!sym) { static int verboseenv_checked = 0; static int verboseenv_value = 0; diff -Nru hwloc-contrib-2.1.0+dfsg/include/hwloc/rename.h hwloc-contrib-2.2.0+dfsg/include/hwloc/rename.h --- hwloc-contrib-2.1.0+dfsg/include/hwloc/rename.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/hwloc/rename.h 2020-03-30 18:07:31.000000000 +0000 @@ -28,6 +28,7 @@ #define HWLOC_MUNGE_NAME(a, b) HWLOC_MUNGE_NAME2(a, b) #define HWLOC_MUNGE_NAME2(a, b) a ## b #define HWLOC_NAME(name) HWLOC_MUNGE_NAME(HWLOC_SYM_PREFIX, hwloc_ ## name) +/* FIXME: should be "HWLOC_ ## name" below, unchanged because it doesn't matter much and could break some embedders hacks */ #define HWLOC_NAME_CAPS(name) HWLOC_MUNGE_NAME(HWLOC_SYM_PREFIX_CAPS, hwloc_ ## name) /* Now define all the "real" names to be the prefixed names. This @@ -92,9 +93,6 @@ #define hwloc_compare_types HWLOC_NAME(compare_types) -#define hwloc_compare_types_e HWLOC_NAME(compare_types_e) -#define HWLOC_TYPE_UNORDERED HWLOC_NAME_CAPS(TYPE_UNORDERED) - #define hwloc_obj HWLOC_NAME(obj) #define hwloc_obj_t HWLOC_NAME(obj_t) @@ -324,6 +322,7 @@ #define hwloc_get_ancestor_obj_by_type HWLOC_NAME(get_ancestor_obj_by_type) #define hwloc_get_next_obj_by_depth HWLOC_NAME(get_next_obj_by_depth) #define hwloc_get_next_obj_by_type HWLOC_NAME(get_next_obj_by_type) +#define hwloc_bitmap_singlify_per_core HWLOC_NAME(bitmap_singlify_by_core) #define hwloc_get_pu_obj_by_os_index HWLOC_NAME(get_pu_obj_by_os_index) #define hwloc_get_numanode_obj_by_os_index HWLOC_NAME(get_numanode_obj_by_os_index) #define hwloc_get_next_child HWLOC_NAME(get_next_child) @@ -482,11 +481,6 @@ #define hwloc_ibv_get_device_osdev HWLOC_NAME(ibv_get_device_osdev) #define hwloc_ibv_get_device_osdev_by_name HWLOC_NAME(ibv_get_device_osdev_by_name) -/* intel-mic.h */ - -#define hwloc_intel_mic_get_device_cpuset HWLOC_NAME(intel_mic_get_device_cpuset) -#define hwloc_intel_mic_get_device_osdev_by_index HWLOC_NAME(intel_mic_get_device_osdev_by_index) - /* opencl.h */ #define hwloc_cl_device_topology_amd HWLOC_NAME(cl_device_topology_amd) @@ -709,6 +703,7 @@ #define hwloc_get_sysctlbyname HWLOC_NAME(get_sysctlbyname) #define hwloc_get_sysctl HWLOC_NAME(get_sysctl) #define hwloc_fallback_nbprocessors HWLOC_NAME(fallback_nbprocessors) +#define hwloc_fallback_memsize HWLOC_NAME(fallback_memsize) #define hwloc__object_cpusets_compare_first HWLOC_NAME(_object_cpusets_compare_first) #define hwloc__reorder_children HWLOC_NAME(_reorder_children) diff -Nru hwloc-contrib-2.1.0+dfsg/include/hwloc.h hwloc-contrib-2.2.0+dfsg/include/hwloc.h --- hwloc-contrib-2.1.0+dfsg/include/hwloc.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/hwloc.h 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -173,8 +173,12 @@ * may be defined in the future! If you need to compare types, use * hwloc_compare_types() instead. */ -#define HWLOC_OBJ_TYPE_MIN HWLOC_OBJ_MACHINE /**< \private Sentinel value */ typedef enum { + +/** \cond */ +#define HWLOC_OBJ_TYPE_MIN HWLOC_OBJ_MACHINE /* Sentinel value */ +/** \endcond */ + HWLOC_OBJ_MACHINE, /**< \brief Machine. * A set of processors and memory with cache * coherency. @@ -251,7 +255,7 @@ */ HWLOC_OBJ_BRIDGE, /**< \brief Bridge (filtered out by default). - * Any bridge that connects the host or an I/O bus, + * Any bridge (or PCI switch) that connects the host or an I/O bus, * to another I/O bus. * They are not added to the topology unless I/O discovery * is enabled with hwloc_topology_set_flags(). @@ -360,9 +364,8 @@ */ HWLOC_DECLSPEC int hwloc_compare_types (hwloc_obj_type_t type1, hwloc_obj_type_t type2) __hwloc_attribute_const; -enum hwloc_compare_types_e { - HWLOC_TYPE_UNORDERED = INT_MAX /**< \brief Value returned by hwloc_compare_types() when types can not be compared. \hideinitializer */ -}; +/** \brief Value returned by hwloc_compare_types() when types can not be compared. \hideinitializer */ +#define HWLOC_TYPE_UNORDERED INT_MAX /** @} */ @@ -614,7 +617,11 @@ } group; /** \brief PCI Device specific Object Attributes */ struct hwloc_pcidev_attr_s { - unsigned short domain; +#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN + unsigned short domain; /* Only 16bits PCI domains are supported by default */ +#else + unsigned int domain; /* 32bits PCI domain support break the library ABI, hence it's disabled by default */ +#endif unsigned char bus, dev, func; unsigned short class_id; unsigned short vendor_id, device_id, subvendor_id, subdevice_id; @@ -629,7 +636,11 @@ hwloc_obj_bridge_type_t upstream_type; union { struct { - unsigned short domain; +#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN + unsigned short domain; /* Only 16bits PCI domains are supported by default */ +#else + unsigned int domain; /* 32bits PCI domain support break the library ABI, hence it's disabled by default */ +#endif unsigned char secondary_bus, subordinate_bus; } pci; } downstream; @@ -859,7 +870,8 @@ /** \brief Returns the type of objects at depth \p depth. * - * \p depth should between 0 and hwloc_topology_get_depth()-1. + * \p depth should between 0 and hwloc_topology_get_depth()-1, + * or a virtual depth such as ::HWLOC_TYPE_DEPTH_NUMANODE. * * \return (hwloc_obj_type_t)-1 if depth \p depth does not exist. */ @@ -1355,7 +1367,7 @@ typedef enum { /** \brief Reset the memory allocation policy to the system default. * Depending on the operating system, this may correspond to - * ::HWLOC_MEMBIND_FIRSTTOUCH (Linux), + * ::HWLOC_MEMBIND_FIRSTTOUCH (Linux, FreeBSD), * or ::HWLOC_MEMBIND_BIND (AIX, HP-UX, Solaris, Windows). * This policy is never returned by get membind functions. * The nodeset argument is ignored. @@ -2169,13 +2181,14 @@ enum hwloc_restrict_flags_e { /** \brief Remove all objects that became CPU-less. * By default, only objects that contain no PU and no memory are removed. + * This flag may not be used with ::HWLOC_RESTRICT_FLAG_BYNODESET. * \hideinitializer */ HWLOC_RESTRICT_FLAG_REMOVE_CPULESS = (1UL<<0), /** \brief Restrict by nodeset instead of CPU set. * Only keep objects whose nodeset is included or partially included in the given set. - * This flag may not be used with ::HWLOC_RESTRICT_FLAG_BYNODESET. + * This flag may not be used with ::HWLOC_RESTRICT_FLAG_REMOVE_CPULESS. */ HWLOC_RESTRICT_FLAG_BYNODESET = (1UL<<3), diff -Nru hwloc-contrib-2.1.0+dfsg/include/Makefile.am hwloc-contrib-2.2.0+dfsg/include/Makefile.am --- hwloc-contrib-2.1.0+dfsg/include/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2018 Inria. All rights reserved. +# Copyright © 2009-2019 Inria. All rights reserved. # Copyright © 2009-2010 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright © 2011 Oracle and/or its affiliates. All rights reserved. @@ -30,7 +30,6 @@ hwloc/nvml.h \ hwloc/plugins.h \ hwloc/gl.h \ - hwloc/intel-mic.h \ hwloc/rename.h \ hwloc/deprecated.h include_hwloc_autogendir = $(includedir)/hwloc/autogen diff -Nru hwloc-contrib-2.1.0+dfsg/include/Makefile.in hwloc-contrib-2.2.0+dfsg/include/Makefile.in --- hwloc-contrib-2.1.0+dfsg/include/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2018 Inria. All rights reserved. +# Copyright © 2009-2019 Inria. All rights reserved. # Copyright © 2009-2010 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright © 2011 Oracle and/or its affiliates. All rights reserved. @@ -186,8 +186,8 @@ hwloc/inlines.h hwloc/diff.h hwloc/shmem.h hwloc/distances.h \ hwloc/export.h hwloc/openfabrics-verbs.h hwloc/opencl.h \ hwloc/cuda.h hwloc/cudart.h hwloc/nvml.h hwloc/plugins.h \ - hwloc/gl.h hwloc/intel-mic.h hwloc/rename.h hwloc/deprecated.h \ - hwloc/linux.h hwloc/linux-libnuma.h private/solaris-chiptype.h \ + hwloc/gl.h hwloc/rename.h hwloc/deprecated.h hwloc/linux.h \ + hwloc/linux-libnuma.h private/solaris-chiptype.h \ hwloc/glibc-sched.h am__noinst_HEADERS_DIST = private/private.h private/debug.h \ private/misc.h private/xml.h private/components.h \ @@ -263,6 +263,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -277,6 +278,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -430,8 +432,7 @@ @HWLOC_BUILD_STANDALONE_TRUE@ hwloc/opencl.h hwloc/cuda.h \ @HWLOC_BUILD_STANDALONE_TRUE@ hwloc/cudart.h hwloc/nvml.h \ @HWLOC_BUILD_STANDALONE_TRUE@ hwloc/plugins.h hwloc/gl.h \ -@HWLOC_BUILD_STANDALONE_TRUE@ hwloc/intel-mic.h hwloc/rename.h \ -@HWLOC_BUILD_STANDALONE_TRUE@ hwloc/deprecated.h \ +@HWLOC_BUILD_STANDALONE_TRUE@ hwloc/rename.h hwloc/deprecated.h \ @HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_2) $(am__append_3) \ @HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_4) @HWLOC_BUILD_STANDALONE_TRUE@include_hwloc_autogendir = $(includedir)/hwloc/autogen diff -Nru hwloc-contrib-2.1.0+dfsg/include/private/autogen/config.h.in hwloc-contrib-2.2.0+dfsg/include/private/autogen/config.h.in --- hwloc-contrib-2.1.0+dfsg/include/private/autogen/config.h.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/private/autogen/config.h.in 2020-03-30 18:07:31.000000000 +0000 @@ -78,10 +78,42 @@ don't. */ #undef HAVE_DECL_GETPROGNAME +/* Define to 1 if you have the declaration of `HW_MEMSIZE', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_MEMSIZE + +/* Define to 1 if you have the declaration of `HW_MEMSIZE64', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_MEMSIZE64 + /* Define to 1 if you have the declaration of `HW_NCPU', and to 0 if you don't. */ #undef HAVE_DECL_HW_NCPU +/* Define to 1 if you have the declaration of `HW_PHYSMEM', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_PHYSMEM + +/* Define to 1 if you have the declaration of `HW_PHYSMEM64', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_PHYSMEM64 + +/* Define to 1 if you have the declaration of `HW_REALMEM', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_REALMEM + +/* Define to 1 if you have the declaration of `HW_REALMEM64', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_REALMEM64 + +/* Define to 1 if you have the declaration of `HW_USERMEM', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_USERMEM + +/* Define to 1 if you have the declaration of `HW_USERMEM64', and to 0 if you + don't. */ +#undef HAVE_DECL_HW_USERMEM64 + /* Define to 1 if you have the declaration of `lgrp_latency_cookie', and to 0 if you don't. */ #undef HAVE_DECL_LGRP_LATENCY_COOKIE @@ -219,6 +251,9 @@ /* Define to 1 if the system has the type `LOGICAL_PROCESSOR_RELATIONSHIP'. */ #undef HAVE_LOGICAL_PROCESSOR_RELATIONSHIP +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_INIT_H + /* Define to 1 if you have the header file. */ #undef HAVE_MACH_MACH_HOST_H @@ -345,6 +380,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CPUSET_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_DOMAINSET_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LGRP_USER_H @@ -417,6 +455,9 @@ /* Define to 1 on *FREEBSD */ #undef HWLOC_FREEBSD_SYS +/* Define to 1 if --enable-32bits-pci-domain is called. */ +#undef HWLOC_HAVE_32BITS_PCI_DOMAIN + /* Whether your compiler has __attribute__ or not */ #undef HWLOC_HAVE_ATTRIBUTE @@ -535,6 +576,12 @@ /* Define to 1 if you have the `flsl' function. */ #undef HWLOC_HAVE_FLSL +/* Define to 1 if gcc -Wcast-function-type is supported and enabled */ +#undef HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE + +/* Define to 1 if gcc -Wmissing-field-initializers is supported and enabled */ +#undef HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS + /* Define to 1 if you have the GL module components. */ #undef HWLOC_HAVE_GL @@ -554,6 +601,9 @@ component */ #undef HWLOC_HAVE_LINUXPCI +/* Define to 1 if the hwloc library should use ltdl for loading plugins */ +#undef HWLOC_HAVE_LTDL + /* Define to 1 if you have the `NVML' library. */ #undef HWLOC_HAVE_NVML diff -Nru hwloc-contrib-2.1.0+dfsg/include/private/private.h hwloc-contrib-2.2.0+dfsg/include/private/private.h --- hwloc-contrib-2.1.0+dfsg/include/private/private.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/include/private/private.h 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2009 CNRS * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2012 Université Bordeaux + * Copyright © 2009-2012, 2020 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * * See COPYING in top-level directory. @@ -224,11 +224,13 @@ extern void hwloc_alloc_root_sets(hwloc_obj_t root); extern void hwloc_setup_pu_level(struct hwloc_topology *topology, unsigned nb_pus); extern int hwloc_get_sysctlbyname(const char *name, int64_t *n); -extern int hwloc_get_sysctl(int name[], unsigned namelen, int *n); +extern int hwloc_get_sysctl(int name[], unsigned namelen, int64_t *n); /* returns the number of CPU from the OS (only valid if thissystem) */ #define HWLOC_FALLBACK_NBPROCESSORS_INCLUDE_OFFLINE 1 /* by default we try to get only the online CPUs */ extern int hwloc_fallback_nbprocessors(unsigned flags); +/* returns the memory size from the OS (only valid if thissystem) */ +extern int64_t hwloc_fallback_memsize(void); extern int hwloc__object_cpusets_compare_first(hwloc_obj_t obj1, hwloc_obj_t obj2); extern void hwloc__reorder_children(hwloc_obj_t parent); diff -Nru hwloc-contrib-2.1.0+dfsg/Makefile.am hwloc-contrib-2.2.0+dfsg/Makefile.am --- hwloc-contrib-2.1.0+dfsg/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -22,7 +22,7 @@ if BUILD_NETLOC SUBDIRS += netloc endif -SUBDIRS += utils tests contrib/systemd contrib/misc contrib/hwloc-ps.www +SUBDIRS += utils tests contrib/systemd contrib/completion contrib/misc contrib/hwloc-ps.www # We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN. # There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there SUBDIRS += doc @@ -56,10 +56,7 @@ # Only install the valgrind suppressions file if we're building in # standalone mode if HWLOC_BUILD_STANDALONE -bashcompdir = $(sysconfdir)/bash_completion.d -dist_bashcomp_DATA = contrib/completion/hwloc-completion.bash dist_pkgdata_DATA = contrib/hwloc-valgrind.supp -dist_doc_DATA = contrib/misc/dynamic_SVG_example.html endif # Only install entire visual studio subdirectory if we're building in @@ -71,7 +68,20 @@ if HWLOC_BUILD_STANDALONE dist-hook: sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)" -endif HWLOC_BUILD_STANDALONE +else !HWLOC_BUILD_STANDALONE +# Create directories needed by embedders' autogen (directories ignored by embedded dist) +dist-hook: + @MKDIR_P@ \ + $(distdir)/doc \ + $(distdir)/netloc \ + $(distdir)/utils \ + $(distdir)/tests \ + $(distdir)/contrib/completion \ + $(distdir)/contrib/hwloc-ps.www \ + $(distdir)/contrib/misc \ + $(distdir)/contrib/systemd \ + $(distdir)/contrib/windows +endif !HWLOC_BUILD_STANDALONE if HWLOC_BUILD_STANDALONE if HWLOC_HAVE_WINDOWS diff -Nru hwloc-contrib-2.1.0+dfsg/Makefile.in hwloc-contrib-2.2.0+dfsg/Makefile.in --- hwloc-contrib-2.1.0+dfsg/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -98,7 +98,8 @@ # We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN. # There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there @HWLOC_BUILD_STANDALONE_TRUE@am__append_2 = utils tests \ -@HWLOC_BUILD_STANDALONE_TRUE@ contrib/systemd contrib/misc \ +@HWLOC_BUILD_STANDALONE_TRUE@ contrib/systemd \ +@HWLOC_BUILD_STANDALONE_TRUE@ contrib/completion contrib/misc \ @HWLOC_BUILD_STANDALONE_TRUE@ contrib/hwloc-ps.www doc @HWLOC_BUILD_STANDALONE_TRUE@am__append_3 = contrib/windows @BUILD_NETLOC_FALSE@@HWLOC_BUILD_STANDALONE_TRUE@am__append_4 = netloc @@ -129,8 +130,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__dist_bashcomp_DATA_DIST) \ - $(am__dist_doc_DATA_DIST) $(am__dist_pkgdata_DATA_DIST) \ + $(am__configure_deps) $(am__dist_pkgdata_DATA_DIST) \ $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno @@ -166,8 +166,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__dist_bashcomp_DATA_DIST = \ - contrib/completion/hwloc-completion.bash +am__dist_pkgdata_DATA_DIST = contrib/hwloc-valgrind.supp am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -195,12 +194,9 @@ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(bashcompdir)" "$(DESTDIR)$(docdir)" \ - "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(hwlocpkgconfigdir)" -am__dist_doc_DATA_DIST = contrib/misc/dynamic_SVG_example.html -am__dist_pkgdata_DATA_DIST = contrib/hwloc-valgrind.supp -DATA = $(dist_bashcomp_DATA) $(dist_doc_DATA) $(dist_pkgdata_DATA) \ - $(hwlocpkgconfig_DATA) +am__installdirs = "$(DESTDIR)$(pkgdatadir)" \ + "$(DESTDIR)$(hwlocpkgconfigdir)" +DATA = $(dist_pkgdata_DATA) $(hwlocpkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -331,6 +327,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -345,6 +342,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -513,10 +511,7 @@ # Only install the valgrind suppressions file if we're building in # standalone mode -@HWLOC_BUILD_STANDALONE_TRUE@bashcompdir = $(sysconfdir)/bash_completion.d -@HWLOC_BUILD_STANDALONE_TRUE@dist_bashcomp_DATA = contrib/completion/hwloc-completion.bash @HWLOC_BUILD_STANDALONE_TRUE@dist_pkgdata_DATA = contrib/hwloc-valgrind.supp -@HWLOC_BUILD_STANDALONE_TRUE@dist_doc_DATA = contrib/misc/dynamic_SVG_example.html all: all-recursive .SUFFIXES: @@ -591,48 +586,6 @@ distclean-libtool: -rm -f libtool config.lt -install-dist_bashcompDATA: $(dist_bashcomp_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bashcompdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bashcompdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bashcompdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(bashcompdir)" || exit $$?; \ - done - -uninstall-dist_bashcompDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(bashcompdir)'; $(am__uninstall_files_from_dir) -install-dist_docDATA: $(dist_doc_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ - done - -uninstall-dist_docDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ @@ -781,7 +734,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -@HWLOC_BUILD_STANDALONE_FALSE@dist-hook: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -981,7 +933,7 @@ all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bashcompdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(hwlocpkgconfigdir)"; do \ + for dir in "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(hwlocpkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -1040,8 +992,7 @@ info-am: -install-data-am: install-data-local install-dist_bashcompDATA \ - install-dist_docDATA install-dist_pkgdataDATA \ +install-data-am: install-data-local install-dist_pkgdataDATA \ install-hwlocpkgconfigDATA install-dvi: install-dvi-recursive @@ -1088,8 +1039,7 @@ ps-am: -uninstall-am: uninstall-dist_bashcompDATA uninstall-dist_docDATA \ - uninstall-dist_pkgdataDATA uninstall-hwlocpkgconfigDATA \ +uninstall-am: uninstall-dist_pkgdataDATA uninstall-hwlocpkgconfigDATA \ uninstall-local .MAKE: $(am__recursive_targets) install-am install-strip @@ -1103,7 +1053,6 @@ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local \ - install-dist_bashcompDATA install-dist_docDATA \ install-dist_pkgdataDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-hwlocpkgconfigDATA install-info install-info-am \ @@ -1112,8 +1061,7 @@ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-dist_bashcompDATA \ - uninstall-dist_docDATA uninstall-dist_pkgdataDATA \ + uninstall-am uninstall-dist_pkgdataDATA \ uninstall-hwlocpkgconfigDATA uninstall-local .PRECIOUS: Makefile @@ -1121,6 +1069,18 @@ @HWLOC_BUILD_STANDALONE_TRUE@dist-hook: @HWLOC_BUILD_STANDALONE_TRUE@ sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)" +# Create directories needed by embedders' autogen (directories ignored by embedded dist) +@HWLOC_BUILD_STANDALONE_FALSE@dist-hook: +@HWLOC_BUILD_STANDALONE_FALSE@ @MKDIR_P@ \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/doc \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/netloc \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/utils \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/tests \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/contrib/completion \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/contrib/hwloc-ps.www \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/contrib/misc \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/contrib/systemd \ +@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/contrib/windows # # Winball specific rules diff -Nru hwloc-contrib-2.1.0+dfsg/netloc/Makefile.in hwloc-contrib-2.2.0+dfsg/netloc/Makefile.in --- hwloc-contrib-2.1.0+dfsg/netloc/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/netloc/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -325,6 +325,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -339,6 +340,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/NEWS hwloc-contrib-2.2.0+dfsg/NEWS --- hwloc-contrib-2.1.0+dfsg/NEWS 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/NEWS 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ Copyright © 2009 CNRS -Copyright © 2009-2019 Inria. All rights reserved. +Copyright © 2009-2020 Inria. All rights reserved. Copyright © 2009-2013 Université Bordeaux Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. @@ -16,6 +16,27 @@ 0.9. +Version 2.2.0 +------------- +* API + + Add hwloc_bitmap_singlify_by_core() to remove SMT from a given cpuset, + thanks to Florian Reynier for the suggestion. + + Add --enable-32bits-pci-domain to stop ignoring PCI devices with domain + >16bits (e.g. 10000:02:03.4). Enabling this option breaks the library ABI. + Thanks to Dylan Simon for the help. +* Backends + + Add support for Linux cgroups v2. + + Add NUMA support for FreeBSD. + + Add get_last_cpu_location support for FreeBSD. + + Remove support for Intel Xeon Phi (MIC, Knights Corner) co-processors. +* Tools + + Add --uid to filter the hwloc-ps output by uid on Linux. + + Add a GRAPHICAL OUTPUT section in the manpage of lstopo. +* Misc + + Use the native dlopen instead of libltdl, + unless --disable-plugin-dlopen is passed at configure time. + + Version 2.1.0 ------------- * API diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/cpuset_nodeset.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/cpuset_nodeset.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/cpuset_nodeset.c 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/cpuset_nodeset.c 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * Copyright © 2020 Inria. All rights reserved. + * See COPYING in top-level directory. + */ + +#include "hwloc.h" + +#include + +/* check cpuset_from/to_nodeset */ + +int main(void) +{ + hwloc_topology_t topology; + hwloc_bitmap_t cpuset, nodeset; + int err; + + err = hwloc_topology_init(&topology); + assert(!err); + err = hwloc_topology_set_synthetic(topology, "pack:2 [numa] l3:2 [numa] pu:2"); + assert(!err); + err = hwloc_topology_load(topology); + assert(!err); + + cpuset = hwloc_bitmap_alloc(); + assert(cpuset); + nodeset = hwloc_bitmap_alloc(); + assert(nodeset); + + /* check empty sets */ + hwloc_bitmap_zero(cpuset); + hwloc_bitmap_zero(nodeset); + err = hwloc_cpuset_to_nodeset(topology, cpuset, nodeset); + assert(!err); + assert(hwloc_bitmap_iszero(cpuset)); + assert(hwloc_bitmap_iszero(nodeset)); + err = hwloc_cpuset_from_nodeset(topology, cpuset, nodeset); + assert(!err); + assert(hwloc_bitmap_iszero(cpuset)); + assert(hwloc_bitmap_iszero(nodeset)); + + /* check full topology sets */ + hwloc_bitmap_zero(nodeset); + err = hwloc_cpuset_to_nodeset(topology, hwloc_topology_get_topology_cpuset(topology), nodeset); + assert(!err); + assert(hwloc_bitmap_isequal(nodeset, hwloc_topology_get_topology_nodeset(topology))); + + hwloc_bitmap_zero(cpuset); + err = hwloc_cpuset_from_nodeset(topology, cpuset, hwloc_topology_get_topology_nodeset(topology)); + assert(!err); + assert(hwloc_bitmap_isequal(cpuset, hwloc_topology_get_topology_cpuset(topology))); + + /* one PU per L3 in single package */ + hwloc_bitmap_zero(cpuset); + hwloc_bitmap_set_range(cpuset, 1, 2); + hwloc_bitmap_zero(nodeset); + err = hwloc_cpuset_to_nodeset(topology, cpuset, nodeset); + assert(!err); + assert(hwloc_bitmap_weight(nodeset) == 3); + assert(hwloc_bitmap_isset(nodeset, 0)); + assert(hwloc_bitmap_isset(nodeset, 1)); + assert(hwloc_bitmap_isset(nodeset, 2)); + + /* 1 large node + 1 of its small node */ + hwloc_bitmap_zero(nodeset); + hwloc_bitmap_set(nodeset, 3); + hwloc_bitmap_set(nodeset, 5); + hwloc_bitmap_zero(cpuset); + err = hwloc_cpuset_from_nodeset(topology, cpuset, nodeset); + assert(!err); + assert(hwloc_bitmap_weight(cpuset) == 4); + assert(hwloc_bitmap_isset(cpuset, 4)); + assert(hwloc_bitmap_isset(cpuset, 5)); + assert(hwloc_bitmap_isset(cpuset, 6)); + assert(hwloc_bitmap_isset(cpuset, 7)); + + /* remove PUs from last (small) node */ + err = hwloc_bitmap_copy(cpuset, hwloc_topology_get_topology_cpuset(topology)); + assert(!err); + err = hwloc_bitmap_clr_range(cpuset, 6, 7); + assert(!err); + hwloc_topology_restrict(topology, cpuset, 0); + assert(!err); + /* remove first node and first large node, PU 0-1 are not covered by a node anymore */ + err = hwloc_bitmap_copy(nodeset, hwloc_topology_get_topology_nodeset(topology)); + assert(!err); + err = hwloc_bitmap_clr(nodeset, 0); /* first small node */ + err = hwloc_bitmap_clr(nodeset, 2); /* first large node */ + assert(!err); + hwloc_topology_restrict(topology, nodeset, HWLOC_RESTRICT_FLAG_BYNODESET); + assert(!err); + + /* check empty sets */ + hwloc_bitmap_zero(cpuset); + hwloc_bitmap_zero(nodeset); + err = hwloc_cpuset_to_nodeset(topology, cpuset, nodeset); + assert(!err); + assert(hwloc_bitmap_iszero(cpuset)); + assert(hwloc_bitmap_iszero(nodeset)); + err = hwloc_cpuset_from_nodeset(topology, cpuset, nodeset); + assert(!err); + assert(hwloc_bitmap_iszero(cpuset)); + assert(hwloc_bitmap_iszero(nodeset)); + + /* check full topology sets */ + hwloc_bitmap_zero(nodeset); + err = hwloc_cpuset_to_nodeset(topology, hwloc_topology_get_topology_cpuset(topology), nodeset); + assert(!err); + assert(hwloc_bitmap_weight(nodeset) == 3); + /* node P#0 doesn't exist anymore */ + assert(hwloc_bitmap_isset(nodeset, 1)); + /* node P#2 doesn't exist anymore */ + assert(hwloc_bitmap_isset(nodeset, 3)); + /* node P#4 has no PUs */ + assert(hwloc_bitmap_isset(nodeset, 5)); + + hwloc_bitmap_zero(cpuset); + err = hwloc_cpuset_from_nodeset(topology, cpuset, hwloc_topology_get_topology_nodeset(topology)); + assert(!err); + assert(hwloc_bitmap_weight(cpuset) == 4); + /* PU P#0-1 not covered anymore */ + assert(hwloc_bitmap_isset(cpuset, 2)); + assert(hwloc_bitmap_isset(cpuset, 3)); + assert(hwloc_bitmap_isset(cpuset, 4)); + assert(hwloc_bitmap_isset(cpuset, 5)); + /* PU P#6-7 don't exist anymore */ + + hwloc_bitmap_free(cpuset); + hwloc_bitmap_free(nodeset); + + hwloc_topology_destroy(topology); + return 0; +} diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/embedded/run-embedded-tests.sh hwloc-contrib-2.2.0+dfsg/tests/hwloc/embedded/run-embedded-tests.sh --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/embedded/run-embedded-tests.sh 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/embedded/run-embedded-tests.sh 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/bash # # Copyright © 2010 Cisco Systems, Inc. All rights reserved. -# Copyright © 2019 Inria. All rights reserved. +# Copyright © 2019-2020 Inria. All rights reserved. # See COPYING in top-level directory. # # Simple script to help test embedding: @@ -78,17 +78,27 @@ ver=`basename $tarball | sed -e 's/^hwloc-//' -e 's/\.tar\..*$//'` print Got version: $ver -# Extract +# Extract and build an embedded tarball +print Removing the old standalone directory... +rm -rf standalone +mkdir standalone +cd standalone print Extracting tarball... -rm -rf hwloc-$ver if test "`echo $tarball | grep .tar.bz2`" != ""; then - try tar jxf $tarball + try tar jxf ../$tarball else - try tar zxf $tarball + try tar zxf ../$tarball fi - -print Removing old tree... -rm -rf hwloc-tree +cd hwloc-$ver +print Building embedded tarball... +try ./configure --enable-embedded-mode +try make dist +cd ../.. + +# Extract embedded tarball for real use +print Extracting the embedded tarball... +rm -rf hwloc-$tree hwloc-$ver +try tar jxf standalone/hwloc-$ver/hwloc-$ver.tar.bz2 mv hwloc-$ver hwloc-tree # Autogen @@ -107,16 +117,9 @@ rm -rf build # Now whack the tree and do a clean VPATH -print Re-extracting tarball... -rm -rf hwloc-$ver -if test "`echo $tarball | grep .tar.bz2`" != ""; then - try tar jxf $tarball -else - try tar zxf $tarball -fi - -print Removing old tree... -rm -rf hwloc-tree +print Re-extracting the embedded tarball... +rm -rf hwloc-tree hwloc-$ver +try tar jxf standalone/hwloc-$ver/hwloc-$ver.tar.bz2 mv hwloc-$ver hwloc-tree # Autogen diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_backends.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_backends.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_backends.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_backends.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2012-2019 Inria. All rights reserved. + * Copyright © 2012-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -69,7 +69,7 @@ const char *orig_backend_name; int err; - putenv("HWLOC_LIBXML_CLEANUP=1"); + putenv((char *) "HWLOC_LIBXML_CLEANUP=1"); printf("trying to export topology to XML buffer and file for later...\n"); hwloc_topology_init(&topology1); @@ -157,7 +157,7 @@ /* syntheticenv+init+load+destroy, synthetic env overrides xml */ printf("switching to synthetic by env and loading...\n"); - putenv("HWLOC_SYNTHETIC=node:3 pu:3"); + putenv((char *) "HWLOC_SYNTHETIC=node:3 pu:3"); hwloc_topology_init(&topology2); hwloc_topology_load(topology2); assert_backend_name(topology2, "Synthetic"); @@ -169,7 +169,7 @@ /* componentsenv+init+load+destroy for testing defaults, overrides synthetic/xml/fsroot envs */ printf("switching to default components by env and loading...\n"); - putenv("HWLOC_COMPONENTS=,"); /* don't set to empty since it means 'unset' on windows */ + putenv((char *) "HWLOC_COMPONENTS=,"); /* don't set to empty since it means 'unset' on windows */ hwloc_topology_init(&topology2); hwloc_topology_load(topology2); assert_backend_name(topology2, orig_backend_name); @@ -188,10 +188,10 @@ /* blacklist everything but noos with hwloc_topology_set_components() */ printf("disabling everything but noos with hwloc_topology_set_components()\n"); - putenv("HWLOC_COMPONENTS="); /* means 'unset' on windows, which means HWLOC_XMLFILE and HWLOC_SYNTHETIC + putenv((char *) "HWLOC_COMPONENTS="); /* means 'unset' on windows, which means HWLOC_XMLFILE and HWLOC_SYNTHETIC * would be processed if not empty, so clear them too. */ - putenv("HWLOC_XMLFILE="); - putenv("HWLOC_SYNTHETIC="); + putenv((char *) "HWLOC_XMLFILE="); + putenv((char *) "HWLOC_SYNTHETIC="); hwloc_topology_init(&topology1); err = hwloc_topology_set_components(topology1, HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST, "foobar"); assert(err == -1); diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_get_last_cpu_location.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_get_last_cpu_location.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_get_last_cpu_location.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_get_last_cpu_location.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2011-2019 Inria. All rights reserved. + * Copyright © 2011-2020 Inria. All rights reserved. * Copyright © 2011 Université Bordeaux. All rights reserved. * See COPYING in top-level directory. */ @@ -7,6 +7,9 @@ #include #include #include +#include +#include +#include #include #include "hwloc.h" @@ -59,12 +62,29 @@ return 0; } +static int has_unexpected_threads(void) +{ +#ifdef HWLOC_LINUX_SYS + struct stat stbuf; + int err = stat("/proc/self/task", &stbuf); + if (!err && stbuf.st_nlink > 3) { + printf("program has multiple threads, disabling process-wide binding/cpulocation checks.\n"); + return 1; + } +#endif + /* if the problem ever occurs on !Linux, + * we'll use HWLOC_TEST_DONTCHECK_PROC_CPULOCATION=1 until detecting it here + */ + return 0; +} + int main(void) { unsigned depth; hwloc_obj_t obj; - checkprocincluded = (NULL == getenv("HWLOC_TEST_DONTCHECK_PROC_CPULOCATION")); + checkprocincluded = !has_unexpected_threads() + && getenv("HWLOC_TEST_DONTCHECK_PROC_CPULOCATION") == NULL; hwloc_topology_init(&topology); hwloc_topology_load(topology); diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_groups.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_groups.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_groups.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_groups.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2011-2019 Inria. All rights reserved. + * Copyright © 2011-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -266,7 +266,7 @@ /* play with accuracy */ values[0] = 29; /* diagonal, instead of 3 (0.0333% error) */ values[1] = 51; values[16] = 52; /* smallest group, instead of 5 (0.02% error) */ - putenv("HWLOC_GROUPING_ACCURACY=0.1"); /* ok */ + putenv((char *) "HWLOC_GROUPING_ACCURACY=0.1"); /* ok */ hwloc_topology_init(&topology); hwloc_topology_set_synthetic(topology, "node:2 core:8 pu:1"); hwloc_topology_load(topology); @@ -279,7 +279,7 @@ assert(depth == 6); hwloc_topology_destroy(topology); - putenv("HWLOC_GROUPING_ACCURACY=try"); /* ok */ + putenv((char *) "HWLOC_GROUPING_ACCURACY=try"); /* ok */ hwloc_topology_init(&topology); hwloc_topology_set_synthetic(topology, "node:2 core:8 pu:1"); hwloc_topology_load(topology); @@ -304,7 +304,7 @@ assert(depth == 4); hwloc_topology_destroy(topology); - putenv("HWLOC_GROUPING_ACCURACY=0.01"); /* too small, cannot group */ + putenv((char *) "HWLOC_GROUPING_ACCURACY=0.01"); /* too small, cannot group */ hwloc_topology_init(&topology); hwloc_topology_set_synthetic(topology, "node:2 core:8 pu:1"); hwloc_topology_load(topology); @@ -317,7 +317,7 @@ assert(depth == 4); hwloc_topology_destroy(topology); - putenv("HWLOC_GROUPING_ACCURACY=0"); /* full accuracy, cannot group */ + putenv((char *) "HWLOC_GROUPING_ACCURACY=0"); /* full accuracy, cannot group */ hwloc_topology_init(&topology); hwloc_topology_set_synthetic(topology, "node:2 core:8 pu:1"); hwloc_topology_load(topology); diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_list_components.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_list_components.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_list_components.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_list_components.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2012 Inria. All rights reserved. + * Copyright © 2012-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -11,7 +11,7 @@ { hwloc_topology_t topology; - putenv("HWLOC_COMPONENTS_VERBOSE=1"); + putenv((char *) "HWLOC_COMPONENTS_VERBOSE=1"); hwloc_topology_init(&topology); /* no load, to avoid spurious "enable" messages */ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_pci_backend.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_pci_backend.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_pci_backend.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_pci_backend.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2011-2016 Inria. All rights reserved. + * Copyright © 2011-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -25,9 +25,9 @@ filter = HWLOC_TYPE_FILTER_KEEP_ALL; if (thissystem) - putenv("HWLOC_THISSYSTEM=1"); + putenv((char *) "HWLOC_THISSYSTEM=1"); else - putenv("HWLOC_THISSYSTEM=0"); + putenv((char *) "HWLOC_THISSYSTEM=0"); hwloc_topology_init(&topology); hwloc_topology_set_io_types_filter(topology, filter); if (xmlbuf) diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_topology_abi.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_topology_abi.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_topology_abi.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_topology_abi.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2017-2019 Inria. All rights reserved. + * Copyright © 2017-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -117,7 +117,11 @@ size = sizeof(struct hwloc_obj); assert(size == 248); size = sizeof(union hwloc_obj_attr_u); +#ifdef HWLOC_HAVE_32BITS_PCI_DOMAIN + assert(size == 48); +#else assert(size == 40); +#endif size = sizeof(struct hwloc_info_s); assert(size == 16); diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_topology_diff.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_topology_diff.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_topology_diff.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_topology_diff.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2013-2017 Inria. All rights reserved. + * Copyright © 2013-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -20,7 +20,7 @@ char *refname; int err; - putenv("HWLOC_LIBXML_CLEANUP=1"); + putenv((char *) "HWLOC_LIBXML_CLEANUP=1"); hwloc_topology_init(&topo1); hwloc_topology_load(topo1); diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_type_sscanf.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_type_sscanf.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/hwloc_type_sscanf.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/hwloc_type_sscanf.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2016-2018 Inria. All rights reserved. + * Copyright © 2016-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -163,6 +163,6 @@ check_topo(); printf("testing topology 32em64t-2n8c2t-pci-wholeio.xml ...\n"); - putenv("HWLOC_XMLFILE=" XMLTESTDIR "/32em64t-2n8c2t-pci-wholeio.xml"); + putenv((char *) "HWLOC_XMLFILE=" XMLTESTDIR "/32em64t-2n8c2t-pci-wholeio.xml"); check_topo(); } diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/intel-mic.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/intel-mic.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/intel-mic.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/intel-mic.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright © 2013-2018 Inria. All rights reserved. - * See COPYING in top-level directory. - */ - -#include -#include - -#include "hwloc.h" -#include "hwloc/intel-mic.h" - -int main(void) -{ - hwloc_topology_t topology; - int i; - int err; - - hwloc_topology_init(&topology); - hwloc_topology_set_type_filter(topology, HWLOC_OBJ_PCI_DEVICE, HWLOC_TYPE_FILTER_KEEP_IMPORTANT); - hwloc_topology_set_type_filter(topology, HWLOC_OBJ_OS_DEVICE, HWLOC_TYPE_FILTER_KEEP_IMPORTANT); - hwloc_topology_load(topology); - - for(i=0; ; i++) { - hwloc_bitmap_t set; - hwloc_obj_t osdev, ancestor; - const char *value; - - osdev = hwloc_intel_mic_get_device_osdev_by_index(topology, i); - if (!osdev) - break; - assert(osdev); - - ancestor = hwloc_get_non_io_ancestor_obj(topology, osdev); - - printf("found OSDev %s\n", osdev->name); - err = strncmp(osdev->name, "mic", 3); - assert(!err); - assert(atoi(osdev->name+3) == (int) i); - - assert(osdev->attr->osdev.type == HWLOC_OBJ_OSDEV_COPROC); - - value = osdev->subtype; - assert(value); - err = strcmp(value, "MIC"); - assert(!err); - - value = hwloc_obj_get_info_by_name(osdev, "MICFamily"); - printf("found MICFamily %s\n", value); - value = hwloc_obj_get_info_by_name(osdev, "MICSKU"); - printf("found MICSKU %s\n", value); - value = hwloc_obj_get_info_by_name(osdev, "MICActiveCores"); - printf("found MICActiveCores %s\n", value); - value = hwloc_obj_get_info_by_name(osdev, "MICMemorySize"); - printf("found MICMemorySize %s\n", value); - - set = hwloc_bitmap_alloc(); - err = hwloc_intel_mic_get_device_cpuset(topology, i, set); - if (err < 0) { - printf("failed to get cpuset for device %d\n", i); - } else { - char *cpuset_string = NULL; - hwloc_bitmap_asprintf(&cpuset_string, set); - printf("got cpuset %s for device %d\n", cpuset_string, i); - if (hwloc_bitmap_isequal(hwloc_topology_get_complete_cpuset(topology), hwloc_topology_get_topology_cpuset(topology))) - /* only compare if the topology is complete, otherwise things can be significantly different */ - assert(hwloc_bitmap_isequal(set, ancestor->cpuset)); - free(cpuset_string); - } - hwloc_bitmap_free(set); - } - - hwloc_topology_destroy(topology); - - return 0; -} Binary files /tmp/tmpaGyMG3/VapXCpg9HS/hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/16amd64-4n4c-cgroup-distance-merge.tar.bz2 and /tmp/tmpaGyMG3/2l0cz8xaq9/hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/16amd64-4n4c-cgroup-distance-merge.tar.bz2 differ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.output hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.output --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.output 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,33 @@ +Machine (P#0 total=2052540KB DMIProductName="CloudStack KVM Hypervisor" DMIProductVersion="RHEL 7.0.0 PC (i440FX + PIIX, 1996)" DMIChassisVendor=Bochs DMIChassisType=1 DMIChassisVersion= DMIChassisAssetTag= DMIBIOSVendor=Seabios DMIBIOSVersion=0.5.1 DMIBIOSDate=01/01/2011 DMISysVendor="Apache Software Foundation" Backend=Linux LinuxCgroup=/ OSName=Linux OSRelease=4.9.0-3-amd64 OSVersion="#1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26)" HostName=hwloc-debian9amd64 Architecture=x86_64) + NUMANode L#0 (P#0 local=2052540KB total=2052540KB) + Package L#0 (P#0 CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=94 CPUModel="Intel Core Processor (Skylake, IBRS)" CPUStepping=3) + L2Cache L#0 (size=4096KB linesize=64 ways=16) + L1dCache L#0 (size=32KB linesize=64 ways=8) + L1iCache L#0 (size=32KB linesize=64 ways=8) + Core L#0 (P#0) + PU L#0 (P#0) + HostBridge L#0 (buses=0000:[00-00]) + PCI L#0 (busid=0000:00:01.1 id=8086:7010 class=0101(IDE)) + Block(Removable Media Device) L#0 (Size=1048575 SectorSize=512 LinuxDeviceID=11:0 Model=QEMU_DVD-ROM Revision=1.5.3 SerialNumber=QM00003) "sr0" + PCI L#1 (busid=0000:00:02.0 id=1013:00b8 class=0300(VGA) PCISlot=2) + PCI L#2 (busid=0000:00:03.0 id=1af4:1000 class=0200(Ethernet) PCISlot=3) + Network L#1 (Address=06:7a:4c:00:00:22) "ens3" + Package L#1 (P#1 CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=94 CPUModel="Intel Core Processor (Skylake, IBRS)" CPUStepping=3) + L2Cache L#1 (size=4096KB linesize=64 ways=16) + L1dCache L#1 (size=32KB linesize=64 ways=8) + L1iCache L#1 (size=32KB linesize=64 ways=8) + Core L#1 (P#0) + PU L#1 (P#1) + Block L#2 (Size=20971520 SectorSize=512 LinuxDeviceID=254:0) "vda" +depth 0: 1 Machine (type #0) + depth 1: 2 Package (type #1) + depth 2: 2 L2Cache (type #5) + depth 3: 2 L1dCache (type #4) + depth 4: 2 L1iCache (type #9) + depth 5: 2 Core (type #2) + depth 6: 2 PU (type #3) +Special depth -3: 1 NUMANode (type #13) +Special depth -4: 1 Bridge (type #14) +Special depth -5: 3 PCIDev (type #15) +Special depth -6: 3 OSDev (type #16) +Topology not from this system diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.source hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.source --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.source 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits-disabled.source 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1 @@ +2pa-pcidomain32bits.tar.bz2 diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits.output hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits.output --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits.output 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,35 @@ +Machine (P#0 total=2052540KB DMIProductName="CloudStack KVM Hypervisor" DMIProductVersion="RHEL 7.0.0 PC (i440FX + PIIX, 1996)" DMIChassisVendor=Bochs DMIChassisType=1 DMIChassisVersion= DMIChassisAssetTag= DMIBIOSVendor=Seabios DMIBIOSVersion=0.5.1 DMIBIOSDate=01/01/2011 DMISysVendor="Apache Software Foundation" Backend=Linux LinuxCgroup=/ OSName=Linux OSRelease=4.9.0-3-amd64 OSVersion="#1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26)" HostName=hwloc-debian9amd64 Architecture=x86_64) + NUMANode L#0 (P#0 local=2052540KB total=2052540KB) + Package L#0 (P#0 CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=94 CPUModel="Intel Core Processor (Skylake, IBRS)" CPUStepping=3) + L2Cache L#0 (size=4096KB linesize=64 ways=16) + L1dCache L#0 (size=32KB linesize=64 ways=8) + L1iCache L#0 (size=32KB linesize=64 ways=8) + Core L#0 (P#0) + PU L#0 (P#0) + HostBridge L#0 (buses=0000:[00-00]) + PCI L#0 (busid=0000:00:01.1 id=8086:7010 class=0101(IDE)) + Block(Removable Media Device) L#0 (Size=1048575 SectorSize=512 LinuxDeviceID=11:0 Model=QEMU_DVD-ROM Revision=1.5.3 SerialNumber=QM00003) "sr0" + PCI L#1 (busid=0000:00:02.0 id=1013:00b8 class=0300(VGA) PCISlot=2) + PCI L#2 (busid=0000:00:03.0 id=1af4:1000 class=0200(Ethernet) PCISlot=3) + Network L#1 (Address=06:7a:4c:00:00:22) "ens3" + Package L#1 (P#1 CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=94 CPUModel="Intel Core Processor (Skylake, IBRS)" CPUStepping=3) + L2Cache L#1 (size=4096KB linesize=64 ways=16) + L1dCache L#1 (size=32KB linesize=64 ways=8) + L1iCache L#1 (size=32KB linesize=64 ways=8) + Core L#1 (P#0) + PU L#1 (P#1) + HostBridge L#1 (buses=10000:[00-00]) + PCI L#3 (busid=10000:00:04.0 id=1af4:1001 class=0100(SCSI)) + Block L#2 (Size=20971520 SectorSize=512 LinuxDeviceID=254:0) "vda" +depth 0: 1 Machine (type #0) + depth 1: 2 Package (type #1) + depth 2: 2 L2Cache (type #5) + depth 3: 2 L1dCache (type #4) + depth 4: 2 L1iCache (type #9) + depth 5: 2 Core (type #2) + depth 6: 2 PU (type #3) +Special depth -3: 1 NUMANode (type #13) +Special depth -4: 2 Bridge (type #14) +Special depth -5: 4 PCIDev (type #15) +Special depth -6: 3 OSDev (type #16) +Topology not from this system Binary files /tmp/tmpaGyMG3/VapXCpg9HS/hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits.tar.bz2 and /tmp/tmpaGyMG3/2l0cz8xaq9/hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/2pa-pcidomain32bits.tar.bz2 differ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.output hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.output --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.output 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,65 @@ +Machine (P#0 total=100661164KB DMIProductName=H8QG6 DMIProductVersion=1234567890 DMIBoardVendor=Supermicro DMIBoardName=H8QG6 DMIBoardVersion=1234567890 DMIBoardAssetTag=1234567890 DMIChassisVendor=Supermicro DMIChassisType=17 DMIChassisVersion=1234567890 DMIChassisAssetTag=1234567890 DMIBIOSVendor="American Megatrends Inc." DMIBIOSVersion="080016 " DMIBIOSDate=07/26/2011 DMISysVendor=Supermicro Backend=Linux LinuxCgroup=/uid_2008/job_15389/step_0) + Package L#0 (P#0 total=33552300KB CPUModel="AMD Opteron(tm) Processor 6134") + L3Cache L#0 (total=16775084KB size=5118KB linesize=64 ways=48) + NUMANode L#0 (P#0 local=16775084KB total=16775084KB) + L2Cache L#0 (size=512KB linesize=64 ways=16) + L1dCache L#0 (size=64KB linesize=64 ways=2) + L1iCache L#0 (size=64KB linesize=64 ways=2) + Core L#0 (P#0) + PU L#0 (P#0) + L2Cache L#1 (size=512KB linesize=64 ways=16) + L1dCache L#1 (size=64KB linesize=64 ways=2) + L1iCache L#1 (size=64KB linesize=64 ways=2) + Core L#1 (P#1) + PU L#1 (P#1) + L2Cache L#2 (size=512KB linesize=64 ways=16) + L1dCache L#2 (size=64KB linesize=64 ways=2) + L1iCache L#2 (size=64KB linesize=64 ways=2) + Core L#2 (P#2) + PU L#2 (P#2) + L2Cache L#3 (size=512KB linesize=64 ways=16) + L1dCache L#3 (size=64KB linesize=64 ways=2) + L1iCache L#3 (size=64KB linesize=64 ways=2) + Core L#3 (P#3) + PU L#3 (P#3) + L3Cache L#1 (total=16777216KB size=5118KB linesize=64 ways=48) + NUMANode L#1 (P#1 local=16777216KB total=16777216KB) + L2Cache L#4 (size=512KB linesize=64 ways=16) + L1dCache L#4 (size=64KB linesize=64 ways=2) + L1iCache L#4 (size=64KB linesize=64 ways=2) + Core L#4 (P#0) + PU L#4 (P#4) + L2Cache L#5 (size=512KB linesize=64 ways=16) + L1dCache L#5 (size=64KB linesize=64 ways=2) + L1iCache L#5 (size=64KB linesize=64 ways=2) + Core L#5 (P#1) + PU L#5 (P#5) + Package L#1 (P#1 total=33554432KB CPUModel="AMD Opteron(tm) Processor 6134") + L3Cache L#2 (total=16777216KB size=5118KB linesize=64 ways=48) + NUMANode L#2 (P#2 local=16777216KB total=16777216KB) + L3Cache L#3 (total=16777216KB size=5118KB linesize=64 ways=48) + NUMANode L#3 (P#3 local=16777216KB total=16777216KB) + Package L#2 (P#2 total=33554432KB CPUModel="AMD Opteron(tm) Processor 6134") + L3Cache L#4 (total=16777216KB size=5118KB linesize=64 ways=48) + NUMANode L#4 (P#4 local=16777216KB total=16777216KB) + L3Cache L#5 (total=16777216KB size=5118KB linesize=64 ways=48) + NUMANode L#5 (P#5 local=16777216KB total=16777216KB) +depth 0: 1 Machine (type #0) + depth 1: 3 Package (type #1) + depth 2: 6 L3Cache (type #6) + depth 3: 6 L2Cache (type #5) + depth 4: 6 L1dCache (type #4) + depth 5: 6 L1iCache (type #9) + depth 6: 6 Core (type #2) + depth 7: 6 PU (type #3) +Special depth -3: 6 NUMANode (type #13) +Relative latency matrix (name NUMALatency kind 5) between 6 NUMANodes (depth -3) by logical indexes: + index 0 1 2 3 4 5 + 0 10 16 16 22 16 22 + 1 16 10 22 16 22 16 + 2 16 22 10 16 16 22 + 3 22 16 16 10 22 16 + 4 16 22 16 22 10 16 + 5 22 16 22 16 16 10 +26 processors not represented in topology: 0xffffffc0 +Topology not from this system Binary files /tmp/tmpaGyMG3/VapXCpg9HS/hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.tar.bz2 and /tmp/tmpaGyMG3/2l0cz8xaq9/hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.tar.bz2 differ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.options hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.options --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.options 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.options 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1 @@ +-v --of xml --no-icaches diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.output hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.output --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.output 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 4 5 + 10 16 16 22 16 22 16 10 22 16 + 22 16 16 22 10 16 16 22 22 16 + 16 10 22 16 16 22 16 22 10 16 + 22 16 22 16 16 10 + + diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.source hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.source --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.source 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup2.xml.source 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1 @@ +32amd64-4s2n4c-cgroup2.tar.bz2 diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.output hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.output --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.output 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.output 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -Machine (P#0 total=100661164KB DMIProductName=H8QG6 DMIProductVersion=1234567890 DMIBoardVendor=Supermicro DMIBoardName=H8QG6 DMIBoardVersion=1234567890 DMIBoardAssetTag=1234567890 DMIChassisVendor=Supermicro DMIChassisType=17 DMIChassisVersion=1234567890 DMIChassisAssetTag=1234567890 DMIBIOSVendor="American Megatrends Inc." DMIBIOSVersion="080016 " DMIBIOSDate=07/26/2011 DMISysVendor=Supermicro Backend=Linux LinuxCgroup=/uid_2008/job_15389/step_0) - Package L#0 (P#0 total=33552300KB CPUModel="AMD Opteron(tm) Processor 6134") - L3Cache L#0 (total=16775084KB size=5118KB linesize=64 ways=48) - NUMANode L#0 (P#0 local=16775084KB total=16775084KB) - L2Cache L#0 (size=512KB linesize=64 ways=16) - L1dCache L#0 (size=64KB linesize=64 ways=2) - L1iCache L#0 (size=64KB linesize=64 ways=2) - Core L#0 (P#0) - PU L#0 (P#0) - L2Cache L#1 (size=512KB linesize=64 ways=16) - L1dCache L#1 (size=64KB linesize=64 ways=2) - L1iCache L#1 (size=64KB linesize=64 ways=2) - Core L#1 (P#1) - PU L#1 (P#1) - L2Cache L#2 (size=512KB linesize=64 ways=16) - L1dCache L#2 (size=64KB linesize=64 ways=2) - L1iCache L#2 (size=64KB linesize=64 ways=2) - Core L#2 (P#2) - PU L#2 (P#2) - L2Cache L#3 (size=512KB linesize=64 ways=16) - L1dCache L#3 (size=64KB linesize=64 ways=2) - L1iCache L#3 (size=64KB linesize=64 ways=2) - Core L#3 (P#3) - PU L#3 (P#3) - L3Cache L#1 (total=16777216KB size=5118KB linesize=64 ways=48) - NUMANode L#1 (P#1 local=16777216KB total=16777216KB) - L2Cache L#4 (size=512KB linesize=64 ways=16) - L1dCache L#4 (size=64KB linesize=64 ways=2) - L1iCache L#4 (size=64KB linesize=64 ways=2) - Core L#4 (P#0) - PU L#4 (P#4) - L2Cache L#5 (size=512KB linesize=64 ways=16) - L1dCache L#5 (size=64KB linesize=64 ways=2) - L1iCache L#5 (size=64KB linesize=64 ways=2) - Core L#5 (P#1) - PU L#5 (P#5) - Package L#1 (P#1 total=33554432KB CPUModel="AMD Opteron(tm) Processor 6134") - L3Cache L#2 (total=16777216KB size=5118KB linesize=64 ways=48) - NUMANode L#2 (P#2 local=16777216KB total=16777216KB) - L3Cache L#3 (total=16777216KB size=5118KB linesize=64 ways=48) - NUMANode L#3 (P#3 local=16777216KB total=16777216KB) - Package L#2 (P#2 total=33554432KB CPUModel="AMD Opteron(tm) Processor 6134") - L3Cache L#4 (total=16777216KB size=5118KB linesize=64 ways=48) - NUMANode L#4 (P#4 local=16777216KB total=16777216KB) - L3Cache L#5 (total=16777216KB size=5118KB linesize=64 ways=48) - NUMANode L#5 (P#5 local=16777216KB total=16777216KB) -depth 0: 1 Machine (type #0) - depth 1: 3 Package (type #1) - depth 2: 6 L3Cache (type #6) - depth 3: 6 L2Cache (type #5) - depth 4: 6 L1dCache (type #4) - depth 5: 6 L1iCache (type #9) - depth 6: 6 Core (type #2) - depth 7: 6 PU (type #3) -Special depth -3: 6 NUMANode (type #13) -Relative latency matrix (name NUMALatency kind 5) between 6 NUMANodes (depth -3) by logical indexes: - index 0 1 2 3 4 5 - 0 10 16 16 22 16 22 - 1 16 10 22 16 22 16 - 2 16 22 10 16 16 22 - 3 22 16 16 10 22 16 - 4 16 22 16 22 10 16 - 5 22 16 22 16 16 10 -26 processors not represented in topology: 0xffffffc0 -Topology not from this system Binary files /tmp/tmpaGyMG3/VapXCpg9HS/hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.tar.bz2 and /tmp/tmpaGyMG3/2l0cz8xaq9/hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.tar.bz2 differ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.options hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.options --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.options 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.options 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ --v --of xml --no-icaches diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.output hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.output --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.output 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.output 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 1 2 3 4 5 - 10 16 16 22 16 22 16 10 22 16 - 22 16 16 22 10 16 16 22 22 16 - 16 10 22 16 16 22 16 22 10 16 - 22 16 22 16 16 10 - - diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.source hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.source --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.source 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32amd64-4s2n4c-cgroup.xml.source 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -32amd64-4s2n4c-cgroup.tar.bz2 diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32em64t-2n8c+1mic.output hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32em64t-2n8c+1mic.output --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/32em64t-2n8c+1mic.output 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/32em64t-2n8c+1mic.output 2020-03-30 18:07:31.000000000 +0000 @@ -291,13 +291,6 @@ - - - - - - - diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/allowed/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/allowed/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/allowed/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/allowed/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -388,6 +388,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -402,6 +403,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/allowed/test-topology.sh.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/allowed/test-topology.sh.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/allowed/test-topology.sh.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/allowed/test-topology.sh.in 2020-03-30 18:07:31.000000000 +0000 @@ -123,7 +123,7 @@ # if there's a .env file, source it if [ -f "$topology".env ] ; then - source "$topology".env + . "$topology".env fi result=1 diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/gather/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/gather/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/gather/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/gather/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -390,6 +390,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -404,6 +405,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/Makefile.am hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/Makefile.am --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2011 Université Bordeaux # Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -19,8 +19,8 @@ 4fake-4gr1nu1pu.output \ 256ppc-8n8s4t.output \ 256ppc-8n8s4t-nocache.output \ - 32amd64-4s2n4c-cgroup.output \ - 32amd64-4s2n4c-cgroup.xml.output \ + 32amd64-4s2n4c-cgroup2.output \ + 32amd64-4s2n4c-cgroup2.xml.output \ 8amd64-4n2c.output \ 8em64t-4c2t.output \ 8em64t-2s2ca2c.output \ @@ -65,6 +65,14 @@ fakecpuid1f-64intel64-2p4d2n2c2t.output \ fakeheteronuma.output +if HWLOC_HAVE_32BITS_PCI_DOMAIN +sysfs_outputs += 2pa-pcidomain32bits.output +EXTRA_DIST = 2pa-pcidomain32bits-disabled.output +else +sysfs_outputs += 2pa-pcidomain32bits-disabled.output +EXTRA_DIST = 2pa-pcidomain32bits.output +endif + # Each output `xyz.output' must have a corresponding tarball `xyz.tar.bz2' # or a corresponding `xyz.source' specifying which tarball to use sysfs_tarballs = \ @@ -79,8 +87,8 @@ 4fake-4gr1nu1pu.tar.bz2 \ 256ppc-8n8s4t.tar.bz2 \ 256ppc-8n8s4t-nocache.source \ - 32amd64-4s2n4c-cgroup.tar.bz2 \ - 32amd64-4s2n4c-cgroup.xml.source \ + 32amd64-4s2n4c-cgroup2.tar.bz2 \ + 32amd64-4s2n4c-cgroup2.xml.source \ 8amd64-4n2c.tar.bz2 \ 8em64t-4c2t.tar.bz2 \ 8em64t-2s2ca2c.tar.bz2 \ @@ -119,6 +127,8 @@ 20s390-2g6s4c.tar.bz2 \ 1alpha.tar.bz2 \ 2arm-2c.tar.bz2 \ + 2pa-pcidomain32bits.tar.bz2 \ + 2pa-pcidomain32bits-disabled.source \ nvidiagpunumanodes.tar.bz2 \ nvidiagpunumanodes.kept.source \ fakememinitiators-1npc+1npc.tar.bz2 \ @@ -143,7 +153,7 @@ 16em64t-4s2c2t_ncaches.options \ 16em64t-4s2c2t_merge.options \ 16em64t-4s2c2t.xml.options \ - 32amd64-4s2n4c-cgroup.xml.options \ + 32amd64-4s2n4c-cgroup2.xml.options \ 32em64t-2n8c+1mic.options \ 40intel64-2g2n4c+pci.options \ fakeheteronuma.options @@ -164,7 +174,7 @@ endif HWLOC_HAVE_BUNZIPP endif HWLOC_HAVE_OPENAT -EXTRA_DIST = $(sysfs_outputs) $(sysfs_tarballs) $(sysfs_excludes) $(sysfs_options) $(sysfs_envs) +EXTRA_DIST += $(sysfs_outputs) $(sysfs_tarballs) $(sysfs_excludes) $(sysfs_options) $(sysfs_envs) LOG_COMPILER = $(builddir)/test-topology.sh diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2011 Université Bordeaux # Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -93,6 +93,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE@am__append_1 = 2pa-pcidomain32bits.output +@HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@am__append_2 = 2pa-pcidomain32bits-disabled.output subdir = tests/hwloc/linux ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ @@ -449,6 +451,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -463,6 +466,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -612,62 +616,50 @@ # Add your expected output file here. # By default, it shows the output of `lstopo - -v'. -sysfs_outputs = \ - 2amd64-2n.output \ - 2i386-2t-hugepagesizecount.xml.output \ - 2i386-2c-nohugepage.xml.output \ - 2ps3-2t.output \ - 4em64t-2c2t-ignore-reorder.output \ - 4ia64-4s.output \ - 4fake-4gr1nu1pu.output \ - 256ppc-8n8s4t.output \ - 256ppc-8n8s4t-nocache.output \ - 32amd64-4s2n4c-cgroup.output \ - 32amd64-4s2n4c-cgroup.xml.output \ - 8amd64-4n2c.output \ - 8em64t-4c2t.output \ - 8em64t-2s2ca2c.output \ - 8em64t-2s2ca2c-buggynuma.output \ - 8em64t-2s4c-heterogeneous.output \ - 8ia64-2n2s2c.output \ - 8ia64-2s2c2t.output \ - 8ia64-4s2c.output \ - 16amd64-4n4c-cgroup-distance-merge.output \ - 16amd64-8n2c.output \ - 16amd64-8n2c-cpusets.output \ - 16amd64-8n2c-cpusets.xml.output \ - 16amd64-8n2c-cpusets_noadmin.output \ - 16em64t-4s2ca2c-cpusetreorder.output \ - 16em64t-4s2ca2c-cpusetreorder-merge.output \ - 16em64t-4s2c2t.output \ - 16em64t-4s2c2t-offlines.output \ - 16em64t-4s2c2t-offlines.xml.output \ - 16em64t-4s2c2t_ncaches.output \ - 16em64t-4s2c2t_merge.output \ - 16em64t-4s2c2t.xml.output \ - 16ia64-8n2s.output \ - 32em64t-2n8c+1mic.output \ - 40intel64-2g2n4c+pci.output \ - 40intel64-4n10c+pci-conflicts.output \ - 48amd64-4d2n6c-sparse.output \ - 64amd64-4s2n4ca2co.output \ - 64fake-4n2s2ca2c2t.output \ - 64intel64-fakeKNL-A2A-cache.output \ - 64intel64-fakeKNL-SNC4-hybrid.output \ - 64intel64-fakeKNL-SNC4-hybrid-msc.output \ - 96em64t-4n4d3ca2co.output \ - 128ia64-17n4s2c.output \ - 256ia64-64n2s2c.output \ - 2s390-2c.output \ - 20s390-2g6s4c.output \ - 1alpha.output \ - 2arm-2c.output \ - nvidiagpunumanodes.output \ - nvidiagpunumanodes.kept.output \ - fakememinitiators-1npc+1npc.output \ - fakecpuid1f-64intel64-2p4d2n2c2t.output \ - fakeheteronuma.output - +sysfs_outputs = 2amd64-2n.output 2i386-2t-hugepagesizecount.xml.output \ + 2i386-2c-nohugepage.xml.output 2ps3-2t.output \ + 4em64t-2c2t-ignore-reorder.output 4ia64-4s.output \ + 4fake-4gr1nu1pu.output 256ppc-8n8s4t.output \ + 256ppc-8n8s4t-nocache.output 32amd64-4s2n4c-cgroup2.output \ + 32amd64-4s2n4c-cgroup2.xml.output 8amd64-4n2c.output \ + 8em64t-4c2t.output 8em64t-2s2ca2c.output \ + 8em64t-2s2ca2c-buggynuma.output \ + 8em64t-2s4c-heterogeneous.output 8ia64-2n2s2c.output \ + 8ia64-2s2c2t.output 8ia64-4s2c.output \ + 16amd64-4n4c-cgroup-distance-merge.output 16amd64-8n2c.output \ + 16amd64-8n2c-cpusets.output 16amd64-8n2c-cpusets.xml.output \ + 16amd64-8n2c-cpusets_noadmin.output \ + 16em64t-4s2ca2c-cpusetreorder.output \ + 16em64t-4s2ca2c-cpusetreorder-merge.output \ + 16em64t-4s2c2t.output 16em64t-4s2c2t-offlines.output \ + 16em64t-4s2c2t-offlines.xml.output \ + 16em64t-4s2c2t_ncaches.output 16em64t-4s2c2t_merge.output \ + 16em64t-4s2c2t.xml.output 16ia64-8n2s.output \ + 32em64t-2n8c+1mic.output 40intel64-2g2n4c+pci.output \ + 40intel64-4n10c+pci-conflicts.output \ + 48amd64-4d2n6c-sparse.output 64amd64-4s2n4ca2co.output \ + 64fake-4n2s2ca2c2t.output 64intel64-fakeKNL-A2A-cache.output \ + 64intel64-fakeKNL-SNC4-hybrid.output \ + 64intel64-fakeKNL-SNC4-hybrid-msc.output \ + 96em64t-4n4d3ca2co.output 128ia64-17n4s2c.output \ + 256ia64-64n2s2c.output 2s390-2c.output 20s390-2g6s4c.output \ + 1alpha.output 2arm-2c.output nvidiagpunumanodes.output \ + nvidiagpunumanodes.kept.output \ + fakememinitiators-1npc+1npc.output \ + fakecpuid1f-64intel64-2p4d2n2c2t.output fakeheteronuma.output \ + $(am__append_1) $(am__append_2) +@HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@EXTRA_DIST = 2pa-pcidomain32bits.output \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@ $(sysfs_outputs) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@ $(sysfs_tarballs) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@ $(sysfs_excludes) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@ $(sysfs_options) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@ $(sysfs_envs) +@HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE@EXTRA_DIST = 2pa-pcidomain32bits-disabled.output \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE@ $(sysfs_outputs) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE@ $(sysfs_tarballs) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE@ $(sysfs_excludes) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE@ $(sysfs_options) \ +@HWLOC_HAVE_32BITS_PCI_DOMAIN_TRUE@ $(sysfs_envs) # Each output `xyz.output' must have a corresponding tarball `xyz.tar.bz2' # or a corresponding `xyz.source' specifying which tarball to use @@ -683,8 +675,8 @@ 4fake-4gr1nu1pu.tar.bz2 \ 256ppc-8n8s4t.tar.bz2 \ 256ppc-8n8s4t-nocache.source \ - 32amd64-4s2n4c-cgroup.tar.bz2 \ - 32amd64-4s2n4c-cgroup.xml.source \ + 32amd64-4s2n4c-cgroup2.tar.bz2 \ + 32amd64-4s2n4c-cgroup2.xml.source \ 8amd64-4n2c.tar.bz2 \ 8em64t-4c2t.tar.bz2 \ 8em64t-2s2ca2c.tar.bz2 \ @@ -723,6 +715,8 @@ 20s390-2g6s4c.tar.bz2 \ 1alpha.tar.bz2 \ 2arm-2c.tar.bz2 \ + 2pa-pcidomain32bits.tar.bz2 \ + 2pa-pcidomain32bits-disabled.source \ nvidiagpunumanodes.tar.bz2 \ nvidiagpunumanodes.kept.source \ fakememinitiators-1npc+1npc.tar.bz2 \ @@ -749,7 +743,7 @@ 16em64t-4s2c2t_ncaches.options \ 16em64t-4s2c2t_merge.options \ 16em64t-4s2c2t.xml.options \ - 32amd64-4s2n4c-cgroup.xml.options \ + 32amd64-4s2n4c-cgroup2.xml.options \ 32em64t-2n8c+1mic.options \ 40intel64-2g2n4c+pci.options \ fakeheteronuma.options @@ -766,7 +760,6 @@ fakeheteronuma.env @HWLOC_HAVE_BUNZIPP_TRUE@@HWLOC_HAVE_OPENAT_TRUE@TESTS = $(sysfs_outputs) -EXTRA_DIST = $(sysfs_outputs) $(sysfs_tarballs) $(sysfs_excludes) $(sysfs_options) $(sysfs_envs) LOG_COMPILER = $(builddir)/test-topology.sh SUBDIRS = . allowed gather all: all-recursive @@ -1114,16 +1107,16 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -32amd64-4s2n4c-cgroup.output.log: 32amd64-4s2n4c-cgroup.output - @p='32amd64-4s2n4c-cgroup.output'; \ - b='32amd64-4s2n4c-cgroup.output'; \ +32amd64-4s2n4c-cgroup2.output.log: 32amd64-4s2n4c-cgroup2.output + @p='32amd64-4s2n4c-cgroup2.output'; \ + b='32amd64-4s2n4c-cgroup2.output'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -32amd64-4s2n4c-cgroup.xml.output.log: 32amd64-4s2n4c-cgroup.xml.output - @p='32amd64-4s2n4c-cgroup.xml.output'; \ - b='32amd64-4s2n4c-cgroup.xml.output'; \ +32amd64-4s2n4c-cgroup2.xml.output.log: 32amd64-4s2n4c-cgroup2.xml.output + @p='32amd64-4s2n4c-cgroup2.xml.output'; \ + b='32amd64-4s2n4c-cgroup2.xml.output'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ @@ -1428,6 +1421,20 @@ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +2pa-pcidomain32bits.output.log: 2pa-pcidomain32bits.output + @p='2pa-pcidomain32bits.output'; \ + b='2pa-pcidomain32bits.output'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +2pa-pcidomain32bits-disabled.output.log: 2pa-pcidomain32bits-disabled.output + @p='2pa-pcidomain32bits-disabled.output'; \ + b='2pa-pcidomain32bits-disabled.output'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/test-topology.sh.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/test-topology.sh.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/linux/test-topology.sh.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/linux/test-topology.sh.in 2020-03-30 18:07:31.000000000 +0000 @@ -119,7 +119,7 @@ # if there's a .env file, source it if [ -f "$topology".env ] ; then - source "$topology".env + . "$topology".env fi # use an absolute path for tar options because tar is invoked from the temp directory diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/Makefile.am hwloc-contrib-2.2.0+dfsg/tests/hwloc/Makefile.am --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2012 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -64,9 +64,9 @@ hwloc_topology_abi \ hwloc_obj_infos \ hwloc_iodevs \ + cpuset_nodeset \ xmlbuffer \ - gl \ - intel-mic + gl if !HWLOC_HAVE_WINDOWS if !HWLOC_HAVE_DARWIN diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2012 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -120,8 +120,8 @@ hwloc_topology_allow$(EXEEXT) hwloc_topology_restrict$(EXEEXT) \ hwloc_topology_dup$(EXEEXT) hwloc_topology_diff$(EXEEXT) \ hwloc_topology_abi$(EXEEXT) hwloc_obj_infos$(EXEEXT) \ - hwloc_iodevs$(EXEEXT) xmlbuffer$(EXEEXT) gl$(EXEEXT) \ - intel-mic$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ + hwloc_iodevs$(EXEEXT) cpuset_nodeset$(EXEEXT) \ + xmlbuffer$(EXEEXT) gl$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ $(am__EXEEXT_3) $(am__EXEEXT_4) $(am__EXEEXT_5) \ $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) @HWLOC_HAVE_DARWIN_FALSE@@HWLOC_HAVE_WINDOWS_FALSE@am__append_4 = shmem @@ -165,13 +165,18 @@ @HWLOC_HAVE_CUDA_TRUE@am__EXEEXT_6 = cuda$(EXEEXT) @HWLOC_HAVE_CUDART_TRUE@am__EXEEXT_7 = cudart$(EXEEXT) @HWLOC_HAVE_NVML_TRUE@am__EXEEXT_8 = nvml$(EXEEXT) -cuda_SOURCES = cuda.c -cuda_OBJECTS = cuda.$(OBJEXT) -cuda_DEPENDENCIES = $(LDADD) +cpuset_nodeset_SOURCES = cpuset_nodeset.c +cpuset_nodeset_OBJECTS = cpuset_nodeset.$(OBJEXT) +cpuset_nodeset_LDADD = $(LDADD) +cpuset_nodeset_DEPENDENCIES = \ + $(HWLOC_top_builddir)/hwloc/$(hwloc_lib) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +cuda_SOURCES = cuda.c +cuda_OBJECTS = cuda.$(OBJEXT) +cuda_DEPENDENCIES = $(LDADD) cudart_SOURCES = cudart.c cudart_OBJECTS = cudart.$(OBJEXT) cudart_DEPENDENCIES = $(LDADD) @@ -373,10 +378,6 @@ hwloc_type_sscanf_LDADD = $(LDADD) hwloc_type_sscanf_DEPENDENCIES = \ $(HWLOC_top_builddir)/hwloc/$(hwloc_lib) -intel_mic_SOURCES = intel-mic.c -intel_mic_OBJECTS = intel-mic.$(OBJEXT) -intel_mic_LDADD = $(LDADD) -intel_mic_DEPENDENCIES = $(HWLOC_top_builddir)/hwloc/$(hwloc_lib) linux_libnuma_SOURCES = linux-libnuma.c linux_libnuma_OBJECTS = linux_libnuma-linux-libnuma.$(OBJEXT) linux_libnuma_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) @@ -416,10 +417,11 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/private/autogen -I$(top_builddir)/include/hwloc/autogen depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/cuda.Po ./$(DEPDIR)/cudart.Po \ - ./$(DEPDIR)/gl.Po ./$(DEPDIR)/glibc-sched.Po \ - ./$(DEPDIR)/hwloc_api_version.Po ./$(DEPDIR)/hwloc_backends.Po \ - ./$(DEPDIR)/hwloc_bind.Po ./$(DEPDIR)/hwloc_bitmap.Po \ +am__depfiles_remade = ./$(DEPDIR)/cpuset_nodeset.Po \ + ./$(DEPDIR)/cuda.Po ./$(DEPDIR)/cudart.Po ./$(DEPDIR)/gl.Po \ + ./$(DEPDIR)/glibc-sched.Po ./$(DEPDIR)/hwloc_api_version.Po \ + ./$(DEPDIR)/hwloc_backends.Po ./$(DEPDIR)/hwloc_bind.Po \ + ./$(DEPDIR)/hwloc_bitmap.Po \ ./$(DEPDIR)/hwloc_bitmap_compare_inclusion.Po \ ./$(DEPDIR)/hwloc_bitmap_first_last_weight.Po \ ./$(DEPDIR)/hwloc_bitmap_singlify.Po \ @@ -448,7 +450,7 @@ ./$(DEPDIR)/hwloc_topology_dup.Po \ ./$(DEPDIR)/hwloc_topology_restrict.Po \ ./$(DEPDIR)/hwloc_type_depth.Po \ - ./$(DEPDIR)/hwloc_type_sscanf.Po ./$(DEPDIR)/intel-mic.Po \ + ./$(DEPDIR)/hwloc_type_sscanf.Po \ ./$(DEPDIR)/linux_libnuma-linux-libnuma.Po ./$(DEPDIR)/nvml.Po \ ./$(DEPDIR)/opencl.Po ./$(DEPDIR)/openfabrics-verbs.Po \ ./$(DEPDIR)/shmem.Po ./$(DEPDIR)/xmlbuffer.Po @@ -471,9 +473,9 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = cuda.c cudart.c gl.c glibc-sched.c hwloc_api_version.c \ - hwloc_backends.c hwloc_bind.c hwloc_bitmap.c \ - hwloc_bitmap_compare_inclusion.c \ +SOURCES = cpuset_nodeset.c cuda.c cudart.c gl.c glibc-sched.c \ + hwloc_api_version.c hwloc_backends.c hwloc_bind.c \ + hwloc_bitmap.c hwloc_bitmap_compare_inclusion.c \ hwloc_bitmap_first_last_weight.c hwloc_bitmap_singlify.c \ hwloc_bitmap_string.c hwloc_distances.c \ hwloc_get_area_memlocation.c hwloc_get_cache_covering_cpuset.c \ @@ -490,11 +492,11 @@ hwloc_topology_abi.c hwloc_topology_allow.c \ hwloc_topology_diff.c hwloc_topology_dup.c \ hwloc_topology_restrict.c hwloc_type_depth.c \ - hwloc_type_sscanf.c intel-mic.c linux-libnuma.c nvml.c \ - opencl.c openfabrics-verbs.c shmem.c xmlbuffer.c -DIST_SOURCES = cuda.c cudart.c gl.c glibc-sched.c hwloc_api_version.c \ - hwloc_backends.c hwloc_bind.c hwloc_bitmap.c \ - hwloc_bitmap_compare_inclusion.c \ + hwloc_type_sscanf.c linux-libnuma.c nvml.c opencl.c \ + openfabrics-verbs.c shmem.c xmlbuffer.c +DIST_SOURCES = cpuset_nodeset.c cuda.c cudart.c gl.c glibc-sched.c \ + hwloc_api_version.c hwloc_backends.c hwloc_bind.c \ + hwloc_bitmap.c hwloc_bitmap_compare_inclusion.c \ hwloc_bitmap_first_last_weight.c hwloc_bitmap_singlify.c \ hwloc_bitmap_string.c hwloc_distances.c \ hwloc_get_area_memlocation.c hwloc_get_cache_covering_cpuset.c \ @@ -511,8 +513,8 @@ hwloc_topology_abi.c hwloc_topology_allow.c \ hwloc_topology_diff.c hwloc_topology_dup.c \ hwloc_topology_restrict.c hwloc_type_depth.c \ - hwloc_type_sscanf.c intel-mic.c linux-libnuma.c nvml.c \ - opencl.c openfabrics-verbs.c shmem.c xmlbuffer.c + hwloc_type_sscanf.c linux-libnuma.c nvml.c opencl.c \ + openfabrics-verbs.c shmem.c xmlbuffer.c RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -832,6 +834,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -846,6 +849,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -1067,6 +1071,10 @@ echo " rm -f" $$list; \ rm -f $$list +cpuset_nodeset$(EXEEXT): $(cpuset_nodeset_OBJECTS) $(cpuset_nodeset_DEPENDENCIES) $(EXTRA_cpuset_nodeset_DEPENDENCIES) + @rm -f cpuset_nodeset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cpuset_nodeset_OBJECTS) $(cpuset_nodeset_LDADD) $(LIBS) + cuda$(EXEEXT): $(cuda_OBJECTS) $(cuda_DEPENDENCIES) $(EXTRA_cuda_DEPENDENCIES) @rm -f cuda$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cuda_OBJECTS) $(cuda_LDADD) $(LIBS) @@ -1223,10 +1231,6 @@ @rm -f hwloc_type_sscanf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hwloc_type_sscanf_OBJECTS) $(hwloc_type_sscanf_LDADD) $(LIBS) -intel-mic$(EXEEXT): $(intel_mic_OBJECTS) $(intel_mic_DEPENDENCIES) $(EXTRA_intel_mic_DEPENDENCIES) - @rm -f intel-mic$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(intel_mic_OBJECTS) $(intel_mic_LDADD) $(LIBS) - linux-libnuma$(EXEEXT): $(linux_libnuma_OBJECTS) $(linux_libnuma_DEPENDENCIES) $(EXTRA_linux_libnuma_DEPENDENCIES) @rm -f linux-libnuma$(EXEEXT) $(AM_V_CCLD)$(linux_libnuma_LINK) $(linux_libnuma_OBJECTS) $(linux_libnuma_LDADD) $(LIBS) @@ -1257,6 +1261,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpuset_nodeset.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cuda.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cudart.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl.Po@am__quote@ # am--include-marker @@ -1296,7 +1301,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwloc_topology_restrict.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwloc_type_depth.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwloc_type_sscanf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel-mic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux_libnuma-linux-libnuma.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvml.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opencl.Po@am__quote@ # am--include-marker @@ -1839,6 +1843,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +cpuset_nodeset.log: cpuset_nodeset$(EXEEXT) + @p='cpuset_nodeset$(EXEEXT)'; \ + b='cpuset_nodeset'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) xmlbuffer.log: xmlbuffer$(EXEEXT) @p='xmlbuffer$(EXEEXT)'; \ b='xmlbuffer'; \ @@ -1853,13 +1864,6 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -intel-mic.log: intel-mic$(EXEEXT) - @p='intel-mic$(EXEEXT)'; \ - b='intel-mic'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) shmem.log: shmem$(EXEEXT) @p='shmem$(EXEEXT)'; \ b='shmem'; \ @@ -2035,7 +2039,8 @@ mostlyclean-am distclean: distclean-recursive - -rm -f ./$(DEPDIR)/cuda.Po + -rm -f ./$(DEPDIR)/cpuset_nodeset.Po + -rm -f ./$(DEPDIR)/cuda.Po -rm -f ./$(DEPDIR)/cudart.Po -rm -f ./$(DEPDIR)/gl.Po -rm -f ./$(DEPDIR)/glibc-sched.Po @@ -2074,7 +2079,6 @@ -rm -f ./$(DEPDIR)/hwloc_topology_restrict.Po -rm -f ./$(DEPDIR)/hwloc_type_depth.Po -rm -f ./$(DEPDIR)/hwloc_type_sscanf.Po - -rm -f ./$(DEPDIR)/intel-mic.Po -rm -f ./$(DEPDIR)/linux_libnuma-linux-libnuma.Po -rm -f ./$(DEPDIR)/nvml.Po -rm -f ./$(DEPDIR)/opencl.Po @@ -2126,7 +2130,8 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f ./$(DEPDIR)/cuda.Po + -rm -f ./$(DEPDIR)/cpuset_nodeset.Po + -rm -f ./$(DEPDIR)/cuda.Po -rm -f ./$(DEPDIR)/cudart.Po -rm -f ./$(DEPDIR)/gl.Po -rm -f ./$(DEPDIR)/glibc-sched.Po @@ -2165,7 +2170,6 @@ -rm -f ./$(DEPDIR)/hwloc_topology_restrict.Po -rm -f ./$(DEPDIR)/hwloc_type_depth.Po -rm -f ./$(DEPDIR)/hwloc_type_sscanf.Po - -rm -f ./$(DEPDIR)/intel-mic.Po -rm -f ./$(DEPDIR)/linux_libnuma-linux-libnuma.Po -rm -f ./$(DEPDIR)/nvml.Po -rm -f ./$(DEPDIR)/opencl.Po diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/pthread.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/pthread.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/pthread.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/pthread.h 2020-03-30 18:07:31.000000000 +0000 @@ -7,4 +7,3 @@ #define HWLOC_PORT_FREEBSD_PTHREAD_H #endif /* HWLOC_PORT_FREEBSD_PTHREAD_H */ - diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/cpuset.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/cpuset.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/cpuset.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/cpuset.h 2020-03-30 18:07:31.000000000 +0000 @@ -18,6 +18,7 @@ #define CPU_LEVEL_WHICH 3 #define CPU_WHICH_TID 1 #define CPU_WHICH_PID 2 +#define CPU_WHICH_DOMAIN 6 int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/domainset.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/domainset.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/domainset.h 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/domainset.h 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,25 @@ +/* + * Copyright © 2009 Université Bordeaux + * Copyright © 2015-2020 Inria. All rights reserved. + * See COPYING in top-level directory. + */ + +#ifndef HWLOC_PORT_FREEBSD_SYS_DOMAINSET_H +#define HWLOC_PORT_FREEBSD_SYS_DOMAINSET_H + +typedef long domainset_t; + +#define DOMAINSET_POLICY_ROUNDROBIN 1 +#define DOMAINSET_POLICY_FIRSTTOUCH 2 +#define DOMAINSET_POLICY_PREFER 3 +#define DOMAINSET_POLICY_INTERLEAVE 4 + +#undef DOMAINSET_ZERO +#define DOMAINSET_ZERO(domainset) (*(domainset) = 0) +#undef DOMAINSET_SETSIZE +#define DOMAINSET_SETSIZE (sizeof(domainset_t) * CHAR_BIT) + +int cpuset_getdomain(cpulevel_t, cpuwhich_t, id_t, size_t, domainset_t *, int *); +int cpuset_setdomain(cpulevel_t, cpuwhich_t, id_t, size_t, const domainset_t *, int); + +#endif /* HWLOC_PORT_FREEBSD_SYS_DOMAINSET_H */ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/param.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/param.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/param.h 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/param.h 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,4 @@ +#ifndef _SYS_PARAM_H_ +#define _SYS_PARAM_H_ + +#endif /* _SYS_PARAM_H_ */ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/sysctl.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/sysctl.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/sysctl.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/sysctl.h 2020-03-30 18:07:31.000000000 +0000 @@ -8,8 +8,28 @@ #define HWLOC_PORT_FREEBSD_SYS_SYSCTL_H extern int sysctl(int *name, int name_len, void *oldp, size_t *oldlenp, void *newp, size_t newlen); +extern int sysctlbyname(const char *name, void *oldp, size_t *oldlenp, const void *newp, size_t newlen); +/* + * CTL_KERN identifiers + */ +#define CTL_KERN 1 #define CTL_HW 6 + +/* + * CTL_KERN identifiers + */ +#define KERN_PROC 14 + +/* + * KERN_PROC subtypes + */ +#define KERN_PROC_PID 1 +#define KERN_PROC_INC_THREAD 0x10 + +/* + * CTL_HW identifiers + */ #define HW_PHYSMEM 5 #endif /* HWLOC_PORT_FREEBSD_SYS_SYSCTL_H */ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/thr.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/thr.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/thr.h 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/thr.h 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef HWLOC_PORT_FREEBSD_SYS_THR_H +#define HWLOC_PORT_FREEBSD_SYS_THR_H + +int thr_self(long *id); + +#endif /* HWLOC_PORT_FREEBSD_SYS_THR_H */ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/user.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/user.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/freebsd/sys/user.h 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/freebsd/sys/user.h 2020-03-30 18:07:31.000000000 +0000 @@ -0,0 +1,13 @@ +#ifndef _SYS_USER_H_ +#define _SYS_USER_H_ + +typedef __int32_t lwpid_t; + +struct kinfo_proc { + pid_t ki_pid; + int ki_oncpu; + int ki_lastcpu; + lwpid_t ki_tid; +}; + +#endif /* _SYS_USER_H_ */ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/windows/windows.h hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/windows/windows.h --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/include/windows/windows.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/include/windows/windows.h 2020-03-30 18:07:31.000000000 +0000 @@ -227,6 +227,17 @@ LRESULT WINAPI DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags); +#define SWP_NOMOVE 0x0002 +#define SWP_NOZORDER 0x0004 +#define SWP_NOCOPYBITS 0x0100 +#define SWP_NOOWNERZORDER 0x0200 +#define SWP_DEFERERASE 0x2000 + +#define HWND_TOP (HWND)0 + +BOOL AdjustWindowRect(LPRECT lpRect, DWORD dwStyle, BOOL bMenu); + #define WHITE_BRUSH 26 HCURSOR WINAPI LoadCursor(HINSTANCE hInstance, LPCTSTR lpCursorName); diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/Makefile.am hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/Makefile.am --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009, 2011-2012 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -73,7 +73,11 @@ include/freebsd/pthread.h \ include/freebsd/pthread_np.h \ include/freebsd/sys/cpuset.h \ - include/freebsd/sys/sysctl.h + include/freebsd/sys/sysctl.h \ + include/freebsd/sys/thr.h \ + include/freebsd/sys/user.h \ + include/freebsd/sys/param.h \ + include/freebsd/sys/domainset.h libhwloc_port_freebsd_la_CPPFLAGS = $(common_CPPFLAGS) \ -I$(HWLOC_top_srcdir)/tests/hwloc/ports/include/freebsd \ -DHWLOC_FREEBSD_SYS \ @@ -85,7 +89,8 @@ -Dhwloc_thread_t=pthread_t \ -DHAVE_DECL_PTHREAD_SETAFFINITY_NP=1 \ -DHAVE_DECL_PTHREAD_GETAFFINITY_NP=1 \ - -DHAVE_CPUSET_SETID + -DHAVE_CPUSET_SETID \ + -DHAVE_SYS_DOMAINSET_H nodist_libhwloc_port_hpux_la_SOURCES = topology-hpux.c libhwloc_port_hpux_la_SOURCES = \ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/ports/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/ports/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009, 2011-2012 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -389,6 +389,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -403,6 +404,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -616,7 +618,11 @@ include/freebsd/pthread.h \ include/freebsd/pthread_np.h \ include/freebsd/sys/cpuset.h \ - include/freebsd/sys/sysctl.h + include/freebsd/sys/sysctl.h \ + include/freebsd/sys/thr.h \ + include/freebsd/sys/user.h \ + include/freebsd/sys/param.h \ + include/freebsd/sys/domainset.h libhwloc_port_freebsd_la_CPPFLAGS = $(common_CPPFLAGS) \ -I$(HWLOC_top_srcdir)/tests/hwloc/ports/include/freebsd \ @@ -629,7 +635,8 @@ -Dhwloc_thread_t=pthread_t \ -DHAVE_DECL_PTHREAD_SETAFFINITY_NP=1 \ -DHAVE_DECL_PTHREAD_GETAFFINITY_NP=1 \ - -DHAVE_CPUSET_SETID + -DHAVE_CPUSET_SETID \ + -DHAVE_SYS_DOMAINSET_H nodist_libhwloc_port_hpux_la_SOURCES = topology-hpux.c libhwloc_port_hpux_la_SOURCES = \ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/rename/main.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/rename/main.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/rename/main.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/rename/main.c 2020-03-30 18:07:31.000000000 +0000 @@ -40,7 +40,6 @@ #include "hwloc/nvml.h" #endif #include "hwloc/gl.h" -#include "hwloc/intel-mic.h" #include "private/components.h" #include "private/internal-components.h" diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/rename/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/rename/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/rename/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/rename/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -188,6 +188,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -202,6 +203,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -388,6 +388,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -402,6 +403,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86/test-topology.sh.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86/test-topology.sh.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86/test-topology.sh.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86/test-topology.sh.in 2020-03-30 18:07:31.000000000 +0000 @@ -106,7 +106,7 @@ # if there's a .env file, source it if [ -f "$topology".env ] ; then - source "$topology".env + . "$topology".env fi result=1 diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86+linux/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86+linux/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86+linux/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86+linux/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -388,6 +388,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -402,6 +403,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86+linux/test-topology.sh.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86+linux/test-topology.sh.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/x86+linux/test-topology.sh.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/x86+linux/test-topology.sh.in 2020-03-30 18:07:31.000000000 +0000 @@ -112,7 +112,7 @@ # if there's a .env file, source it if [ -f "$topology".env ] ; then - source "$topology".env + . "$topology".env fi result=1 diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/xml/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/hwloc/xml/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/xml/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/xml/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -390,6 +390,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -404,6 +405,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/hwloc/xmlbuffer.c hwloc-contrib-2.2.0+dfsg/tests/hwloc/xmlbuffer.c --- hwloc-contrib-2.1.0+dfsg/tests/hwloc/xmlbuffer.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/hwloc/xmlbuffer.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2010-2018 Inria. All rights reserved. + * Copyright © 2010-2020 Inria. All rights reserved. * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -93,21 +93,21 @@ exit(EXIT_FAILURE); } - putenv("HWLOC_LIBXML_CLEANUP=1"); + putenv((char *) "HWLOC_LIBXML_CLEANUP=1"); if (atoi(argv[1])) { - putenv("HWLOC_LIBXML_IMPORT=1"); + putenv((char *) "HWLOC_LIBXML_IMPORT=1"); printf("import=libxml "); } else { - putenv("HWLOC_LIBXML_IMPORT=0"); + putenv((char *) "HWLOC_LIBXML_IMPORT=0"); printf("import=nolibxml "); } if (atoi(argv[2])) { - putenv("HWLOC_LIBXML_EXPORT=1"); + putenv((char *) "HWLOC_LIBXML_EXPORT=1"); printf("export=libxml\n"); } else { - putenv("HWLOC_LIBXML_EXPORT=0"); + putenv((char *) "HWLOC_LIBXML_EXPORT=0"); printf("export=nolibxml\n"); } diff -Nru hwloc-contrib-2.1.0+dfsg/tests/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -246,6 +246,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -260,6 +261,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/tests/netloc/Makefile.in hwloc-contrib-2.2.0+dfsg/tests/netloc/Makefile.in --- hwloc-contrib-2.1.0+dfsg/tests/netloc/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/tests/netloc/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -391,6 +391,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -405,6 +406,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/common-ps.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/common-ps.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/common-ps.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/common-ps.c 2020-03-30 18:07:31.000000000 +0000 @@ -122,6 +122,31 @@ free(cmd); } + if (flags & HWLOC_PS_FLAG_UID) { + proc->uid = HWLOC_PS_ALL_UIDS; +#ifdef HWLOC_LINUX_SYS + pathlen = 6 + 21 + 1 + 6 + 1; + path = malloc(pathlen); + snprintf(path, pathlen, "/proc/%ld/status", proc->pid); + fd = open(path, O_RDONLY); + if (fd >= 0) { + char status[1024]; + char *uid; + (void) read(fd, &status, sizeof(status)); + status[1023] = '\0'; + uid = strstr(status, "Uid:"); + if (uid) + proc->uid = strtoul(uid+4, NULL, 0); + close(fd); + } + free(path); +#endif + /* On *BSD, parse the end of the single-line in /proc/pid/status + * (but the format is different between FreeBSD and NetBSD). + * It may be a good time to switch to a portable library for gathering this info. + */ + } + if (flags & HWLOC_PS_FLAG_THREADS) { #ifdef HWLOC_LINUX_SYS /* check if some threads must be displayed */ @@ -254,7 +279,7 @@ int hwloc_ps_foreach_process(hwloc_topology_t topology, hwloc_const_bitmap_t topocpuset, void (*callback)(hwloc_topology_t topology, struct hwloc_ps_process *proc, void *cbdata), void *cbdata, - unsigned long flags, const char *only_name, const char *pidcmd) + unsigned long flags, const char *only_name, long uid, const char *pidcmd) { #ifdef HAVE_DIRENT_H DIR *dir; @@ -283,6 +308,8 @@ goto next; if (only_name && !strstr(proc.name, only_name)) goto next; + if (uid != HWLOC_PS_ALL_UIDS && proc.uid != HWLOC_PS_ALL_UIDS && proc.uid != uid) + goto next; callback(topology, &proc, cbdata); next: hwloc_ps_free_process(&proc); diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/common-ps.h hwloc-contrib-2.2.0+dfsg/utils/hwloc/common-ps.h --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/common-ps.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/common-ps.h 2020-03-30 18:07:31.000000000 +0000 @@ -18,6 +18,8 @@ char string[1024]; char name[64]; hwloc_bitmap_t cpuset; +#define HWLOC_PS_ALL_UIDS ((long)-1) + long uid; int bound; unsigned nthreads; unsigned nboundthreads; @@ -32,6 +34,7 @@ #define HWLOC_PS_FLAG_THREADS (1UL<<0) #define HWLOC_PS_FLAG_LASTCPULOCATION (1UL<<1) #define HWLOC_PS_FLAG_SHORTNAME (1UL<<2) +#define HWLOC_PS_FLAG_UID (1UL<<3) int hwloc_ps_read_process(hwloc_topology_t topology, hwloc_const_bitmap_t topocpuset, struct hwloc_ps_process *proc, @@ -40,7 +43,7 @@ int hwloc_ps_foreach_process(hwloc_topology_t topology, hwloc_const_bitmap_t topocpuset, void (*callback)(hwloc_topology_t topology, struct hwloc_ps_process *proc, void *cbdata), void *cbdata, - unsigned long flags, const char *only_name, const char *pidcmd); + unsigned long flags, const char *only_name, long only_uid, const char *pidcmd); void hwloc_ps_free_process(struct hwloc_ps_process *proc); diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc.7in hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc.7in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc.7in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc.7in 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" Copyright © 2010-2018 Inria. All rights reserved. +.\" Copyright © 2010-2020 Inria. All rights reserved. .\" Copyright © 2010 Université of Bordeaux .\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. .\" See COPYING in top-level directory. @@ -29,8 +29,8 @@ A set of processors included in an hwloc object, expressed as a bitmask indexed by the physical numbers of the CPUs (as announced by the OS). The hwloc definition -of "CPU set" does not carry any the same connotations as Linux's "CPU -set" (e.g., process affinity, etc.). +of "CPU set" does not carry any of the same connotations as Linux's "CPU +set" (e.g., process affinity, cgroup, etc.). . .TP .B hwloc node set: @@ -122,6 +122,12 @@ . "\fBos=eth0\fR" is the network interface whose software name is "eth0". . +PCI devices may also be filtered based on their vendor and/or device IDs, +for instance "\fBpci[15b3:]:2\fR" for the third Mellanox PCI device (vendor ID 0x15b3). +. +OS devices may also be filtered based on their subtype, +for instance "\fBos[gpu]:all\fR" for all GPU OS devices. +. .TP .B Hex: For tools that manipulate object as sets (e.g. hwloc-calc and hwloc-bind), diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-annotate.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-annotate.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-annotate.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-annotate.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2012-2019 Inria. All rights reserved. + * Copyright © 2012-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -394,7 +394,7 @@ lcontext.logical = 1; lcontext.verbose = 0; err = hwloc_calc_process_location(&lcontext, location, typelen, - hwloc_calc_process_location_annotate_cb, topology); + hwloc_calc_process_location_annotate_cb, NULL); } } } diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-bind.1in hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-bind.1in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-bind.1in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-bind.1in 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" Copyright © 2009-2019 Inria. All rights reserved. +.\" Copyright © 2009-2020 Inria. All rights reserved. .\" Copyright © 2010 Université of Bordeaux .\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. .\" See COPYING in top-level directory. @@ -97,8 +97,10 @@ \fB\-\-single\fR Bind on a single CPU to prevent migration. .TP -\fB\-\-no\-smt\fR -Only keep a single PU per core before binding. +\fB\-\-no\-smt\fR, \fB\-\-no\-smt=\fR +Only keep the first PU per core before binding. +If \fI\fR is specified, keep the -th instead, if any. +PUs are ordered by physical index during this filtering. .TP \fB\-\-strict\fR Require strict binding. @@ -167,8 +169,9 @@ .SH DESCRIPTION . hwloc-bind execs an executable (with optional command line arguments) -that is bound to the specified location (or list of locations). Upon -successful execution, hwloc-bind simply sets bindings and then execs +that is bound to the specified location (or list of locations). +Location specification is described in hwloc(7). +Upon successful execution, hwloc-bind simply sets bindings and then execs the executable over itself. . .PP diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-bind.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-bind.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-bind.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-bind.c 2020-03-30 18:07:31.000000000 +0000 @@ -77,7 +77,7 @@ int force = 0; int single = 0; int verbose = 0; - int no_smt = 0; + int no_smt = -1; int only_hbm = -1; int logical = 1; int taskset = 0; @@ -145,7 +145,11 @@ goto next; } if (!strcmp(argv[0], "--no-smt")) { - no_smt = 1; + no_smt = 0; + goto next; + } + if (!strncmp(argv[0], "--no-smt=", 9)) { + no_smt = atoi(argv[0] + 9); goto next; } if (!strcmp(argv[0], "-f") || !strcmp(argv[0], "--force")) { @@ -454,7 +458,7 @@ fprintf(stderr, "--mempolicy ignored unless memory binding is also requested with --membind.\n"); } - if (!got_cpubind && no_smt) { + if (!got_cpubind && no_smt != -1) { hwloc_bitmap_copy(cpubind_set, hwloc_topology_get_topology_cpuset(topology)); got_cpubind = 1; } @@ -477,21 +481,11 @@ fprintf(stderr, "Conflicting CPU and memory binding requested, adding HWLOC_CPUBIND_NOMEMBIND flag.\n"); cpubind_flags |= HWLOC_CPUBIND_NOMEMBIND; } - if (no_smt) { + if (no_smt != -1) { if (hwloc_get_type_depth(topology, HWLOC_OBJ_CORE) == HWLOC_TYPE_DEPTH_UNKNOWN) { fprintf(stderr, "Topology has no Core object, ignoring --no-smt\n"); } else { - hwloc_obj_t core = NULL; - while ((core = hwloc_get_next_obj_covering_cpuset_by_type(topology, cpubind_set, HWLOC_OBJ_CORE, core)) != NULL) { - int firstpu = hwloc_bitmap_first(core->cpuset); - int hadpu = hwloc_bitmap_isset(cpubind_set, firstpu); - assert(firstpu >= 0); - /* remove the entire core */ - hwloc_bitmap_andnot(cpubind_set, cpubind_set, core->cpuset); - /* put back its first PU if it was there */ - if (hadpu) - hwloc_bitmap_set(cpubind_set, firstpu); - } + hwloc_bitmap_singlify_per_core(topology, cpubind_set, no_smt); } } if (single) diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-calc.1in hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-calc.1in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-calc.1in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-calc.1in 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" Copyright © 2010-2019 Inria. All rights reserved. +.\" Copyright © 2010-2020 Inria. All rights reserved. .\" Copyright © 2009 Cisco Systems, Inc. All rights reserved. .\" See COPYING in top-level directory. .TH HWLOC-CALC "1" "%HWLOC_DATE%" "%PACKAGE_VERSION%" "%PACKAGE_NAME%" @@ -56,16 +56,25 @@ Report the number of objects of the given type or depth that intersect the CPU set. This is convenient for finding how many cores, NUMA nodes or PUs are available in a machine. + +When combined with \fB\-\-nodeset\fR or \fB\-\-nodeset-output\fR, +the nodeset is considered instead of the CPU set for finding matching objects. +This is useful when reporting the output as a number or set of NUMA nodes. .TP \fB\-I \-\-intersect \fR Find the list of objects of the given type or depth that intersect the CPU set and report the comma-separated list of their indexes instead of the cpu mask string. This may be used for determining the list of objects above or below the input objects. + When combined with \fB\-\-physical\fR, the list is convenient to pass to external tools such as taskset or numactl \fB\-\-physcpubind\fR or \fB\-\-membind\fR. This is different from \-\-largest since the latter requires that all reported objects are strictly included inside the input objects. + +When combined with \fB\-\-nodeset\fR or \fB\-\-nodeset-output\fR, +the nodeset is considered instead of the CPU set for finding matching objects. +This is useful when reporting the output as a number or set of NUMA nodes. .TP \fB\-H \-\-hierarchical ....\fR Find the list of objects of type that intersect the CPU set and @@ -74,10 +83,12 @@ For instance, if \fIpackage.core\fR is given, the output would be \fIPackage:1.Core:2 Package:2.Core:3\fR if the input contains the third core of the second package and the fourth core of the third package. + +Only normal CPU-side object types may be used. NUMA nodes cannot. .TP \fB\-\-largest\fR Report (in a human readable format) the list of largest objects which exactly -include all input objects. +include all input objects (by looking at their CPU sets). None of these output objects intersect each other, and the sum of them is exactly equivalent to the input. No largest object is included in the input This is different from \-\-intersect where reported objects may not be @@ -93,8 +104,10 @@ \fB\-\-single\fR Singlify the output to a single CPU. .TP -\fB\-\-no\-smt\fR -Only keep a single PU per core in the input locations. +\fB\-\-no\-smt\fR, \fB\-\-no\-smt=\fR +Only keep the first PU per core in the input locations. +If \fI\fR is specified, keep the -th instead, if any. +PUs are ordered by physical index during this filtering. .TP \fB\-\-taskset\fR Display CPU set strings in the format recognized by the taskset command-line @@ -154,6 +167,7 @@ Both input and output may be either objects (with physical or logical indexes), CPU lists (with physical or logical indexes), or CPU mask strings (always physically indexed). +Input location specification is described in hwloc(7). . .PP If objects or CPU mask strings are given on the command-line, @@ -226,10 +240,23 @@ $ hwloc-calc --physical --intersect NUMAnode 0xf0f0f0f0 0,2 -To display the physical index of a processor given by its logical index: +Converting object logical indexes (default) from/to physical/OS indexes +may be performed with \fB--intersect\fR combined with either \fB--physical-output\fR +(logical to physical conversion) or \fB--physical-input\fR (physical to logical): + + $ hwloc-calc --physical-output PU:2 --intersect PU + 3 + $ hwloc-calc --physical-input PU:3 --intersect PU + 2 + +One should add \fB--nodeset\fR when converting indexes of memory objects +to make sure a single NUMA node index is returned on platforms +with heterogeneous memory: - $ hwloc-calc PU:2 --physical-output --intersect PU + $ hwloc-calc --nodeset --physical-output node:2 --intersect node 3 + $ hwloc-calc --nodeset --physical-input node:3 --intersect node + 2 To display the set of CPUs near network interface eth0: diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-calc.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-calc.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-calc.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-calc.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux * Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -66,10 +66,34 @@ static int hiernblevels = 0; static int *hierdepth = NULL; static int showobjs = 0; -static int no_smt = 0; +static int no_smt = -1; static int singlify = 0; static int taskset = 0; +static int +hwloc_calc_intersects_set(hwloc_bitmap_t set, int use_nodeset, hwloc_obj_t obj) +{ + if (use_nodeset) + return hwloc_bitmap_intersects(set, obj->nodeset); + else + return hwloc_bitmap_intersects(set, obj->cpuset); +} + +/* generalization of hwloc_get_next_obj_covering_cpuset_by_depth() which may also use nodeset instead of cpuset */ +static hwloc_obj_t +hwloc_calc_get_next_obj_covering_set_by_depth(hwloc_topology_t topology, + hwloc_bitmap_t set, int use_nodeset, + int depth, + hwloc_obj_t prev) +{ + hwloc_obj_t next = hwloc_get_next_obj_by_depth(topology, depth, prev); + if (!next) + return NULL; + while (next && !hwloc_calc_intersects_set(set, use_nodeset, next)) + next = next->next_cousin; + return next; +} + static void hwloc_calc_hierarch_output(hwloc_topology_t topology, const char *prefix, const char *sep, hwloc_obj_t root, hwloc_bitmap_t set, int level) { @@ -103,21 +127,11 @@ static int hwloc_calc_output(hwloc_topology_t topology, const char *sep, hwloc_bitmap_t set) { - if (no_smt) { + if (no_smt != -1 && !nodeseto) { if (hwloc_get_type_depth(topology, HWLOC_OBJ_CORE) == HWLOC_TYPE_DEPTH_UNKNOWN) { fprintf(stderr, "Topology has no Core object, ignoring --no-smt\n"); } else { - hwloc_obj_t core = NULL; - while ((core = hwloc_get_next_obj_covering_cpuset_by_type(topology, set, HWLOC_OBJ_CORE, core)) != NULL) { - int firstpu = hwloc_bitmap_first(core->cpuset); - int hadpu = hwloc_bitmap_isset(set, firstpu); - assert(firstpu >= 0); - /* remove the entire core */ - hwloc_bitmap_andnot(set, set, core->cpuset); - /* put back its first PU if it was there */ - if (hadpu) - hwloc_bitmap_set(set, firstpu); - } + hwloc_bitmap_singlify_per_core(topology, set, no_smt); } } @@ -127,6 +141,7 @@ if (showobjs) { hwloc_bitmap_t remaining = hwloc_bitmap_dup(set); int first = 1; + assert(!nodeseto); /* disabled for now, not very useful since the hierarchy of nodes isn't complex */ if (!sep) sep = " "; while (!hwloc_bitmap_iszero(remaining)) { @@ -152,14 +167,14 @@ } else if (numberofdepth != -1) { unsigned nb = 0; hwloc_obj_t obj = NULL; - while ((obj = hwloc_get_next_obj_covering_cpuset_by_depth(topology, set, numberofdepth, obj)) != NULL) + while ((obj = hwloc_calc_get_next_obj_covering_set_by_depth(topology, set, nodeseto, numberofdepth, obj)) != NULL) nb++; printf("%u\n", nb); } else if (intersectdepth != -1) { hwloc_obj_t proc, prev = NULL; if (!sep) sep = ","; - while ((proc = hwloc_get_next_obj_covering_cpuset_by_depth(topology, set, intersectdepth, prev)) != NULL) { + while ((proc = hwloc_calc_get_next_obj_covering_set_by_depth(topology, set, nodeseto, intersectdepth, prev)) != NULL) { if (prev) printf("%s", sep); printf("%u", logicalo ? proc->logical_index : proc->os_index); @@ -255,7 +270,7 @@ hwloc_topology_set_all_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_ALL); \ hwloc_topology_set_flags(topology, flags); \ if (input) { \ - err = hwloc_utils_enable_input_format(topology, input, &input_format, verbose, callname); \ + err = hwloc_utils_enable_input_format(topology, flags, input, &input_format, verbose, callname); \ if (err) return EXIT_FAILURE; \ } \ err = hwloc_topology_load(topology); \ @@ -288,7 +303,11 @@ return EXIT_SUCCESS; } if (!strcmp (argv[0], "--no-smt")) { - no_smt = 1; + no_smt = 0; + goto next; + } + if (!strncmp(argv[0], "--no-smt=", 9)) { + no_smt = atoi(argv[0] + 9); goto next; } if (!strcmp (argv[0], "--restrict")) { @@ -449,6 +468,11 @@ next: argc--; argv++; + + if (showobjs && nodeseto) { + fprintf(stderr, "ignoring --nodeset-output when --largest output is enabled\n"); + nodeseto = 0; + } } ENSURE_LOADED(); @@ -478,6 +502,10 @@ *next = '\0'; if (hwloc_calc_type_depth(topology, tmp, &hierdepth[i], "--hierarchical") < 0) goto out; + if (hierdepth[i] < 0) { + fprintf(stderr, "unsupported (non-normal) --hierarchical type %s\n", tmp); + goto out; + } tmp = next+1; } } diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-calc.h hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-calc.h --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-calc.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-calc.h 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2018 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -195,7 +195,8 @@ static __hwloc_inline int hwloc_calc_parse_range(const char *_string, int *firstp, int *amountp, int *stepp, int *wrapp, - const char **dotp) + const char **dotp, + int verbose) { char string[65]; size_t len; @@ -211,7 +212,8 @@ len = strlen(_string); } if (len >= sizeof(string)) { - fprintf(stderr, "invalid range `%s', too long\n", _string); + if (verbose >= 0) + fprintf(stderr, "invalid range `%s', too long\n", _string); return -1; } memcpy(string, _string, len); @@ -237,7 +239,8 @@ *wrapp = 0; return 0; } else { - fprintf(stderr, "unrecognized range keyword `%s'\n", string); + if (verbose >= 0) + fprintf(stderr, "unrecognized range keyword `%s'\n", string); return -1; } } @@ -249,7 +252,8 @@ if (*end == '-') { last = strtol(end+1, &end2, 10); if (*end2) { - fprintf(stderr, "invalid character at `%s' after range at `%s'\n", end2, string); + if (verbose >= 0) + fprintf(stderr, "invalid character at `%s' after range at `%s'\n", end2, string); return -1; } else if (end2 == end+1) { /* X- */ @@ -264,15 +268,18 @@ wrap = 1; amount = strtol(end+1, &end2, 10); if (*end2) { - fprintf(stderr, "invalid character at `%s' after range at `%s'\n", end2, string); + if (verbose >= 0) + fprintf(stderr, "invalid character at `%s' after range at `%s'\n", end2, string); return -1; } else if (end2 == end+1) { - fprintf(stderr, "missing width at `%s' in range at `%s'\n", end2, string); + if (verbose >= 0) + fprintf(stderr, "missing width at `%s' in range at `%s'\n", end2, string); return -1; } } else if (*end) { - fprintf(stderr, "invalid character at `%s' after index at `%s'\n", end, string); + if (verbose >= 0) + fprintf(stderr, "invalid character at `%s' after index at `%s'\n", end, string); return -1; } @@ -296,13 +303,18 @@ int nextdepth = -1; int first, wrap, amount, step; unsigned i,j; + int found = 0; int err; err = hwloc_calc_parse_range(string, &first, &amount, &step, &wrap, - &dot); - if (err < 0) + &dot, + verbose); + if (err < 0) { + if (verbose >= 0) + fprintf(stderr, "Failed to parse object index range %s\n", string); return -1; + } assert(amount != -1 || !wrap); if (dot) { @@ -311,15 +323,26 @@ hwloc_obj_type_t type; const char *nextstring = dot+1; typelen = strspn(nextstring, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); - if (!typelen || nextstring[typelen] != ':') + if (!typelen || nextstring[typelen] != ':') { + if (verbose >= 0) + fprintf(stderr, "hierarchical sublocation %s contains types not followed by colon and index range\n", nextstring); return -1; + } nextsep = &nextstring[typelen]; nextdepth = hwloc_calc_parse_depth_prefix(lcontext, nextstring, typelen, &type); - if (nextdepth == HWLOC_TYPE_DEPTH_UNKNOWN || nextdepth == HWLOC_TYPE_DEPTH_MULTIPLE) + if (nextdepth == HWLOC_TYPE_DEPTH_UNKNOWN) { + if (verbose >= 0) + fprintf(stderr, "could not find level specified by location %s\n", nextstring); return -1; + } + if (nextdepth == HWLOC_TYPE_DEPTH_MULTIPLE) { + if (verbose >= 0) + fprintf(stderr, "found multiple levels for location %s\n", nextstring); + return -1; + } /* we need an object with a cpuset, that's depth>=0 or memory */ if (nextdepth < 0 && nextdepth != HWLOC_TYPE_DEPTH_NUMANODE) { if (verbose >= 0) @@ -351,6 +374,7 @@ free(sn); } if (obj) { + found++; if (dot) { hwloc_calc_append_object_range(lcontext, obj->cpuset, obj->nodeset, nextdepth, nextsep+1, cbfunc, cbdata); } else { @@ -361,6 +385,8 @@ } } } + if (!found && verbose >= 0) + fprintf(stderr, "failed to use any single object in index range %s\n", string); return 0; } @@ -383,6 +409,7 @@ int verbose = lcontext->verbose; hwloc_obj_t obj, prev = NULL; int pcivendor = -1, pcidevice = -1; + int osdevtype = -1; const char *current, *dot; char *endp; int first = 0, step = 1, amount = 1, wrap = 0; /* assume the index suffix is `:0' by default */ @@ -420,6 +447,35 @@ return -1; } + } else if (type == HWLOC_OBJ_OS_DEVICE) { + /* try to match by [osdevtype] */ + hwloc_obj_type_t type2; + union hwloc_obj_attr_u attr; + + endp = strchr(current, ']'); + if (!endp) { + if (verbose >= 0) + fprintf(stderr, "invalid OS device subtype specification %s\n", string); + return -1; + } + *endp = 0; + + err = hwloc_type_sscanf(current, &type2, &attr, sizeof(attr)); + *endp = ']'; + if (err < 0 || type2 != HWLOC_OBJ_OS_DEVICE) { + if (verbose >= 0) + fprintf(stderr, "invalid OS device subtype specification %s\n", string); + return -1; + } + osdevtype = attr.osdev.type; + + current = endp+1; + if (*current != ':' && *current != '\0') { + if (verbose >= 0) + fprintf(stderr, "invalid OS device subtype specification %s\n", string); + return -1; + } + } else { /* no matching for non-PCI devices */ if (verbose >= 0) @@ -436,13 +492,17 @@ current++; err = hwloc_calc_parse_range(current, &first, &amount, &step, &wrap, - &dot); + &dot, + verbose); if (dot) { fprintf(stderr, "hierarchical location %s only supported with normal object types\n", string); return -1; } - if (err < 0) + if (err < 0) { + if (verbose >= 0) + fprintf(stderr, "Failed to parse object index range %s\n", current); return -1; + } } max = hwloc_get_nbobjs_by_depth(topology, depth); @@ -466,6 +526,11 @@ continue; } + if (type == HWLOC_OBJ_OS_DEVICE) { + if (osdevtype != -1 && (int) obj->attr->osdev.type != osdevtype) + continue; + } + if (first--) continue; @@ -502,10 +567,18 @@ depth = hwloc_calc_parse_depth_prefix(lcontext, arg, typelen, &type); - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE) { + if (depth == HWLOC_TYPE_DEPTH_UNKNOWN) { + if (verbose >= 0) + fprintf(stderr, "could not find level specified by location %s\n", arg); return -1; + } + if (depth == HWLOC_TYPE_DEPTH_MULTIPLE) { + if (verbose >= 0) + fprintf(stderr, "found multiple levels for location %s\n", arg); + return -1; + } - } else if (depth < 0 && depth != HWLOC_TYPE_DEPTH_NUMANODE) { + if (depth < 0 && depth != HWLOC_TYPE_DEPTH_NUMANODE) { /* special object without cpusets */ /* if we didn't find a depth but found a type, handle special cases */ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-distrib.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-distrib.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-distrib.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-distrib.c 2020-03-30 18:07:31.000000000 +0000 @@ -200,7 +200,7 @@ cpuset = malloc(n * sizeof(hwloc_bitmap_t)); if (input) { - err = hwloc_utils_enable_input_format(topology, input, &input_format, verbose, callname); + err = hwloc_utils_enable_input_format(topology, flags, input, &input_format, verbose, callname); if (err) { free(cpuset); return EXIT_FAILURE; diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-dump-hwdata-knl.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-dump-hwdata-knl.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-dump-hwdata-knl.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-dump-hwdata-knl.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2015-2018 Intel - * Copyright © 2015-2018 Inria. All rights reserved. + * Copyright © 2015-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -27,7 +27,7 @@ /* unexpected strings, found at least in Dell C6320p BIOS <=1.4.1 */ #define KNL_DELL_GROUP_STRING "Knights Landing Association" -static char *allowed_group_strings[] = +static const char *allowed_group_strings[] = { KNL_INTEL_GROUP_STRING, KNM_INTEL_GROUP_STRING, @@ -472,10 +472,12 @@ DIR *d; int i; struct dirent *dir; - struct parser_data data = { 0 }; + struct parser_data data; char path[PATH_SIZE]; int err; + memset(&data, 0, sizeof(data)); + printf("Dumping Xeon Phi SMBIOS Memory-Side Cache information:\n"); snprintf(path, PATH_SIZE-1, "%s/" KERNEL_SMBIOS_SYSFS, input_fsroot); diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-gather-cpuid.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-gather-cpuid.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-gather-cpuid.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-gather-cpuid.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2015-2019 Inria. All rights reserved. + * Copyright © 2015-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -285,6 +285,12 @@ } } + /* 0x1a = Hybrid Information Enumeration Leaf on Intel ; Reserved on AMD */ + if (highest_cpuid >= 0x1a) { + regs[0] = 0x1a; regs[2] = 0; + dump_one_cpuid(output, regs, 0x5); + } + /* 0x1b = (Removed) PCONFIG Information on Intel ; Reserved on AMD */ /* 0x1f = V2 Extended Topology Enumeration on Intel ; Reserved on AMD */ @@ -367,6 +373,12 @@ dump_one_cpuid(output, regs, 0x1); } + /* 0x8000001a = Performance Optimization Identifiers on AMD ; Reserved on Intel */ + if (highest_ext_cpuid >= 0x8000001a) { + regs[0] = 0x8000001a; + dump_one_cpuid(output, regs, 0x1); + } + /* 0x8000001b = IBS on AMD ; Reserved on Intel */ if (highest_ext_cpuid >= 0x8000001b) { regs[0] = 0x8000001b; diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-gather-topology.in hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-gather-topology.in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-gather-topology.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-gather-topology.in 2020-03-30 18:07:31.000000000 +0000 @@ -3,7 +3,7 @@ # # Copyright © 2009 CNRS -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2012 Université Bordeaux # Copyright © 2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -270,6 +270,7 @@ cat /proc/mounts | while read -r dummy1 mntpath mnttype mntopts dummy2 ; do [ x$mnttype = xcpuset ] && savemntpnt "$mntpath" [ x$mnttype = xcgroup ] && echo $mntopts | grep -w cpuset >/dev/null && savemntpnt "$mntpath" + [ x$mnttype = xcgroup2 ] && savemntpnt "$mntpath" done # @@ -337,7 +338,7 @@ "$lstopo" - -v > "$dirname/$basename.output" echo "Expected topology output stored in $dirname/$basename.output" "$lstopo" -.xml --whole-io --disallowed > "$dirname/$basename.xml" -echo "XML topology stored in in $dirname/$basename.xml" +echo "XML topology stored in $dirname/$basename.xml" echo echo "WARNING: Do not post these files on a public list or website unless you" diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-info.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-info.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-info.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-info.c 2020-03-30 18:07:31.000000000 +0000 @@ -524,7 +524,7 @@ hwloc_topology_set_flags(topology, flags); if (input) { - err = hwloc_utils_enable_input_format(topology, input, &input_format, verbose_mode, callname); + err = hwloc_utils_enable_input_format(topology, flags, input, &input_format, verbose_mode, callname); if (err) return err; } diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-ps.1in hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-ps.1in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-ps.1in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-ps.1in 2020-03-30 18:07:31.000000000 +0000 @@ -33,6 +33,12 @@ even if they are not bound to any specific part of the machine. This is not supported on all operating systems. .TP +\fB\--uid \fR +Only show processes of the user whose UID is \fI\fR, +or processes of all users if \fIall\fR is given. +By default, only processes of the current user are displayed. +This is currently only supported on Linux. +.TP \fB\-p\fR \fB\-\-physical\fR Report OS/physical indexes instead of logical indexes .TP diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-ps.c hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-ps.c --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/hwloc-ps.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/hwloc-ps.c 2020-03-30 18:07:31.000000000 +0000 @@ -34,6 +34,7 @@ static int logical = 1; #define NO_ONLY_PID -1 static long only_pid = NO_ONLY_PID; +static long only_uid; static int json_server = 0; static int json_port = JSON_PORT; static FILE *json_output = NULL; @@ -46,6 +47,10 @@ fprintf (where, " -a Show all processes, including those that are not bound\n"); fprintf (where, " --pid Only show process of pid number \n"); fprintf (where, " --name Only show processes whose name contains \n"); +#ifdef HWLOC_LINUX_SYS + fprintf (where, " --uid Only show processes of the user with the given uid\n"); + fprintf (where, " --uid all Show processes of all users\n"); +#endif fprintf (where, " -l --logical Use logical object indexes (default)\n"); fprintf (where, " -p --physical Use physical object indexes\n"); fprintf (where, " -c --cpuset Show cpuset instead of objects\n"); @@ -186,7 +191,7 @@ { if (only_pid == NO_ONLY_PID) { /* show all */ - return hwloc_ps_foreach_process(topology, topocpuset, foreach_process_cb, NULL, psflags, only_name, pidcmd); + return hwloc_ps_foreach_process(topology, topocpuset, foreach_process_cb, NULL, psflags, only_name, only_uid, pidcmd); } else { /* show only one */ @@ -194,6 +199,7 @@ int ret; proc.pid = only_pid; + proc.uid = only_uid; proc.cpuset = NULL; proc.nthreads = 0; proc.nboundthreads = 0; @@ -345,6 +351,8 @@ int err; int opt; + only_uid = getuid(); + callname = strrchr(argv[0], '/'); if (!callname) callname = argv[0]; @@ -388,6 +396,20 @@ } only_name = argv[1]; opt = 1; + } else if (!strcmp(argv[0], "--uid")) { +#ifdef HWLOC_LINUX_SYS + if (argc < 2) { + usage(callname, stdout); + exit(EXIT_FAILURE); + } + if (!strcmp(argv[1], "all")) + only_uid = HWLOC_PS_ALL_UIDS; + else + only_uid = atoi(argv[1]); + opt = 1; +#else + fprintf (stderr, "Filtering by UID is currently only supported on Linux\n"); +#endif } else if (!strcmp (argv[0], "--disallowed") || !strcmp (argv[0], "--whole-system")) { flags |= HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED; } else if (!strcmp (argv[0], "--pid-cmd")) { @@ -449,6 +471,8 @@ psflags |= HWLOC_PS_FLAG_THREADS; if (get_last_cpu_location) psflags |= HWLOC_PS_FLAG_LASTCPULOCATION; + if (only_uid != HWLOC_PS_ALL_UIDS) + psflags |= HWLOC_PS_FLAG_UID; if (json_server) { run_json_server(topology, topocpuset); diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/Makefile.am hwloc-contrib-2.2.0+dfsg/utils/hwloc/Makefile.am --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/Makefile.am 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/Makefile.am 2020-03-30 18:07:31.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2012, 2014, 2016 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # @@ -56,7 +56,7 @@ hwloc_dump_hwdata_SOURCES = \ hwloc-dump-hwdata.c \ hwloc-dump-hwdata-knl.c -hwloc_dump_hwdata_CPPFLAGS = $(AM_CPPFLAGS) -DRUNSTATEDIR=\"$(HWLOC_runstatedir)\" +hwloc_dump_hwdata_CPPFLAGS = $(AM_CPPFLAGS) -DRUNSTATEDIR="\"$(HWLOC_runstatedir)\"" hwloc_calc_SOURCES = \ hwloc-calc.h \ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/hwloc/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009-2012, 2014, 2016 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # @@ -587,6 +587,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -601,6 +602,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ @@ -769,7 +771,7 @@ hwloc-dump-hwdata.c \ hwloc-dump-hwdata-knl.c -hwloc_dump_hwdata_CPPFLAGS = $(AM_CPPFLAGS) -DRUNSTATEDIR=\"$(HWLOC_runstatedir)\" +hwloc_dump_hwdata_CPPFLAGS = $(AM_CPPFLAGS) -DRUNSTATEDIR="\"$(HWLOC_runstatedir)\"" hwloc_calc_SOURCES = \ hwloc-calc.h \ hwloc-calc.c diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/misc.h hwloc-contrib-2.2.0+dfsg/utils/hwloc/misc.h --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/misc.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/misc.h 2020-03-30 18:07:31.000000000 +0000 @@ -217,7 +217,7 @@ } static __hwloc_inline int -hwloc_utils_enable_input_format(struct hwloc_topology *topology, +hwloc_utils_enable_input_format(struct hwloc_topology *topology, unsigned long flags, const char *input, enum hwloc_utils_input_format *input_format, int verbose, const char *callname) @@ -258,6 +258,9 @@ fprintf(stderr, "Cannot force linux component first because HWLOC_COMPONENTS environment variable is already set to %s.\n", env); else putenv((char *) "HWLOC_COMPONENTS=linux,pci,stop"); + /* normally-set flags are overriden by envvar-forced backends */ + if (flags & HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM) + putenv((char *) "HWLOC_THISSYSTEM=1"); #else /* HWLOC_LINUX_SYS */ fprintf(stderr, "This installation of hwloc does not support changing the file-system root, sorry.\n"); exit(EXIT_FAILURE); @@ -280,6 +283,9 @@ fprintf(stderr, "Cannot force x86 component first because HWLOC_COMPONENTS environment variable is already set to %s.\n", env); else putenv((char *) "HWLOC_COMPONENTS=x86,stop"); + /* normally-set flags are overriden by envvar-forced backends */ + if (flags & HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM) + putenv((char *) "HWLOC_THISSYSTEM=1"); #else fprintf(stderr, "This installation of hwloc does not support loading from a cpuid dump, sorry.\n"); exit(EXIT_FAILURE); diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-fake-plugin.sh.in hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-fake-plugin.sh.in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-fake-plugin.sh.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-fake-plugin.sh.in 2020-03-30 18:07:31.000000000 +0000 @@ -13,7 +13,7 @@ lstopo="$builddir/utils/lstopo/lstopo-no-graphics" hcalc="$builddir/utils/hwloc/hwloc-calc" -HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc +HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc/.libs export HWLOC_PLUGINS_PATH HWLOC_DEBUG_CHECK=1 @@ -46,8 +46,8 @@ $lstopo > $file -grep "fake component initialized" $file \ -&& grep "fake component instantiated" $file \ -&& grep "fake component finalized" $file +grep "fake component initialized" $file || false +grep "fake component instantiated" $file || false +grep "fake component finalized" $file || false rm -rf "$tmp" diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-hwloc-calc.output hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-hwloc-calc.output --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-hwloc-calc.output 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-hwloc-calc.output 2020-03-30 18:07:31.000000000 +0000 @@ -2,10 +2,17 @@ 0xffffffffffffffff 0x0000000f -0x11111111,0x0 0x00000f0c 0x0000800a +0x11111111,0x0 +0x00000112 +0x00000024 +0x00000048 +0x00000080 +0x0 +0x000001fe + 0x55555555,0x55555555 0xffffffff,0x0 0xffff0000,0x0 @@ -22,11 +29,11 @@ 1 2,3 -NUMANode:0.PU:2 NUMANode:0.PU:3 -NUMANode:0.Core:0fooNUMANode:0.Core:1 +Group0:0.PU:2 Group0:0.PU:3 +Group0:0.Core:0fooGroup0:0.Core:1 Core:0.PU:3 Core:1.PU:0 Core:1.PU:1 Core:1.PU:2 3,4,5,6 -NUMANode:0.Core:2.PU:3 NUMANode:0.Core:3.PU:0 NUMANode:0.Core:3.PU:1 NUMANode:0.Core:3.PU:2 +Group0:0.Core:2.PU:3 Group0:0.Core:3.PU:0 Group0:0.Core:3.PU:1 Group0:0.Core:3.PU:2 11,12,13,14 Core:3 Group0:1 Core:8 PU:36 PU:37 diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-hwloc-calc.sh.in hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-hwloc-calc.sh.in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-hwloc-calc.sh.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-hwloc-calc.sh.in 2020-03-30 18:07:31.000000000 +0000 @@ -3,7 +3,7 @@ # # Copyright © 2009 CNRS -# Copyright © 2009-2019 Inria. All rights reserved. +# Copyright © 2009-2020 Inria. All rights reserved. # Copyright © 2009, 2011 Université Bordeaux # Copyright © 2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -40,10 +40,17 @@ $calc --if synthetic --input "node:4 core:4 pu:4" all --taskset echo $calc --if synthetic --input "node:4 core:4 pu:4" 0xf - $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt node:2-3 $calc --if synthetic --input "node:4 core:4 pu:4" 0xf ~0x3 0xff0 '^0xf0' $calc --if synthetic --input "node:4 core:4 pu:4" core:0 pu:15 ~pu:0 '^pu:2' echo + $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt node:2-3 + $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt 0x1fe + $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=1 0x1fe + $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=2 0x1fe + $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=3 0x1fe + $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=4 0x1fe + $calc --if synthetic --input "node:4 core:4 pu:4" --no-smt=-1 0x1fe + echo $calc --if synthetic --input "node:4 core:4 pu:4" pu:even $calc --if synthetic --input "node:4 core:4 pu:4" node:2- $calc --if synthetic --input "node:4 core:4 pu:4" core:12- @@ -60,12 +67,12 @@ $calc --if synthetic --input "node:4 core:4 pu:4" core:4-7 -I NUMANode $calc --if synthetic --input "node:4 core:4 pu:4" core:10-15 -I NUMANode echo - $calc --if synthetic --input "node:4 core:4 pu:4" pu:2-3 --hierarchical node.pu - $calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H node.core --sep foo + $calc --if synthetic --input "node:4 core:4 pu:4" pu:2-3 --hierarchical group.pu + $calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H group.core --sep foo $calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H core.pu $calc --if synthetic --input "node:4 core:4 pu:4" -I pu `$calc --if synthetic --input "node:4 core:4 pu:4" pu:3-6 -H core.pu` - $calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H node.core.pu - $calc --if synthetic --input "node:4 core:4 pu:4" -I pu `$calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H node.core.pu` + $calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H group.core.pu + $calc --if synthetic --input "node:4 core:4 pu:4" -I pu `$calc --if synthetic --input "node:4 core:4 pu:4" pu:11:4 -H group.core.pu` echo $calc --if synthetic --input "node:4 core:4 pu:4" pu:12-37 --largest $calc --if synthetic --input "node:4 core:4 pu:4" pu:22-47 --largest --sep "_" diff -Nru hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -389,6 +389,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -403,6 +404,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-ascii.c hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-ascii.c --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-ascii.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-ascii.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2009 CNRS * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2012 Université Bordeaux + * Copyright © 2009-2012, 2020 Université Bordeaux * Copyright © 2009-2018 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -32,6 +32,8 @@ #include "lstopo.h" +#define TERM_COLOR_START 16 + /* Uses unicode bars if available */ #ifdef HAVE_PUTWC typedef wchar_t character; @@ -133,7 +135,7 @@ #endif /* HWLOC_HAVE_LIBTERMCAP */ #ifdef HWLOC_HAVE_LIBTERMCAP -static int ascii_color_index = 16; +static int ascii_color_index = TERM_COLOR_START; #endif static struct lstopo_color *default_color = NULL; @@ -472,10 +474,10 @@ /* Get terminfo(5) strings */ initp = initialize_pair; - if (max_pairs <= 16 || !initp || !set_color_pair) { + if (max_pairs <= TERM_COLOR_START || !initp || !set_color_pair) { /* Can't use max_pairs to define our own colors */ initp = NULL; - if (max_colors > 16) + if (max_colors > TERM_COLOR_START) if (can_change) initc = initialize_color; } diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo.c hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo.c --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2012, 2015, 2017 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -74,7 +74,7 @@ const char *task_background_color_string = "#ffff00"; -static hwloc_obj_t insert_task(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const char * name) +static hwloc_obj_t insert_task(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const char * name, int thread) { hwloc_obj_t group, obj; @@ -90,11 +90,14 @@ group = hwloc_topology_insert_group_object(topology, group); if (!group) { /* try to insert in a larger parent */ - char *s; + char *s, *gs; hwloc_bitmap_asprintf(&s, cpuset); group = hwloc_get_obj_covering_cpuset(topology, cpuset); - fprintf(stderr, "Inserting process `%s' below parent larger than cpuset %s\n", name, s); + hwloc_bitmap_asprintf(&gs, group->cpuset); + fprintf(stderr, "%s `%s' binding %s doesn't match any object, extended to %s before inserting the %s in the topology.\n", + thread ? "Thread" : "Process", name, s, gs, thread ? "thread" : "process"); free(s); + free(gs); } obj = hwloc_topology_insert_misc_object(topology, group, name); if (!obj) @@ -123,7 +126,7 @@ snprintf(name, sizeof(name), "%ld %s", proc->pid, proc->name); if (proc->bound) - insert_task(topology, proc->cpuset, name); + insert_task(topology, proc->cpuset, name, 0); if (proc->nthreads) for(i=0; inthreads; i++) @@ -135,7 +138,7 @@ else snprintf(task_name, sizeof(task_name), "%s %li", name, proc->threads[i].tid); - insert_task(topology, proc->threads[i].cpuset, task_name); + insert_task(topology, proc->threads[i].cpuset, task_name, 1); } } @@ -149,7 +152,7 @@ hwloc_ps_foreach_process(topology, root->cpuset, foreach_process_cb, NULL, - HWLOC_PS_FLAG_THREADS | HWLOC_PS_FLAG_SHORTNAME, NULL, NULL); + HWLOC_PS_FLAG_THREADS | HWLOC_PS_FLAG_SHORTNAME, NULL, HWLOC_PS_ALL_UIDS, NULL); } static __hwloc_inline void lstopo_update_factorize_bounds(unsigned min, unsigned *first, unsigned *last) @@ -437,13 +440,15 @@ printf("Keyboard shortcuts:\n"); printf(" Zooming, scrolling and closing:\n"); printf(" Zoom-in or out ...................... + -\n"); - printf(" Try to fit scale to window .......... F\n"); printf(" Reset scale to default .............. 1\n"); + printf(" Try to fit scale to window .......... F\n"); + printf(" Resize window to the drawing ........ r\n"); + printf(" Toggle auto-resizing of the window .. R\n"); printf(" Scroll vertically ................... Up Down PageUp PageDown\n"); printf(" Scroll horizontally ................. Left Right Ctrl+PageUp/Down\n"); printf(" Scroll to the top-left corner ....... Home\n"); printf(" Scroll to the bottom-right corner ... End\n"); - printf(" Show this help ...................... h H\n"); + printf(" Show this help ...................... h H ?\n"); printf(" Exit ................................ q Q Esc\n"); printf(" Configuration tweaks:\n"); printf(" Toggle factorizing or collapsing .... f\n"); @@ -486,12 +491,19 @@ void lstopo_show_interactive_cli_options(const struct lstopo_output *loutput) { +#if (defined LSTOPO_HAVE_GRAPHICS) && (defined CAIRO_HAS_PDF_SURFACE) + const char *format = "PDF"; + const char *extension = "pdf"; +#else + const char *format = "SVG"; + const char *extension = "svg"; +#endif printf("\nCommand-line options for the current configuration tweaks:\n"); lstopo__show_interactive_cli_options(loutput); - printf("\n\nTo export to PDF:\n"); + printf("\n\nTo export to %s:\n", format); printf(" lstopo "); lstopo__show_interactive_cli_options(loutput); - printf(" topology.pdf\n\n"); + printf(" topology.%s\n\n", extension); } enum output_format { @@ -609,6 +621,7 @@ loutput.legend = 1; loutput.legend_append = NULL; loutput.legend_append_nr = 0; + snprintf(loutput.title, sizeof(loutput.title), "lstopo"); loutput.show_distances_only = 0; loutput.show_only = HWLOC_OBJ_TYPE_NONE; @@ -883,7 +896,7 @@ } } - for(i=type_min; i 1, callname); + err = hwloc_utils_enable_input_format(topology, flags, input, &input_format, loutput.verbose_mode > 1, callname); if (err) goto out_with_topology; + + if (input_format != HWLOC_UTILS_INPUT_DEFAULT) { + /* add the input path to the window title */ + snprintf(loutput.title, sizeof(loutput.title), "lstopo - %s", input); + +#ifndef HWLOC_WIN_SYS + /* try to only add the last part of the input path to the window title. + * disabled on windows because it requires to deal with / or \ in both cygwin and native paths. + * looks like _fullpath() is good way to replace realpath() on !cygwin. + */ + /* sanitize the path to avoid / ./ or ../ at the end */ + char *fullpath = realpath(input, NULL); + if (fullpath) { + char *pos = strrchr(fullpath, '/'); + /* now only keep the last part */ + if (pos) + pos++; + else + pos = fullpath; + snprintf(loutput.title, sizeof(loutput.title), "lstopo - %s", pos); + free(fullpath); + } +#endif + } } if (loutput.pid_number > 0) { diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-cairo.c hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-cairo.c --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-cairo.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-cairo.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright © 2009 CNRS * Copyright © 2009-2019 Inria. All rights reserved. - * Copyright © 2009-2010, 2014, 2017 Université Bordeaux + * Copyright © 2009-2010, 2014, 2017, 2020 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ @@ -33,6 +33,7 @@ # include # include # include +# include # include # include /* Avoid Xwindow's definition conflict with Windows' use for fields names. */ @@ -157,6 +158,8 @@ int x, y; /** top left corner of the visible part */ float scale, last_scale; int needs_redraw; + int needs_resize; + int auto_resize; }; static void @@ -238,6 +241,17 @@ if (disp->y >= disp->height - disp->screen_height) disp->y = disp->height - disp->screen_height; } + + if (disp->needs_resize >= 1) { + if (disp->auto_resize || disp->needs_resize >= 2) { + disp->last_screen_width = disp->screen_width = disp->width; + disp->last_screen_height = disp->screen_height = disp->height; + disp->x = 0; + disp->y = 0; + XResizeWindow(disp->dpy, disp->top, disp->screen_width, disp->screen_height); + } + disp->needs_resize = 0; + } } static struct draw_methods x11_draw_methods = { @@ -258,11 +272,12 @@ int scr; Screen *screen; int screen_width, screen_height; - unsigned int dpi_x, dpi_y, dpi; + unsigned int dpi_x, dpi_y, dpi = 0; int finish = 0; int state = 0; int x = 0, y = 0; /* shut warning down */ int lastx, lasty; + char *resources; coutput = &disp->coutput; memset(coutput, 0, sizeof(*coutput)); @@ -276,14 +291,33 @@ return -1; } + XrmInitialize(); + disp->dpy = dpy; disp->scr = scr = DefaultScreen(dpy); screen = ScreenOfDisplay(dpy, scr); - /* 25.4mm per inch */ - dpi_x = ((double) DisplayWidth(dpy, scr) * 25.4) / DisplayWidthMM(dpy, scr); - dpi_y = ((double) DisplayHeight(dpy, scr) * 25.4) / DisplayHeightMM(dpy, scr); - dpi = (dpi_x + dpi_y) / 2; + /* Get DPI from xft, most often configured properly by users */ + resources = XResourceManagerString(dpy); + if (resources) { + XrmDatabase database = XrmGetStringDatabase(resources); + char *type; + XrmValue value; + + if (XrmGetResource(database, "Xft.dpi", "Xft.dpi", &type, &value)) + if (type && strcmp(type, "String") == 0) + dpi = atoi(value.addr); + + XrmDestroyDatabase(database); + } + + if (dpi == 0) { + /* Fallback to value set by X server, but very often hardwired to 96dpi :/ */ + /* 25.4mm per inch */ + dpi_x = ((double) DisplayWidth(dpy, scr) * 25.4) / DisplayWidthMM(dpy, scr); + dpi_y = ((double) DisplayHeight(dpy, scr) * 25.4) / DisplayHeightMM(dpy, scr); + dpi = (dpi_x + dpi_y) / 2; + } /* Original values for fontsize/gridsize were tuned for 96dpi */ coutput->loutput->fontsize = (coutput->loutput->fontsize * dpi) / 96; @@ -303,7 +337,7 @@ screen_height = loutput->height; disp->top = top = XCreateSimpleWindow(dpy, root, 0, 0, screen_width, screen_height, 0, WhitePixel(dpy, scr), WhitePixel(dpy, scr)); - XStoreName(dpy, top, "lstopo"); + XStoreName(dpy, top, loutput->title); XSetIconName(dpy, top, "lstopo"); XSelectInput(dpy,top, StructureNotifyMask | KeyPressMask); @@ -324,6 +358,8 @@ disp->scale = disp->last_scale = 1.0f; /* TODO: if window got truncated, scale down? */ disp->needs_redraw = 0; + disp->needs_resize = 0; + disp->auto_resize = 1; x11_create(disp, loutput->width, loutput->height); @@ -400,56 +436,57 @@ KeySym keysym; XLookupString(&e.xkey, NULL, 0, &keysym, NULL); switch (keysym) { - case XK_q: - case XK_Q: - case XK_Escape: - finish = 1; - break; - case XK_Left: - disp->x -= disp->screen_width/10; - move_x11(disp); - break; - case XK_Right: - disp->x += disp->screen_width/10; - move_x11(disp); - break; - case XK_Up: - disp->y -= disp->screen_height/10; - move_x11(disp); - break; - case XK_Down: - disp->y += disp->screen_height/10; - move_x11(disp); - break; - case XK_Page_Up: - if (e.xkey.state & ControlMask) { - disp->x -= disp->screen_width; - move_x11(disp); - } else { - disp->y -= disp->screen_height; - move_x11(disp); - } - break; - case XK_Page_Down: - if (e.xkey.state & ControlMask) { - disp->x += disp->screen_width; - move_x11(disp); - } else { - disp->y += disp->screen_height; - move_x11(disp); - } - break; - case XK_Home: - disp->x = 0; - disp->y = 0; - move_x11(disp); - break; - case XK_End: - disp->x = INT_MAX; - disp->y = INT_MAX; - move_x11(disp); - break; + case XK_q: + case XK_Q: + case XK_Escape: + finish = 1; + break; + case XK_Left: + disp->x -= disp->screen_width/10; + move_x11(disp); + break; + case XK_Right: + disp->x += disp->screen_width/10; + move_x11(disp); + break; + case XK_Up: + disp->y -= disp->screen_height/10; + move_x11(disp); + break; + case XK_Down: + disp->y += disp->screen_height/10; + move_x11(disp); + break; + case XK_Page_Up: + if (e.xkey.state & ControlMask) { + disp->x -= disp->screen_width; + move_x11(disp); + } else { + disp->y -= disp->screen_height; + move_x11(disp); + } + break; + case XK_Page_Down: + if (e.xkey.state & ControlMask) { + disp->x += disp->screen_width; + move_x11(disp); + } else { + disp->y += disp->screen_height; + move_x11(disp); + } + break; + case XK_Home: + disp->x = 0; + disp->y = 0; + move_x11(disp); + break; + case XK_End: + disp->x = INT_MAX; + disp->y = INT_MAX; + move_x11(disp); + break; case XK_F: { + /* fit drawing to window, dont't resize the window */ float wscale = disp->screen_width / (float)disp->width; float hscale = disp->screen_height / (float)disp->height; disp->scale *= wscale > hscale ? hscale : wscale; @@ -459,32 +496,48 @@ case XK_plus: case XK_KP_Add: disp->scale *= 1.2f; + disp->needs_resize = 1; move_x11(disp); break; case XK_minus: case XK_KP_Subtract: disp->scale /= 1.2f; + disp->needs_resize = 1; move_x11(disp); break; case XK_1: case XK_KP_1: disp->scale = 1.0f; + disp->needs_resize = 1; + move_x11(disp); + break; + case XK_r: + disp->needs_resize = 2; + move_x11(disp); + break; + case XK_R: + disp->auto_resize ^= 1; + printf("%s window autoresizing\n", disp->auto_resize ? "enabled" : "disabled"); + disp->needs_resize = 1; move_x11(disp); break; case XK_h: case XK_H: + case XK_question: lstopo_show_interactive_help(); break; case XK_a: loutput->show_attrs_enabled ^= 1; printf("%s object attributes\n", loutput->show_attrs_enabled ? "enabled" : "disabled"); disp->needs_redraw = 1; + disp->needs_resize = 1; move_x11(disp); break; case XK_t: loutput->show_text_enabled ^= 1; printf("%s object text\n", loutput->show_text_enabled ? "enabled" : "disabled"); disp->needs_redraw = 1; + disp->needs_resize = 1; move_x11(disp); break; case XK_i: @@ -504,6 +557,7 @@ abort(); } disp->needs_redraw = 1; + disp->needs_resize = 1; move_x11(disp); break; case XK_b: @@ -532,12 +586,14 @@ printf("factorizing and PCI collapsing enabled\n"); } disp->needs_redraw = 1; + disp->needs_resize = 1; move_x11(disp); break; case XK_l: loutput->legend ^= 1; printf("%s legend\n", loutput->legend ? "enabled" : "disabled"); disp->needs_redraw = 1; + disp->needs_resize = 1; move_x11(disp); break; case XK_E: diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-draw.c hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-draw.c --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-draw.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-draw.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2013, 2015 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -29,6 +29,9 @@ #define DARKER_EPOXY_G_COLOR ((DARK_EPOXY_G_COLOR * 100) / 110) #define DARKER_EPOXY_B_COLOR ((DARK_EPOXY_B_COLOR * 100) / 110) +#ifdef HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif /* each of these colors must be declared in declare_colors() */ struct lstopo_color BLACK_COLOR = { 0, 0, 0, 0 }; struct lstopo_color WHITE_COLOR = { 0xff, 0xff, 0xff, 0 }; @@ -47,6 +50,9 @@ struct lstopo_color PCI_DEVICE_COLOR = { DARKER_EPOXY_R_COLOR, DARKER_EPOXY_G_COLOR, DARKER_EPOXY_B_COLOR, 0 }; struct lstopo_color OS_DEVICE_COLOR = { 0xde, 0xde, 0xde, 0 }; struct lstopo_color BRIDGE_COLOR = { 0xff, 0xff, 0xff, 0 }; +#ifdef HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS +#pragma GCC diagnostic warning "-Wmissing-field-initializers" +#endif static struct lstopo_color *colors = NULL; @@ -540,6 +546,12 @@ orient = LSTOPO_ORIENT_HORIZ; } + /* if there are memory children and using plain children layout, use horizontal by default */ + if (orient == LSTOPO_ORIENT_NONE + && parent->memory_arity + && loutput->plain_children_order) + orient = LSTOPO_ORIENT_HORIZ; + /* recurse into children to prepare their sizes, * and check whether all normal children are PUs. */ normal_children_are_PUs = (parent->arity > 0); @@ -708,10 +720,20 @@ char totmemstr[64] = ""; int attrlen; - /* For OSDev, Misc and Group, name replaces type+index+attrs */ - if (obj->name && (obj->type == HWLOC_OBJ_OS_DEVICE || obj->type == HWLOC_OBJ_MISC || obj->type == HWLOC_OBJ_GROUP)) { + /* For Misc and Group, name replaces type+index+attrs */ + if (obj->name && (obj->type == HWLOC_OBJ_MISC || obj->type == HWLOC_OBJ_GROUP)) { return snprintf(text, textlen, "%s", obj->name); } + /* For OSDev, OSDev-type+name replaces type+index+attrs */ + if (obj->type == HWLOC_OBJ_OS_DEVICE) { + /* consider the name as an index and remove it if LSTOPO_INDEX_TYPE_NONE */ + if (index_type != LSTOPO_INDEX_TYPE_NONE) { + hwloc_obj_type_snprintf(typestr, sizeof(typestr), obj, 0); + return snprintf(text, textlen, "%s %s", typestr, obj->name); + } else { + return hwloc_obj_type_snprintf(text, textlen, obj, 0); + } + } /* subtype replaces the basic type name */ if (obj->subtype) { @@ -1007,22 +1029,6 @@ "%s MP x (%s cores + %s kB)", value, value2, value3); } - } else if (!strcmp(obj->subtype, "MIC")) { - /* MIC */ - const char *value; - value = hwloc_obj_get_info_by_name(obj, "MICActiveCores"); - if (value) { - snprintf(lud->text[lud->ntext++].text, sizeof(lud->text[0].text), - "%s cores", value); - } - value = hwloc_obj_get_info_by_name(obj, "MICMemorySize"); - if (value) { - unsigned long long mb = strtoull(value, NULL, 10) / 1024; - snprintf(lud->text[lud->ntext++].text, sizeof(lud->text[0].text), - mb >= 10240 ? "%llu GB" : "%llu MB", - mb >= 10240 ? mb/1024 : mb); - } - } else if (!strcmp(obj->subtype, "OpenCL")) { /* OpenCL */ const char *value; @@ -1225,7 +1231,7 @@ lud->width = gridsize*5; /* space, box, space, box, space */ lud->height = gridsize*2 + linespacing + fontsize + gridsize; /* space, box, linespace, text, gridsize */ sprintf(lud->text[0].text, "%ux total", level->parent->arity); - n = strlen(lud->text[0].text); + n = (unsigned)strlen(lud->text[0].text); textwidth = get_textwidth(loutput, lud->text[0].text, n, fontsize); lud->text[0].width = textwidth; if (textwidth > lud->width) { @@ -1447,9 +1453,9 @@ #else /* HAVE_STRFTIME */ { char *date; - int n; + unsigned n; date = ctime(&t); - n = strlen(date); + n = (unsigned) strlen(date); if (n && date[n-1] == '\n') { date[n-1] = 0; } diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo.h hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo.h --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo.h 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo.h 2020-03-30 18:07:31.000000000 +0000 @@ -73,6 +73,7 @@ int show_taskset; /* draw config */ + char title[256]; unsigned plain_children_order; unsigned int gridsize, fontsize, linespacing; float text_xscale; @@ -236,7 +237,7 @@ static __hwloc_inline int lstopo_busid_snprintf(struct lstopo_output *loutput, char *text, size_t textlen, hwloc_obj_t firstobj, int collapse, unsigned needdomain) { hwloc_obj_t lastobj; - char domain[6] = ""; + char domain[10] = ""; unsigned i; if (needdomain) diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-no-graphics.1in hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-no-graphics.1in --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-no-graphics.1in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-no-graphics.1in 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" Copyright © 2009-2019 Inria. All rights reserved. +.\" Copyright © 2009-2020 Inria. All rights reserved. .\" Copyright © 2009-2010 Université of Bordeaux .\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. .\" See COPYING in top-level directory. @@ -218,19 +218,19 @@ Do not show any I/O device or bridge. This is identical to \fB\-\-filter io:none\fR. By default, common devices (GPUs, NICs, block devices, ...) and -interesting bridges are shown. +interesting bridges/switches are shown. .TP \fB\-\-no\-bridges\fB Do not show any I/O bridge except hostbridges. This is identical to \fB\-\-filter bridge:none\fR. By default, common devices (GPUs, NICs, block devices, ...) and -interesting bridges are shown. +interesting bridges/switches are shown. .TP \fB\-\-whole\-io\fB Show all I/O devices and bridges. This is identical to \fB\-\-filter io:all\fR. By default, only common devices (GPUs, NICs, block devices, ...) and -interesting bridges are shown. +interesting bridges/switches are shown. .TP \fB\-\-thissystem\fR Assume that the selected backend provides the topology for the @@ -268,9 +268,11 @@ memory children are listed below their parent just like any other child. PUs are therefore on the side of their local NUMA nodes, below a common ancestor. + +See also the GRAPHICAL OUTPUT section below. .TP \fB\-\-fontsize\fR -Set size of text font. +Set the size of text font in the graphical output. The default is 10. @@ -281,14 +283,14 @@ The \fB\-\-fontsize\fR option is ignored in the ASCII backend. .TP \fB\-\-gridsize\fR -Set size of margin between elements. +Set the margin between elements in the graphical output. The default is 7. It was 10 prior to hwloc 2.1. This option is ignored in the ASCII backend. .TP \fB\-\-linespacing\fR -Set spacing between lines of text. +Set the spacing between lines of text in the graphical output. The default is 4. @@ -297,20 +299,20 @@ This option is ignored in the ASCII backend. .TP \fB\-\-horiz\fR, \fB\-\-horiz\fR= -Horizontal graphical layout instead of nearly 4/3 ratio. +Force a horizontal graphical layout instead of nearly 4/3 ratio in the graphical output. If a comma-separated list of object types is given, the layout only -applies to the corresponding container objects. +applies to the corresponding \fIcontainer\fR objects. Ignored for bridges since their children are always vertically aligned. .TP \fB\-\-vert\fR, \fB\-\-vert\fR= -Vertical graphical layout instead of nearly 4/3 ratio. +Force a vertical graphical layout instead of nearly 4/3 ratio in the graphical output. If a comma-separated list of object types is given, the layout only -applies to the corresponding container objects. +applies to the corresponding \fIcontainer\fR objects. .TP \fB\-\-rect\fR, \fB\-\-rect\fR= -Rectangular graphical layout with nearly 4/3 ratio. +Force a rectangular graphical layout with nearly 4/3 ratio in the graphical output. If a comma-separated list of object types is given, the layout only -applies to the corresponding container objects. +applies to the corresponding \fIcontainer\fR objects. Ignored for bridges since their children are always vertically aligned. .TP \fB\-\-no\-text\fR, \fB\-\-no\-text=\fR @@ -344,22 +346,22 @@ (if they were previously disabled with \fB\-\-no\-attrs\fR). .TP \fB\-\-no\-legend\fR -Remove the text legend at the bottom. +Remove the text legend at the bottom of the graphical output. .TP \fB\-\-append\-legend\fB -Append the line of text to the bottom of the legend in graphical mode. +Append the line of text to the bottom of the legend in the graphical output. If the line is too long, it will be truncated in the output. If adding multiple lines, each line should be given separately by passing this option multiple times. .TP \fB\-\-binding\-color none -Do not colorize PUs and NUMA nodes according to the binding. +Do not colorize PUs and NUMA nodes according to the binding in the graphical output. .TP \fB\-\-disallowed\-color none -Do not colorize disallowed PUs and NUMA nodes. +Do not colorize disallowed PUs and NUMA nodes in the graphical output. .TP \fB\-\-top\-color -Do not colorize task objects when \-\-top is given, +Do not colorize task objects in the graphical output when \-\-top is given, or change the background color. .TP \fB\-\-version\fR @@ -507,6 +509,67 @@ graphical output formats are supported in your hwloc installation. . .\" ************************** +.\" Graphical Section +.\" ************************** +. +.SH GRAPHICAL OUTPUT +The graphical output is made of nested boxes representing +the inclusion of objects in the hierarchy of resources. +Usually a Machine box contains one or several Package boxes, +that contain multiple Core boxes, with one or several PUs each. + +.SS Caches +Caches are displayed in a slightly different manner because +they do not actually include computing resources such as cores. +For instance, a L2 Cache shared by a pair of Cores is drawn +as a Cache box on top of two Core boxes +(instead of having Core boxes inside the Cache box). + +.SS NUMA nodes and Memory-side Caches +By default, NUMA nodes boxes are drawn on top of their local +computing resources. +For instance, a processor Package containing one NUMA node +and four Cores is displayed as a Package box containing +the NUMA node box above four Core boxes. +If a NUMA node is local to the L3 Cache, the NUMA node is displayed +above that Cache box. +All this specific drawing strategy for memory objects may be disabled +by passing command-line option \fB\-\-children\-order plain\fR. + +If multiple NUMA nodes are attached to the same parent object, +they are displayed inside an additional unnamed memory box. + +If some Memory-side Caches exist in front of some NUMA nodes, +they are drawn as boxes immediately above them. + +.SS PCI bridges, PCI devices and OS devices +The PCI hierarchy is not drawn as a set of included boxes but rather +as a tree of bridges (that may actually be switches) with links between them. +The tree starts with a small square on the left for the +hostbridge or root complex. +It ends with PCI device boxes on the right. +Intermediate PCI bridges/switches may appear as additional small +squares in the middle. + +PCI devices on the right of the tree are boxes containing +their PCI bus ID (such as 00:02.3). +They may also contain sub-boxes for OS device objects +such as a network interface \fIeth0\fR or a CUDA GPU \fIcuda0\fR. + +The datarate of a PCI link may be written (in GB/s) right below +its drawn line (if the operating system and/or libraries are able +to report that information). +This datarate is the currently configured PCI datarate. +It may change during execution since some devices are able to +slow their PCI links down when idle. + +When there is a single link (horizontal line) on the right of a +PCI bridge, it means that a single device or bridge is connected +on the secondary PCI bus behind that bridge. +When there is a vertical line, it means that multiple devices +and/or bridges are connected to the same secondary PCI bus. + +.\" ************************** .\" Colors Section .\" ************************** .SH COLORS diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-shmem.c hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-shmem.c --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-shmem.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-shmem.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 Inria. All rights reserved. + * Copyright © 2018-2020 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -133,7 +133,7 @@ close(fd); - printf("Exported shmem topology to %s for mmap address 0x%lx length %lu\n", filename, loutput->shmem_output_addr, (unsigned long) shmem_length); + printf("Exported shmem topology to %s for mmap address 0x%llx length %lu\n", filename, (unsigned long long) loutput->shmem_output_addr, (unsigned long) shmem_length); return 0; } diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-text.c hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-text.c --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-text.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-text.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -225,14 +225,17 @@ if (!err) { for(j=0; jkind & HWLOC_DISTANCES_KIND_MEANS_LATENCY) ? "latency" : (dist[j]->kind & HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH) ? "bandwidth" : "distance"; + const char *name = hwloc_distances_get_name(topology, dist[j]); + if (!name) + name = "(null)"; if (dist[j]->kind & HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES) { fprintf(output, "Relative %s matrix (name %s kind %lu) between %u heterogeneous objects by %s indexes:\n", - kindmeans, hwloc_distances_get_name(topology, dist[j]), dist[j]->kind, + kindmeans, name, dist[j]->kind, dist[j]->nbobjs, index_type != LSTOPO_INDEX_TYPE_PHYSICAL ? "logical" : "physical"); } else { fprintf(output, "Relative %s matrix (name %s kind %lu) between %u %ss (depth %d) by %s indexes:\n", - kindmeans, hwloc_distances_get_name(topology, dist[j]), dist[j]->kind, + kindmeans, name, dist[j]->kind, dist[j]->nbobjs, hwloc_obj_type_string(dist[j]->objs[0]->type), dist[j]->objs[0]->depth, diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-windows.c hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-windows.c --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/lstopo-windows.c 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/lstopo-windows.c 2020-03-30 18:07:31.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2019 Inria. All rights reserved. + * Copyright © 2009-2020 Inria. All rights reserved. * Copyright © 2009-2010, 2012 Université Bordeaux * Copyright © 2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -37,6 +37,9 @@ static int win_width, win_height; static unsigned int the_fontsize, the_gridsize; static float the_scale; +static int auto_resize; +static int needs_resize; +static int ignore_wm_size; static void windows_box(struct lstopo_output *loutput, const struct lstopo_color *lcolor, unsigned depth __hwloc_attribute_unused, unsigned x, unsigned width, unsigned y, unsigned height, hwloc_obj_t obj __hwloc_attribute_unused, unsigned box_id __hwloc_attribute_unused); @@ -53,12 +56,17 @@ case '+': the_scale *= 1.2f; redraw = 1; + if (auto_resize) + needs_resize = 1; break; case '-': the_scale /= 1.2f; redraw = 1; + if (auto_resize) + needs_resize = 1; break; case 'F': { + /* fit drawing to window, don't resize the window */ float wscale, hscale; wscale = win_width / (float)the_width; hscale = win_height / (float)the_height; @@ -69,16 +77,31 @@ case '1': the_scale = 1.0; redraw = 1; + if (auto_resize) + needs_resize = 1; + break; + case 'r': + needs_resize = 1; /* forced */ + break; + case 'R': + auto_resize ^= 1; + if (auto_resize) + needs_resize = 1; + printf("%s window autoresizing\n", auto_resize ? "enabled" : "disabled"); break; case 'a': loutput->show_attrs_enabled ^= 1; printf("%s object attributes\n", loutput->show_attrs_enabled ? "enabled" : "disabled"); redraw = 1; + if (auto_resize) + needs_resize = 1; break; case 't': loutput->show_text_enabled ^= 1; printf("%s object text\n", loutput->show_text_enabled ? "enabled" : "disabled"); redraw = 1; + if (auto_resize) + needs_resize = 1; break; case 'i': if (loutput->index_type == LSTOPO_INDEX_TYPE_DEFAULT) { @@ -97,6 +120,8 @@ abort(); } redraw = 1; + if (auto_resize) + needs_resize = 1; break; case 'd': loutput->show_disallowed ^= 1; @@ -112,6 +137,8 @@ loutput->legend ^= 1; printf("%s legend\n", loutput->legend ? "enabled" : "disabled"); redraw = 1; + if (auto_resize) + needs_resize = 1; break; case 'f': /* alternate between factorize+collapse, collapse only, and none */ @@ -127,6 +154,8 @@ printf("factorizing and PCI collapsing enabled\n"); } redraw = 1; + if (auto_resize) + needs_resize = 1; break; case 'E': lstopo_show_interactive_cli_options(loutput); @@ -134,6 +163,7 @@ break; case 'h': case 'H': + case '?': lstopo_show_interactive_help(); break; case 'q': @@ -146,17 +176,43 @@ case WM_PAINT: { HFONT font; +#ifdef HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif struct lstopo_color white = {0xff, 0xff, 0xff}; +#ifdef HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS +#pragma GCC diagnostic warning "-Wmissing-field-initializers" +#endif BeginPaint(hwnd, &the_output.ps); font = CreateFont(loutput->fontsize, 0, 0, 0, 0, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, NULL); SelectObject(the_output.ps.hdc, (HGDIOBJ) font); SetBkMode(the_output.ps.hdc, TRANSPARENT); - windows_box(loutput, &white, 0, 0, win_width, 0, win_height, NULL, 0); loutput->drawing = LSTOPO_DRAWING_PREPARE; output_draw(loutput); the_width = loutput->width; the_height = loutput->height; + + /* now that we computed the new drawing size, resize the window if needed */ + if (needs_resize) { + RECT rect; + x_delta = 0; + y_delta = 0; + rect.top = 0; + rect.left = 0; + rect.right = the_width; + rect.bottom = the_height; + AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); + + /* SetWindowPos() generates a WM_SIZE event, we don't want to scale the drawing there */ + ignore_wm_size = 1; + SetWindowPos(the_output.toplevel, HWND_TOP, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_DEFERERASE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER); + ignore_wm_size = 0; + + needs_resize = 0; + } + loutput->drawing = LSTOPO_DRAWING_DRAW; + windows_box(loutput, &white, 0, 0, win_width, 0, win_height, NULL, 0); output_draw(loutput); DeleteObject(font); EndPaint(hwnd, &the_output.ps); @@ -250,18 +306,24 @@ PostQuitMessage(0); return 0; case WM_SIZE: { - float wscale, hscale; win_width = LOWORD(lparam); win_height = HIWORD(lparam); - wscale = win_width / (float)the_width; - hscale = win_height / (float)the_height; - the_scale *= wscale > hscale ? hscale : wscale; - if (the_scale < 1.0f) - the_scale = 1.0f; - redraw = 1; + if (!ignore_wm_size) { + float wscale, hscale; + wscale = win_width / (float)the_width; + hscale = win_height / (float)the_height; + the_scale *= wscale > hscale ? hscale : wscale; + if (the_scale < 1.0f) + the_scale = 1.0f; + redraw = 1; + } break; } } + if (needs_resize) { + /* force a redraw since resizing occurs during redraw */ + redraw = 1; + } if (redraw) { if (x_delta > the_width - win_width) x_delta = the_width - win_width; @@ -356,6 +418,7 @@ unsigned width, height; HFONT font; MSG msg; + RECT rect; memset(&the_output, 0, sizeof(the_output)); the_output.loutput = loutput; @@ -377,7 +440,7 @@ /* recurse once for preparing sizes and positions using a fake top level window */ loutput->drawing = LSTOPO_DRAWING_PREPARE; - faketoplevel = CreateWindow("lstopo", "lstopo", WS_OVERLAPPEDWINDOW, + faketoplevel = CreateWindow("lstopo", loutput->title, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, NULL, NULL, NULL, NULL); BeginPaint(faketoplevel, &the_output.ps); @@ -393,16 +456,22 @@ width = loutput->width; height = loutput->height; - win_width = width + 2*GetSystemMetrics(SM_CXSIZEFRAME); - win_height = height + 2*GetSystemMetrics(SM_CYSIZEFRAME) + GetSystemMetrics(SM_CYCAPTION); + /* compute the window dimensions with borders/title/... */ + rect.top = 0; + rect.left = 0; + rect.right = width; + rect.bottom = height; + AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); + win_width = rect.right - rect.left; + win_height = rect.bottom - rect.top; + /* don't make it bigger than the screen */ if (win_width > GetSystemMetrics(SM_CXFULLSCREEN)) win_width = GetSystemMetrics(SM_CXFULLSCREEN); - if (win_height > GetSystemMetrics(SM_CYFULLSCREEN)) win_height = GetSystemMetrics(SM_CYFULLSCREEN); - toplevel = CreateWindow("lstopo", "lstopo", WS_OVERLAPPEDWINDOW, + toplevel = CreateWindow("lstopo", loutput->title, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, win_width, win_height, NULL, NULL, NULL, NULL); the_output.toplevel = toplevel; @@ -415,6 +484,10 @@ the_fontsize = loutput->fontsize; the_gridsize = loutput->gridsize; + auto_resize = 1; + needs_resize = 0; + ignore_wm_size = 0; + /* and display the window */ ShowWindow(toplevel, SW_SHOWDEFAULT); diff -Nru hwloc-contrib-2.1.0+dfsg/utils/lstopo/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/lstopo/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/lstopo/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/lstopo/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -561,6 +561,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -575,6 +576,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -252,6 +252,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -266,6 +267,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/netloc/draw/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/netloc/draw/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/netloc/draw/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/netloc/draw/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -274,6 +274,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -288,6 +289,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/netloc/infiniband/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/netloc/infiniband/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/netloc/infiniband/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/netloc/infiniband/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -265,6 +265,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -279,6 +280,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/netloc/mpi/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/netloc/mpi/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/netloc/mpi/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/netloc/mpi/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -264,6 +264,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -278,6 +279,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/utils/netloc/scotch/Makefile.in hwloc-contrib-2.2.0+dfsg/utils/netloc/scotch/Makefile.in --- hwloc-contrib-2.1.0+dfsg/utils/netloc/scotch/Makefile.in 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/utils/netloc/scotch/Makefile.in 2020-03-30 18:07:31.000000000 +0000 @@ -244,6 +244,7 @@ HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ HWLOC_DIFF_U = @HWLOC_DIFF_U@ HWLOC_DIFF_W = @HWLOC_DIFF_W@ +HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ @@ -258,6 +259,7 @@ HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ +HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ HWLOC_MS_LIB = @HWLOC_MS_LIB@ HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ diff -Nru hwloc-contrib-2.1.0+dfsg/VERSION hwloc-contrib-2.2.0+dfsg/VERSION --- hwloc-contrib-2.1.0+dfsg/VERSION 2019-10-13 16:41:47.000000000 +0000 +++ hwloc-contrib-2.2.0+dfsg/VERSION 2020-03-30 18:07:31.000000000 +0000 @@ -8,7 +8,7 @@ # Please update HWLOC_VERSION* in contrib/windows/hwloc_config.h too. major=2 -minor=1 +minor=2 release=0 # greek is used for alpha or beta release tags. If it is non-empty, @@ -22,7 +22,7 @@ # The date when this release was created -date="Sep 30, 2019" +date="Mar 30, 2020" # If snapshot=1, then use the value from snapshot_version as the # entire hwloc version (i.e., ignore major, minor, release, and @@ -41,7 +41,7 @@ # 2. Version numbers are described in the Libtool current:revision:age # format. -libhwloc_so_version=16:0:1 +libhwloc_so_version=17:0:2 libnetloc_so_version=0:0:0 # Please also update the lines in contrib/windows/libhwloc.vcxproj