From 7a263b508cb437cc9ae5b7b976d1e2a3075045d1 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 21 Jun 2022 16:47:30 +0200 Subject: [PATCH 01/36] VERSION: prepare for 2.8rc1 Bump soname to 21:0:6 (vs 20:3:5 for 2.7.1), Reuse AM 1.16.5 and AC 2.71, but bump LT to 2.4.7. Signed-off-by: Brice Goglin --- VERSION | 4 ++-- contrib/android/AndroidApp/lstopo/build.gradle | 2 +- contrib/android/include/hwloc/autogen/config.h | 6 +++--- contrib/dist/make_dist_tarball | 8 ++++---- contrib/windows/hwloc_config.h | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/VERSION b/VERSION index 7edb358a28..dd3ebb0ebe 100644 --- a/VERSION +++ b/VERSION @@ -18,7 +18,7 @@ release=0 # requirement is that it must be entirely printable ASCII characters # and have no white space. -greek=a1 +greek=rc1 # The date when this release was created @@ -41,7 +41,7 @@ snapshot_version=${major}.${minor}.${release}${greek}-git # 2. Version numbers are described in the Libtool current:revision:age # format. -libhwloc_so_version=0:0:0 +libhwloc_so_version=21:0:6 libnetloc_so_version=0:0:0 # Please also update the lines in contrib/windows/libhwloc.vcxproj diff --git a/contrib/android/AndroidApp/lstopo/build.gradle b/contrib/android/AndroidApp/lstopo/build.gradle index 21212664d0..2ca5324875 100644 --- a/contrib/android/AndroidApp/lstopo/build.gradle +++ b/contrib/android/AndroidApp/lstopo/build.gradle @@ -11,7 +11,7 @@ android { // Official hwloc version - snapshot number - android apk version // Set snapshot number to 1 when the hwloc version is increased. // Increase the snapshot number when the hwloc code changed but not its version - versionName "2.8.0a1-1-1.5.1" + versionName "2.8.0rc1-1-1.5.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { diff --git a/contrib/android/include/hwloc/autogen/config.h b/contrib/android/include/hwloc/autogen/config.h index c787e4fd63..0126ee4c99 100644 --- a/contrib/android/include/hwloc/autogen/config.h +++ b/contrib/android/include/hwloc/autogen/config.h @@ -1,7 +1,7 @@ /* include/hwloc/autogen/config.h. Generated from config.h.in by configure. */ /* -*- c -*- * Copyright © 2009 CNRS - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2022 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -12,11 +12,11 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.8.0a1" +#define HWLOC_VERSION "2.8.0rc1" #define HWLOC_VERSION_MAJOR 2 #define HWLOC_VERSION_MINOR 8 #define HWLOC_VERSION_RELEASE 0 -#define HWLOC_VERSION_GREEK "a1" +#define HWLOC_VERSION_GREEK "rc1" #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) # define __hwloc_restrict __restrict diff --git a/contrib/dist/make_dist_tarball b/contrib/dist/make_dist_tarball index 7565e0edd4..abd3234951 100755 --- a/contrib/dist/make_dist_tarball +++ b/contrib/dist/make_dist_tarball @@ -11,7 +11,7 @@ # Copyright © 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright © 2008-2013 Cisco Systems, Inc. All rights reserved. -# Copyright © 2012-2018 Inria. All rights reserved. +# Copyright © 2012-2022 Inria. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -27,9 +27,9 @@ # Version of auto tools that we want # -AM_TARGET_VERSION=1.14.1 -AC_TARGET_VERSION=2.69 -LT_TARGET_VERSION=2.4.2 +AM_TARGET_VERSION=1.16.5 +AC_TARGET_VERSION=2.71 +LT_TARGET_VERSION=2.4.7 # # First things first -- check that the auto versions that we have are diff --git a/contrib/windows/hwloc_config.h b/contrib/windows/hwloc_config.h index bfdc1716e3..9d3e658dec 100644 --- a/contrib/windows/hwloc_config.h +++ b/contrib/windows/hwloc_config.h @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2022 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,11 +11,11 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.8.0a1" +#define HWLOC_VERSION "2.8.0rc1" #define HWLOC_VERSION_MAJOR 2 #define HWLOC_VERSION_MINOR 8 #define HWLOC_VERSION_RELEASE 0 -#define HWLOC_VERSION_GREEK "a1" +#define HWLOC_VERSION_GREEK "rc1" #define __hwloc_restrict #define __hwloc_inline __inline From 197493246fef0d0d8e06c72f1baa595efb3b4990 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 18 Dec 2017 11:37:23 +0100 Subject: [PATCH 02/36] configure: disable netloc by default in 2.8 Still too experimental, might get removed if we don't find some manpower to revive it And also disable netloc in sonarscanner job Signed-off-by: Brice Goglin (cherry picked from commit 2082c24712dec620d3fac34f1728c4a72efa378d and 15a927b97d07cb9a9334ce3966cc27af34e2ec58) (cherry picked from commit eddcbcfe6455360858ce599a6aca5c3acc63d311) (cherry picked from commit 30075ab0d743766b5678c331a3d3d913d05a4da7) (cherry picked from commit 29af441e276ab7886c9ecfd9d91afb76bb44b311) (cherry picked from commit dfab43ec865c15e2e6ee92fb92dee1973031d0e9) (cherry picked from commit 4fcdc9347a808fc0f1f3f0920a881d836304178d) (cherry picked from commit b2eff2be6def48b9928cf7fff39bb316ff43413c) Signed-off-by: Brice Goglin --- configure.ac | 4 ++-- contrib/ci.inria.fr/job-3-sonarscanner.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index f1165aa0cb..efad7cc12b 100644 --- a/configure.ac +++ b/configure.ac @@ -141,10 +141,10 @@ AC_SUBST([libnetloc_so_version]) AC_ARG_ENABLE([netloc], [AS_HELP_STRING([--enable-netloc], - [The Netloc functionality is enabled by default, but will be silently skipped it if cannot be built (e.g., not supported on your platform). Using --enable-netloc will cause configure to abort if Netloc cannot be build. Using --disable-netloc will cause configure to skip attempting to build netloc at all.]) + [The Netloc functionality is disabled by default. Using --enable-netloc will cause configure to abort if Netloc cannot be build (e.g., not supported on your platform).]) ]) -AS_IF([test "$enable_netloc" != "no" -a "$hwloc_mode" = "standalone"], +AS_IF([test "$enable_netloc" = "yes" -a "$hwloc_mode" = "standalone"], [NETLOC_SETUP_CORE([], [], [AS_IF([test "$enable_netloc" = "yes"], [AC_MSG_ERROR([Cannot build netloc core])]) diff --git a/contrib/ci.inria.fr/job-3-sonarscanner.sh b/contrib/ci.inria.fr/job-3-sonarscanner.sh index 8b017b7aa6..de3db149bb 100755 --- a/contrib/ci.inria.fr/job-3-sonarscanner.sh +++ b/contrib/ci.inria.fr/job-3-sonarscanner.sh @@ -78,7 +78,7 @@ scan-build -plist --intercept-first --analyze-headers -o analyzer_reports make | test x$NO_CHECK = xtrue || scan-build -plist --intercept-first --analyze-headers -o analyzer_reports make check | tee -a scan-build.log # Run cppcheck analysis -SOURCES_TO_ANALYZE="hwloc netloc tests utils" +SOURCES_TO_ANALYZE="hwloc tests utils" SOURCES_TO_EXCLUDE="-itests/hwloc/ports -ihwloc/topology-aix.c -ihwloc/topology-bgq.c -ihwloc/topology-darwin.c -ihwloc/topology-freebsd.c -ihwloc/topology-hpux.c -ihwloc/topology-netbsd.c -ihwloc/topology-solaris.c -ihwloc/topology-solaris-chiptype.c -ihwloc/topology-windows.c -ihwloc/topology-cuda.c -ihwloc/topology-gl.c -ihwloc/topology-nvml.c -ihwloc/topology-rsmi.c -ihwloc/topology-levelzero.c -ihwloc/topology-opencl.c -iutils/lstopo/lstopo-windows.c -iutils/lstopo/lstopo-android.c" CPPCHECK_INCLUDES="-Iinclude -Ihwloc -Iutils/lstopo -Iutils/hwloc" CPPCHECK="cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=purgedConfiguration --suppress=missingIncludeSystem ${CPPCHECK_INCLUDES}" @@ -156,7 +156,7 @@ sonar.projectVersion=$hwloc_branch sonar.scm.disabled=false # sonar.scm.provider=git requires sonar-scanner to run inside a git clone sonar.sourceEncoding=UTF-8 -sonar.sources=hwloc, netloc, tests, utils +sonar.sources=hwloc, tests, utils sonar.exclusions=tests/hwloc/ports/**,utils/netloc/draw/**,tests/hwloc/xml/*.xml sonar.c.clangsa.reportPath=analyzer_reports/*/*.plist sonar.c.errorRecoveryEnabled=true From 3c6fd18c4a9d6f26a4076d62c824acfca5b61283 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 21 Jun 2022 16:49:57 +0200 Subject: [PATCH 03/36] ci.inria.fr: move the v2.8 nightly build to a different time Reuse the timeslot of v2.3 which is unlikely to ever run again. Signed-off-by: Brice Goglin --- contrib/ci.inria.fr/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ci.inria.fr/Jenkinsfile b/contrib/ci.inria.fr/Jenkinsfile index 5e645a70e3..1179989f87 100644 --- a/contrib/ci.inria.fr/Jenkinsfile +++ b/contrib/ci.inria.fr/Jenkinsfile @@ -48,7 +48,7 @@ pipeline { // Trigger the build triggers { // extended/* jobs poll GitHub explicitly once per night, in case webhooks aren't used - pollSCM(isExtendedJob ? '0 3 * * *' : '') + pollSCM(isExtendedJob ? '30 4 * * *' : '') } stages { From b62ca679bf8d8186cb0842af2d6ec3a22220c1b8 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 28 Jun 2022 16:52:04 +0200 Subject: [PATCH 04/36] private/windows.h: guard against _ANONYMOUS_UNION/STRUCT redefinition It's already defined in Cygwin's /usr/include/w32api/_mingw.h Signed-off-by: Brice Goglin (cherry picked from commit c91712ebcf6109a42ffe7527f09108a33c6274bd) --- include/private/windows.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/private/windows.h b/include/private/windows.h index 0a061b0942..cb3e0d62c8 100644 --- a/include/private/windows.h +++ b/include/private/windows.h @@ -1,6 +1,6 @@ /* * Copyright © 2009 Université Bordeaux - * Copyright © 2020 Inria. All rights reserved. + * Copyright © 2020-2022 Inria. All rights reserved. * * See COPYING in top-level directory. */ @@ -8,13 +8,22 @@ #ifndef HWLOC_PRIVATE_WINDOWS_H #define HWLOC_PRIVATE_WINDOWS_H +#ifndef _ANONYMOUS_UNION #ifdef __GNUC__ #define _ANONYMOUS_UNION __extension__ -#define _ANONYMOUS_STRUCT __extension__ #else #define _ANONYMOUS_UNION +#endif /* __GNUC__ */ +#endif /* _ANONYMOUS_UNION */ + +#ifndef _ANONYMOUS_STRUCT +#ifdef __GNUC__ +#define _ANONYMOUS_STRUCT __extension__ +#else #define _ANONYMOUS_STRUCT #endif /* __GNUC__ */ +#endif /* _ANONYMOUS_STRUCT */ + #define DUMMYUNIONNAME #define DUMMYSTRUCTNAME From 1f746c0aad15e2ef7b46ca51802e23d5b5fc72b4 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 29 Jun 2022 13:32:36 +0200 Subject: [PATCH 05/36] VERSION: 2.8.0rc1 released, doing rc2 now Signed-off-by: Brice Goglin --- VERSION | 2 +- contrib/android/AndroidApp/lstopo/build.gradle | 2 +- contrib/android/include/hwloc/autogen/config.h | 4 ++-- contrib/windows/hwloc_config.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index dd3ebb0ebe..ac3ef818e0 100644 --- a/VERSION +++ b/VERSION @@ -18,7 +18,7 @@ release=0 # requirement is that it must be entirely printable ASCII characters # and have no white space. -greek=rc1 +greek=rc2 # The date when this release was created diff --git a/contrib/android/AndroidApp/lstopo/build.gradle b/contrib/android/AndroidApp/lstopo/build.gradle index 2ca5324875..fcb7488f3e 100644 --- a/contrib/android/AndroidApp/lstopo/build.gradle +++ b/contrib/android/AndroidApp/lstopo/build.gradle @@ -11,7 +11,7 @@ android { // Official hwloc version - snapshot number - android apk version // Set snapshot number to 1 when the hwloc version is increased. // Increase the snapshot number when the hwloc code changed but not its version - versionName "2.8.0rc1-1-1.5.1" + versionName "2.8.0rc2-1-1.5.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { diff --git a/contrib/android/include/hwloc/autogen/config.h b/contrib/android/include/hwloc/autogen/config.h index 0126ee4c99..881a623dc7 100644 --- a/contrib/android/include/hwloc/autogen/config.h +++ b/contrib/android/include/hwloc/autogen/config.h @@ -12,11 +12,11 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.8.0rc1" +#define HWLOC_VERSION "2.8.0rc2" #define HWLOC_VERSION_MAJOR 2 #define HWLOC_VERSION_MINOR 8 #define HWLOC_VERSION_RELEASE 0 -#define HWLOC_VERSION_GREEK "rc1" +#define HWLOC_VERSION_GREEK "rc2" #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) # define __hwloc_restrict __restrict diff --git a/contrib/windows/hwloc_config.h b/contrib/windows/hwloc_config.h index 9d3e658dec..6264c54f59 100644 --- a/contrib/windows/hwloc_config.h +++ b/contrib/windows/hwloc_config.h @@ -11,11 +11,11 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.8.0rc1" +#define HWLOC_VERSION "2.8.0rc2" #define HWLOC_VERSION_MAJOR 2 #define HWLOC_VERSION_MINOR 8 #define HWLOC_VERSION_RELEASE 0 -#define HWLOC_VERSION_GREEK "rc1" +#define HWLOC_VERSION_GREEK "rc2" #define __hwloc_restrict #define __hwloc_inline __inline From cf388b05e69554d5e58c3ae271b9a2996002ca02 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 5 Jul 2022 11:27:49 +0200 Subject: [PATCH 06/36] VERSION: 2.8.0 released, doing 2.8.1rc1 now Signed-off-by: Brice Goglin --- VERSION | 4 ++-- contrib/android/AndroidApp/lstopo/build.gradle | 2 +- contrib/android/include/hwloc/autogen/config.h | 6 +++--- contrib/windows-cmake/CMakeLists.txt | 2 +- contrib/windows/hwloc_config.h | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index ac3ef818e0..6b41b2fbd6 100644 --- a/VERSION +++ b/VERSION @@ -9,7 +9,7 @@ major=2 minor=8 -release=0 +release=1 # greek is used for alpha or beta release tags. If it is non-empty, # it will be appended to the version number. It does not have to be @@ -18,7 +18,7 @@ release=0 # requirement is that it must be entirely printable ASCII characters # and have no white space. -greek=rc2 +greek=rc1 # The date when this release was created diff --git a/contrib/android/AndroidApp/lstopo/build.gradle b/contrib/android/AndroidApp/lstopo/build.gradle index fcb7488f3e..5a1ec73721 100644 --- a/contrib/android/AndroidApp/lstopo/build.gradle +++ b/contrib/android/AndroidApp/lstopo/build.gradle @@ -11,7 +11,7 @@ android { // Official hwloc version - snapshot number - android apk version // Set snapshot number to 1 when the hwloc version is increased. // Increase the snapshot number when the hwloc code changed but not its version - versionName "2.8.0rc2-1-1.5.1" + versionName "2.8.1rc1-1-1.5.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { diff --git a/contrib/android/include/hwloc/autogen/config.h b/contrib/android/include/hwloc/autogen/config.h index 881a623dc7..41473ebfa4 100644 --- a/contrib/android/include/hwloc/autogen/config.h +++ b/contrib/android/include/hwloc/autogen/config.h @@ -12,11 +12,11 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.8.0rc2" +#define HWLOC_VERSION "2.8.1rc1" #define HWLOC_VERSION_MAJOR 2 #define HWLOC_VERSION_MINOR 8 -#define HWLOC_VERSION_RELEASE 0 -#define HWLOC_VERSION_GREEK "rc2" +#define HWLOC_VERSION_RELEASE 1 +#define HWLOC_VERSION_GREEK "rc1" #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) # define __hwloc_restrict __restrict diff --git a/contrib/windows-cmake/CMakeLists.txt b/contrib/windows-cmake/CMakeLists.txt index 836e1fd1e8..b9b1ca6691 100644 --- a/contrib/windows-cmake/CMakeLists.txt +++ b/contrib/windows-cmake/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) project(hwloc LANGUAGES C - VERSION 2.8.0) + VERSION 2.8.1) enable_testing() diff --git a/contrib/windows/hwloc_config.h b/contrib/windows/hwloc_config.h index 6264c54f59..241e6fc70a 100644 --- a/contrib/windows/hwloc_config.h +++ b/contrib/windows/hwloc_config.h @@ -11,11 +11,11 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.8.0rc2" +#define HWLOC_VERSION "2.8.1rc1" #define HWLOC_VERSION_MAJOR 2 #define HWLOC_VERSION_MINOR 8 -#define HWLOC_VERSION_RELEASE 0 -#define HWLOC_VERSION_GREEK "rc2" +#define HWLOC_VERSION_RELEASE 1 +#define HWLOC_VERSION_GREEK "rc1" #define __hwloc_restrict #define __hwloc_inline __inline From 0db5fdc54fb8cb7db12e5abfafee0a28cdc7efa1 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 12 Jul 2022 10:22:08 +0200 Subject: [PATCH 07/36] pci: document the PCI affinity quirk for HPE Cray EX235a Signed-off-by: Brice Goglin (cherry picked from commit ac18e13eb3d52f55a373c71947b9456a7c36690c) --- hwloc/pci-common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hwloc/pci-common.c b/hwloc/pci-common.c index e312e4f24e..5d7e884789 100644 --- a/hwloc/pci-common.c +++ b/hwloc/pci-common.c @@ -481,6 +481,13 @@ hwloc__pci_find_busid_parent_quirk(struct hwloc_topology *topology, } if (topology->pci_locality_quirks & HWLOC_PCI_LOCALITY_QUIRK_CRAY_EX235A) { + /* AMD Trento has xGMI ports connected to individual CCDs (8 cores + L3) + * instead of NUMA nodes (pairs of CCDs within Trento) as is usual in AMD EPYC CPUs. + * This is not described by the ACPI tables, hence we need to manually hardwire + * the xGMI locality for the (currently single) server that currently uses that CPU. + * It's not clear if ACPI tables can/will ever be fixed (would require one initiator + * proximity domain per CCD), or if Linux can/will work around the issue. + */ if (busid->domain == 0) { if (busid->bus >= 0xd0 && busid->bus <= 0xd1) { hwloc_bitmap_set_range(cpuset, 0, 7); From 38fbe3d2480b3efbe06bebac803b619ac5fc494b Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 19 Jul 2022 11:18:27 +0200 Subject: [PATCH 08/36] utils/tests/calc: check for multiple levels of groups Signed-off-by: Brice Goglin (cherry picked from commit 4732ec41fb3c89ff5a722da599c0176448099ba6) --- utils/hwloc/test-hwloc-calc.output | 12 ++++++++++++ utils/hwloc/test-hwloc-calc.sh.in | 15 ++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/utils/hwloc/test-hwloc-calc.output b/utils/hwloc/test-hwloc-calc.output index a3dd638bb3..9acf4f778a 100644 --- a/utils/hwloc/test-hwloc-calc.output +++ b/utils/hwloc/test-hwloc-calc.output @@ -55,6 +55,18 @@ # combination of different ranges, hierarchical or not 0x8000c000,0x000ee0c0 +# number of Group0 when there are 3 group levels +2 + +# list of Group1 near one Group0 when there are 3 group levels +0,1 + +# hierarchical list of Group0.Group2 near one NUMA when there are 3 group levels +Group0:1.Group2:2 Group0:1.Group2:3 + +# number of Group2 when there are 3 group levels +8 + # Number of NUMA Nodes 4 diff --git a/utils/hwloc/test-hwloc-calc.sh.in b/utils/hwloc/test-hwloc-calc.sh.in index 1653d7c919..9455e40cd1 100644 --- a/utils/hwloc/test-hwloc-calc.sh.in +++ b/utils/hwloc/test-hwloc-calc.sh.in @@ -3,7 +3,7 @@ # # Copyright © 2009 CNRS -# Copyright © 2009-2020 Inria. All rights reserved. +# Copyright © 2009-2022 Inria. All rights reserved. # Copyright © 2009, 2011 Université Bordeaux # Copyright © 2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -98,6 +98,19 @@ set -e $calc --if synthetic --input "node:4 core:4 pu:4" pu:6:2 core:3-4.pu:1-3 node:2.pu:14:2 node:3.core:3.pu:3 echo + echo "# number of Group0 when there are 3 group levels" + $calc --if synthetic --input "group:2 node:2 group:2 pu:2" -N group0 all + echo + echo "# list of Group1 near one Group0 when there are 3 group levels" + $calc --if synthetic --input "group:2 node:2 group:2 pu:2" -I group1 group0:0 + echo + echo "# hierarchical list of Group0.Group2 near one NUMA when there are 3 group levels" + $calc --if synthetic --input "group:2 node:2 group:2 pu:2" -H group0.group2 numa:3 + echo + echo "# number of Group2 when there are 3 group levels" + $calc --if synthetic --input "group:2 node:2 group:2 pu:2" -N group2 all + echo + echo "# Number of NUMA Nodes" $calc --if synthetic --input "node:4 core:4 pu:4" root --number-of node echo From 32d273fe3f7cd420eddb9d1aeede948a657e712e Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 19 Jul 2022 21:55:37 +0200 Subject: [PATCH 09/36] levelzero: fix subdevice info properties Thanks to Jonathan Peyton for the fix. Signed-off-by: Brice Goglin (cherry picked from commit 1f0283e3b04c74af58f9c15c42816628001814b0) --- hwloc/topology-levelzero.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwloc/topology-levelzero.c b/hwloc/topology-levelzero.c index 4cb8ae1c69..a059d73368 100644 --- a/hwloc/topology-levelzero.c +++ b/hwloc/topology-levelzero.c @@ -461,7 +461,7 @@ hwloc_levelzero_discover(struct hwloc_backend *backend, struct hwloc_disc_status snprintf(tmp, sizeof(tmp), "%u", k); hwloc_obj_add_info(subosdevs[k], "LevelZeroSubdeviceID", tmp); - hwloc__levelzero_properties_get(subh[j], subosdevs[k], sysman_maybe_missing, NULL); + hwloc__levelzero_properties_get(subh[k], subosdevs[k], sysman_maybe_missing, NULL); hwloc__levelzero_cqprops_get(subh[k], subosdevs[k]); } From 6d1ea4f929ef5a47499b64d3d6348b247637eff9 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 25 Jul 2022 09:33:12 +0200 Subject: [PATCH 10/36] pci+linux: make 32bits domain warnings non-critical This issue seems to happen more frequently, don't report it unless all errors are enabled. This warning means that some PCI devices might be missing. That's not critical enough to warn users (most of them know nothing about hwloc). For the record, CUDA init warnings were demoted the same a couple releases ago. Refs #354 Signed-off-by: Brice Goglin (cherry picked from commit 69fbc208ee373cc042aa803325e65febd0bd17ae) --- hwloc/topology-linux.c | 2 +- hwloc/topology-pci.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hwloc/topology-linux.c b/hwloc/topology-linux.c index 49bb2d99c6..f7795ea263 100644 --- a/hwloc/topology-linux.c +++ b/hwloc/topology-linux.c @@ -6903,7 +6903,7 @@ hwloc_linuxfs_pci_look_pcidevices(struct hwloc_backend *backend) #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN if (domain > 0xffff) { static int warned = 0; - if (!warned && hwloc_hide_errors() < 2) + if (!warned && !hwloc_hide_errors()) fprintf(stderr, "hwloc/linux: 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; diff --git a/hwloc/topology-pci.c b/hwloc/topology-pci.c index 7beaf473ee..c5e38e7feb 100644 --- a/hwloc/topology-pci.c +++ b/hwloc/topology-pci.c @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2022 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 @@ -205,7 +205,7 @@ hwloc_look_pci(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus) #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN if (domain > 0xffff) { static int warned = 0; - if (!warned && hwloc_hide_errors() < 2) + if (!warned && !hwloc_hide_errors()) fprintf(stderr, "hwloc/pci: 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; From 346d231265da710900b11118b1d9512c79cf65b7 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 25 Jul 2022 09:35:13 +0200 Subject: [PATCH 11/36] core: if debug is enabled and debug messages are disabled, unhide errors too Signed-off-by: Brice Goglin (cherry picked from commit 64e01e8155e2814ad96faa61f8e67d797d1a0ef4) --- hwloc/topology.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hwloc/topology.c b/hwloc/topology.c index 326db3a790..1c7ff5d533 100644 --- a/hwloc/topology.c +++ b/hwloc/topology.c @@ -120,8 +120,18 @@ int hwloc_hide_errors(void) static int checked = 0; if (!checked) { const char *envvar = getenv("HWLOC_HIDE_ERRORS"); - if (envvar) + if (envvar) { hide = atoi(envvar); +#ifdef HWLOC_DEBUG + } else { + /* if debug is enabled and HWLOC_DEBUG_VERBOSE isn't forced to 0, + * show all errors jus like we show all debug messages. + */ + envvar = getenv("HWLOC_DEBUG_VERBOSE"); + if (!envvar || atoi(envvar)) + hide = 0; +#endif + } checked = 1; } return hide; From d8f96b3291cf093d8d49670928b5a20b40537dfd Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 25 Jul 2022 11:22:00 +0200 Subject: [PATCH 12/36] xml: also demote 32bits pci domain import errors to non-critical Forgotten in commit 69fbc208ee373cc042aa803325e65febd0bd17ae Signed-off-by: Brice Goglin (cherry picked from commit c100a528a3d41c7ca986ec9f24cb8a7d33b3bcab) --- hwloc/topology-xml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hwloc/topology-xml.c b/hwloc/topology-xml.c index 942fac0f74..b31bfdb2df 100644 --- a/hwloc/topology-xml.c +++ b/hwloc/topology-xml.c @@ -274,7 +274,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology, #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN } else if (domain > 0xffff) { static int warned = 0; - if (!warned && hwloc_hide_errors() < 2) + if (!warned && !hwloc_hide_errors()) fprintf(stderr, "hwloc/xml: 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; @@ -374,7 +374,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology, #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN } else if (domain > 0xffff) { static int warned = 0; - if (!warned && hwloc_hide_errors() < 2) + if (!warned && !hwloc_hide_errors()) fprintf(stderr, "hwloc/xml: 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; From 4a782ccdd695c1de08a9ee7034e9fad34c595d18 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 25 Jul 2022 17:45:00 +0200 Subject: [PATCH 13/36] xml: fix an error message in the future xml obj id attribute Signed-off-by: Brice Goglin (cherry picked from commit 3329842da11c4f9ad085014f6eeda12efc877e58) --- hwloc/topology-xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwloc/topology-xml.c b/hwloc/topology-xml.c index b31bfdb2df..5f97eaa16e 100644 --- a/hwloc/topology-xml.c +++ b/hwloc/topology-xml.c @@ -132,7 +132,7 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology, topology->next_gp_index = obj->gp_index + 1; } else { if (hwloc__xml_verbose()) - fprintf(stderr, "%s: unexpected id `%s' not-starting with `obj', ignoring\n", value, state->global->msgprefix); + fprintf(stderr, "%s: unexpected id `%s' not-starting with `obj', ignoring\n", state->global->msgprefix, value); } } else if (!strcmp(name, "cpuset")) { if (!obj->cpuset) From 2475694eae35eb5de7303279df79a080ce52e5b1 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Thu, 28 Jul 2022 13:54:03 +0200 Subject: [PATCH 14/36] completion: fix diff --refname Don't fallthough to xml filenames after setting COMPREPLY for --refname. Signed-off-by: Brice Goglin (cherry picked from commit c57d0fe1162e8189b04f5047b966b3978fc1d272) --- contrib/completion/bash/hwloc | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/bash/hwloc b/contrib/completion/bash/hwloc index a6f39f591b..7afee0d25c 100644 --- a/contrib/completion/bash/hwloc +++ b/contrib/completion/bash/hwloc @@ -390,6 +390,7 @@ _hwloc_diff(){ case "$prev" in --refname) COMPREPLY=( "" "") + return ;; esac fi From 0d4a0d2e4041d3704a3e2cc9abdf54dd6a16812b Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 10 Aug 2022 09:24:48 +0200 Subject: [PATCH 15/36] bitmap.h: fix the doc for foreach() We were still using index instead of id. Thanks to Guillaume Mercier. Signed-off-by: Brice Goglin (cherry picked from commit 61083f1d672b74f4f5a699e1081b82fe85840bde) --- include/hwloc/bitmap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hwloc/bitmap.h b/include/hwloc/bitmap.h index 8d9bb9c880..9a149dd8c2 100644 --- a/include/hwloc/bitmap.h +++ b/include/hwloc/bitmap.h @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2020 Inria. All rights reserved. + * Copyright © 2009-2022 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -357,11 +357,11 @@ HWLOC_DECLSPEC int hwloc_bitmap_last_unset(hwloc_const_bitmap_t bitmap) __hwloc_ * The loop must start with hwloc_bitmap_foreach_begin() and end * with hwloc_bitmap_foreach_end() followed by a terminating ';'. * - * \p index is the loop variable; it should be an unsigned int. The - * first iteration will set \p index to the lowest index in the bitmap. + * \p id is the loop variable; it should be an unsigned int. The + * first iteration will set \p id 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 \p index such that hwloc_bitmap_isset(bitmap, index) is true. + * value for \p id such that hwloc_bitmap_isset(bitmap, id) is true. * * The assert prevents the loop from being infinite if the bitmap is infinitely set. * From f0a92461cc0e59a1bb893fa3c3d790e2805cff5c Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 19 Aug 2022 10:48:33 +0200 Subject: [PATCH 16/36] doc/examples: add memory-attributes.c Closes #542 Signed-off-by: Brice Goglin (cherry picked from commit 8d81da3a98565971bb18a408a2493fd19553f556) --- doc/examples/Makefile.am | 4 +- doc/examples/memory-attributes.c | 91 ++++++++++++++++++++++++++++++++ doc/hwloc.doxy | 1 + include/hwloc/memattrs.h | 2 + 4 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 doc/examples/memory-attributes.c diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 355d71185f..96b7ae9d46 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -1,4 +1,4 @@ -# Copyright © 2009-2018 Inria. All rights reserved. +# Copyright © 2009-2022 Inria. All rights reserved. # Copyright © 2009-2013, 2017 Université Bordeaux # Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -19,7 +19,7 @@ if HWLOC_HAVE_CXX TESTS += hwloc-hello-cpp endif HWLOC_HAVE_CXX -check_PROGRAMS = $(TESTS) cpuset+bitmap+cpubind nodeset+membind+policy get-knl-modes gpu +check_PROGRAMS = $(TESTS) cpuset+bitmap+cpubind nodeset+membind+policy get-knl-modes gpu memory-attributes if !HWLOC_HAVE_WINDOWS check_PROGRAMS += sharedcaches endif diff --git a/doc/examples/memory-attributes.c b/doc/examples/memory-attributes.c new file mode 100644 index 0000000000..a4b5e9e6df --- /dev/null +++ b/doc/examples/memory-attributes.c @@ -0,0 +1,91 @@ +/* This example program plays with: + * - finding local NUMA nodes + * - finding the best NUMA nodes for bandwidth/latency + * - displaying the bandwidth/latency values of NUMA nodes + * - allocating on the best NUMA node for bandwidth + * + * Copyright © 2022 Inria. All rights reserved. + * See COPYING in top-level directory. + */ + +#include "hwloc.h" + +#include +#include +#include + +int main(void) +{ + hwloc_topology_t topology; + hwloc_obj_t core, *nodes, bestnode; + struct hwloc_location initiator; + unsigned i,n; + char *s, *buffer; + int err; + + /* Allocate, initialize and load topology object. */ + hwloc_topology_init(&topology); + hwloc_topology_load(topology); + + /* Find max number of NUMA nodes to allocate the array for hwloc_get_local_numanode_objs() */ + n = hwloc_bitmap_weight(hwloc_topology_get_topology_nodeset(topology)); + printf("There are %u NUMA nodes\n", n); + nodes = malloc(n * sizeof(*nodes)); + assert(nodes); + + /* Take the first core */ + core = hwloc_get_obj_by_type(topology, HWLOC_OBJ_CORE, 0); + if (!core) + goto out; + + hwloc_bitmap_asprintf(&s, core->cpuset); + printf("Core L#0 cpuset = %s\n", s); + free(s); + + /* setup the initiator to the first core cpuset */ + initiator.type = HWLOC_LOCATION_TYPE_CPUSET; + initiator.location.cpuset = core->cpuset; + + /* get local NUMA nodes and display their attributes */ + err = hwloc_get_local_numanode_objs(topology, &initiator, &n, nodes, + /* we want NUMA nodes that are local to that core or to more */ + HWLOC_LOCAL_NUMANODE_FLAG_LARGER_LOCALITY); + printf("Found %u local NUMA nodes\n", n); + for(i=0; ilogical_index, nodes[i]->os_index, nodes[i]->subtype); + + err = hwloc_memattr_get_value(topology, HWLOC_MEMATTR_ID_BANDWIDTH, nodes[i], &initiator, 0, &bandwidth); + if (err < 0) { + printf(" bandwidth is unknown\n"); + } else { + printf(" bandwidth = %llu MiB/s\n", (unsigned long long) bandwidth); + } + err = hwloc_memattr_get_value(topology, HWLOC_MEMATTR_ID_LATENCY, nodes[i], &initiator, 0, &latency); + if (err < 0) { + printf(" latency is unknown\n"); + } else { + printf(" latency = %llu ns\n", (unsigned long long) latency); + } + } + free(nodes); + + /* allocate on best-bandwidth node */ + err = hwloc_memattr_get_best_target(topology, HWLOC_MEMATTR_ID_BANDWIDTH, &initiator, 0, &bestnode, NULL); + if (err < 0) { + printf("Couldn't find best NUMA node for bandwidth to core L#0\n"); + } else { + printf("Best bandwidth NUMA node for core L#0 is L#%u P#%u\n", bestnode->logical_index, bestnode->os_index); + /* allocate memory on best node */ + buffer = hwloc_alloc_membind(topology, 1048576, bestnode->nodeset, HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_BYNODESET); + printf("Allocated buffer %p on best node\n", buffer); + free(buffer); + } + + out: + /* Destroy topology object. */ + hwloc_topology_destroy(topology); + + return 0; +} diff --git a/doc/hwloc.doxy b/doc/hwloc.doxy index 970319e721..816f38984b 100644 --- a/doc/hwloc.doxy +++ b/doc/hwloc.doxy @@ -2296,6 +2296,7 @@ Users may also specify their own attributes and values. The memory attributes API is located in hwloc/memattrs.h, see \ref hwlocality_memattrs and \ref hwlocality_memattrs_manage for details. +See also an example in doc/examples/memory-attributes.c in the source tree. \htmlonly diff --git a/include/hwloc/memattrs.h b/include/hwloc/memattrs.h index 007390d673..39809aba9c 100644 --- a/include/hwloc/memattrs.h +++ b/include/hwloc/memattrs.h @@ -54,6 +54,8 @@ extern "C" { * Attribute values for these nodes, if any, may then be obtained with * hwloc_memattr_get_value() and manually compared with the desired criteria. * + * \sa An example is available in doc/examples/memory-attributes.c in the source tree. + * * \note The API also supports specific objects as initiator, * but it is currently not used internally by hwloc. * Users may for instance use it to provide custom performance From f2ae31a1f7fe10c66c2c09e0869c5b50596b6fdf Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 19 Aug 2022 15:01:57 +0200 Subject: [PATCH 17/36] memattrs.h: cleanup doxygen formatting of the enum of memory attributes Escape double-quotes in comments (they break the parser and the remaining enum item doc is ignored in manpages). Hide initializer values. Uniformize the source formatting to keep it easy to read even if the manpage formatting isn't perfect (looks like doxygen/manpage wants only two paragraph per enum item, but we'd have to change lots of other places, and it would make the source harder to read). Signed-off-by: Brice Goglin (cherry picked from commit d316fa749474b5ba0a2d557989af5fb9e0b556de) --- include/hwloc/memattrs.h | 53 +++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/include/hwloc/memattrs.h b/include/hwloc/memattrs.h index 39809aba9c..acf4da537a 100644 --- a/include/hwloc/memattrs.h +++ b/include/hwloc/memattrs.h @@ -67,19 +67,19 @@ extern "C" { /** \brief Memory node attributes. */ enum hwloc_memattr_id_e { - /** \brief "Capacity". - * The capacity is returned in bytes - * (local_memory attribute in objects). + /** \brief + * The \"Capacity\" is returned in bytes (local_memory attribute in objects). * * Best capacity nodes are nodes with higher capacity. * * No initiator is involved when looking at this attribute. * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_HIGHER_FIRST. + * \hideinitializer */ HWLOC_MEMATTR_ID_CAPACITY = 0, - /** \brief "Locality". - * The locality is returned as the number of PUs in that locality + /** \brief + * The \"Locality\" is returned as the number of PUs in that locality * (e.g. the weight of its cpuset). * * Best locality nodes are nodes with smaller locality @@ -89,62 +89,81 @@ enum hwloc_memattr_id_e { * * No initiator is involved when looking at this attribute. * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_HIGHER_FIRST. + * \hideinitializer */ HWLOC_MEMATTR_ID_LOCALITY = 1, - /** \brief "Bandwidth". - * The bandwidth is returned in MiB/s, as seen from the given initiator location. + /** \brief + * The \"Bandwidth\" is returned in MiB/s, as seen from the given initiator location. + * * Best bandwidth nodes are nodes with higher bandwidth. + * * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_HIGHER_FIRST * and ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR. * * This is the average bandwidth for read and write accesses. If the platform * provides individual read and write bandwidths but no explicit average value, * hwloc computes and returns the average. + * \hideinitializer */ HWLOC_MEMATTR_ID_BANDWIDTH = 2, - /** \brief "ReadBandwidth". - * The Read bandwidth is returned in MiB/s, as seen from the given initiator location. + /** \brief + * The \"ReadBandwidth\" is returned in MiB/s, as seen from the given initiator location. + * * Best bandwidth nodes are nodes with higher bandwidth. + * * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_HIGHER_FIRST * and ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR. + * \hideinitializer */ HWLOC_MEMATTR_ID_READ_BANDWIDTH = 4, - /** \brief "WriteBandwidth". - * The Write bandwidth is returned in MiB/s, as seen from the given initiator location. + /** \brief + * The \"WriteBandwidth\" is returned in MiB/s, as seen from the given initiator location. + * * Best bandwidth nodes are nodes with higher bandwidth. + * * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_HIGHER_FIRST * and ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR. + * \hideinitializer */ HWLOC_MEMATTR_ID_WRITE_BANDWIDTH = 5, - /** \brief "Latency". - * The latency is returned as nanoseconds, as seen from the given initiator location. + /** \brief + * The \"Latency\" is returned as nanoseconds, as seen from the given initiator location. + * * Best latency nodes are nodes with smaller latency. + * * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_LOWER_FIRST * and ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR. * * This is the average latency for read and write accesses. If the platform * provides individual read and write latencies but no explicit average value, * hwloc computes and returns the average. + * \hideinitializer */ HWLOC_MEMATTR_ID_LATENCY = 3, - /** \brief "ReadLatency". - * The Read latency is returned as nanoseconds, as seen from the given initiator location. + /** \brief + * The \"ReadLatency\" is returned as nanoseconds, as seen from the given initiator location. + * * Best latency nodes are nodes with smaller latency. + * * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_LOWER_FIRST * and ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR. + * \hideinitializer */ HWLOC_MEMATTR_ID_READ_LATENCY = 6, - /** \brief "WriteLatency". - * The Write latency is returned as nanoseconds, as seen from the given initiator location. + /** \brief + * The \"WriteLatency\" is returned as nanoseconds, as seen from the given initiator location. + * * Best latency nodes are nodes with smaller latency. + * * The corresponding attribute flags are ::HWLOC_MEMATTR_FLAG_LOWER_FIRST * and ::HWLOC_MEMATTR_FLAG_NEED_INITIATOR. + * \hideinitializer */ HWLOC_MEMATTR_ID_WRITE_LATENCY = 7, From 676f9dbec7e54c621dfd9314411b7d98b39e7a80 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 23 Aug 2022 11:13:51 +0200 Subject: [PATCH 18/36] doc/examples: use hwloc_uint64_t in memory-attributes.c MinGW doesn't get uint64_t on our CI. Signed-off-by: Brice Goglin (cherry picked from commit 601b58dccec5e802a4ab2e4e8019a987de9afb07) --- doc/examples/memory-attributes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/memory-attributes.c b/doc/examples/memory-attributes.c index a4b5e9e6df..a62eee3ef3 100644 --- a/doc/examples/memory-attributes.c +++ b/doc/examples/memory-attributes.c @@ -52,7 +52,7 @@ int main(void) HWLOC_LOCAL_NUMANODE_FLAG_LARGER_LOCALITY); printf("Found %u local NUMA nodes\n", n); for(i=0; ilogical_index, nodes[i]->os_index, nodes[i]->subtype); From 060a4a13db4e03eae4eb4856081f5a20f568865f Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 23 Aug 2022 23:57:24 +0200 Subject: [PATCH 19/36] nvml/bw: add nvlink versions 3&4 Possible version values aren't documented in NVML API doc, but wikipedia and other sources say 50GB/s per link for v3 (Ampere) and v4 (Hopper). Signed-off-by: Brice Goglin (cherry picked from commit 352348a1d861614f67553dd5fd6ad1ef1d4ebca5) --- hwloc/topology-nvml.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hwloc/topology-nvml.c b/hwloc/topology-nvml.c index 4b922840af..fa9ca2a655 100644 --- a/hwloc/topology-nvml.c +++ b/hwloc/topology-nvml.c @@ -357,6 +357,8 @@ hwloc_nvml_discover(struct hwloc_backend *backend, struct hwloc_disc_status *dst bw = 20000; /* multiple links may connect same GPUs */ } else if (version == 2) { bw = 25000; /* multiple links may connect same GPUs */ + } else if (version == 3 || version == 4) { + bw = 50000; /* multiple links may connect same GPUs */ } else { static int warned = 0; if (!warned && !hwloc_hide_errors()) From 863e8872a98d85043198f314f48ee425e4ea0b3c Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 19 Sep 2022 10:07:36 +0200 Subject: [PATCH 20/36] tests/backends: fix build with ClangCI 15 compiler frontend for MSVC hwloc_backends.c needs some open/read/close/mktemp redirection to _foo. Copy what we did in pci-common.c and add mktemp. Thanks to Mario Emmenlauer for the report. Fixes #546 Signed-off-by: Brice Goglin (cherry picked from commit 0de22a593ff280cca67a01724a01bcf81d4490fc) --- tests/hwloc/hwloc_backends.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/hwloc/hwloc_backends.c b/tests/hwloc/hwloc_backends.c index 74580bd47d..75ef717ba4 100644 --- a/tests/hwloc/hwloc_backends.c +++ b/tests/hwloc/hwloc_backends.c @@ -1,5 +1,5 @@ /* - * Copyright © 2012-2020 Inria. All rights reserved. + * Copyright © 2012-2022 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -15,6 +15,14 @@ #include #include +#if defined(HWLOC_WIN_SYS) && !defined(__CYGWIN__) +#include +#define open _open +#define read _read +#define close _close +#define mktemp _mktemp +#endif + #ifndef HAVE_MKSTEMP #include #include From ba439ea5e85a98c13855852829ea77f28baac914 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 23 Sep 2022 12:54:37 +0200 Subject: [PATCH 21/36] completion/lstopo: update the list of output formats Signed-off-by: Brice Goglin (cherry picked from commit 3b5d5d875a9d03a5a1ec8874aad116d3d145602a) --- contrib/completion/bash/hwloc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/bash/hwloc b/contrib/completion/bash/hwloc index 7afee0d25c..3e5508c467 100644 --- a/contrib/completion/bash/hwloc +++ b/contrib/completion/bash/hwloc @@ -12,7 +12,7 @@ _lstopo() { local INPUT_FORMAT=(xml synthetic fsroot cpuid) - local OUTPUT_FORMAT=(console ascii tikz fig pdf ps png svg xml synthetic) + local OUTPUT_FORMAT=(default console ascii tikz tex fig pdf nativesvg cairosvg ps png svg xml shmem synthetic) 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=(-l --logical From 3cbcde121a4742df8525769ed022b5f0181d8226 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 7 Oct 2022 11:52:56 +0200 Subject: [PATCH 22/36] cuda: update to compute capability 9 128 FP32 cores again. Signed-off-by: Brice Goglin (cherry picked from commit a908085792db1670c769769bd93179fc3a92dc2a) --- hwloc/topology-cuda.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hwloc/topology-cuda.c b/hwloc/topology-cuda.c index fa5bd250a6..3aad7777d3 100644 --- a/hwloc/topology-cuda.c +++ b/hwloc/topology-cuda.c @@ -53,6 +53,8 @@ static unsigned hwloc_cuda_cores_per_MP(int major, int minor) case 6: return 128; } break; + case 9: + return 128; } hwloc_debug("unknown compute capability %d.%d, disabling core display.\n", major, minor); return 0; From b6cf3af3562da1f370155ff829b823a55fa83889 Mon Sep 17 00:00:00 2001 From: Hui Zhou Date: Tue, 11 Oct 2022 13:42:29 -0500 Subject: [PATCH 23/36] Leak in hwloc__xml_import_cpukind Looks like we always need free the locally allocated infos. (cherry picked from commit b86f63fcfaeb480613e0ec6f345444a98b95d36f) --- hwloc/topology-xml.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hwloc/topology-xml.c b/hwloc/topology-xml.c index 5f97eaa16e..b0ab551836 100644 --- a/hwloc/topology-xml.c +++ b/hwloc/topology-xml.c @@ -1853,6 +1853,7 @@ hwloc__xml_import_cpukind(hwloc_topology_t topology, hwloc_bitmap_free(cpuset); } else { hwloc_internal_cpukinds_register(topology, cpuset, forced_efficiency, infos, nr_infos, HWLOC_CPUKINDS_REGISTER_FLAG_OVERWRITE_FORCED_EFFICIENCY); + hwloc__free_infos(infos, nr_infos); } return state->global->close_tag(state); From f58797ef8d336acdbf96d0f0432ecbd244a6fb88 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 26 Oct 2022 16:55:43 +0200 Subject: [PATCH 24/36] lstopo/draw: fix the displaying of non-HBM L0 device memory Signed-off-by: Brice Goglin (cherry picked from commit 46300028ce0428f3593753d130b8b96709b98ee4) --- utils/lstopo/lstopo-draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/lstopo/lstopo-draw.c b/utils/lstopo/lstopo-draw.c index e6c34d361c..2f180df59f 100644 --- a/utils/lstopo/lstopo-draw.c +++ b/utils/lstopo/lstopo-draw.c @@ -1328,7 +1328,7 @@ prepare_text(struct lstopo_output *loutput, hwloc_obj_t obj) if (valueMem) { unsigned long long mb = strtoull(valueMem, NULL, 10) / 1024; snprintf(lud->text[lud->ntext++].text, sizeof(lud->text[0].text), - mb >= 10240 ? "%llu GB HBM" : "%llu MB", + mb >= 10240 ? "%llu GB" : "%llu MB", mb >= 10240 ? mb/1024 : mb); } valueSl = hwloc_obj_get_info_by_name(obj, "LevelZeroNumSlices"); From a28cec69a7b68679446a05941bfe5a02647284a7 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 2 Nov 2022 13:05:48 +0100 Subject: [PATCH 25/36] cuda: update for compute capability 8.9 And 8.7 is officially documented now. Signed-off-by: Brice Goglin (cherry picked from commit 604fdd5f047224eca7b35288981ef6bdcbfa7405) --- NEWS | 5 +++++ hwloc/topology-cuda.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index d40a8951f1..efdb59a515 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,11 @@ bug fixes (and other actions) for each version of hwloc since version 0.9. +Version 2.8.1 +------------- +* Add support for CUDA compute capability up to 9.0. + + Version 2.8.0 ------------- * API diff --git a/hwloc/topology-cuda.c b/hwloc/topology-cuda.c index 3aad7777d3..dc43cbbb81 100644 --- a/hwloc/topology-cuda.c +++ b/hwloc/topology-cuda.c @@ -49,8 +49,9 @@ static unsigned hwloc_cuda_cores_per_MP(int major, int minor) case 8: switch (minor) { case 0: return 64; - case 7: /* 8.7 is not documented yet, assume it's like 8.6 below */ - case 6: return 128; + case 6: + case 7: + case 9: return 128; } break; case 9: From a5bbb02b846ffb699a7d8ea2643e6e0ca6a09d3b Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Thu, 10 Nov 2022 18:12:28 +0100 Subject: [PATCH 26/36] doxy: number of character +s Signed-off-by: Brice Goglin (cherry picked from commit e84553d4a9efd3a48c385e5131e0715535683b3a) --- include/hwloc.h | 4 ++-- include/hwloc/bitmap.h | 6 +++--- include/hwloc/deprecated.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hwloc.h b/include/hwloc.h index b6c03e2a8a..18ea1dfa1c 100644 --- a/include/hwloc.h +++ b/include/hwloc.h @@ -971,7 +971,7 @@ HWLOC_DECLSPEC const char * hwloc_obj_type_string (hwloc_obj_type_t type) __hwlo * * If \p size is 0, \p string may safely be \c NULL. * - * \return the number of character that were actually written if not truncating, + * \return the number of characters that were actually written if not truncating, * or that would have been written (not including the ending \\0). */ HWLOC_DECLSPEC int hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_t size, @@ -986,7 +986,7 @@ HWLOC_DECLSPEC int hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_ * * If \p size is 0, \p string may safely be \c NULL. * - * \return the number of character that were actually written if not truncating, + * \return the number of characters that were actually written if not truncating, * or that would have been written (not including the ending \\0). */ HWLOC_DECLSPEC int hwloc_obj_attr_snprintf(char * __hwloc_restrict string, size_t size, diff --git a/include/hwloc/bitmap.h b/include/hwloc/bitmap.h index 9a149dd8c2..cd118b387c 100644 --- a/include/hwloc/bitmap.h +++ b/include/hwloc/bitmap.h @@ -112,7 +112,7 @@ HWLOC_DECLSPEC int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t sr * * If \p buflen is 0, \p buf may safely be \c NULL. * - * \return the number of character that were actually written if not truncating, + * \return the number of characters that were actually written if not truncating, * or that would have been written (not including the ending \\0). */ HWLOC_DECLSPEC int hwloc_bitmap_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap); @@ -137,7 +137,7 @@ HWLOC_DECLSPEC int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char * __hwl * * If \p buflen is 0, \p buf may safely be \c NULL. * - * \return the number of character that were actually written if not truncating, + * \return the number of characters that were actually written if not truncating, * or that would have been written (not including the ending \\0). */ HWLOC_DECLSPEC int hwloc_bitmap_list_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap); @@ -161,7 +161,7 @@ HWLOC_DECLSPEC int hwloc_bitmap_list_sscanf(hwloc_bitmap_t bitmap, const char * * * If \p buflen is 0, \p buf may safely be \c NULL. * - * \return the number of character that were actually written if not truncating, + * \return the number of characters that were actually written if not truncating, * or that would have been written (not including the ending \\0). */ HWLOC_DECLSPEC int hwloc_bitmap_taskset_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap); diff --git a/include/hwloc/deprecated.h b/include/hwloc/deprecated.h index f2419dd482..d563b43795 100644 --- a/include/hwloc/deprecated.h +++ b/include/hwloc/deprecated.h @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2022 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -55,7 +55,7 @@ hwloc_topology_insert_misc_object_by_parent(hwloc_topology_t topology, hwloc_obj * * If \p size is 0, \p string may safely be \c NULL. * - * \return the number of character that were actually written if not truncating, + * \return the number of characters that were actually written if not truncating, * or that would have been written (not including the ending \\0). */ static __hwloc_inline int From 637927f02b5bde22f92ff4066908829faefd8a5b Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Thu, 10 Nov 2022 18:12:10 +0100 Subject: [PATCH 27/36] diff: reuse temp variable Signed-off-by: Brice Goglin (cherry picked from commit b5c07dd3f07deeab91312e85551906c2dd196f28) --- hwloc/diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hwloc/diff.c b/hwloc/diff.c index 7449a8582c..81e12c5585 100644 --- a/hwloc/diff.c +++ b/hwloc/diff.c @@ -1,5 +1,5 @@ /* - * Copyright © 2013-2020 Inria. All rights reserved. + * Copyright © 2013-2022 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -218,7 +218,7 @@ hwloc_diff_trees(hwloc_topology_t topo1, hwloc_obj_t obj1, struct hwloc_info_s *info1 = &obj1->infos[i], *info2 = &obj2->infos[i]; if (strcmp(info1->name, info2->name)) goto out_too_complex; - if (strcmp(obj1->infos[i].value, obj2->infos[i].value)) { + if (strcmp(info1->value, info2->value)) { err = hwloc_append_diff_obj_attr_string(obj1, HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO, info1->name, From 69d5d8b8205644123426ce22f9871cbb4d8a994b Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 5 Dec 2022 10:33:44 +0100 Subject: [PATCH 28/36] pci: don't ignore CXL memory expanders And use "CXLMem" as a string for PCI_CLASS_MEMORY_CXL = 0x0502 Signed-off-by: Brice Goglin (cherry picked from commit e0f56e2fac08e8dd5a916747ff113d711ba5f0d5) --- hwloc/pci-common.c | 1 + include/hwloc/plugins.h | 1 + 2 files changed, 2 insertions(+) diff --git a/hwloc/pci-common.c b/hwloc/pci-common.c index 5d7e884789..2ab969db00 100644 --- a/hwloc/pci-common.c +++ b/hwloc/pci-common.c @@ -1039,6 +1039,7 @@ hwloc_pci_class_string(unsigned short class_id) switch (class_id) { case 0x0500: return "RAM"; case 0x0501: return "Flash"; + case 0x0502: return "CXLMem"; } return "Memory"; case 0x06: diff --git a/include/hwloc/plugins.h b/include/hwloc/plugins.h index ed4b833d84..bd9e4a8310 100644 --- a/include/hwloc/plugins.h +++ b/include/hwloc/plugins.h @@ -501,6 +501,7 @@ hwloc_filter_check_pcidev_subtype_important(unsigned classid) || baseclass == 0x0b /* PCI_BASE_CLASS_PROCESSOR */ || classid == 0x0c04 /* PCI_CLASS_SERIAL_FIBER */ || classid == 0x0c06 /* PCI_CLASS_SERIAL_INFINIBAND */ + || classid == 0x0502 /* PCI_CLASS_MEMORY_CXL */ || baseclass == 0x06 /* PCI_BASE_CLASS_BRIDGE with non-PCI downstream. the core will drop the useless ones later */ || baseclass == 0x12 /* Processing Accelerators */); } From 20c4d4a3387ecf41cbaad1fac8460adf39cb475f Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Mon, 5 Dec 2022 11:16:53 +0100 Subject: [PATCH 29/36] utils/gather-topology: gather cxl devices and drivers We'll need to double-check whether they are useful in the end. Signed-off-by: Brice Goglin (cherry picked from commit a172c8499d21c5db2b059ff657c0a690b9427936) --- utils/hwloc/hwloc-gather-topology.in | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/hwloc/hwloc-gather-topology.in b/utils/hwloc/hwloc-gather-topology.in index 68ba8cf5ef..27532afa56 100644 --- a/utils/hwloc/hwloc-gather-topology.in +++ b/utils/hwloc/hwloc-gather-topology.in @@ -289,6 +289,7 @@ if [ x$gatherio = x1 ]; then savedir "$destdir/$basename" /sys/bus/pci/slots/ ls -d /sys/devices/pci* 2>/dev/null | while read -r path ; do savedir "$destdir/$basename" "$path" ; done # gather class and bus links, we'll parse that the target path for PCI busids + savebusdir "$destdir/$basename" cxl . 1 saveclassdir "$destdir/$basename" block saveclassdir "$destdir/$basename" dax savebusdir "$destdir/$basename" dax .. 1 From 802b625814e0432bd523326a5328677e9aaa9fba Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 3 Jan 2023 11:24:24 +0100 Subject: [PATCH 30/36] NEWS: bring 2.7.2 bullets Signed-off-by: Brice Goglin --- NEWS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index efdb59a515..a6f45a5762 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ Copyright © 2009 CNRS -Copyright © 2009-2022 Inria. All rights reserved. +Copyright © 2009-2023 Inria. All rights reserved. Copyright © 2009-2013 Université Bordeaux Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. Copyright © 2020 Hewlett Packard Enterprise. All rights reserved. @@ -52,6 +52,14 @@ Version 2.8.0 file from the documentation. +Version 2.7.2 +------------- +* Fix a crash when LevelZero devices have multiple subdevices, + e.g. on PonteVecchio GPUs, thanks to Jonathan Peyton. +* Fix a leak when importing cpukinds from XML, + thanks to Hui Zhou. + + Version 2.7.1 ------------- * Workaround crashes when virtual machines report incoherent x86 CPUID From c6f6ed851b98484307374893f7f26db209872bec Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 3 Jan 2023 11:37:41 +0100 Subject: [PATCH 31/36] contrib/*/check-versions.sh: add --update to usage Signed-off-by: Brice Goglin (cherry picked from commit c938d8159a98378db08f96a35e7c42d6bce8b1ea) --- contrib/android/check-versions.sh | 4 ++-- contrib/windows-cmake/check-versions.sh | 4 ++-- contrib/windows/check-versions.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/android/check-versions.sh b/contrib/android/check-versions.sh index c0af16010b..7a573e5b36 100755 --- a/contrib/android/check-versions.sh +++ b/contrib/android/check-versions.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright © 2018-2021 Inria. All rights reserved. +# Copyright © 2018-2023 Inria. All rights reserved. # $COPYRIGHT$ # @@ -10,7 +10,7 @@ function die() { } if test "x$1" = "x-h" -o "x$1" = "x--help"; then - echo "$0 [--quiet] [git root directory]" + echo "$0 [--quiet] [--update] [git root directory]" exit 0 fi diff --git a/contrib/windows-cmake/check-versions.sh b/contrib/windows-cmake/check-versions.sh index c3d426febd..9bee924a5a 100755 --- a/contrib/windows-cmake/check-versions.sh +++ b/contrib/windows-cmake/check-versions.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright © 2018-2021 Inria. All rights reserved. +# Copyright © 2018-2023 Inria. All rights reserved. # $COPYRIGHT$ # @@ -10,7 +10,7 @@ function die() { } if test "x$1" = "x-h" -o "x$1" = "x--help"; then - echo "$0 [--quiet] [git root directory]" + echo "$0 [--quiet] [--update] [git root directory]" exit 0 fi diff --git a/contrib/windows/check-versions.sh b/contrib/windows/check-versions.sh index 2fdacfc06f..32105ab941 100755 --- a/contrib/windows/check-versions.sh +++ b/contrib/windows/check-versions.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright © 2018-2021 Inria. All rights reserved. +# Copyright © 2018-2023 Inria. All rights reserved. # $COPYRIGHT$ # @@ -10,7 +10,7 @@ function die() { } if test "x$1" = "x-h" -o "x$1" = "x--help"; then - echo "$0 [--quiet] [git root directory]" + echo "$0 [--quiet] [--update] [git root directory]" exit 0 fi From f588db9e74cb1174a43604e038a2b26515acbc22 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 3 Jan 2023 11:38:00 +0100 Subject: [PATCH 32/36] contrib/android/check-versions.sh: make a remaining verbose message conditional Signed-off-by: Brice Goglin (cherry picked from commit 471e43ddfb9d46c6779ec407c290b56bd3e2b8e6) --- contrib/android/check-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/android/check-versions.sh b/contrib/android/check-versions.sh index 7a573e5b36..e18f52e8ba 100755 --- a/contrib/android/check-versions.sh +++ b/contrib/android/check-versions.sh @@ -60,7 +60,7 @@ if test "x$update" = "x1"; then sed -r -e '/define HWLOC_VERSION_MINOR /s/[0-9]+/'$official_minor'/' -i "$android_config_h" sed -r -e '/define HWLOC_VERSION_RELEASE /s/[0-9]+/'$official_release'/' -i "$android_config_h" sed -r -e '/define HWLOC_VERSION_GREEK "/s/"[0-9a-zA-Z\.-]*"/"'$official_greek'"/' -i "$android_config_h" - echo "Updating Android VERSION in $android_gradle ..." + $echo "Updating Android VERSION in $android_gradle ..." # replace oldversion-X-Y with newversion-1-Y since a version bump usually puts back snapshot number to 1 suffix=$(grep -w versionName $android_gradle | grep -oP '".*"' | tr -d \" | grep -oP -- '-[0-9\.]+$') sed -r -e '/versionName "/s/"[0-9a-zA-Z\.-]+"/"'$official_version'-1'$suffix'"/' -i $android_gradle From f2ec6ef7cd33c2272981de54d694949a6fbba211 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 3 Jan 2023 11:28:00 +0100 Subject: [PATCH 33/36] contrib/dist/make_dist_tarball: update android/windows VERSION too HWLOC_VERSION* macros were X.Yrc1 instead of X.Y in the MSVC builds. Windows CMAKE builds don't include suffixes such as rc1, but we still update the hwloc version there for consistency (and in case X.Y was changed too). Android isn't updated since it isn't distributed in tarballs. Signed-off-by: Brice Goglin (cherry picked from commit accb7020c814610ea381438c199843514fe6c9b4) --- contrib/dist/make_dist_tarball | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/dist/make_dist_tarball b/contrib/dist/make_dist_tarball index abd3234951..591e2371ed 100755 --- a/contrib/dist/make_dist_tarball +++ b/contrib/dist/make_dist_tarball @@ -11,7 +11,7 @@ # Copyright © 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright © 2008-2013 Cisco Systems, Inc. All rights reserved. -# Copyright © 2012-2022 Inria. All rights reserved. +# Copyright © 2012-2023 Inria. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -173,6 +173,9 @@ sed -e "s/^date=.*/date=\"$release_date\"/" \ cp -f VERSION.new VERSION rm -f VERSION.new +contrib/windows/check-versions.sh --quiet --update +contrib/windows-cmake/check-versions.sh --quiet --update + # # Make 2 tarballs: # @@ -201,6 +204,8 @@ if test "$1" != "-greekonly" -a "$1" != "--greekonly"; then sed -e 's/^greek=.*/greek=/' VERSION > VERSION.new cp -f VERSION.new VERSION rm -f VERSION.new + contrib/windows/check-versions.sh --quiet --update + contrib/windows-cmake/check-versions.sh --quiet --update echo "Making non-greek tarball" make_tarball fi @@ -208,3 +213,7 @@ fi # Put the VERSION and README files back the way they were echo "*** Reverting VERSION and README files" git diff VERSION README | patch -p1 -R + +contrib/windows/check-versions.sh --quiet --update +contrib/windows-cmake/check-versions.sh --quiet --update +# no need for contrib/android/check-versions.sh, it isn't distributed in tarballs From cfab985ac13d9db9d0ab9c56ecfc3215c2010a50 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 1 Feb 2023 09:09:28 +0100 Subject: [PATCH 34/36] darwin: don't forget to filter perflevel caches Forgotten in f7c9aa86c2f8ce8717ce4381357d3b98518d14ca Thanks to Michel Lesoinne for the report. Closes #564 Signed-off-by: Brice Goglin (cherry picked from commit aa0ef16c41279cdfd1a6f5d276cfdb2d46ee88bd) --- NEWS | 2 ++ hwloc/topology-darwin.c | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index a6f45a5762..ea7529bb9b 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,8 @@ bug fixes (and other actions) for each version of hwloc since version Version 2.8.1 ------------- +* Don't forget to apply filters to "perflevel" caches detected on recent + Mac OS X releases, thanks to Michel Lesoinne for the report. * Add support for CUDA compute capability up to 9.0. diff --git a/hwloc/topology-darwin.c b/hwloc/topology-darwin.c index 9811e8e538..1e79f3dd3e 100644 --- a/hwloc/topology-darwin.c +++ b/hwloc/topology-darwin.c @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2022 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2013 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -456,7 +456,8 @@ static void hwloc__darwin_look_perflevel_caches(struct hwloc_topology *topology, int64_t size; snprintf(name, sizeof(name), "hw.perflevel%u.l1icachesize", level); - if (!hwloc_get_sysctlbyname(name, &size)) { + if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1ICACHE) + && !hwloc_get_sysctlbyname(name, &size)) { /* hw.perflevel%u.cpusperl1i missing, assume it's per PU */ hwloc_debug("found perflevel %u l1icachesize %ld, assuming width 1\n", level, (long) size); hwloc__darwin_build_perflevel_cache_level(topology, cpuset, 1, HWLOC_OBJ_L1ICACHE, 1, size, linesize); @@ -464,7 +465,8 @@ static void hwloc__darwin_look_perflevel_caches(struct hwloc_topology *topology, } snprintf(name, sizeof(name), "hw.perflevel%u.l1dcachesize", level); - if (!hwloc_get_sysctlbyname(name, &size)) { + if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L1CACHE) + && !hwloc_get_sysctlbyname(name, &size)) { /* hw.perflevel%u.cpusperl1d missing, assume it's per PU */ hwloc_debug("found perflevel %u l1dcachesize %ld, assuming width 1\n", level, (long) size); hwloc__darwin_build_perflevel_cache_level(topology, cpuset, 1, HWLOC_OBJ_L1CACHE, 1, size, linesize); @@ -472,7 +474,8 @@ static void hwloc__darwin_look_perflevel_caches(struct hwloc_topology *topology, } snprintf(name, sizeof(name), "hw.perflevel%u.l2cachesize", level); - if (!hwloc_get_sysctlbyname(name, &size)) { + if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L2CACHE) + && !hwloc_get_sysctlbyname(name, &size)) { int64_t cpus; hwloc_debug("found perflevel %u l2cachesize %ld\n", level, (long) size); @@ -499,10 +502,11 @@ static void hwloc__darwin_look_perflevel_caches(struct hwloc_topology *topology, /* assume PUs are contigous for now. */ hwloc__darwin_build_perflevel_cache_level(topology, cpuset, cpus, HWLOC_OBJ_L2CACHE, 2, size, linesize); gothybrid->l2++; -} + } snprintf(name, sizeof(name), "hw.perflevel%u.l3cachesize", level); - if (!hwloc_get_sysctlbyname(name, &size)) { + if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_L3CACHE) + && !hwloc_get_sysctlbyname(name, &size)) { int64_t cpus; hwloc_debug("found perflevel %u l3cachesize %ld\n", level, (long) size); From 1a5a66d1f7f42d84271863ec0fd9d4dddcae8863 Mon Sep 17 00:00:00 2001 From: Michel Lesoinne Date: Mon, 30 Jan 2023 11:17:48 -0700 Subject: [PATCH 35/36] feat: Create a CMakeLists.txt file Currently only effective for MacOS. Hoping it can be improved to become general for more systems. --- CMakeLists.txt | 257 ++++++++ cmake/hwlocConfig.cmake.in | 4 + contrib/macos/hwloc_config.h | 242 +++++++ contrib/macos/private_config.h.in | 930 +++++++++++++++++++++++++++ contrib/macos/static-components.h.in | 19 + 5 files changed, 1452 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cmake/hwlocConfig.cmake.in create mode 100644 contrib/macos/hwloc_config.h create mode 100644 contrib/macos/private_config.h.in create mode 100644 contrib/macos/static-components.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..00b94fba96 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,257 @@ +cmake_minimum_required(VERSION 3.24) +project(hwloc + LANGUAGES C + VERSION 3.0.0) + +enable_testing() + +if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + set( STANDALONE TRUE ) +endif() + +option(HWLOC_ENABLE_TESTING "Enable testing" ON) +option(HWLOC_SKIP_LSTOPO "don't build/install lstopo") +option(HWLOC_SKIP_TOOLS "don't build/install other hwloc tools") +option(HWLOC_SKIP_INCLUDES "don't install headers") +option(HWLOC_WITH_LIBXML2 "use libxml2 instead of minimal XML") +option(HWLOC_WITH_OPENCL "enable OpenCL support") +option(HWLOC_WITH_CUDA "enable CUDA support") +option(HWLOC_BUILD_SHARED_LIBS "build shared libraries" ${BUILD_SHARED_LIBS}) + +set(TOPDIR .) +#configure_file(${TOPDIR}/contrib/windows/hwloc_config.h include/hwloc/autogen/config.h COPYONLY) + +# Configure dynamically based on platform capabilities +include(CheckIncludeFile) +include(CheckSymbolExists) +include(CheckCSourceCompiles) + +check_include_file("dirent.h" HAVE_DIRENT_H) +check_include_file("unistd.h" HAVE_UNISTD_H) +check_include_file("malloc.h" HAVE_MALLOC_H) +check_include_file("memory.h" HAVE_MEMORY_H) + +check_symbol_exists(mkstemp "stdlib.h" HAVE_MKSTEMP) +check_symbol_exists(memalign "malloc.h" HAVE_MEMALIGN) + +check_symbol_exists(strncasecmp "strings.h" HAVE_STRNCASECMP) +if(MSVC AND HAVE_STRNCASECMP) + set(hwloc_strncasecmp 1) + set(hwloc_strncasecmp_fcn strncasecmp) +else() + set(hwloc_strncasecmp 0) + set(hwloc_strncasecmp_fcn strncmp) +endif() + + +set(SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) +# disable x86 entirely by default +set(HWLOC_X86_32_ARCH) +set(HWLOC_X86_64_ARCH) +set(HWLOC_HAVE_X86_CPUID 1) +if (CMAKE_SYSTEM_PROCESSOR MATCHES "(^AMD64$|^x86_64$)") + # "AMD64" on Windows, "x86_64" on Linux + set(HWLOC_X86_64_ARCH 1) +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "(^x86$|i.86)") + # "x86" on Windows, "i.86" on Linux + set(HWLOC_X86_32_ARCH 1) +else() + set(HWLOC_HAVE_X86_CPUID 0) +endif() + +check_c_source_compiles("int main(void) {int cpuinfo[4]; __cpuidex(cpuinfo,0,0); return 0;}" + HWLOC_HAVE_MSVC_CPUIDEX + ) + +# the following lines are disabled until we are sure they are safe with old build environmentx +# - snprintf() returned broken values in the past, hwloc detects it during configure (see 7a4ee26510c06b55fc04aaccbfa18d0ca3b87198) +# set(HAVE_DECL_SNPRINTF 1) +# - strtoull() had some issues in the past (see 9559bd08b79ef63dce45df87fb7f875b73ecb512) +# set(HAVE_DECL_STRTOULL 1) + +# --- optional external libraries +set(HWLOC_HAVE_LIBXML2) +if(HWLOC_WITH_LIBXML2) + find_package(LibXml2 REQUIRED) + set(HWLOC_HAVE_LIBXML2 1) +endif() + +set(HWLOC_HAVE_OPENCL) +if(HWLOC_WITH_OPENCL) + find_package(OpenCL REQUIRED) + set(HWLOC_HAVE_OPENCL 1) +endif() + +set(HAVE_CUDA) +set(HAVE_CUDA_H) +set(HAVE_CUDA_RUNTIME_API_H) +set(HWLOC_HAVE_CUDART) +if(HWLOC_WITH_CUDA) + find_package(CUDAToolkit REQUIRED) + set(HAVE_CUDA 1) + set(HAVE_CUDA_H 1) + set(HAVE_CUDA_RUNTIME_API_H 1) + set(HWLOC_HAVE_CUDART 1) +endif() + +# Library + +add_compile_definitions($<$:HWLOC_DEBUG=1>) + +add_library(hwloc) +add_library(hwloc::hwloc ALIAS hwloc) +target_sources(hwloc PRIVATE + ${TOPDIR}/hwloc/topology.c + ${TOPDIR}/hwloc/traversal.c + ${TOPDIR}/hwloc/distances.c + ${TOPDIR}/hwloc/memattrs.c + ${TOPDIR}/hwloc/cpukinds.c + ${TOPDIR}/hwloc/components.c + ${TOPDIR}/hwloc/bind.c + ${TOPDIR}/hwloc/bitmap.c + ${TOPDIR}/hwloc/pci-common.c + ${TOPDIR}/hwloc/diff.c + ${TOPDIR}/hwloc/shmem.c + ${TOPDIR}/hwloc/misc.c + ${TOPDIR}/hwloc/base64.c + ${TOPDIR}/hwloc/topology-noos.c + ${TOPDIR}/hwloc/topology-synthetic.c + ${TOPDIR}/hwloc/topology-xml.c + ${TOPDIR}/hwloc/topology-xml-nolibxml.c + $<$:${TOPDIR}/hwloc/topology-windows.c> + ${TOPDIR}/hwloc/topology-x86.c + $<$:${TOPDIR}/hwloc/topology-xml-libxml.c> + $<$:${TOPDIR}/hwloc/topology-opencl.c> + $<$:${TOPDIR}/hwloc/topology-cuda.c> + PRIVATE FILE_SET private_headers TYPE HEADERS + BASE_DIRS ${PROJECT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include/ + FILES + ${CMAKE_CURRENT_BINARY_DIR}/include/private/autogen/config.h + ${CMAKE_CURRENT_BINARY_DIR}/include/static-components.h + PUBLIC FILE_SET HEADERS + BASE_DIRS ${PROJECT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include/ + FILES + include/hwloc.h + include/hwloc/rename.h + include/hwloc/bitmap.h + include/hwloc/helper.h + include/hwloc/inlines.h + include/hwloc/memattrs.h + include/hwloc/cpukinds.h + include/hwloc/export.h + include/hwloc/distances.h + include/hwloc/diff.h + include/hwloc/deprecated.h + ${CMAKE_CURRENT_BINARY_DIR}/include/hwloc/autogen/config.h + ) + +if (APPLE) + set (OS_CONTRIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/macos) + + configure_file(${OS_CONTRIB_DIR}/private_config.h.in include/private/autogen/config.h) + configure_file(${OS_CONTRIB_DIR}/static-components.h.in include/static-components.h) + configure_file(${OS_CONTRIB_DIR}/hwloc_config.h include/hwloc/autogen/config.h COPYONLY) + + target_sources(hwloc PRIVATE + ${TOPDIR}/hwloc/topology-darwin.c + ) + target_link_libraries(hwloc PUBLIC "-framework CoreFoundation" "-framework IOKit") +endif () + +if (STANDALONE) + #if(HWLOC_ENABLE_TESTING) + #add_subdirectory(${TOPDIR}/tests/hwloc ${CMAKE_CURRENT_BINARY_DIR}/tests/hwloc) + #endif() + # Tools under utils/hwloc + + if (NOT HWLOC_SKIP_TOOLS) + + set(TOOLS + hwloc-bind + hwloc-calc + hwloc-diff + hwloc-distrib + hwloc-gather-cpuid + hwloc-info + hwloc-patch + ) + + foreach (tool IN ITEMS ${TOOLS}) + add_executable(${tool} + ${TOPDIR}/utils/hwloc/${tool}.c) + target_link_libraries(${tool} hwloc) + endforeach (tool) + + endif () + + if (NOT HWLOC_SKIP_LSTOPO) + + set(LSTOPOS + lstopo-no-graphics + # lstopo + # lstopo-win + ) + + # set(LSTOPO_COMMON_SOURCES + # ${TOPDIR}/utils/lstopo/lstopo.c + # ${TOPDIR}/utils/lstopo/lstopo-draw.c + # ${TOPDIR}/utils/lstopo/lstopo-tikz.c + # ${TOPDIR}/utils/lstopo/lstopo-fig.c + # ${TOPDIR}/utils/lstopo/lstopo-svg.c + # ${TOPDIR}/utils/lstopo/lstopo-ascii.c + # ${TOPDIR}/utils/lstopo/lstopo-text.c + # ${TOPDIR}/utils/lstopo/lstopo-xml.c + # ${TOPDIR}/utils/hwloc/common-ps.c + # ) + # + # add_executable(lstopo-no-graphics + # ${LSTOPO_COMMON_SOURCES} + # ) + # target_link_libraries(lstopo-no-graphics PRIVATE hwloc) + + # add_executable(lstopo + # ${LSTOPO_COMMON_SOURCES} + ## ${TOPDIR}/utils/lstopo/lstopo-windows.c + # ) + # target_compile_definitions(lstopo PRIVATE LSTOPO_HAVE_GRAPHICS) + + # add_executable(lstopo-win WIN32 + # ${LSTOPO_COMMON_SOURCES} + # ${TOPDIR}/utils/lstopo/lstopo-windows.c + # ) + # target_compile_definitions(lstopo-win PRIVATE LSTOPO_HAVE_GRAPHICS) + # target_link_options(lstopo-win PRIVATE "$<$:/subsystem:windows;/entry:mainCRTStartup>") + + + endif () + + include(GNUInstallDirs) + include(CMakePackageConfigHelpers) + + install(TARGETS hwloc + EXPORT ${PROJECT_NAME}_Targets + FILE_SET HEADERS + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include) + + install(EXPORT ${PROJECT_NAME}_Targets + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + DESTINATION lib/cmake/hwloc) + + write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion) + + configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in" + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION + ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) + + install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) +endif () diff --git a/cmake/hwlocConfig.cmake.in b/cmake/hwlocConfig.cmake.in new file mode 100644 index 0000000000..ff0fa6724e --- /dev/null +++ b/cmake/hwlocConfig.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +check_required_components("@PROJECT_NAME@") \ No newline at end of file diff --git a/contrib/macos/hwloc_config.h b/contrib/macos/hwloc_config.h new file mode 100644 index 0000000000..c97c4b1a99 --- /dev/null +++ b/contrib/macos/hwloc_config.h @@ -0,0 +1,242 @@ +/* include/hwloc/autogen/config.h. Generated from config.h.in by configure. */ +/* -*- c -*- + * Copyright © 2009 CNRS + * Copyright © 2009-2022 Inria. All rights reserved. + * Copyright © 2009-2012 Université Bordeaux + * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. + * See COPYING in top-level directory. + */ + +/* The configuration file */ + +#ifndef HWLOC_CONFIG_H +#define HWLOC_CONFIG_H + +#define HWLOC_VERSION "2.9.0" +#define HWLOC_VERSION_MAJOR 2 +#define HWLOC_VERSION_MINOR 9 +#define HWLOC_VERSION_RELEASE 0 +#define HWLOC_VERSION_GREEK "" + +/* #undef HWLOC_PCI_COMPONENT_BUILTIN */ +#define HWLOC_OPENCL_COMPONENT_BUILTIN 1 +/* #undef HWLOC_CUDA_COMPONENT_BUILTIN */ +/* #undef HWLOC_NVML_COMPONENT_BUILTIN */ +/* #undef HWLOC_RSMI_COMPONENT_BUILTIN */ +/* #undef HWLOC_LEVELZERO_COMPONENT_BUILTIN */ +/* #undef HWLOC_GL_COMPONENT_BUILTIN */ +#define HWLOC_XML_LIBXML_COMPONENT_BUILTIN 1 + +#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) +# define __hwloc_restrict __restrict +#else +# if __STDC_VERSION__ >= 199901L +# define __hwloc_restrict restrict +# else +# define __hwloc_restrict +# endif +#endif + +/* Note that if we're compiling C++, then just use the "inline" + keyword, since it's part of C++ */ +#if defined(c_plusplus) || defined(__cplusplus) +# define __hwloc_inline inline +#elif defined(_MSC_VER) || defined(__HP_cc) +# define __hwloc_inline __inline +#else +# define __hwloc_inline __inline__ +#endif + +/* + * Note: this is public. We can not assume anything from the compiler used + * by the application and thus the HWLOC_HAVE_* macros below are not + * fetched from the autoconf result here. We only automatically use a few + * well-known easy cases. + */ + +/* Some handy constants to make the logic below a little more readable */ +#if defined(__cplusplus) && \ + (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR >= 4)) +#define GXX_ABOVE_3_4 1 +#else +#define GXX_ABOVE_3_4 0 +#endif + +#if !defined(__cplusplus) && \ + (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) +#define GCC_ABOVE_2_95 1 +#else +#define GCC_ABOVE_2_95 0 +#endif + +#if !defined(__cplusplus) && \ + (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)) +#define GCC_ABOVE_2_96 1 +#else +#define GCC_ABOVE_2_96 0 +#endif + +#if !defined(__cplusplus) && \ + (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +#define GCC_ABOVE_3_3 1 +#else +#define GCC_ABOVE_3_3 0 +#endif + +#if !defined(__cplusplus) && \ + (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#define GCC_ABOVE_3_4 1 +#else +#define GCC_ABOVE_3_4 0 +#endif + +/* Maybe before gcc 2.95 too */ +#ifdef HWLOC_HAVE_ATTRIBUTE_UNUSED +#define __HWLOC_HAVE_ATTRIBUTE_UNUSED HWLOC_HAVE_ATTRIBUTE_UNUSED +#elif defined(__GNUC__) +# define __HWLOC_HAVE_ATTRIBUTE_UNUSED (GXX_ABOVE_3_4 || GCC_ABOVE_2_95) +#else +# define __HWLOC_HAVE_ATTRIBUTE_UNUSED 0 +#endif +#if __HWLOC_HAVE_ATTRIBUTE_UNUSED +# define __hwloc_attribute_unused __attribute__((__unused__)) +#else +# define __hwloc_attribute_unused +#endif + +#ifdef HWLOC_HAVE_ATTRIBUTE_MALLOC +#define __HWLOC_HAVE_ATTRIBUTE_MALLOC HWLOC_HAVE_ATTRIBUTE_MALLOC +#elif defined(__GNUC__) +# define __HWLOC_HAVE_ATTRIBUTE_MALLOC (GXX_ABOVE_3_4 || GCC_ABOVE_2_96) +#else +# define __HWLOC_HAVE_ATTRIBUTE_MALLOC 0 +#endif +#if __HWLOC_HAVE_ATTRIBUTE_MALLOC +# define __hwloc_attribute_malloc __attribute__((__malloc__)) +#else +# define __hwloc_attribute_malloc +#endif + +#ifdef HWLOC_HAVE_ATTRIBUTE_CONST +#define __HWLOC_HAVE_ATTRIBUTE_CONST HWLOC_HAVE_ATTRIBUTE_CONST +#elif defined(__GNUC__) +# define __HWLOC_HAVE_ATTRIBUTE_CONST (GXX_ABOVE_3_4 || GCC_ABOVE_2_95) +#else +# define __HWLOC_HAVE_ATTRIBUTE_CONST 0 +#endif +#if __HWLOC_HAVE_ATTRIBUTE_CONST +# define __hwloc_attribute_const __attribute__((__const__)) +#else +# define __hwloc_attribute_const +#endif + +#ifdef HWLOC_HAVE_ATTRIBUTE_PURE +#define __HWLOC_HAVE_ATTRIBUTE_PURE HWLOC_HAVE_ATTRIBUTE_PURE +#elif defined(__GNUC__) +# define __HWLOC_HAVE_ATTRIBUTE_PURE (GXX_ABOVE_3_4 || GCC_ABOVE_2_96) +#else +# define __HWLOC_HAVE_ATTRIBUTE_PURE 0 +#endif +#if __HWLOC_HAVE_ATTRIBUTE_PURE +# define __hwloc_attribute_pure __attribute__((__pure__)) +#else +# define __hwloc_attribute_pure +#endif + +#ifndef __hwloc_attribute_deprecated /* allow the user to disable these warnings by defining this macro to nothing */ +#ifdef HWLOC_HAVE_ATTRIBUTE_DEPRECATED +#define __HWLOC_HAVE_ATTRIBUTE_DEPRECATED HWLOC_HAVE_ATTRIBUTE_DEPRECATED +#elif defined(__GNUC__) +# define __HWLOC_HAVE_ATTRIBUTE_DEPRECATED (GXX_ABOVE_3_4 || GCC_ABOVE_3_3) +#else +# define __HWLOC_HAVE_ATTRIBUTE_DEPRECATED 0 +#endif +#if __HWLOC_HAVE_ATTRIBUTE_DEPRECATED +# define __hwloc_attribute_deprecated __attribute__((__deprecated__)) +#else +# define __hwloc_attribute_deprecated +#endif +#endif + +#ifdef HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS +#define __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS +#elif defined(__GNUC__) +# define __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS (GXX_ABOVE_3_4 || GCC_ABOVE_3_3) +#else +# define __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS 0 +#endif +#if __HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS +# define __hwloc_attribute_may_alias __attribute__((__may_alias__)) +#else +# define __hwloc_attribute_may_alias +#endif + +#ifdef HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT +#define __HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT +#elif defined(__GNUC__) +# define __HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT (GXX_ABOVE_3_4 || GCC_ABOVE_3_4) +#else +# define __HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT 0 +#endif +#if __HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT +# define __hwloc_attribute_warn_unused_result __attribute__((__warn_unused_result__)) +#else +# define __hwloc_attribute_warn_unused_result +#endif + +#ifdef HWLOC_C_HAVE_VISIBILITY +# if HWLOC_C_HAVE_VISIBILITY +# define HWLOC_DECLSPEC __attribute__((__visibility__("default"))) +# else +# define HWLOC_DECLSPEC +# endif +#else +# define HWLOC_DECLSPEC +#endif + +/* Defined to 1 on Linux */ +/* #undef HWLOC_LINUX_SYS */ + +/* Defined to 1 if the CPU_SET macro works */ +/* #undef HWLOC_HAVE_CPU_SET */ + +/* Defined to 1 if you have the `windows.h' header. */ +/* #undef HWLOC_HAVE_WINDOWS_H */ +#define hwloc_pid_t pid_t +#define hwloc_thread_t pthread_t + +#ifdef HWLOC_HAVE_WINDOWS_H + +# include +typedef DWORDLONG hwloc_uint64_t; + +#else /* HWLOC_HAVE_WINDOWS_H */ + +# ifdef hwloc_thread_t +# include +# endif /* hwloc_thread_t */ + +/* Defined to 1 if you have the header file. */ +# define HWLOC_HAVE_STDINT_H 1 + +# include +# ifdef HWLOC_HAVE_STDINT_H +# include +# endif +typedef uint64_t hwloc_uint64_t; + +#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 */ +#define HWLOC_SYM_TRANSFORM 0 + +/* The hwloc symbol prefix */ +#define HWLOC_SYM_PREFIX hwloc_ + +/* The hwloc symbol prefix in all caps */ +#define HWLOC_SYM_PREFIX_CAPS HWLOC_ + +#endif /* HWLOC_CONFIG_H */ diff --git a/contrib/macos/private_config.h.in b/contrib/macos/private_config.h.in new file mode 100644 index 0000000000..ac8cd943c9 --- /dev/null +++ b/contrib/macos/private_config.h.in @@ -0,0 +1,930 @@ +/* include/private/autogen/config.h. Generated from config.h.in by configure. */ +/* include/private/autogen/config.h.in. Generated from configure.ac by autoheader. */ + +/* -*- c -*- + * + * Copyright © 2009, 2011, 2012 CNRS, inria., Université Bordeaux All rights reserved. + * Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. + * Copyright © 2022 IBM Corporation. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * This file is automatically generated by configure. Edits will be lost + * the next time you run configure! + */ + +#ifndef HWLOC_CONFIGURE_H +#define HWLOC_CONFIGURE_H + + +/* Define to 1 if the system has the type `CACHE_DESCRIPTOR'. */ +/* #undef HAVE_CACHE_DESCRIPTOR */ + +/* Define to 1 if the system has the type `CACHE_RELATIONSHIP'. */ +/* #undef HAVE_CACHE_RELATIONSHIP */ + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the `clz' function. */ +/* #undef HAVE_CLZ */ + +/* Define to 1 if you have the `clzl' function. */ +/* #undef HAVE_CLZL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CL_CL_EXT_H */ + +/* Define to 1 if you have the `cpuset_setaffinity' function. */ +/* #undef HAVE_CPUSET_SETAFFINITY */ + +/* Define to 1 if you have the `cpuset_setid' function. */ +/* #undef HAVE_CPUSET_SETID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if we have -lcuda */ +#cmakedefine HAVE_CUDA @HAVE_CUDA@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CUDA_H @HAVE_CUDA_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CUDA_RUNTIME_API_H @HAVE_CUDA_RUNTIME_API_H@ + +/* Define to 1 if you have the declaration of `bind', and to 0 if you don't. + */ +#define HAVE_DECL_BIND 1 + +/* Define to 1 if you have the declaration of `CTL_HW', and to 0 if you don't. + */ +#define HAVE_DECL_CTL_HW 1 + +/* Define to 1 if you have the declaration of `fabsf', and to 0 if you don't. + */ +#define HAVE_DECL_FABSF 1 + +/* Define to 1 if you have the declaration of `getexecname', and to 0 if you + don't. */ +#define HAVE_DECL_GETEXECNAME 0 + +/* Define to 1 if you have the declaration of `GetModuleFileName', and to 0 if + you don't. */ +/* #undef HAVE_DECL_GETMODULEFILENAME */ + +/* Define to 1 if you have the declaration of `getprogname', and to 0 if you + don't. */ +#define HAVE_DECL_GETPROGNAME 1 + +/* Define to 1 if you have the declaration of `HW_MEMSIZE', and to 0 if you + don't. */ +#define HAVE_DECL_HW_MEMSIZE 1 + +/* Define to 1 if you have the declaration of `HW_MEMSIZE64', and to 0 if you + don't. */ +#define HAVE_DECL_HW_MEMSIZE64 0 + +/* Define to 1 if you have the declaration of `HW_NCPU', and to 0 if you + don't. */ +#define HAVE_DECL_HW_NCPU 1 + +/* Define to 1 if you have the declaration of `HW_PHYSMEM', and to 0 if you + don't. */ +#define HAVE_DECL_HW_PHYSMEM 1 + +/* Define to 1 if you have the declaration of `HW_PHYSMEM64', and to 0 if you + don't. */ +#define HAVE_DECL_HW_PHYSMEM64 0 + +/* Define to 1 if you have the declaration of `HW_REALMEM', and to 0 if you + don't. */ +#define HAVE_DECL_HW_REALMEM 0 + +/* Define to 1 if you have the declaration of `HW_REALMEM64', and to 0 if you + don't. */ +#define HAVE_DECL_HW_REALMEM64 0 + +/* Define to 1 if you have the declaration of `HW_USERMEM', and to 0 if you + don't. */ +#define HAVE_DECL_HW_USERMEM 1 + +/* Define to 1 if you have the declaration of `HW_USERMEM64', and to 0 if you + don't. */ +#define HAVE_DECL_HW_USERMEM64 0 + +/* 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 */ + +/* Define to 1 if you have the declaration of `modff', and to 0 if you don't. + */ +#define HAVE_DECL_MODFF 1 + +/* Define to 1 if you have the declaration of + `nvmlDeviceGetMaxPcieLinkGeneration', and to 0 if you don't. */ +/* #undef HAVE_DECL_NVMLDEVICEGETMAXPCIELINKGENERATION */ + +/* Define to 1 if you have the declaration of `pthread_getaffinity_np', and to + 0 if you don't. */ +#define HAVE_DECL_PTHREAD_GETAFFINITY_NP 0 + +/* Define to 1 if you have the declaration of `pthread_setaffinity_np', and to + 0 if you don't. */ +#define HAVE_DECL_PTHREAD_SETAFFINITY_NP 0 + +/* Embedded mode; just assume we do not have Valgrind support */ +#define HAVE_DECL_RUNNING_ON_VALGRIND 0 + +/* Define to 1 if you have the declaration of `sched_getcpu', and to 0 if you + don't. */ +/* #undef HAVE_DECL_SCHED_GETCPU */ + +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#define HAVE_DECL_SNPRINTF 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + +/* Define to 1 if you have the declaration of `_putenv', and to 0 if you + don't. */ +#define HAVE_DECL__PUTENV 0 + +/* Define to 1 if you have the declaration of `_SC_LARGE_PAGESIZE', and to 0 + if you don't. */ +#define HAVE_DECL__SC_LARGE_PAGESIZE 0 + +/* Define to 1 if you have the declaration of `_SC_NPROCESSORS_CONF', and to 0 + if you don't. */ +#define HAVE_DECL__SC_NPROCESSORS_CONF 1 + +/* Define to 1 if you have the declaration of `_SC_NPROCESSORS_ONLN', and to 0 + if you don't. */ +#define HAVE_DECL__SC_NPROCESSORS_ONLN 1 + +/* Define to 1 if you have the declaration of `_SC_NPROC_CONF', and to 0 if + you don't. */ +#define HAVE_DECL__SC_NPROC_CONF 0 + +/* Define to 1 if you have the declaration of `_SC_NPROC_ONLN', and to 0 if + you don't. */ +#define HAVE_DECL__SC_NPROC_ONLN 0 + +/* Define to 1 if you have the declaration of `_SC_PAGESIZE', and to 0 if you + don't. */ +#define HAVE_DECL__SC_PAGESIZE 1 + +/* Define to 1 if you have the declaration of `_SC_PAGE_SIZE', and to 0 if you + don't. */ +#define HAVE_DECL__SC_PAGE_SIZE 1 + +/* Define to 1 if you have the declaration of `_strdup', and to 0 if you + don't. */ +#define HAVE_DECL__STRDUP 0 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DIRENT_H @HAVE_DIRENT_H@ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `ffs' function. */ +#define HAVE_FFS 1 + +/* Define to 1 if you have the `ffsl' function. */ +#define HAVE_FFSL 1 + +/* Define to 1 if you have the `fls' function. */ +#define HAVE_FLS 1 + +/* Define to 1 if you have the `flsl' function. */ +#define HAVE_FLSL 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if the system has the type `GROUP_AFFINITY'. */ +/* #undef HAVE_GROUP_AFFINITY */ + +/* Define to 1 if the system has the type `GROUP_RELATIONSHIP'. */ +/* #undef HAVE_GROUP_RELATIONSHIP */ + +/* Define to 1 if you have the `host_info' function. */ +#define HAVE_HOST_INFO 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INFINIBAND_VERBS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isatty' function. */ +#define HAVE_ISATTY 1 + +/* Define to 1 if the system has the type `KAFFINITY'. */ +/* #undef HAVE_KAFFINITY */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_KSTAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LEVEL_ZERO_ZES_API_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LEVEL_ZERO_ZE_API_H */ + +/* Define to 1 if we have -lgdi32 */ +/* #undef HAVE_LIBGDI32 */ + +/* Define to 1 if we have -libverbs */ +/* #undef HAVE_LIBIBVERBS */ + +/* Define to 1 if we have -lkstat */ +/* #undef HAVE_LIBKSTAT */ + +/* Define to 1 if we have -llgrp */ +/* #undef HAVE_LIBLGRP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUDEV_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* 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. */ +#define HAVE_MACH_MACH_HOST_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MACH_MACH_INIT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MALLOC_H @HAVE_MALLOC_H@ + +/* Define to 1 if you have the `memalign' function. */ +#cmakedefine HAVE_MEMALIGN @HAVE_MEMALIGN@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H @HAVE_MEMORY_H@ + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MPI_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if the system has the type `NUMA_NODE_RELATIONSHIP'. */ +/* #undef HAVE_NUMA_NODE_RELATIONSHIP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NVCTRL_NVCTRL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NVML_H */ + +/* Define to 1 if you have the `openat' function. */ +#define HAVE_OPENAT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENCL_CL_EXT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PICL_H */ + +/* Define to 1 if you have the `posix_memalign' function. */ +#define HAVE_POSIX_MEMALIGN 1 + +/* Define to 1 if the system has the type `PROCESSOR_CACHE_TYPE'. */ +/* #undef HAVE_PROCESSOR_CACHE_TYPE */ + +/* Define to 1 if the system has the type `PROCESSOR_GROUP_INFO'. */ +/* #undef HAVE_PROCESSOR_GROUP_INFO */ + +/* Define to 1 if the system has the type `PROCESSOR_NUMBER'. */ +/* #undef HAVE_PROCESSOR_NUMBER */ + +/* Define to 1 if the system has the type `PROCESSOR_RELATIONSHIP'. */ +/* #undef HAVE_PROCESSOR_RELATIONSHIP */ + +/* Define to '1' if program_invocation_name is present and usable */ +/* #undef HAVE_PROGRAM_INVOCATION_NAME */ + +/* Define to 1 if the system has the type `PSAPI_WORKING_SET_EX_BLOCK'. */ +/* #undef HAVE_PSAPI_WORKING_SET_EX_BLOCK */ + +/* Define to 1 if the system has the type `PSAPI_WORKING_SET_EX_INFORMATION'. + */ +/* #undef HAVE_PSAPI_WORKING_SET_EX_INFORMATION */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PTHREAD_NP_H */ + +/* Define to 1 if the system has the type `pthread_t'. */ +#define HAVE_PTHREAD_T 1 + +/* Define to 1 if you have the `putwc' function. */ +#define HAVE_PUTWC 1 + +/* Define to 1 if the system has the type `RelationProcessorPackage'. */ +/* #undef HAVE_RELATIONPROCESSORPACKAGE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ROCM_SMI_ROCM_SMI_H */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if the system has the type `ssize_t'. */ +#define HAVE_SSIZE_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#cmakedefine HAVE_STRNCASECMP @HAVE_STRNCASECMP@ + +/* Define to 1 if you have the `strtoull' function. */ +/* #undef HAVE_STRTOULL */ + +/* Define to '1' if sysctl is present and usable */ +#define HAVE_SYSCTL 1 + +/* Define to '1' if sysctlbyname is present and usable */ +#define HAVE_SYSCTLBYNAME 1 + +/* Define to 1 if the system has the type + `SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX'. */ +/* #undef HAVE_SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX */ + +/* 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 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCTL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_THR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UTSNAME_H 1 + +/* Define to 1 if you have the `tcgetpgrp' function. */ +#define HAVE_TCGETPGRP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the `uname' function. */ +#define HAVE_UNAME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ + +/* Define to 1 if you have the `uselocale' function. */ +#define HAVE_USELOCALE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VALGRIND_VALGRIND_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if the system has the type `wchar_t'. */ +#define HAVE_WCHAR_T 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_X11_KEYSYM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_X11_XLIB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_X11_XUTIL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_XLOCALE_H 1 + +/* Define to '1' if __progname is present and usable */ +#define HAVE___PROGNAME 1 + +/* Define to 1 on AIX */ +/* #undef HWLOC_AIX_SYS */ + +/* Define to the location of the archivemount program */ +/* #undef HWLOC_ARCHIVEMOUNT_PATH */ + +/* Define to 1 on BlueGene/Q */ +/* #undef HWLOC_BGQ_SYS */ + +/* Define if the CUDA component is built statically inside libhwloc */ +/* #undef HWLOC_CUDA_COMPONENT_BUILTIN */ + +/* Whether C compiler supports symbol visibility or not */ +#define HWLOC_C_HAVE_VISIBILITY 1 + +/* Define to 1 on Darwin */ +#define HWLOC_DARWIN_SYS 1 + +/* Whether we are in debugging mode or not */ +/* #undef HWLOC_DEBUG */ + +/* Define to 1 on *FREEBSD */ +/* #undef HWLOC_FREEBSD_SYS */ + +/* Define if the GL component is built statically inside libhwloc */ +/* #undef HWLOC_GL_COMPONENT_BUILTIN */ + +/* Define to 1 if --enable-32bits-pci-domain is called. */ +/* #undef HWLOC_HAVE_32BITS_PCI_DOMAIN */ + +/* Whether your compiler has __attribute__ or not */ +#define HWLOC_HAVE_ATTRIBUTE + +/* Whether your compiler has __attribute__ aligned or not */ +#define HWLOC_HAVE_ATTRIBUTE_ALIGNED 1 + +/* Whether your compiler has __attribute__ always_inline or not */ +#define HWLOC_HAVE_ATTRIBUTE_ALWAYS_INLINE 1 + +/* Whether your compiler has __attribute__ cold or not */ +#define HWLOC_HAVE_ATTRIBUTE_COLD 1 + +/* Whether your compiler has __attribute__ const or not */ +#define HWLOC_HAVE_ATTRIBUTE_CONST 1 + +/* Whether your compiler has __attribute__ constructor or not */ +#define HWLOC_HAVE_ATTRIBUTE_CONSTRUCTOR 1 + +/* Whether your compiler has __attribute__ deprecated or not */ +#define HWLOC_HAVE_ATTRIBUTE_DEPRECATED 1 + +/* Whether your compiler has __attribute__ format or not */ +#define HWLOC_HAVE_ATTRIBUTE_FORMAT 1 + +/* Whether your compiler has __attribute__ hot or not */ +#define HWLOC_HAVE_ATTRIBUTE_HOT 1 + +/* Whether your compiler has __attribute__ malloc or not */ +#define HWLOC_HAVE_ATTRIBUTE_MALLOC 1 + +/* Whether your compiler has __attribute__ may_alias or not */ +#define HWLOC_HAVE_ATTRIBUTE_MAY_ALIAS 1 + +/* Whether your compiler has __attribute__ nonnull or not */ +#define HWLOC_HAVE_ATTRIBUTE_NONNULL 1 + +/* Whether your compiler has __attribute__ noreturn or not */ +#define HWLOC_HAVE_ATTRIBUTE_NORETURN 1 + +/* Whether your compiler has __attribute__ no_instrument_function or not */ +#define HWLOC_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION 1 + +/* Whether your compiler has __attribute__ packed or not */ +#define HWLOC_HAVE_ATTRIBUTE_PACKED 1 + +/* Whether your compiler has __attribute__ pure or not */ +#define HWLOC_HAVE_ATTRIBUTE_PURE 1 + +/* Whether your compiler has __attribute__ sentinel or not */ +#define HWLOC_HAVE_ATTRIBUTE_SENTINEL 1 + +/* Whether your compiler has __attribute__ unused or not */ +#define HWLOC_HAVE_ATTRIBUTE_UNUSED 1 + +/* Whether your compiler has __attribute__ warn unused result or not */ +#define HWLOC_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT 1 + +/* Whether your compiler has __attribute__ weak alias or not */ +#define HWLOC_HAVE_ATTRIBUTE_WEAK_ALIAS 0 + +/* Define to 1 if your `ffs' function is known to be broken. */ +/* #undef HWLOC_HAVE_BROKEN_FFS */ + +/* Define to 1 if you have the `cairo' library. */ +#define HWLOC_HAVE_CAIRO 1 + +/* Define to 1 if you have the `clz' function. */ +/* #undef HWLOC_HAVE_CLZ */ + +/* Define to 1 if you have the `clzl' function. */ +/* #undef HWLOC_HAVE_CLZL */ + +/* Define to 1 if snprintf supports NULL output buffer and returns the correct + length on truncation */ +#define HWLOC_HAVE_CORRECT_SNPRINTF 1 + +/* Define to 1 if the CPU_SET macro works */ +/* #undef HWLOC_HAVE_CPU_SET */ + +/* Define to 1 if the CPU_SET_S macro works */ +/* #undef HWLOC_HAVE_CPU_SET_S */ + +/* Define to 1 if you have the `cudart' SDK. */ +#cmakedefine HWLOC_HAVE_CUDART @HWLOC_HAVE_CUDART@ + +/* `Define to 1 if you have the Foundation Darwin framework' */ +#define HWLOC_HAVE_DARWIN_FOUNDATION 1 + +/* `Define to 1 if you have the IOKit Darwin framework' */ +#define HWLOC_HAVE_DARWIN_IOKIT 1 + +/* Define to 1 if function `clz' is declared by system headers */ +/* #undef HWLOC_HAVE_DECL_CLZ */ + +/* Define to 1 if function `clzl' is declared by system headers */ +/* #undef HWLOC_HAVE_DECL_CLZL */ + +/* Define to 1 if function `ffs' is declared by system headers */ +#define HWLOC_HAVE_DECL_FFS 1 + +/* Define to 1 if function `ffsl' is declared by system headers */ +#define HWLOC_HAVE_DECL_FFSL 1 + +/* Define to 1 if function `fls' is declared by system headers */ +#define HWLOC_HAVE_DECL_FLS 1 + +/* Define to 1 if function `flsl' is declared by system headers */ +#define HWLOC_HAVE_DECL_FLSL 1 + +/* Define to 1 if function `strcasecmp' is declared by system headers */ +#define HWLOC_HAVE_DECL_STRCASECMP 1 + +/* Define to 1 if function `strncasecmp' is declared by system headers */ +#define HWLOC_HAVE_DECL_STRNCASECMP 1 + +/* Define to 1 if you have the `ffs' function. */ +#define HWLOC_HAVE_FFS 1 + +/* Define to 1 if you have the `ffsl' function. */ +#define HWLOC_HAVE_FFSL 1 + +/* Define to 1 if you have the `fls' function. */ +#define HWLOC_HAVE_FLS 1 + +/* Define to 1 if you have the `flsl' function. */ +#define HWLOC_HAVE_FLSL 1 + +/* 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 */ + +/* Define to 1 if you have the `LevelZero' library. */ +/* #undef HWLOC_HAVE_LEVELZERO */ + +/* Define to 1 if you have a library providing the termcap interface */ +#define HWLOC_HAVE_LIBTERMCAP 1 + +/* Define to 1 if you have libudev. */ +/* #undef HWLOC_HAVE_LIBUDEV */ + +/* Define to 1 if you have the `libxml2' library. */ +#cmakedefine HWLOC_HAVE_LIBXML2 @HWLOC_HAVE_LIBXML2@ + +/* Define to 1 for I/O discovery in the Linux component */ +/* #undef HWLOC_HAVE_LINUXIO */ + +/* Define to 1 if enabling Linux-specific PCI discovery in the Linux I/O + 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 */ + +/* Define to 1 if glibc provides the old prototype (without length) of + sched_setaffinity() */ +/* #undef HWLOC_HAVE_OLD_SCHED_SETAFFINITY */ + +/* Define to 1 if you have the `OpenCL' library. */ +#cmakedefine HWLOC_HAVE_OPENCL @HWLOC_HAVE_OPENCL@ + +/* Define to 1 if the hwloc library should support dynamically-loaded plugins + */ +/* #undef HWLOC_HAVE_PLUGINS */ + +/* `Define to 1 if you have pthread_getthrds_np' */ +/* #undef HWLOC_HAVE_PTHREAD_GETTHRDS_NP */ + +/* Define to 1 if pthread mutexes are available */ +#define HWLOC_HAVE_PTHREAD_MUTEX 1 + +/* Define to 1 if you have the `RSMI' library. */ +/* #undef HWLOC_HAVE_RSMI */ + +/* Define to 1 if glibc provides a prototype of sched_setaffinity() */ +/* #undef HWLOC_HAVE_SCHED_SETAFFINITY */ + +/* Define to 1 if you have the header file. */ +#define HWLOC_HAVE_STDINT_H 1 + +/* Define to 1 if function `syscall' is available with 6 parameters */ +/* #undef HWLOC_HAVE_SYSCALL */ + +/* Define to 1 if you have the `windows.h' header. */ +/* #undef HWLOC_HAVE_WINDOWS_H */ + +/* Define to 1 if X11 headers including Xutil.h and keysym.h are available. */ +/* #undef HWLOC_HAVE_X11_KEYSYM */ + +/* Define to 1 if you have x86 cpuid */ +#define HWLOC_HAVE_X86_CPUID 1 + +/* Define to 1 if zeDevicePciGetPropertiesExt is available */ +/* #undef HWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT */ + +/* Define to 1 on HP-UX */ +/* #undef HWLOC_HPUX_SYS */ + +/* Define to 1 on Irix */ +/* #undef HWLOC_IRIX_SYS */ + +/* Define if the LevelZero component is built statically inside libhwloc */ +/* #undef HWLOC_LEVELZERO_COMPONENT_BUILTIN */ + +/* Define to 1 on Linux */ +/* #undef HWLOC_LINUX_SYS */ + +/* Define to 1 on *NETBSD */ +/* #undef HWLOC_NETBSD_SYS */ + +/* Define if the NVML component is built statically inside libhwloc */ +/* #undef HWLOC_NVML_COMPONENT_BUILTIN */ + +/* Define if the OpenCL component is built statically inside libhwloc */ +#define HWLOC_OPENCL_COMPONENT_BUILTIN 1 + +/* Define if the PCI component is built statically inside libhwloc */ +/* #undef HWLOC_PCI_COMPONENT_BUILTIN */ + +/* Define if the RSMI component is built statically inside libhwloc */ +/* #undef HWLOC_RSMI_COMPONENT_BUILTIN */ + +/* The size of `unsigned int', as computed by sizeof */ +#define HWLOC_SIZEOF_UNSIGNED_INT 4 + +/* The size of `unsigned long', as computed by sizeof */ +#define HWLOC_SIZEOF_UNSIGNED_LONG 8 + +/* Define to 1 on Solaris */ +/* #undef HWLOC_SOLARIS_SYS */ + +/* The hwloc symbol prefix */ +#define HWLOC_SYM_PREFIX hwloc_ + +/* The hwloc symbol prefix in all caps */ +#define HWLOC_SYM_PREFIX_CAPS HWLOC_ + +/* Whether we need to re-define all the hwloc public symbols or not */ +#define HWLOC_SYM_TRANSFORM 0 + +/* Define to 1 on unsupported systems */ +/* #undef HWLOC_UNSUPPORTED_SYS */ + +/* Define to 1 if ncurses works, preferred over curses */ +#define HWLOC_USE_NCURSES 1 + +/* The library version, always available, even in embedded mode, contrary to + VERSION */ +#define HWLOC_VERSION "2.9.0" + +/* The library version optional greek suffix string */ +#define HWLOC_VERSION_GREEK "" + +/* The library version major number */ +#define HWLOC_VERSION_MAJOR 2 + +/* The library version minor number */ +#define HWLOC_VERSION_MINOR 9 + +/* The library version release number */ +#define HWLOC_VERSION_RELEASE 0 + +/* Define to 1 on WINDOWS */ +/* #undef HWLOC_WIN_SYS */ + +/* Define to 1 on x86_32 */ +#cmakedefine HWLOC_X86_32_ARCH @HWLOC_X86_32_ARCH@ + +/* Define to 1 on x86_64 */ +#cmakedefine HWLOC_X86_64_ARCH @HWLOC_X86_64_ARCH@ + +/* Define if the libxml XML component is built statically inside libhwloc */ +#define HWLOC_XML_LIBXML_COMPONENT_BUILTIN 1 + +/* Define if lstopo Cairo/X11 interactive graphical output is supported */ +/* #undef LSTOPO_HAVE_X11 */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if scotch is netlocscotch is enabled */ +/* #undef NETLOC_SCOTCH */ + +/* Name of package */ +#define PACKAGE "hwloc" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://github.com/open-mpi/hwloc/issues" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "hwloc" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "hwloc 2.9.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "hwloc" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.9.0" + +/* The size of `unsigned int', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_INT 4 + +/* The size of `unsigned long', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_LONG 8 + +/* The size of `void *', as computed by sizeof. */ +#cmakedefine SIZEOF_VOID_P @SIZEOF_VOID_P@ + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define STDC_HEADERS 1 + +/* Enable extensions on HP-UX. */ +#ifndef _HPUX_SOURCE +# define _HPUX_SOURCE 1 +#endif + + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# define _DARWIN_C_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# define _HPUX_ALT_XOPEN_SOCKET_API 1 +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +/* # undef _MINIX */ +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# define _NETBSD_SOURCE 1 +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# define _OPENBSD_SOURCE 1 +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +/* # undef _POSIX_SOURCE */ +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +/* # undef _POSIX_1_SOURCE */ +#endif +/* Enable POSIX-compatible threading on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# define __STDC_WANT_IEC_60559_BFP_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# define __STDC_WANT_IEC_60559_DFP_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# define __STDC_WANT_LIB_EXT2__ 1 +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# define __STDC_WANT_MATH_SPEC_FUNCS__ 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +/* # undef _XOPEN_SOURCE */ +#endif + + +/* Version number of package */ +#define VERSION "2.9.0" + +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ + +/* Are we building for HP-UX? */ +#define _HPUX_SOURCE 1 + +/* Define this to the process ID type */ +#define hwloc_pid_t pid_t + +/* Define this to the thread ID type */ +#define hwloc_thread_t pthread_t + +/* Define this to either strncasecmp or strncmp */ +#cmakedefine hwloc_strncasecmp @hwloc_strncasecmp_fcn@ + +#endif /* HWLOC_CONFIGURE_H */ + diff --git a/contrib/macos/static-components.h.in b/contrib/macos/static-components.h.in new file mode 100644 index 0000000000..afb2e21e06 --- /dev/null +++ b/contrib/macos/static-components.h.in @@ -0,0 +1,19 @@ +#include + +static const struct hwloc_component * hwloc_static_components[] = { + &hwloc_noos_component, + &hwloc_xml_component, + &hwloc_synthetic_component, + &hwloc_xml_nolibxml_component, + &hwloc_darwin_component, +#ifdef HWLOC_HAVE_X86_CPUID + &hwloc_x86_component, +#endif +#ifdef HWLOC_HAVE_OPENCL + &hwloc_opencl_component, +#endif +#ifdef HWLOC_HAVE_LIBXML2 + &hwloc_xml_libxml_component, +#endif + NULL +}; From ef897c365fbe5cfa67c19a9e26f414bd70e193b7 Mon Sep 17 00:00:00 2001 From: Michel Lesoinne Date: Thu, 20 Apr 2023 11:40:57 -0600 Subject: [PATCH 36/36] chore: Reactivate tests and introduce OS specific test treatment. --- CMakeLists.txt | 6 +++--- tests/hwloc/CMakeLists.txt | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00b94fba96..ac20bca7c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,9 +159,9 @@ if (APPLE) endif () if (STANDALONE) - #if(HWLOC_ENABLE_TESTING) - #add_subdirectory(${TOPDIR}/tests/hwloc ${CMAKE_CURRENT_BINARY_DIR}/tests/hwloc) - #endif() + if(HWLOC_ENABLE_TESTING) + add_subdirectory(${TOPDIR}/tests/hwloc ${CMAKE_CURRENT_BINARY_DIR}/tests/hwloc) + endif() # Tools under utils/hwloc if (NOT HWLOC_SKIP_TOOLS) diff --git a/tests/hwloc/CMakeLists.txt b/tests/hwloc/CMakeLists.txt index 5af675485b..0e6f7314d6 100644 --- a/tests/hwloc/CMakeLists.txt +++ b/tests/hwloc/CMakeLists.txt @@ -13,7 +13,11 @@ foreach(t api_version backends bind set_tests_properties(${t} PROPERTIES TIMEOUT 10) endforeach() -foreach(t cpuset_nodeset memattrs cpukinds gl windows_processor_groups) +if(WIN32) + list(APPEND os_specific_tests windows_processor_groups) +endif() + +foreach(t cpuset_nodeset memattrs cpukinds gl ${os_specific_tests}) add_executable(${t} ${t}.c) target_link_libraries(${t} PRIVATE hwloc)