diff -Nru hwloc-2.9.2/Makefile.am hwloc-2.10.0/Makefile.am --- hwloc-2.9.2/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -20,9 +20,6 @@ SUBDIRS = include hwloc if HWLOC_BUILD_STANDALONE -if BUILD_NETLOC -SUBDIRS += netloc -endif SUBDIRS += utils tests contrib/systemd contrib/completion contrib/misc contrib/hwloc-ps.www # We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN. # There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there @@ -35,24 +32,12 @@ if HWLOC_BUILD_STANDALONE DIST_SUBDIRS += contrib/windows EXTRA_DIST += contrib/windows-cmake -if !BUILD_NETLOC -DIST_SUBDIRS += netloc -endif endif # Only install the pkg file if we're building in standalone mode (and not on Windows) if HWLOC_BUILD_STANDALONE hwlocpkgconfigdir = $(libdir)/pkgconfig hwlocpkgconfig_DATA = hwloc.pc -if BUILD_NETLOC -# JMS Need to compare hwloc.pc and netloc.pc -- I think netloc.pc is -# missing some things. -# pkgconfig_DATA += netloc.pc Disabled until the netloc API is public -EXTRA_DIST += netloc.pc -if BUILD_NETLOCSCOTCH -hwlocpkgconfig_DATA += netlocscotch.pc -endif BUILD_NETLOCSCOTCH -endif BUILD_NETLOC endif HWLOC_BUILD_STANDALONE # Only install the valgrind suppressions file if we're building in @@ -69,7 +54,6 @@ dist-hook: @MKDIR_P@ \ $(distdir)/doc \ - $(distdir)/netloc \ $(distdir)/utils \ $(distdir)/tests \ $(distdir)/contrib/completion \ diff -Nru hwloc-2.9.2/Makefile.in hwloc-2.10.0/Makefile.in --- hwloc-2.9.2/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -94,21 +94,14 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@BUILD_NETLOC_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@am__append_1 = netloc # We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN. # There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there -@HWLOC_BUILD_STANDALONE_TRUE@am__append_2 = utils tests \ +@HWLOC_BUILD_STANDALONE_TRUE@am__append_1 = utils tests \ @HWLOC_BUILD_STANDALONE_TRUE@ contrib/systemd \ @HWLOC_BUILD_STANDALONE_TRUE@ contrib/completion contrib/misc \ @HWLOC_BUILD_STANDALONE_TRUE@ contrib/hwloc-ps.www doc -@HWLOC_BUILD_STANDALONE_TRUE@am__append_3 = contrib/windows -@HWLOC_BUILD_STANDALONE_TRUE@am__append_4 = contrib/windows-cmake -@BUILD_NETLOC_FALSE@@HWLOC_BUILD_STANDALONE_TRUE@am__append_5 = netloc -# JMS Need to compare hwloc.pc and netloc.pc -- I think netloc.pc is -# missing some things. -# pkgconfig_DATA += netloc.pc Disabled until the netloc API is public -@BUILD_NETLOC_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@am__append_6 = netloc.pc -@BUILD_NETLOCSCOTCH_TRUE@@BUILD_NETLOC_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@am__append_7 = netlocscotch.pc +@HWLOC_BUILD_STANDALONE_TRUE@am__append_2 = contrib/windows +@HWLOC_BUILD_STANDALONE_TRUE@am__append_3 = contrib/windows-cmake subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ @@ -122,8 +115,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -134,7 +126,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ $(top_builddir)/include/hwloc/autogen/config.h -CONFIG_CLEAN_FILES = hwloc.pc netloc.pc netlocscotch.pc +CONFIG_CLEAN_FILES = hwloc.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -220,7 +212,6 @@ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/hwloc.pc.in \ - $(srcdir)/netloc.pc.in $(srcdir)/netlocscotch.pc.in \ $(top_srcdir)/./config/ar-lib $(top_srcdir)/./config/compile \ $(top_srcdir)/./config/config.guess \ $(top_srcdir)/./config/config.sub \ @@ -280,7 +271,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -407,17 +397,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -486,7 +465,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -509,7 +487,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ # Note that the -I directory must *exactly* match what was specified # via AC_CONFIG_MACRO_DIR in configure.ac. @@ -521,18 +498,16 @@ # EXTRA_DIST = README VERSION COPYING AUTHORS \ config/hwloc_get_version.sh config/distscript.sh \ - config/libtool-big-sur-fixup.patch $(am__append_4) \ - $(am__append_6) -SUBDIRS = include hwloc $(am__append_1) $(am__append_2) + config/libtool-big-sur-fixup.patch $(am__append_3) +SUBDIRS = include hwloc $(am__append_1) # Do not let automake automatically add the non-standalone dirs to the # distribution tarball if we're building in embedded mode. -DIST_SUBDIRS = $(SUBDIRS) $(am__append_3) $(am__append_5) +DIST_SUBDIRS = $(SUBDIRS) $(am__append_2) # Only install the pkg file if we're building in standalone mode (and not on Windows) @HWLOC_BUILD_STANDALONE_TRUE@hwlocpkgconfigdir = $(libdir)/pkgconfig -@HWLOC_BUILD_STANDALONE_TRUE@hwlocpkgconfig_DATA = hwloc.pc \ -@HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_7) +@HWLOC_BUILD_STANDALONE_TRUE@hwlocpkgconfig_DATA = hwloc.pc # Only install the valgrind suppressions file if we're building in # standalone mode @@ -598,10 +573,6 @@ -rm -f include/private/autogen/config.h include/private/autogen/stamp-h1 include/hwloc/autogen/config.h include/hwloc/autogen/stamp-h2 hwloc.pc: $(top_builddir)/config.status $(srcdir)/hwloc.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ -netloc.pc: $(top_builddir)/config.status $(srcdir)/netloc.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -netlocscotch.pc: $(top_builddir)/config.status $(srcdir)/netlocscotch.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -1103,7 +1074,6 @@ @HWLOC_BUILD_STANDALONE_FALSE@dist-hook: @HWLOC_BUILD_STANDALONE_FALSE@ @MKDIR_P@ \ @HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/doc \ -@HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/netloc \ @HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/utils \ @HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/tests \ @HWLOC_BUILD_STANDALONE_FALSE@ $(distdir)/contrib/completion \ diff -Nru hwloc-2.9.2/NEWS hwloc-2.10.0/NEWS --- hwloc-2.9.2/NEWS 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/NEWS 2023-12-05 12:32:19.000000000 +0000 @@ -17,6 +17,73 @@ 0.9. +Version 2.10.0 +-------------- +* Heterogeneous Memory core improvements + + Better heuristics to identify the subtype of memory such as HBM, + DRAM, NVM, CXL-DRAM, etc. + + Build memory tiers, i.e. sets of NUMA nodes with the same subtype + and similar performance. + - NUMA node tier ranks are exposed in the new MemoryTier info + attribute (starts from 0 for highest bandwidth tier).. + + See the new Heterogeneous Memory section in the documentation. +* API + + Add hwloc_topology_free_group_object() to discard a Group created + by hwloc_topology_alloc_group_object(). +* Linux backend + + Fix cpukinds on NVIDIA Grace to report identical cores even if they + actually have very small frequency differences. + Thanks to John C. Linford for the report. + + Add CXLDevice attributes to CXL DAX objects and NUMA nodes to show + which PCI device implements which window. + + Ignore buggy memory-side caches and memory attributes when fake NUMA + emulation is enabled on the Linux kernel command-line. + + Add more info attributes in MemoryModule Misc objects, + thanks to Zubiao Xiong for the patch. + + Get CPUModel and CPUFamily info attributes on LoongArch platforms. +* x86 backend + + Add support for new AMD CPUID leaf 0x80000026 for better detection + of Core Complex and Die on Zen4 processors. + + Improve Zhaoxin CPU topology detection. +* Tools + + Input locations and many command-line options (e.g. hwloc-calc -I -N -H, + lstopo --only) now accept filters such as "NUMA[HBM]" so that only + objects are that type and subtype are considered. + - NUMA[tier=1] is also accepted for selecting NUMA nodes depending + on their MemoryTier info attribute. + + Add --object-output to hwloc-calc to report the type as a prefix to + object indexes, e.g. Core:2 instead of 2 in the output of -I. + + hwloc-info --ancestor and --descendants now accepts kinds of objects + instead of single types. + - The new --first option only shows the first matching object. + + Add --children-of-pid to hwloc-ps to show a hierarchy of processes. + Thanks to Antoine Morvan for the suggestion. + + Add --misc-from to lstopo to add Misc objects described in a file. + - To be combined with the new hwloc-ps --lstopo-misc for a customizable + lstopo --top replacement. +* Misc + + lstopo may now configure the layout of memory object placed above, + for instance with --children-order memory:above:vert. + + Fix XML import from memory or stdin when using libxml2 2.12. + + Fix installation failures when configuring with --target, + thanks to Clement Foyer for the patch. + + Fix support for 128bit pointer architectures. + + Remove Netloc. + + +Version 2.9.3 +------------- +* Handle Linux glibc allocation errors in binding routines (CVE-2022-47022). +* Fix hwloc-calc when searching objects on heterogeneous memory platforms, + thanks to Antoine Morvan for the report. +* Fix hwloc_get_next_child() when there are some memory-side caches. +* Don't crash if the topology is empty because Linux cgroups are wrong. +* Improve some hwloc-bind warnings in case of command-line parsing errors. +* Many documentation improvements all over the place, including: + + hwloc_topology_restrict() and hwloc_topology_insert_group() may reorder + children, causing the logical indexes of objects to change. + + Version 2.9.2 ------------- * Don't forget L3i when defining filters for multiple levels of caches diff -Nru hwloc-2.9.2/README hwloc-2.10.0/README --- hwloc-2.9.2/README 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/README 2023-12-05 12:32:19.000000000 +0000 @@ -1,4 +1,8 @@ -Introduction +This is a truncated and poorly-formatted version of the documentation main page. +See https://www.open-mpi.org/projects/hwloc/doc/ for more. + + +hwloc Overview The Hardware Locality (hwloc) software project aims at easing the process of discovering hardware resources in parallel architectures. It offers @@ -8,66 +12,456 @@ project seeking to exploit code and/or data locality on modern computing platforms. -hwloc is actually made of two subprojects distributed together: - - * The original hwloc project for describing the internals of computing nodes. - It is described in details starting at section Hardware Locality (hwloc) - Introduction. - * The network-oriented companion called netloc (Network Locality), described - in details starting with section Network Locality (netloc). - -See also the Related pages tab above for links to other sections. - -Netloc may be disabled, but the original hwloc cannot. Both hwloc and netloc -APIs are documented after these sections. - -Installation - -hwloc (https://www.open-mpi.org/projects/hwloc/) is available under the BSD -license. It is hosted as a sub-project of the overall Open MPI project (https:/ -/www.open-mpi.org/). Note that hwloc does not require any functionality from -Open MPI -- it is a wholly separate (and much smaller!) project and code base. -It just happens to be hosted as part of the overall Open MPI project. - -Basic Installation - -Installation is the fairly common GNU-based process: - -shell$ ./configure --prefix=... -shell$ make -shell$ make install - -hwloc- and netloc-specific configure options and requirements are documented in -sections hwloc Installation and Netloc Installation respectively. - -Also note that if you install supplemental libraries in non-standard locations, -hwloc's configure script may not be able to find them without some help. You -may need to specify additional CPPFLAGS, LDFLAGS, or PKG_CONFIG_PATH values on -the configure command line. - -For example, if libpciaccess was installed into /opt/pciaccess, hwloc's -configure script may not find it by default. Try adding PKG_CONFIG_PATH to the -./configure command line, like this: - -./configure PKG_CONFIG_PATH=/opt/pciaccess/lib/pkgconfig ... - -Running the "lstopo" tool is a good way to check as a graphical output whether -hwloc properly detected the architecture of your node. Netloc command-line -tools can be used to display the network topology interconnecting your nodes. - -Installing from a Git clone - -Additionally, the code can be directly cloned from Git: - -shell$ git clone https://github.com/open-mpi/hwloc.git -shell$ cd hwloc -shell$ ./autogen.sh - -Note that GNU Autoconf >=2.63, Automake >=1.11 and Libtool >=2.2.6 are required -when building from a Git clone. - -Nightly development snapshots are available on the web site, they can be -configured and built without any need for Git or GNU Autotools. +hwloc provides command line tools and a C API to obtain the hierarchical map of +key computing elements within a node, such as: NUMA memory nodes, shared +caches, processor packages, dies and cores, processing units (logical +processors or "threads") and even I/O devices. hwloc also gathers various +attributes such as cache and memory information, and is portable across a +variety of different operating systems and platforms. + +hwloc primarily aims at helping high-performance computing (HPC) applications, +but is also applicable to any project seeking to exploit code and/or data +locality on modern computing platforms. + +hwloc supports the following operating systems: + + * Linux (with knowledge of cgroups and cpusets, memory targets/initiators, + etc.) on all supported hardware, including Intel Xeon Phi, ScaleMP vSMP, + and NumaScale NumaConnect. + * Solaris (with support for processor sets and logical domains) + * AIX + * Darwin / OS X + * FreeBSD and its variants (such as kFreeBSD/GNU) + * NetBSD + * HP-UX + * Microsoft Windows + * IBM BlueGene/Q Compute Node Kernel (CNK) + +Since it uses standard Operating System information, hwloc's support is mostly +independant from the processor type (x86, powerpc, ...) and just relies on the +Operating System support. The main exception is BSD operating systems (NetBSD, +FreeBSD, etc.) because they do not provide support topology information, hence +hwloc uses an x86-only CPUID-based backend (which can be used for other OSes +too, see the Components and plugins section). + +To check whether hwloc works on a particular machine, just try to build it and +run lstopo or lstopo-no-graphics. If some things do not look right (e.g. bogus +or missing cache information), see Questions and Bugs. + +hwloc only reports the number of processors on unsupported operating systems; +no topology information is available. + +For development and debugging purposes, hwloc also offers the ability to work +on "fake" topologies: + + * Symmetrical tree of resources generated from a list of level arities, see + Synthetic topologies. + * Remote machine simulation through the gathering of topology as XML files, + see Importing and exporting topologies from/to XML files. + +hwloc can display the topology in a human-readable format, either in graphical +mode (X11), or by exporting in one of several different formats, including: +plain text, LaTeX tikzpicture, PDF, PNG, and FIG (see Command-line Examples +below). Note that some of the export formats require additional support +libraries. + +hwloc offers a programming interface for manipulating topologies and objects. +It also brings a powerful CPU bitmap API that is used to describe topology +objects location on physical/logical processors. See the Programming Interface +below. It may also be used to binding applications onto certain cores or memory +nodes. Several utility programs are also provided to ease command-line +manipulation of topology objects, binding of processes, and so on. + +Bindings for several other languages are available from the project website. + +Command-line Examples + +On a 4-package 2-core machine with hyper-threading, the lstopo tool may show +the following graphical output: + +[dudley] + +Here's the equivalent output in textual form: + +Machine + NUMANode L#0 (P#0) + Package L#0 + L3 L#0 (4096KB) + L2 L#0 (1024KB) + L1 L#0 (16KB) + Core L#0 + PU L#0 (P#0) + PU L#1 (P#8) + L2 L#1 (1024KB) + L1 L#1 (16KB) + Core L#1 + PU L#2 (P#4) + PU L#3 (P#12) + Package L#1 + L3 L#1 (4096KB) + L2 L#2 (1024KB) + L1 L#2 (16KB) + Core L#2 + PU L#4 (P#1) + PU L#5 (P#9) + L2 L#3 (1024KB) + L1 L#3 (16KB) + Core L#3 + PU L#6 (P#5) + PU L#7 (P#13) + Package L#2 + L3 L#2 (4096KB) + L2 L#4 (1024KB) + L1 L#4 (16KB) + Core L#4 + PU L#8 (P#2) + PU L#9 (P#10) + L2 L#5 (1024KB) + L1 L#5 (16KB) + Core L#5 + PU L#10 (P#6) + PU L#11 (P#14) + Package L#3 + L3 L#3 (4096KB) + L2 L#6 (1024KB) + L1 L#6 (16KB) + Core L#6 + PU L#12 (P#3) + PU L#13 (P#11) + L2 L#7 (1024KB) + L1 L#7 (16KB) + Core L#7 + PU L#14 (P#7) + PU L#15 (P#15) + +Note that there is also an equivalent output in XML that is meant for exporting +/importing topologies but it is hardly readable to human-beings (see Importing +and exporting topologies from/to XML files for details). + +On a 4-package 2-core Opteron NUMA machine (with two core cores disallowed by +the administrator), the lstopo tool may show the following graphical output +(with --disallowed for displaying disallowed objects): + +[hagrid] + +Here's the equivalent output in textual form: + +Machine (32GB total) + Package L#0 + NUMANode L#0 (P#0 8190MB) + L2 L#0 (1024KB) + L1 L#0 (64KB) + Core L#0 + PU L#0 (P#0) + L2 L#1 (1024KB) + L1 L#1 (64KB) + Core L#1 + PU L#1 (P#1) + Package L#1 + NUMANode L#1 (P#1 8192MB) + L2 L#2 (1024KB) + L1 L#2 (64KB) + Core L#2 + PU L#2 (P#2) + L2 L#3 (1024KB) + L1 L#3 (64KB) + Core L#3 + PU L#3 (P#3) + Package L#2 + NUMANode L#2 (P#2 8192MB) + L2 L#4 (1024KB) + L1 L#4 (64KB) + Core L#4 + PU L#4 (P#4) + L2 L#5 (1024KB) + L1 L#5 (64KB) + Core L#5 + PU L#5 (P#5) + Package L#3 + NUMANode L#3 (P#3 8192MB) + L2 L#6 (1024KB) + L1 L#6 (64KB) + Core L#6 + PU L#6 (P#6) + L2 L#7 (1024KB) + L1 L#7 (64KB) + Core L#7 + PU L#7 (P#7) + +On a 2-package quad-core Xeon (pre-Nehalem, with 2 dual-core dies into each +package): + +[emmett] + +Here's the same output in textual form: + +Machine (total 16GB) + NUMANode L#0 (P#0 16GB) + Package L#0 + L2 L#0 (4096KB) + L1 L#0 (32KB) + Core L#0 + PU L#0 (P#0) + L1 L#1 (32KB) + Core L#1 + PU L#1 (P#4) + L2 L#1 (4096KB) + L1 L#2 (32KB) + Core L#2 + PU L#2 (P#2) + L1 L#3 (32KB) + Core L#3 + PU L#3 (P#6) + Package L#1 + L2 L#2 (4096KB) + L1 L#4 (32KB) + Core L#4 + PU L#4 (P#1) + L1 L#5 (32KB) + Core L#5 + PU L#5 (P#5) + L2 L#3 (4096KB) + L1 L#6 (32KB) + Core L#6 + PU L#6 (P#3) + L1 L#7 (32KB) + Core L#7 + PU L#7 (P#7) + +Programming Interface + +The basic interface is available in hwloc.h. Some higher-level functions are +available in hwloc/helper.h to reduce the need to manually manipulate objects +and follow links between them. Documentation for all these is provided later in +this document. Developers may also want to look at hwloc/inlines.h which +contains the actual inline code of some hwloc.h routines, and at this document, +which provides good higher-level topology traversal examples. + +To precisely define the vocabulary used by hwloc, a Terms and Definitions +section is available and should probably be read first. + +Each hwloc object contains a cpuset describing the list of processing units +that it contains. These bitmaps may be used for CPU binding and Memory binding. +hwloc offers an extensive bitmap manipulation interface in hwloc/bitmap.h. + +Moreover, hwloc also comes with additional helpers for interoperability with +several commonly used environments. See the Interoperability With Other +Software section for details. + +The complete API documentation is available in a full set of HTML pages, man +pages, and self-contained PDF files (formatted for both both US letter and A4 +formats) in the source tarball in doc/doxygen-doc/. + +NOTE: If you are building the documentation from a Git clone, you will need to +have Doxygen and pdflatex installed -- the documentation will be built during +the normal "make" process. The documentation is installed during "make install" +to $prefix/share/doc/hwloc/ and your systems default man page tree (under +$prefix, of course). + +Portability + +Operating System have varying support for CPU and memory binding, e.g. while +some Operating Systems provide interfaces for all kinds of CPU and memory +bindings, some others provide only interfaces for a limited number of kinds of +CPU and memory binding, and some do not provide any binding interface at all. +Hwloc's binding functions would then simply return the ENOSYS error (Function +not implemented), meaning that the underlying Operating System does not provide +any interface for them. CPU binding and Memory binding provide more information +on which hwloc binding functions should be preferred because interfaces for +them are usually available on the supported Operating Systems. + +Similarly, the ability of reporting topology information varies from one +platform to another. As shown in Command-line Examples, hwloc can obtain +information on a wide variety of hardware topologies. However, some platforms +and/or operating system versions will only report a subset of this information. +For example, on an PPC64-based system with 8 cores (each with 2 hardware +threads) running a default 2.6.18-based kernel from RHEL 5.4, hwloc is only +able to glean information about NUMA nodes and processor units (PUs). No +information about caches, packages, or cores is available. + +Here's the graphical output from lstopo on this platform when Simultaneous +Multi-Threading (SMT) is enabled: + +[ppc64-with] + +And here's the graphical output from lstopo on this platform when SMT is +disabled: + +[ppc64-with] + +Notice that hwloc only sees half the PUs when SMT is disabled. PU L#6, for +example, seems to change location from NUMA node #0 to #1. In reality, no PUs +"moved" -- they were simply re-numbered when hwloc only saw half as many (see +also Logical index in Indexes and Sets). Hence, PU L#6 in the SMT-disabled +picture probably corresponds to PU L#12 in the SMT-enabled picture. + +This same "PUs have disappeared" effect can be seen on other platforms -- even +platforms / OSs that provide much more information than the above PPC64 system. +This is an unfortunate side-effect of how operating systems report information +to hwloc. + +Note that upgrading the Linux kernel on the same PPC64 system mentioned above +to 2.6.34, hwloc is able to discover all the topology information. The +following picture shows the entire topology layout when SMT is enabled: + +[ppc64-full] + +Developers using the hwloc API or XML output for portable applications should +therefore be extremely careful to not make any assumptions about the structure +of data that is returned. For example, per the above reported PPC topology, it +is not safe to assume that PUs will always be descendants of cores. + +Additionally, future hardware may insert new topology elements that are not +available in this version of hwloc. Long-lived applications that are meant to +span multiple different hardware platforms should also be careful about making +structure assumptions. For example, a new element may someday exist between a +core and a PU. + +API Example + +The following small C example (available in the source tree as ``doc/examples/ +hwloc-hello.c'') prints the topology of the machine and performs some thread +and memory binding. More examples are available in the doc/examples/ directory +of the source tree. + +/* Example hwloc API program. +* +* See other examples under doc/examples/ in the source tree +* for more details. +* +* Copyright (c) 2009-2016 Inria. All rights reserved. +* Copyright (c) 2009-2011 Universit?eacute; Bordeaux +* Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved. +* See COPYING in top-level directory. +* +* hwloc-hello.c +*/ +#include "hwloc.h" +#include +#include +#include +static void print_children(hwloc_topology_t topology, hwloc_obj_t obj, +int depth) +{ +char type[32], attr[1024]; +unsigned i; +hwloc_obj_type_snprintf(type, sizeof(type), obj, 0); +printf("%*s%s", 2*depth, "", type); +if (obj->os_index != (unsigned) -1) +printf("#%u", obj->os_index); +hwloc_obj_attr_snprintf(attr, sizeof(attr), obj, " ", 0); +if (*attr) +printf("(%s)", attr); +printf("\n"); +for (i = 0; i < obj->arity; i++) { +print_children(topology, obj->children[i], depth + 1); +} +} +int main(void) +{ +int depth; +unsigned i, n; +unsigned long size; +int levels; +char string[128]; +int topodepth; +void *m; +hwloc_topology_t topology; +hwloc_cpuset_t cpuset; +hwloc_obj_t obj; +/* Allocate and initialize topology object. */ +hwloc_topology_init(&topology); +/* ... Optionally, put detection configuration here to ignore +some objects types, define a synthetic topology, etc.... +The default is to detect all the objects of the machine that +the caller is allowed to access. See Configure Topology +Detection. */ +/* Perform the topology detection. */ +hwloc_topology_load(topology); +/* Optionally, get some additional topology information +in case we need the topology depth later. */ +topodepth = hwloc_topology_get_depth(topology); +/***************************************************************** +* First example: +* Walk the topology with an array style, from level 0 (always +* the system level) to the lowest level (always the proc level). +*****************************************************************/ +for (depth = 0; depth < topodepth; depth++) { +printf("*** Objects at level %d\n", depth); +for (i = 0; i < hwloc_get_nbobjs_by_depth(topology, depth); +i++) { +hwloc_obj_type_snprintf(string, sizeof(string), +hwloc_get_obj_by_depth(topology, depth, i), 0); +printf("Index %u: %s\n", i, string); +} +} +/***************************************************************** +* Second example: +* Walk the topology with a tree style. +*****************************************************************/ +printf("*** Printing overall tree\n"); +print_children(topology, hwloc_get_root_obj(topology), 0); +/***************************************************************** +* Third example: +* Print the number of packages. +*****************************************************************/ +depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PACKAGE); +if (depth == HWLOC_TYPE_DEPTH_UNKNOWN) { +printf("*** The number of packages is unknown\n"); +} else { +printf("*** %u package(s)\n", +hwloc_get_nbobjs_by_depth(topology, depth)); +} +/***************************************************************** +* Fourth example: +* Compute the amount of cache that the first logical processor +* has above it. +*****************************************************************/ +levels = 0; +size = 0; +for (obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, 0); +obj; +obj = obj->parent) +if (hwloc_obj_type_is_cache(obj->type)) { +levels++; +size += obj->attr->cache.size; +} +printf("*** Logical processor 0 has %d caches totaling %luKB\n", +levels, size / 1024); +/***************************************************************** +* Fifth example: +* Bind to only one thread of the last core of the machine. +* +* First find out where cores are, or else smaller sets of CPUs if +* the OS doesn't have the notion of a "core". +*****************************************************************/ +depth = hwloc_get_type_or_below_depth(topology, HWLOC_OBJ_CORE); +/* Get last core. */ +obj = hwloc_get_obj_by_depth(topology, depth, +hwloc_get_nbobjs_by_depth(topology, depth) - 1); +if (obj) { +/* Get a copy of its cpuset that we may modify. */ +cpuset = hwloc_bitmap_dup(obj->cpuset); +/* Get only one logical processor (in case the core is +SMT/hyper-threaded). */ +hwloc_bitmap_singlify(cpuset); +/* And try to bind ourself there. */ +if (hwloc_set_cpubind(topology, cpuset, 0)) { +char *str; +int error = errno; +hwloc_bitmap_asprintf(&str, obj->cpuset); +printf("Couldn't bind to cpuset %s: %s\n", str, strerror(error)); +free(str); +} +/* Free our cpuset copy */ +hwloc_bitmap_free(cpuset); +} +/***************************************************************** +* Sixth example: +* Allocate some memory on the last NUMA node, bind some existing +* memory to the last NUMA node. +*****************************************************************/ +/* Get last node. There's always at least one. */ +n = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_NUMANODE); +obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, n - 1); +size = 1024*1024; +m = hwloc_alloc_membind(topology, size, obj->nodeset, +HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_BYNODESET); +hwloc_free(topology, m, size); +m = malloc(size); +hwloc_set_area_membind(topology, m, size, obj->nodeset, +HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_BYNODESET); +free(m); +/* Destroy topology object. */ +hwloc_topology_destroy(topology); +return 0; +} + +hwloc provides a pkg-config executable to obtain relevant compiler and linker +flags. For example, it can be used thusly to compile applications that utilize +the hwloc library (assuming GNU Make): + +CFLAGS += $(shell pkg-config --cflags hwloc) +LDLIBS += $(shell pkg-config --libs hwloc) + +hwloc-hello: hwloc-hello.c + $(CC) hwloc-hello.c $(CFLAGS) -o hwloc-hello $(LDLIBS) + +On a machine 2 processor packages -- each package of which has two processing +cores -- the output from running hwloc-hello could be something like the +following: + +shell$ ./hwloc-hello +*** Objects at level 0 +Index 0: Machine +*** Objects at level 1 +Index 0: Package#0 +Index 1: Package#1 +*** Objects at level 2 +Index 0: Core#0 +Index 1: Core#1 +Index 2: Core#3 +Index 3: Core#2 +*** Objects at level 3 +Index 0: PU#0 +Index 1: PU#1 +Index 2: PU#2 +Index 3: PU#3 +*** Printing overall tree +Machine + Package#0 + Core#0 + PU#0 + Core#1 + PU#1 + Package#1 + Core#3 + PU#2 + Core#2 + PU#3 +*** 2 package(s) +*** Logical processor 0 has 0 caches totaling 0KB +shell$ Questions and Bugs @@ -80,6 +474,20 @@ There is also a #hwloc IRC channel on Libera Chat (irc.libera.chat). +History / Credits + +hwloc is the evolution and merger of the libtopology project and the Portable +Linux Processor Affinity (PLPA) (https://www.open-mpi.org/projects/plpa/) +project. Because of functional and ideological overlap, these two code bases +and ideas were merged and released under the name "hwloc" as an Open MPI +sub-project. + +libtopology was initially developed by the Inria Runtime Team-Project. PLPA was +initially developed by the Open MPI development team as a sub-project. Both are +now deprecated in favor of hwloc, which is distributed as an Open MPI +sub-project. + -See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation. +See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation, +actual links to related pages, images, etc. diff -Nru hwloc-2.9.2/VERSION hwloc-2.10.0/VERSION --- hwloc-2.9.2/VERSION 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/VERSION 2023-12-05 12:32:19.000000000 +0000 @@ -8,8 +8,8 @@ # Please update HWLOC_VERSION* in contrib/windows/hwloc_config.h too. major=2 -minor=9 -release=2 +minor=10 +release=0 # 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 @@ -22,7 +22,7 @@ # The date when this release was created -date="Jun 28, 2023" +date="Dec 04, 2023" # If snapshot=1, then use the value from snapshot_version as the # entire hwloc version (i.e., ignore major, minor, release, and @@ -41,7 +41,6 @@ # 2. Version numbers are described in the Libtool current:revision:age # format. -libhwloc_so_version=21:3:6 -libnetloc_so_version=0:0:0 +libhwloc_so_version=22:0:7 # Please also update the lines in contrib/windows/libhwloc.vcxproj diff -Nru hwloc-2.9.2/aclocal.m4 hwloc-2.10.0/aclocal.m4 --- hwloc-2.9.2/aclocal.m4 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/aclocal.m4 2023-12-05 12:32:19.000000000 +0000 @@ -1220,4 +1220,3 @@ m4_include([config/ltsugar.m4]) m4_include([config/ltversion.m4]) m4_include([config/lt~obsolete.m4]) -m4_include([config/netloc.m4]) diff -Nru hwloc-2.9.2/config/hwloc.m4 hwloc-2.10.0/config/hwloc.m4 --- hwloc-2.9.2/config/hwloc.m4 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/config/hwloc.m4 2023-12-05 12:32:19.000000000 +0000 @@ -1,7 +1,7 @@ dnl -*- Autoconf -*- dnl dnl Copyright © 2009-2023 Inria. All rights reserved. -dnl Copyright © 2009-2012, 2015-2017, 2020 Université Bordeaux +dnl Copyright © 2009-2012, 2015-2017, 2020, 2023 Université Bordeaux dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana dnl University Research and Technology dnl Corporation. All rights reserved. @@ -1420,6 +1420,7 @@ HWLOC_PKG_CHECK_MODULES([LEVELZERO], [libze_loader], [zesDevicePciGetProperties], [level_zero/zes_api.h], [hwloc_levelzero_happy=yes HWLOC_LEVELZERO_REQUIRES=libze_loader + AC_CHECK_LIB([ze_loader], [zesInit], [AC_DEFINE(HWLOC_HAVE_ZESINIT, 1, [Define to 1 if zesInit is available])]) AC_CHECK_LIB([ze_loader], [zeDevicePciGetPropertiesExt], [AC_DEFINE(HWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT, 1, [Define to 1 if zeDevicePciGetPropertiesExt is available])]) ], [hwloc_levelzero_happy=no]) if test x$hwloc_levelzero_happy = xno; then @@ -1430,6 +1431,7 @@ AC_CHECK_LIB([ze_loader], [zesDevicePciGetProperties], [HWLOC_LEVELZERO_LIBS="-lze_loader" + AC_CHECK_LIB([ze_loader], [zesInit], [AC_DEFINE(HWLOC_HAVE_ZESINIT, 1, [Define to 1 if zesInit is available])]) AC_CHECK_LIB([ze_loader], [zeDevicePciGetPropertiesExt], [AC_DEFINE(HWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT, 1, [Define to 1 if zeDevicePciGetPropertiesExt is available])]) ], [hwloc_levelzero_happy=no]) ], [hwloc_levelzero_happy=no]) @@ -1861,13 +1863,9 @@ AM_CONDITIONAL([HWLOC_XML_LIBXML_BUILD_STATIC], [test "x$hwloc_xml_libxml_component" = "xstatic"]) AM_CONDITIONAL([HWLOC_HAVE_CXX], [test "x$hwloc_have_cxx" = "xyes"]) + AM_CONDITIONAL([HWLOC_CROSS_COMPILING], [test "x$cross_compiling" = "xyes"]) ]) hwloc_did_am_conditionals=yes - - # For backwards compatibility (i.e., packages that only call - # HWLOC_DO_AM_CONDITIONS, not NETLOC DO_AM_CONDITIONALS), we also have to - # do the netloc AM conditionals here - NETLOC_DO_AM_CONDITIONALS ])dnl #----------------------------------------------------------------------- diff -Nru hwloc-2.9.2/config/hwloc_internal.m4 hwloc-2.10.0/config/hwloc_internal.m4 --- hwloc-2.9.2/config/hwloc_internal.m4 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/config/hwloc_internal.m4 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ dnl -*- Autoconf -*- dnl -dnl Copyright © 2010-2022 Inria. All rights reserved. +dnl Copyright © 2010-2023 Inria. All rights reserved. dnl Copyright © 2009, 2011 Université Bordeaux dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana dnl University Research and Technology @@ -413,28 +413,12 @@ AC_CHECK_FUNCS([clock_gettime]) ]) - AC_ARG_VAR([ARCHIVEMOUNT], [Location of the archivemount program (for loading archive topology in tools)]) - AC_PATH_TOOL([ARCHIVEMOUNT], [archivemount]) - if test "x$ARCHIVEMOUNT" != x; then - AC_DEFINE_UNQUOTED([HWLOC_ARCHIVEMOUNT_PATH], ["$ARCHIVEMOUNT"], [Define to the location of the archivemount program]) - fi - # Only generate this if we're building the utilities - # Even the netloc library Makefile is here because - # we don't embed libnetloc yet, it's useless without tools AC_CONFIG_FILES( hwloc_config_prefix[utils/Makefile] hwloc_config_prefix[utils/hwloc/Makefile] hwloc_config_prefix[utils/lstopo/Makefile] hwloc_config_prefix[hwloc.pc] - - hwloc_config_prefix[netloc/Makefile] - hwloc_config_prefix[utils/netloc/infiniband/Makefile] - hwloc_config_prefix[utils/netloc/draw/Makefile] - hwloc_config_prefix[utils/netloc/scotch/Makefile] - hwloc_config_prefix[utils/netloc/mpi/Makefile] - hwloc_config_prefix[netloc.pc] - hwloc_config_prefix[netlocscotch.pc] ) ])dnl @@ -531,14 +515,11 @@ hwloc_config_prefix[utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh] hwloc_config_prefix[utils/lstopo/test-lstopo.sh] hwloc_config_prefix[utils/lstopo/test-lstopo-shmem.sh] - hwloc_config_prefix[utils/netloc/infiniband/netloc_ib_gather_raw] hwloc_config_prefix[contrib/hwloc-ps.www/Makefile] hwloc_config_prefix[contrib/systemd/Makefile] hwloc_config_prefix[contrib/completion/Makefile] hwloc_config_prefix[contrib/misc/Makefile] hwloc_config_prefix[contrib/windows/Makefile] - hwloc_config_prefix[tests/netloc/Makefile] - hwloc_config_prefix[tests/netloc/tests.sh] ) AC_CONFIG_COMMANDS([chmoding-scripts], [chmod +x] \ @@ -562,9 +543,7 @@ hwloc_config_prefix[utils/hwloc/test-parsing-flags.sh] \ hwloc_config_prefix[utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh] \ hwloc_config_prefix[utils/lstopo/test-lstopo.sh] \ - hwloc_config_prefix[utils/lstopo/test-lstopo-shmem.sh] \ - hwloc_config_prefix[utils/netloc/infiniband/netloc_ib_gather_raw] \ - hwloc_config_prefix[tests/netloc/tests.sh]) + hwloc_config_prefix[utils/lstopo/test-lstopo-shmem.sh]) # These links are only needed in standalone mode. It would # be nice to m4 foreach this somehow, but whenever I tried diff -Nru hwloc-2.9.2/config/netloc.m4 hwloc-2.10.0/config/netloc.m4 --- hwloc-2.9.2/config/netloc.m4 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/config/netloc.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -dnl -*- Autoconf -*- -dnl -dnl Copyright © 2014 Cisco Systems, Inc. All rights reserved. -dnl -dnl Copyright © 2014-2018 Inria. All rights reserved. -dnl See COPYING in top-level directory. - -# Main hwloc m4 macro, to be invoked by the user -# -# Expects: -# 1. Configuration prefix -# 2. What to do upon success -# 3. What to do upon failure -# 4. If non-empty, print the announcement banner -# -AC_DEFUN([NETLOC_SETUP_CORE],[ - AC_REQUIRE([HWLOC_SETUP_CORE]) - AC_REQUIRE([AC_PROG_CC]) - - AS_IF([test "x$4" != "x"], - [cat </dev/null` - MPI_LDADD=`mpicc -showme:link 2>/dev/null` - AC_SUBST(MPI_CPPFLAGS) - AC_SUBST(MPI_LDADD) - break;]) - - AC_CHECK_PROG([xz],[xz],[yes],[no]) -])dnl - -AC_DEFUN([NETLOC_DO_AM_CONDITIONALS], [ - AM_CONDITIONAL([BUILD_NETLOC], [test "$netloc_happy" = "yes"]) - AM_CONDITIONAL([BUILD_NETLOCSCOTCH], [test "x$scotch_found_headers" = "xyes"]) - AM_CONDITIONAL([BUILD_MPITOOLS], [test "x$mpi_found_headers" = "xyes"]) - AM_CONDITIONAL([FOUND_XZ], [test "x$xz" = xyes]) -])dnl diff -Nru hwloc-2.9.2/configure hwloc-2.10.0/configure --- hwloc-2.9.2/configure 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/configure 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for hwloc 2.9.2. +# Generated by GNU Autoconf 2.71 for hwloc 2.10.0. # # Report bugs to . # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='hwloc' PACKAGE_TARNAME='hwloc' -PACKAGE_VERSION='2.9.2' -PACKAGE_STRING='hwloc 2.9.2' +PACKAGE_VERSION='2.10.0' +PACKAGE_STRING='hwloc 2.10.0' PACKAGE_BUGREPORT='https://github.com/open-mpi/hwloc/issues' PACKAGE_URL='' @@ -662,14 +662,8 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -FOUND_XZ_FALSE -FOUND_XZ_TRUE -BUILD_MPITOOLS_FALSE -BUILD_MPITOOLS_TRUE -BUILD_NETLOCSCOTCH_FALSE -BUILD_NETLOCSCOTCH_TRUE -BUILD_NETLOC_FALSE -BUILD_NETLOC_TRUE +HWLOC_CROSS_COMPILING_FALSE +HWLOC_CROSS_COMPILING_TRUE HWLOC_HAVE_CXX_FALSE HWLOC_HAVE_CXX_TRUE HWLOC_XML_LIBXML_BUILD_STATIC_FALSE @@ -773,7 +767,6 @@ HWLOC_IBVERBS_LIBS HWLOC_NUMA_LIBS HWLOC_NUMA_CFLAGS -ARCHIVEMOUNT HWLOC_PS_LIBS HWLOC_DIFF_W HWLOC_DIFF_U @@ -795,19 +788,6 @@ PDFLATEX DOXYGEN CONFIGURE_DEPENDENCIES -NETLOC_EMBEDDED_LIBS -NETLOC_EMBEDDED_LDADD -NETLOC_EMBEDDED_CPPFLAGS -NETLOC_EMBEDDED_CFLAGS -NETLOC_LIBS_PRIVATE -NETLOC_LIBS -NETLOC_LDFLAGS -NETLOC_CPPFLAGS -NETLOC_CFLAGS -xz -MPI_LDADD -MPI_CPPFLAGS -libnetloc_so_version HWLOC_EMBEDDED_LIBS HWLOC_EMBEDDED_LDADD HWLOC_EMBEDDED_LDFLAGS @@ -1044,7 +1024,6 @@ enable_plugin_ltdl enable_visibility with_x -enable_netloc ' ac_precious_vars='build_alias host_alias @@ -1086,7 +1065,6 @@ HWLOC_CAIRO_CFLAGS HWLOC_CAIRO_LIBS DIFF -ARCHIVEMOUNT HWLOC_NUMA_CFLAGS HWLOC_NUMA_LIBS' @@ -1637,7 +1615,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures hwloc 2.9.2 to adapt to many kinds of systems. +\`configure' configures hwloc 2.10.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1713,7 +1691,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of hwloc 2.9.2:";; + short | recursive ) echo "Configuration of hwloc 2.10.0:";; esac cat <<\_ACEOF @@ -1783,11 +1761,6 @@ --enable-visibility enable visibility feature of certain compilers/linkers (default: enabled on platforms that support it) - --enable-netloc 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). - Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1888,9 +1861,6 @@ HWLOC_CAIRO_LIBS linker flags for CAIRO, overriding pkg-config DIFF diff tool - ARCHIVEMOUNT - Location of the archivemount program (for loading archive - topology in tools) HWLOC_NUMA_CFLAGS C compiler flags for NUMA, overriding pkg-config HWLOC_NUMA_LIBS @@ -1963,7 +1933,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -hwloc configure 2.9.2 +hwloc configure 2.10.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2684,7 +2654,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by hwloc $as_me 2.9.2, which was +It was created by hwloc $as_me 2.10.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4303,7 +4273,7 @@ # Define the identity of the package. PACKAGE='hwloc' - VERSION='2.9.2' + VERSION='2.10.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -28428,6 +28398,48 @@ printf "%s\n" "yes" >&6; } hwloc_levelzero_happy=yes HWLOC_LEVELZERO_REQUIRES=libze_loader + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zesInit in -lze_loader" >&5 +printf %s "checking for zesInit in -lze_loader... " >&6; } +if test ${ac_cv_lib_ze_loader_zesInit+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lze_loader $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char zesInit (); +int +main (void) +{ +return zesInit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ze_loader_zesInit=yes +else $as_nop + ac_cv_lib_ze_loader_zesInit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ze_loader_zesInit" >&5 +printf "%s\n" "$ac_cv_lib_ze_loader_zesInit" >&6; } +if test "x$ac_cv_lib_ze_loader_zesInit" = xyes +then : + +printf "%s\n" "#define HWLOC_HAVE_ZESINIT 1" >>confdefs.h + +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zeDevicePciGetPropertiesExt in -lze_loader" >&5 printf %s "checking for zeDevicePciGetPropertiesExt in -lze_loader... " >&6; } if test ${ac_cv_lib_ze_loader_zeDevicePciGetPropertiesExt+y} @@ -28569,6 +28581,48 @@ if test "x$ac_cv_lib_ze_loader_zesDevicePciGetProperties" = xyes then : HWLOC_LEVELZERO_LIBS="-lze_loader" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zesInit in -lze_loader" >&5 +printf %s "checking for zesInit in -lze_loader... " >&6; } +if test ${ac_cv_lib_ze_loader_zesInit+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lze_loader $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char zesInit (); +int +main (void) +{ +return zesInit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ze_loader_zesInit=yes +else $as_nop + ac_cv_lib_ze_loader_zesInit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ze_loader_zesInit" >&5 +printf "%s\n" "$ac_cv_lib_ze_loader_zesInit" >&6; } +if test "x$ac_cv_lib_ze_loader_zesInit" = xyes +then : + +printf "%s\n" "#define HWLOC_HAVE_ZESINIT 1" >>confdefs.h + +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zeDevicePciGetPropertiesExt in -lze_loader" >&5 printf %s "checking for zeDevicePciGetPropertiesExt in -lze_loader... " >&6; } if test ${ac_cv_lib_ze_loader_zeDevicePciGetPropertiesExt+y} @@ -30228,215 +30282,6 @@ #################################################################### -# Setup the netloc API -#################################################################### - - - -# Check whether --enable-netloc was given. -if test ${enable_netloc+y} -then : - enableval=$enable_netloc; -fi - - -if test "$enable_netloc" = "yes" -a "$hwloc_mode" = "standalone" -then : - - - - - if test "x1" != "x" -then : - cat <&5 -printf %s "checking if netloc supports this platform... " >&6; } - if test "$ac_cv_func_asprintf" != "yes" -then : - netloc_happy=no netloc_missing_reason=" (asprintf missing)" -fi - if test "$hwloc_windows" = "yes" -then : - netloc_happy=no netloc_missing_reason=" (Windows platform)" -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $netloc_happy$netloc_missing_reason" >&5 -printf "%s\n" "$netloc_happy$netloc_missing_reason" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SCOTCH_archSub in -lscotch" >&5 -printf %s "checking for SCOTCH_archSub in -lscotch... " >&6; } -if test ${ac_cv_lib_scotch_SCOTCH_archSub+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lscotch -lscotcherr $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char SCOTCH_archSub (); -int -main (void) -{ -return SCOTCH_archSub (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_scotch_SCOTCH_archSub=yes -else $as_nop - ac_cv_lib_scotch_SCOTCH_archSub=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_scotch_SCOTCH_archSub" >&5 -printf "%s\n" "$ac_cv_lib_scotch_SCOTCH_archSub" >&6; } -if test "x$ac_cv_lib_scotch_SCOTCH_archSub" = xyes -then : - scotch_found_headers=yes; - -printf "%s\n" "#define NETLOC_SCOTCH 1" >>confdefs.h - - -fi - - for ac_header in mpi.h -do : - ac_fn_c_check_header_compile "$LINENO" "mpi.h" "ac_cv_header_mpi_h" "$ac_includes_default" -if test "x$ac_cv_header_mpi_h" = xyes -then : - printf "%s\n" "#define HAVE_MPI_H 1" >>confdefs.h - mpi_found_headers=yes; - MPI_CPPFLAGS=`mpicc -showme:compile 2>/dev/null` - MPI_LDADD=`mpicc -showme:link 2>/dev/null` - - - break; -fi - -done - - # Extract the first word of "xz", so it can be a program name with args. -set dummy xz; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_xz+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$xz"; then - ac_cv_prog_xz="$xz" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_xz="yes" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_xz" && ac_cv_prog_xz="no" -fi -fi -xz=$ac_cv_prog_xz -if test -n "$xz"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xz" >&5 -printf "%s\n" "$xz" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - -fi - - - - - - - - # Set these values explicitly for embedded builds. Exporting - # these values through *_EMBEDDED_* values gives us the freedom to - # do something different someday if we ever need to. There's no - # need to fill these values in unless we're in embedded mode. - # Indeed, if we're building in embedded mode, we want NETLOC_LIBS - # to be empty so that nothing is linked into libnetloc_embedded.la - # itself -- only the upper-layer will link in anything required. - - if test "$hwloc_mode" = "embedded" -then : - NETLOC_EMBEDDED_CFLAGS=$NETLOC_CFLAGS - NETLOC_EMBEDDED_CPPFLAGS=$NETLOC_CPPFLAGS - NETLOC_EMBEDDED_LDADD='$(HWLOC_top_builddir)/netloc/libnetloc_embedded.la' - NETLOC_EMBEDDED_LIBS=$NETLOC_LIBS - NETLOC_LIBS= -fi - - - - - - if test "$netloc_happy" = "yes" -then : - -else $as_nop - if test "$enable_netloc" = "yes" -then : - as_fn_error $? "Cannot build netloc core" "$LINENO" 5 -fi - -fi - - -fi - -#################################################################### # Version information #################################################################### @@ -32556,125 +32401,8 @@ done - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}archivemount", so it can be a program name with args. -set dummy ${ac_tool_prefix}archivemount; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ARCHIVEMOUNT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ARCHIVEMOUNT in - [\\/]* | ?:[\\/]*) - ac_cv_path_ARCHIVEMOUNT="$ARCHIVEMOUNT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ARCHIVEMOUNT="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ARCHIVEMOUNT=$ac_cv_path_ARCHIVEMOUNT -if test -n "$ARCHIVEMOUNT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ARCHIVEMOUNT" >&5 -printf "%s\n" "$ARCHIVEMOUNT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_ARCHIVEMOUNT"; then - ac_pt_ARCHIVEMOUNT=$ARCHIVEMOUNT - # Extract the first word of "archivemount", so it can be a program name with args. -set dummy archivemount; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_ARCHIVEMOUNT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_ARCHIVEMOUNT in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_ARCHIVEMOUNT="$ac_pt_ARCHIVEMOUNT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_ARCHIVEMOUNT="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_ARCHIVEMOUNT=$ac_cv_path_ac_pt_ARCHIVEMOUNT -if test -n "$ac_pt_ARCHIVEMOUNT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_ARCHIVEMOUNT" >&5 -printf "%s\n" "$ac_pt_ARCHIVEMOUNT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_pt_ARCHIVEMOUNT" = x; then - ARCHIVEMOUNT="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - ARCHIVEMOUNT=$ac_pt_ARCHIVEMOUNT - fi -else - ARCHIVEMOUNT="$ac_cv_path_ARCHIVEMOUNT" -fi - - if test "x$ARCHIVEMOUNT" != x; then - -printf "%s\n" "#define HWLOC_ARCHIVEMOUNT_PATH \"$ARCHIVEMOUNT\"" >>confdefs.h - - fi - # Only generate this if we're building the utilities - # Even the netloc library Makefile is here because - # we don't embed libnetloc yet, it's useless without tools - ac_config_files="$ac_config_files utils/Makefile utils/hwloc/Makefile utils/lstopo/Makefile hwloc.pc netloc/Makefile utils/netloc/infiniband/Makefile utils/netloc/draw/Makefile utils/netloc/scotch/Makefile utils/netloc/mpi/Makefile netloc.pc netlocscotch.pc" + ac_config_files="$ac_config_files utils/Makefile utils/hwloc/Makefile utils/lstopo/Makefile hwloc.pc" @@ -33241,7 +32969,7 @@ # Only generate these files if we're making the tests - ac_config_files="$ac_config_files tests/Makefile tests/hwloc/Makefile tests/hwloc/linux/Makefile tests/hwloc/linux/allowed/Makefile tests/hwloc/linux/gather/Makefile tests/hwloc/x86/Makefile tests/hwloc/x86+linux/Makefile tests/hwloc/xml/Makefile tests/hwloc/ports/Makefile tests/hwloc/rename/Makefile tests/hwloc/linux/allowed/test-topology.sh tests/hwloc/linux/gather/test-gather-topology.sh tests/hwloc/linux/test-topology.sh tests/hwloc/x86/test-topology.sh tests/hwloc/x86+linux/test-topology.sh tests/hwloc/xml/test-topology.sh tests/hwloc/wrapper.sh utils/hwloc/hwloc-compress-dir utils/hwloc/hwloc-gather-topology utils/hwloc/test-hwloc-annotate.sh utils/hwloc/test-hwloc-calc.sh utils/hwloc/test-hwloc-compress-dir.sh utils/hwloc/test-hwloc-diffpatch.sh utils/hwloc/test-hwloc-distrib.sh utils/hwloc/test-hwloc-info.sh utils/hwloc/test-build-custom-topology.sh utils/hwloc/test-fake-plugin.sh utils/hwloc/test-parsing-flags.sh utils/hwloc/test-hwloc-dump-hwdata/Makefile utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh utils/lstopo/test-lstopo.sh utils/lstopo/test-lstopo-shmem.sh utils/netloc/infiniband/netloc_ib_gather_raw contrib/hwloc-ps.www/Makefile contrib/systemd/Makefile contrib/completion/Makefile contrib/misc/Makefile contrib/windows/Makefile tests/netloc/Makefile tests/netloc/tests.sh" + ac_config_files="$ac_config_files tests/Makefile tests/hwloc/Makefile tests/hwloc/linux/Makefile tests/hwloc/linux/allowed/Makefile tests/hwloc/linux/gather/Makefile tests/hwloc/x86/Makefile tests/hwloc/x86+linux/Makefile tests/hwloc/xml/Makefile tests/hwloc/ports/Makefile tests/hwloc/rename/Makefile tests/hwloc/linux/allowed/test-topology.sh tests/hwloc/linux/gather/test-gather-topology.sh tests/hwloc/linux/test-topology.sh tests/hwloc/x86/test-topology.sh tests/hwloc/x86+linux/test-topology.sh tests/hwloc/xml/test-topology.sh tests/hwloc/wrapper.sh utils/hwloc/hwloc-compress-dir utils/hwloc/hwloc-gather-topology utils/hwloc/test-hwloc-annotate.sh utils/hwloc/test-hwloc-calc.sh utils/hwloc/test-hwloc-compress-dir.sh utils/hwloc/test-hwloc-diffpatch.sh utils/hwloc/test-hwloc-distrib.sh utils/hwloc/test-hwloc-info.sh utils/hwloc/test-build-custom-topology.sh utils/hwloc/test-fake-plugin.sh utils/hwloc/test-parsing-flags.sh utils/hwloc/test-hwloc-dump-hwdata/Makefile utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh utils/lstopo/test-lstopo.sh utils/lstopo/test-lstopo-shmem.sh contrib/hwloc-ps.www/Makefile contrib/systemd/Makefile contrib/completion/Makefile contrib/misc/Makefile contrib/windows/Makefile" ac_config_commands="$ac_config_commands chmoding-scripts" @@ -33669,81 +33397,17 @@ HWLOC_HAVE_CXX_FALSE= fi - -fi - hwloc_did_am_conditionals=yes - - # For backwards compatibility (i.e., packages that only call - # HWLOC_DO_AM_CONDITIONS, not NETLOC DO_AM_CONDITIONALS), we also have to - # do the netloc AM conditionals here - - if test "$netloc_happy" = "yes"; then - BUILD_NETLOC_TRUE= - BUILD_NETLOC_FALSE='#' -else - BUILD_NETLOC_TRUE='#' - BUILD_NETLOC_FALSE= -fi - - if test "x$scotch_found_headers" = "xyes"; then - BUILD_NETLOCSCOTCH_TRUE= - BUILD_NETLOCSCOTCH_FALSE='#' + if test "x$cross_compiling" = "xyes"; then + HWLOC_CROSS_COMPILING_TRUE= + HWLOC_CROSS_COMPILING_FALSE='#' else - BUILD_NETLOCSCOTCH_TRUE='#' - BUILD_NETLOCSCOTCH_FALSE= + HWLOC_CROSS_COMPILING_TRUE='#' + HWLOC_CROSS_COMPILING_FALSE= fi - if test "x$mpi_found_headers" = "xyes"; then - BUILD_MPITOOLS_TRUE= - BUILD_MPITOOLS_FALSE='#' -else - BUILD_MPITOOLS_TRUE='#' - BUILD_MPITOOLS_FALSE= -fi - if test "x$xz" = xyes; then - FOUND_XZ_TRUE= - FOUND_XZ_FALSE='#' -else - FOUND_XZ_TRUE='#' - FOUND_XZ_FALSE= -fi - - - - - if test "$netloc_happy" = "yes"; then - BUILD_NETLOC_TRUE= - BUILD_NETLOC_FALSE='#' -else - BUILD_NETLOC_TRUE='#' - BUILD_NETLOC_FALSE= fi - - if test "x$scotch_found_headers" = "xyes"; then - BUILD_NETLOCSCOTCH_TRUE= - BUILD_NETLOCSCOTCH_FALSE='#' -else - BUILD_NETLOCSCOTCH_TRUE='#' - BUILD_NETLOCSCOTCH_FALSE= -fi - - if test "x$mpi_found_headers" = "xyes"; then - BUILD_MPITOOLS_TRUE= - BUILD_MPITOOLS_FALSE='#' -else - BUILD_MPITOOLS_TRUE='#' - BUILD_MPITOOLS_FALSE= -fi - - if test "x$xz" = xyes; then - FOUND_XZ_TRUE= - FOUND_XZ_FALSE='#' -else - FOUND_XZ_TRUE='#' - FOUND_XZ_FALSE= -fi - + hwloc_did_am_conditionals=yes #################################################################### @@ -34093,36 +33757,8 @@ as_fn_error $? "conditional \"HWLOC_HAVE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${BUILD_NETLOC_TRUE}" && test -z "${BUILD_NETLOC_FALSE}"; then - as_fn_error $? "conditional \"BUILD_NETLOC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_NETLOCSCOTCH_TRUE}" && test -z "${BUILD_NETLOCSCOTCH_FALSE}"; then - as_fn_error $? "conditional \"BUILD_NETLOCSCOTCH\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_MPITOOLS_TRUE}" && test -z "${BUILD_MPITOOLS_FALSE}"; then - as_fn_error $? "conditional \"BUILD_MPITOOLS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FOUND_XZ_TRUE}" && test -z "${FOUND_XZ_FALSE}"; then - as_fn_error $? "conditional \"FOUND_XZ\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_NETLOC_TRUE}" && test -z "${BUILD_NETLOC_FALSE}"; then - as_fn_error $? "conditional \"BUILD_NETLOC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_NETLOCSCOTCH_TRUE}" && test -z "${BUILD_NETLOCSCOTCH_FALSE}"; then - as_fn_error $? "conditional \"BUILD_NETLOCSCOTCH\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_MPITOOLS_TRUE}" && test -z "${BUILD_MPITOOLS_FALSE}"; then - as_fn_error $? "conditional \"BUILD_MPITOOLS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FOUND_XZ_TRUE}" && test -z "${FOUND_XZ_FALSE}"; then - as_fn_error $? "conditional \"FOUND_XZ\" was never defined. +if test -z "${HWLOC_CROSS_COMPILING_TRUE}" && test -z "${HWLOC_CROSS_COMPILING_FALSE}"; then + as_fn_error $? "conditional \"HWLOC_CROSS_COMPILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -34515,7 +34151,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by hwloc $as_me 2.9.2, which was +This file was extended by hwloc $as_me 2.10.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -34587,7 +34223,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -hwloc config.status 2.9.2 +hwloc config.status 2.10.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -35115,13 +34751,6 @@ "utils/hwloc/Makefile") CONFIG_FILES="$CONFIG_FILES utils/hwloc/Makefile" ;; "utils/lstopo/Makefile") CONFIG_FILES="$CONFIG_FILES utils/lstopo/Makefile" ;; "hwloc.pc") CONFIG_FILES="$CONFIG_FILES hwloc.pc" ;; - "netloc/Makefile") CONFIG_FILES="$CONFIG_FILES netloc/Makefile" ;; - "utils/netloc/infiniband/Makefile") CONFIG_FILES="$CONFIG_FILES utils/netloc/infiniband/Makefile" ;; - "utils/netloc/draw/Makefile") CONFIG_FILES="$CONFIG_FILES utils/netloc/draw/Makefile" ;; - "utils/netloc/scotch/Makefile") CONFIG_FILES="$CONFIG_FILES utils/netloc/scotch/Makefile" ;; - "utils/netloc/mpi/Makefile") CONFIG_FILES="$CONFIG_FILES utils/netloc/mpi/Makefile" ;; - "netloc.pc") CONFIG_FILES="$CONFIG_FILES netloc.pc" ;; - "netlocscotch.pc") CONFIG_FILES="$CONFIG_FILES netlocscotch.pc" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/hwloc/Makefile") CONFIG_FILES="$CONFIG_FILES tests/hwloc/Makefile" ;; "tests/hwloc/linux/Makefile") CONFIG_FILES="$CONFIG_FILES tests/hwloc/linux/Makefile" ;; @@ -35154,14 +34783,11 @@ "utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh") CONFIG_FILES="$CONFIG_FILES utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh" ;; "utils/lstopo/test-lstopo.sh") CONFIG_FILES="$CONFIG_FILES utils/lstopo/test-lstopo.sh" ;; "utils/lstopo/test-lstopo-shmem.sh") CONFIG_FILES="$CONFIG_FILES utils/lstopo/test-lstopo-shmem.sh" ;; - "utils/netloc/infiniband/netloc_ib_gather_raw") CONFIG_FILES="$CONFIG_FILES utils/netloc/infiniband/netloc_ib_gather_raw" ;; "contrib/hwloc-ps.www/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/hwloc-ps.www/Makefile" ;; "contrib/systemd/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/systemd/Makefile" ;; "contrib/completion/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/completion/Makefile" ;; "contrib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/misc/Makefile" ;; "contrib/windows/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/windows/Makefile" ;; - "tests/netloc/Makefile") CONFIG_FILES="$CONFIG_FILES tests/netloc/Makefile" ;; - "tests/netloc/tests.sh") CONFIG_FILES="$CONFIG_FILES tests/netloc/tests.sh" ;; "chmoding-scripts") CONFIG_COMMANDS="$CONFIG_COMMANDS chmoding-scripts" ;; "tests/hwloc/ports/topology-solaris.c") CONFIG_LINKS="$CONFIG_LINKS tests/hwloc/ports/topology-solaris.c:hwloc/topology-solaris.c" ;; "tests/hwloc/ports/topology-solaris-chiptype.c") CONFIG_LINKS="$CONFIG_LINKS tests/hwloc/ports/topology-solaris-chiptype.c:hwloc/topology-solaris-chiptype.c" ;; @@ -36644,9 +36270,7 @@ utils/hwloc/test-parsing-flags.sh \ utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh \ utils/lstopo/test-lstopo.sh \ - utils/lstopo/test-lstopo-shmem.sh \ - utils/netloc/infiniband/netloc_ib_gather_raw \ - tests/netloc/tests.sh ;; + utils/lstopo/test-lstopo-shmem.sh ;; esac done # for ac_tag @@ -36703,18 +36327,6 @@ then : hwloc_xml_status=full fi -netloc_status=no -if test "$netloc_happy" = "yes" -then : - - netlocscotch_status=without - if test "$scotch_found_headers" = "yes" -then : - netlocscotch_status=with -fi - netloc_status="yes ($netlocscotch_status scotch)" - -fi if test "$enable_embedded_mode" = "yes" then : @@ -36835,7 +36447,6 @@ cat <" "" ) @@ -306,6 +308,7 @@ -n --nodeset --ni --nodeset-input --no --nodeset-output + --oo --object-output --sep --taskset --single @@ -479,6 +482,7 @@ _hwloc_ps(){ local OPTIONS=(-a --pid + --children-of-pid --name --uid -l --logical @@ -490,6 +494,7 @@ --pid-cmd --short-name --disallowed --whole-system + --lstopo-misc --json-server --json-port -v --verbose @@ -509,7 +514,7 @@ --uid) COMPREPLY=( "" "all" "" ) ;; - --pid) + --pid|--children-of-pid) COMPREPLY=( "" "" ) ;; --pid-cmd) @@ -526,7 +531,7 @@ _hwloc_gather_cpuid(){ local OPTIONS=(-c - -s --silent + -q --quiet -s --silent --version -h --help ) @@ -549,6 +554,7 @@ _hwloc_gather_topology(){ local OPTIONS=(--io --dmi + --dt --no-cpuid --keep --version diff -Nru hwloc-2.9.2/contrib/hwloc-ps.www/Makefile.in hwloc-2.10.0/contrib/hwloc-ps.www/Makefile.in --- hwloc-2.9.2/contrib/hwloc-ps.www/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/contrib/hwloc-ps.www/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -105,8 +105,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_js_DATA) \ @@ -171,7 +170,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -298,17 +296,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -377,7 +364,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -400,7 +386,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ jsdir = $(pkgdatadir)/hwloc-ps.www dist_js_DATA = client.js \ package.json \ diff -Nru hwloc-2.9.2/contrib/misc/Makefile.in hwloc-2.10.0/contrib/misc/Makefile.in --- hwloc-2.9.2/contrib/misc/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/contrib/misc/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -109,8 +109,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \ @@ -223,7 +222,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -350,17 +348,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -429,7 +416,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -452,7 +438,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) diff -Nru hwloc-2.9.2/contrib/systemd/Makefile.in hwloc-2.10.0/contrib/systemd/Makefile.in --- hwloc-2.9.2/contrib/systemd/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/contrib/systemd/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -109,8 +109,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -174,7 +173,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -301,17 +299,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -380,7 +367,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -403,7 +389,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ EXTRA_DIST = hwloc-dump-hwdata.service.in @HWLOC_HAVE_LINUX_TRUE@nodist_pkgdata_DATA = hwloc-dump-hwdata.service all: all-am diff -Nru hwloc-2.9.2/contrib/windows/Makefile.in hwloc-2.10.0/contrib/windows/Makefile.in --- hwloc-2.9.2/contrib/windows/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/contrib/windows/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -104,8 +104,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -140,7 +139,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -267,17 +265,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -346,7 +333,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -369,7 +355,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ EXTRA_DIST = \ README \ hwloc.sln \ diff -Nru hwloc-2.9.2/contrib/windows/hwloc_config.h hwloc-2.10.0/contrib/windows/hwloc_config.h --- hwloc-2.9.2/contrib/windows/hwloc_config.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/contrib/windows/hwloc_config.h 2023-12-05 12:32:19.000000000 +0000 @@ -11,10 +11,10 @@ #ifndef HWLOC_CONFIG_H #define HWLOC_CONFIG_H -#define HWLOC_VERSION "2.9.2" +#define HWLOC_VERSION "2.10.0" #define HWLOC_VERSION_MAJOR 2 -#define HWLOC_VERSION_MINOR 9 -#define HWLOC_VERSION_RELEASE 2 +#define HWLOC_VERSION_MINOR 10 +#define HWLOC_VERSION_RELEASE 0 #define HWLOC_VERSION_GREEK "" #define __hwloc_restrict diff -Nru hwloc-2.9.2/contrib/windows-cmake/CMakeLists.txt hwloc-2.10.0/contrib/windows-cmake/CMakeLists.txt --- hwloc-2.9.2/contrib/windows-cmake/CMakeLists.txt 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/contrib/windows-cmake/CMakeLists.txt 2023-12-05 12:32:19.000000000 +0000 @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) project(hwloc LANGUAGES C - VERSION 2.9.2) + VERSION 2.10.0) enable_testing() @@ -245,5 +245,5 @@ # Testing if(HWLOC_ENABLE_TESTING) - add_subdirectory(${TOPDIR}/tests/hwloc ${CMAKE_CURRENT_BINARY_DIR}/tests/hwloc) + add_subdirectory(tests ${CMAKE_CURRENT_BINARY_DIR}/tests) endif() diff -Nru hwloc-2.9.2/contrib/windows-cmake/tests/CMakeLists.txt hwloc-2.10.0/contrib/windows-cmake/tests/CMakeLists.txt --- hwloc-2.9.2/contrib/windows-cmake/tests/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/contrib/windows-cmake/tests/CMakeLists.txt 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,68 @@ +foreach(t api_version backends bind + bitmap bitmap_compare_inclusion bitmap_first_last_weight bitmap_singlify bitmap_string + distances get_area_memlocation get_cache_covering_cpuset get_closest_objs get_largest_objs_inside_cpuset + get_last_cpu_location get_next_obj_covering_cpuset get_obj_below_array_by_type get_obj_covering_cpuset + get_obj_inside_cpuset get_obj_with_same_locality get_shared_cache_covering_obj + groups insert_misc iodevs is_thissystem list_components obj_infos object_userdata pci_backend synthetic + topology_abi topology_allow topology_diff topology_dup topology_restrict type_depth type_sscanf +) + add_executable(hwloc_${t} ${TOPDIR}/tests/hwloc/hwloc_${t}.c) + target_link_libraries(hwloc_${t} PRIVATE hwloc) + + add_test(NAME ${t} COMMAND hwloc_${t} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) + set_tests_properties(${t} PROPERTIES TIMEOUT 10) +endforeach() + +foreach(t cpuset_nodeset memattrs cpukinds gl windows_processor_groups) + add_executable(${t} ${TOPDIR}/tests/hwloc/${t}.c) + target_link_libraries(${t} PRIVATE hwloc) + + add_test(NAME ${t} COMMAND ${t} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) + set_tests_properties(${t} PROPERTIES TIMEOUT 10) +endforeach() + +add_executable(xmlbuffer ${TOPDIR}/tests/hwloc/xmlbuffer.c) +target_link_libraries(xmlbuffer PRIVATE hwloc) +add_test(NAME xmlbuffer00 COMMAND xmlbuffer 0 0 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) +add_test(NAME xmlbuffer01 COMMAND xmlbuffer 0 1 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) +add_test(NAME xmlbuffer10 COMMAND xmlbuffer 1 0 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) +add_test(NAME xmlbuffer11 COMMAND xmlbuffer 1 1 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) +set_tests_properties(xmlbuffer00 xmlbuffer01 xmlbuffer10 xmlbuffer11 PROPERTIES TIMEOUT 10) + +target_compile_definitions(hwloc_type_sscanf PRIVATE XMLTESTDIR=\"${CMAKE_CURRENT_SOURCE_DIR}/xml/\") + +set_tests_properties(get_obj_with_same_locality PROPERTIES ENVIRONMENT HWLOC_TOP_SRCDIR=${TOPDIR}) + +add_test(NAME lstopo-no-graphics:verbose COMMAND lstopo-no-graphics -v) +add_test(NAME lstopo-no-graphics:groups COMMAND lstopo-no-graphics --windows-processor-groups) +set_tests_properties(lstopo-no-graphics:verbose lstopo-no-graphics:groups PROPERTIES +DISABLED ${HWLOC_SKIP_LSTOPO} +LABELS exe +TIMEOUT 10 +) + +add_test(NAME hwloc-info:support COMMAND hwloc-info --support) +set_tests_properties(hwloc-info:support PROPERTIES +DISABLED ${HWLOC_SKIP_TOOLS} +LABELS exe +TIMEOUT 10 +) + + +# --- optional tests + +if(HWLOC_HAVE_OPENCL) + add_executable(test_opencl opencl.c) + target_link_libraries(test_opencl PRIVATE hwloc OpenCL::OpenCL) + + add_test(NAME OpenCL COMMAND test_opencl) + set_tests_properties(OpenCL PROPERTIES TIMEOUT 10) +endif() + +if(HAVE_CUDA) + add_executable(test_cuda cuda.c) + target_link_libraries(test_cuda PRIVATE hwloc CUDA::cudart CUDA::cuda_driver) + + add_test(NAME CUDA COMMAND test_cuda) + set_tests_properties(CUDA PROPERTIES TIMEOUT 10) +endif() diff -Nru hwloc-2.9.2/debian/changelog hwloc-2.10.0/debian/changelog --- hwloc-2.9.2/debian/changelog 2023-09-03 20:18:44.000000000 +0000 +++ hwloc-2.10.0/debian/changelog 2024-01-14 22:53:38.000000000 +0000 @@ -1,10 +1,50 @@ -hwloc (2.9.2-1~16.04.sav0) xenial; urgency=medium +hwloc (2.10.0-1~16.04.sav0) xenial; urgency=medium * Backport to Xenial * debian/control: Set debhelper-compat (= 10) BD (LP highest for Xenial) * debian/hwloc{-nox}.docs: Add debian/tmp/ prefix to html file (compat < 11) - -- Rob Savoury Sun, 03 Sep 2023 13:18:44 -0700 + -- Rob Savoury Sun, 14 Jan 2024 14:53:38 -0800 + +hwloc (2.10.0-1) unstable; urgency=medium + + * New upstream release. + * rules: Disable gather topology test on hppa. + + -- Samuel Thibault Tue, 05 Dec 2023 13:32:39 +0100 + +hwloc (2.10.0~rc2-1) experimental; urgency=medium + + * New upstream RC release. + - patches/smbios-big-endian: Upstreamed. + + -- Samuel Thibault Thu, 23 Nov 2023 14:11:22 +0100 + +hwloc (2.10.0~rc1-2) experimental; urgency=medium + + * patches/smbios-big-endian: Fix smbios on big-endian architectures. + + -- Samuel Thibault Thu, 23 Nov 2023 13:08:47 +0100 + +hwloc (2.10.0~rc1-1) experimental; urgency=medium + + * New upstream RC release. + - debian/tests-patches/use_system_hwloc: Refrsh. + + -- Samuel Thibault Tue, 21 Nov 2023 15:16:41 +0100 + +hwloc (2.9.3-2) unstable; urgency=medium + + * control, rules: Add pkg.hwloc.minimum and nodoc build profiles to ease + bootstrapping ports with openmpi used by boost etc. + + -- Samuel Thibault Sat, 04 Nov 2023 20:10:42 +0100 + +hwloc (2.9.3-1) unstable; urgency=medium + + * New upstream release. + + -- Samuel Thibault Tue, 12 Sep 2023 20:28:47 +0200 hwloc (2.9.2-1) unstable; urgency=medium diff -Nru hwloc-2.9.2/debian/control hwloc-2.10.0/debian/control --- hwloc-2.9.2/debian/control 2023-09-03 20:18:37.000000000 +0000 +++ hwloc-2.10.0/debian/control 2024-01-14 22:53:38.000000000 +0000 @@ -1,17 +1,21 @@ Source: hwloc Priority: optional Maintainer: Samuel Thibault -Build-Depends: debhelper-compat (= 10), dh-exec, libltdl-dev [!gnu-any-any], - valgrind-if-available, - libcairo2-dev, libx11-dev, libxml2-dev, libxml2-utils , libncurses-dev, - libnuma-dev [linux-any] , - libxnvctrl-dev, - libpciaccess-dev, libudev-dev [linux-any], pkg-config, - ocl-icd-opencl-dev [!hurd-any] | opencl-dev, opencl-headers, +Build-Depends: debhelper-compat (= 10), dh-exec, + libltdl-dev [!gnu-any-any] , + valgrind-if-available , + libcairo2-dev , libx11-dev , + libxml2-dev , libxml2-utils , + libncurses-dev , + libnuma-dev [linux-any] , + libxnvctrl-dev , + libpciaccess-dev , libudev-dev [linux-any] , + pkg-config, + ocl-icd-opencl-dev [!hurd-any] | opencl-dev , opencl-headers , autoconf (>= 2.63), # w3m, if we ever need to update README dpkg-dev (>= 1.16) -Build-Depends-Indep: doxygen-latex, transfig +Build-Depends-Indep: doxygen-latex , transfig Build-Conflicts: autoconf2.13 Rules-Requires-Root: no Standards-Version: 4.6.0 @@ -23,6 +27,7 @@ Package: hwloc Section: admin Architecture: any +Build-Profiles: Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends} Description: Hierarchical view of the machine - utilities @@ -113,6 +118,7 @@ Package: libhwloc-plugins Architecture: any Multi-Arch: same +Build-Profiles: Depends: ${shlibs:Depends}, ${misc:Depends}, libhwloc15 (>= ${source:Upstream-Version}~), libhwloc15 (<< ${source:Upstream-Version}A) Breaks: libhwloc-contrib-plugins (<< 2.1.0+dfsg-3~) Replaces: libhwloc-contrib-plugins (<< 2.1.0+dfsg-3~) @@ -157,6 +163,7 @@ Package: libhwloc-doc Section: doc Architecture: all +Build-Profiles: Multi-Arch: foreign Depends: ${misc:Depends}, libjs-jquery Description: Hierarchical view of the machine - documentation diff -Nru hwloc-2.9.2/debian/gbp.conf hwloc-2.10.0/debian/gbp.conf --- hwloc-2.9.2/debian/gbp.conf 2022-12-09 22:51:07.000000000 +0000 +++ hwloc-2.10.0/debian/gbp.conf 2023-12-05 12:32:07.000000000 +0000 @@ -2,4 +2,4 @@ filter = [ 'doc/doxygen-doc', 'utils/netloc/draw/visdist/vis.min.css', 'utils/netloc/draw/visdist/vis.min.js' ] -symlink-orig = false +symlink-orig = False diff -Nru hwloc-2.9.2/debian/rules hwloc-2.10.0/debian/rules --- hwloc-2.9.2/debian/rules 2022-12-20 10:33:42.000000000 +0000 +++ hwloc-2.10.0/debian/rules 2023-12-05 12:32:07.000000000 +0000 @@ -5,12 +5,20 @@ include /usr/share/dpkg/architecture.mk +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) +DOXYGEN = --enable-doxygen +endif + +ifeq (,$(filter pkg.hwloc.minimum,$(DEB_BUILD_PROFILES))) +PLUGINS = --enable-plugins +endif + override_dh_clean: dh_clean -rm -fr doc/doxygen-doc override_dh_auto_configure: - dh_auto_configure -- --enable-static --enable-plugins --enable-doxygen + dh_auto_configure -- --enable-static $(PLUGINS) $(DOXYGEN) override_dh_auto_install: dh_auto_install @@ -21,6 +29,14 @@ override_dh_makeshlibs: dh_makeshlibs -V +NOTEST = HWLOC_TEST_DONTCHECK_PROC_CPULOCATION=1 + +# Keep this while hppa's buildd is using qemu-user and +# https://gitlab.com/qemu-project/qemu/-/issues/2004 happens there +ifeq ($(DEB_HOST_ARCH_CPU),hppa) +NOTEST += HWLOC_TEST_GATHER_TOPOLOGY=0 +endif + override_dh_auto_test: - HWLOC_TEST_DONTCHECK_PROC_CPULOCATION=1 dh_auto_test -- -k || \ + $(NOTEST) dh_auto_test -- -k || \ ( cat $$(find . -name \*.log) ; false ) diff -Nru hwloc-2.9.2/debian/salsa-ci.yml hwloc-2.10.0/debian/salsa-ci.yml --- hwloc-2.9.2/debian/salsa-ci.yml 2022-12-20 10:33:42.000000000 +0000 +++ hwloc-2.10.0/debian/salsa-ci.yml 2023-12-05 12:32:07.000000000 +0000 @@ -4,8 +4,8 @@ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml variables: - # Disable reprotest until salsa-ci-team/pipeline#26 is resolved - SALSA_CI_DISABLE_REPROTEST: 1 + # https://manpages.debian.org/unstable/reprotest/reprotest.1.en.html#Domain_or_host + SALSA_CI_REPROTEST_ARGS: --vary=domain_host.use_sudo=1 SALSA_CI_REPROTEST_ENABLE_DIFFOSCOPE: 1 test-crossbuild-arm64: diff -Nru hwloc-2.9.2/debian/tests-patches/use_system_hwloc hwloc-2.10.0/debian/tests-patches/use_system_hwloc --- hwloc-2.9.2/debian/tests-patches/use_system_hwloc 2022-12-09 22:51:07.000000000 +0000 +++ hwloc-2.10.0/debian/tests-patches/use_system_hwloc 2023-12-05 12:32:07.000000000 +0000 @@ -24,10 +24,6 @@ utils/lstopo/Makefile.am | 5 --- utils/lstopo/test-lstopo-shmem.sh.in | 5 --- utils/lstopo/test-lstopo.sh.in | 5 --- - utils/netloc/draw/Makefile.am | 3 -- - utils/netloc/infiniband/Makefile.am | 3 -- - utils/netloc/mpi/Makefile.am | 11 ------- - utils/netloc/scotch/Makefile.am | 5 --- 29 files changed, 27 insertions(+), 117 deletions(-) --- a/doc/examples/Makefile.am @@ -118,13 +114,14 @@ export HWLOC_DEBUG_CHECK --- a/utils/hwloc/test-hwloc-info.sh.in +++ b/utils/hwloc/test-hwloc-info.sh.in -@@ -13,12 +13,9 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" +@@ -13,13 +13,10 @@ HWLOC_top_srcdir="@HWLOC_top_srcdir@" HWLOC_top_builddir="@HWLOC_top_builddir@" srcdir="$HWLOC_top_srcdir/utils/hwloc" builddir="$HWLOC_top_builddir/utils/hwloc" -info="$builddir/hwloc-info" +info="/usr/bin/hwloc-info" linuxdir="$HWLOC_top_srcdir/tests/hwloc/linux" + xmldir="$HWLOC_top_srcdir/tests/hwloc/xml" -HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc/.libs -export HWLOC_PLUGINS_PATH @@ -348,63 +345,6 @@ lstopo_SOURCES += lstopo-windows.c lstopo_CPPFLAGS += -DLSTOPO_HAVE_GRAPHICS if HWLOC_HAVE_USER32 ---- a/utils/netloc/draw/Makefile.am -+++ b/utils/netloc/draw/Makefile.am -@@ -12,9 +12,6 @@ AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - --bin_PROGRAMS = \ -- netloc_draw_to_json -- - netloc_draw_to_json_SOURCES = \ - netloc_draw_to_json.c - ---- a/utils/netloc/infiniband/Makefile.am -+++ b/utils/netloc/infiniband/Makefile.am -@@ -19,9 +19,6 @@ AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - --bin_PROGRAMS = \ -- netloc_ib_extract_dats -- - netloc_ib_extract_dats_SOURCES = \ - netloc_ib_extract_dats.c - ---- a/utils/netloc/mpi/Makefile.am -+++ b/utils/netloc/mpi/Makefile.am -@@ -13,17 +13,6 @@ AM_LDFLAGS = $(HWLOC_LDFLAGS) - LDADD = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la - --if BUILD_MPITOOLS --bin_PROGRAMS = \ -- netloc_rank_order \ -- netloc_mpi_find_hosts -- --if BUILD_NETLOCSCOTCH --bin_PROGRAMS += \ -- netloc_mpi_rank_file --endif --endif -- - netloc_rank_order_SOURCES = netloc_rank_order.c - - netloc_mpi_find_hosts_SOURCES = netloc_mpi_find_hosts.c ---- a/utils/netloc/scotch/Makefile.am -+++ b/utils/netloc/scotch/Makefile.am -@@ -15,10 +15,5 @@ LDADD = $(top_builddir)/netloc/libnetloc - $(top_builddir)/hwloc/libhwloc.la \ - -lscotch -lscotcherr -lm -lpthread - --if BUILD_NETLOCSCOTCH --bin_PROGRAMS = \ -- netlocscotch_get_arch --endif -- - netlocscotch_get_arch_SOURCES = \ - netlocscotch_get_arch.c --- a/hwloc/Makefile.am +++ b/hwloc/Makefile.am @@ -13,12 +13,6 @@ EXTRA_DIST = dolib.c diff -Nru hwloc-2.9.2/debian/watch hwloc-2.10.0/debian/watch --- hwloc-2.9.2/debian/watch 2022-12-16 13:41:33.000000000 +0000 +++ hwloc-2.10.0/debian/watch 2023-12-05 12:32:07.000000000 +0000 @@ -1,4 +1,4 @@ version=3 opts=dversionmangle=s/\+dfsg\d*$//,uversionmangle=s/(\d)(rc\d*)$/$1~$2/ \ -https://www.open-mpi.org/software/hwloc/v2.9 \ -https://download.open-mpi.org/release/hwloc/v2.9/hwloc(?:[_\-]v?|)@ANY_VERSION@@ARCHIVE_EXT@ +https://www.open-mpi.org/software/hwloc/v2.10 \ +https://download.open-mpi.org/release/hwloc/v2.10/hwloc(?:[_\-]v?|)@ANY_VERSION@@ARCHIVE_EXT@ diff -Nru hwloc-2.9.2/doc/Makefile.am hwloc-2.10.0/doc/Makefile.am --- hwloc-2.9.2/doc/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/doc/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -28,17 +28,13 @@ # images already available in repository PREBUILT_IMAGES = images/dudley.png images/emmett.png images/hagrid.png \ images/ppc64-with-smt.png images/ppc64-without-smt.png images/ppc64-full-with-smt.png \ - images/devel09-pci.png \ - images/netloc_design.png images/netloc_draw.png + images/devel09-pci.png # images built from repository before inclusion in make dist BUILT_IMAGES = images/diagram.png images/diagram.eps EXTRA_DIST = \ - main.doxy \ hwloc.doxy \ - netloc.doxy \ README.sed \ - doxygen.css \ doxygen.cfg \ images/diagram.fig \ www.open-mpi.org.cfg \ @@ -62,7 +58,6 @@ hwloc_include_dir = $(HWLOC_top_srcdir)/include dox_inputs = $(DOX_CONFIG) \ - $(srcdir)/main.doxy \ $(srcdir)/hwloc.doxy \ $(hwloc_include_dir)/hwloc.h \ $(hwloc_include_dir)/hwloc/helper.h \ @@ -85,9 +80,7 @@ $(hwloc_include_dir)/hwloc/levelzero.h \ $(hwloc_include_dir)/hwloc/gl.h \ $(hwloc_include_dir)/hwloc/windows.h \ - $(hwloc_include_dir)/hwloc/openfabrics-verbs.h \ - $(srcdir)/netloc.doxy \ - $(hwloc_include_dir)/netloc.h + $(hwloc_include_dir)/hwloc/openfabrics-verbs.h # # Create the images that we need for the PDF output and the HTML @@ -123,18 +116,6 @@ # Remove useless manpages, they have too long filenames anyway because # of nested structurre/union declarations. # - -# -# Note that we want to use our own doxygen.css file; not the one that -# doxygen installs in the HTML directory. So manually copy it over. -# Be a little clever: only copy the doxygen.css file over if it exists -# in DOX_HTML_DIR (which is in the build tree). If the html tree -# doesn't exist in the build tree, then we're using an html tree in -# the source tree, and we don't need to copy over the doxygen.css -# because we didn't build the html tree (e.g., the html tree came -# pre-bundled in a tarball). -# - $(DOX_TAG): $(BUILT_SOURCES) $(dox_inputs) $(PREBUILT_IMAGES) rm -fr $(DOX_DIR) $(DOXYGEN) $(DOX_CONFIG) @@ -149,10 +130,6 @@ @mv $(DOX_MAN_DIR)/man3/hwloc* $(DOX_MAN_DIR)/man3/HWLOC* $(DOX_DIR)/man.tmp/ @rm -rf $(DOX_MAN_DIR)/man3 @mv $(DOX_DIR)/man.tmp $(DOX_MAN_DIR)/man3 - @echo "Copying custom doxygen.css..." - if test -d $(DOX_HTML_DIR) -a -f $(DOX_HTML_DIR)/doxygen.css; then \ - cp -f $(srcdir)/doxygen.css $(DOX_HTML_DIR); \ - fi # # Rules for building the PDF @@ -482,6 +459,7 @@ $(DOX_MAN_DIR)/man3/hwloc_topology_allow.3 \ $(DOX_MAN_DIR)/man3/hwloc_topology_insert_misc_object.3 \ $(DOX_MAN_DIR)/man3/hwloc_topology_alloc_group_object.3 \ + $(DOX_MAN_DIR)/man3/hwloc_topology_free_group_object.3 \ $(DOX_MAN_DIR)/man3/hwloc_topology_insert_group_object.3 \ $(DOX_MAN_DIR)/man3/hwloc_obj_add_other_obj_sets.3 \ $(DOX_MAN_DIR)/man3/hwloc_topology_refresh.3 @@ -915,24 +893,27 @@ if HWLOC_BUILD_README # -# Rules for creating the top-level README file. There does not appear -# to be an easy way to know if AC_PATH_PROG found something in -# configure.ac (!), so put a run-time check here to see if we have -# w3c. +# Rules for creating the top-level README file. +# Take the main html doc page, ignore headers and footers, and add our owns. # # Just like BUILD_DOXYGEN, BUILD_README will automatically be false if # we're not building standalone. # readme: $(HWLOC_top_srcdir)/README $(HWLOC_top_srcdir)/README: $(DOX_TAG) + echo "This is a truncated and poorly-formatted version of the documentation main page." > $@ + echo "See https://www.open-mpi.org/projects/hwloc/doc/ for more." >> $@ + echo >> $@ + echo >> $@ sed -n -f $(srcdir)/README.sed $(DOX_HTML_DIR)/index.html > $(DOX_HTML_README) LC_ALL=C $(HWLOC_W3_GENERATOR) $(DOX_HTML_README) \ - | $(SED) -n -e 's/^ //' -e '/^Introduction$$/,$$p' \ + | $(SED) -n -e 's/^ //' -e '/^hwloc Overview$$/,$$p' \ | $(SED) -e '/^--*-$$/,$$ d' \ - > $@ + >> $@ echo >> $@ echo >> $@ - echo "See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation." >> $@ + echo "See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation," >> $@ + echo "actual links to related pages, images, etc." >> $@ rm -f $(DOX_HTML_README) else diff -Nru hwloc-2.9.2/doc/Makefile.in hwloc-2.10.0/doc/Makefile.in --- hwloc-2.9.2/doc/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/doc/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -107,8 +107,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -282,7 +281,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -409,17 +407,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -488,7 +475,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -511,7 +497,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CPPFLAGS = $(HWLOC_CPPFLAGS) DOCDIR = $(HWLOC_top_builddir)/doc DOX_CONFIG = $(HWLOC_top_srcdir)/doc/doxygen.cfg @@ -535,17 +520,13 @@ # images already available in repository PREBUILT_IMAGES = images/dudley.png images/emmett.png images/hagrid.png \ images/ppc64-with-smt.png images/ppc64-without-smt.png images/ppc64-full-with-smt.png \ - images/devel09-pci.png \ - images/netloc_design.png images/netloc_draw.png + images/devel09-pci.png # images built from repository before inclusion in make dist BUILT_IMAGES = images/diagram.png images/diagram.eps EXTRA_DIST = \ - main.doxy \ hwloc.doxy \ - netloc.doxy \ README.sed \ - doxygen.css \ doxygen.cfg \ images/diagram.fig \ www.open-mpi.org.cfg \ @@ -564,7 +545,6 @@ # @HWLOC_BUILD_DOXYGEN_TRUE@hwloc_include_dir = $(HWLOC_top_srcdir)/include @HWLOC_BUILD_DOXYGEN_TRUE@dox_inputs = $(DOX_CONFIG) \ -@HWLOC_BUILD_DOXYGEN_TRUE@ $(srcdir)/main.doxy \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(srcdir)/hwloc.doxy \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc.h \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/helper.h \ @@ -587,9 +567,7 @@ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/levelzero.h \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/gl.h \ @HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/windows.h \ -@HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/openfabrics-verbs.h \ -@HWLOC_BUILD_DOXYGEN_TRUE@ $(srcdir)/netloc.doxy \ -@HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/netloc.h +@HWLOC_BUILD_DOXYGEN_TRUE@ $(hwloc_include_dir)/hwloc/openfabrics-verbs.h # @@ -858,6 +836,7 @@ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_topology_allow.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_topology_insert_misc_object.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_topology_alloc_group_object.3 \ +@HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_topology_free_group_object.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_topology_insert_group_object.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_obj_add_other_obj_sets.3 \ @HWLOC_INSTALL_DOXYGEN_TRUE@ $(DOX_MAN_DIR)/man3/hwloc_topology_refresh.3 @@ -2485,18 +2464,6 @@ # Remove useless manpages, they have too long filenames anyway because # of nested structurre/union declarations. # - -# -# Note that we want to use our own doxygen.css file; not the one that -# doxygen installs in the HTML directory. So manually copy it over. -# Be a little clever: only copy the doxygen.css file over if it exists -# in DOX_HTML_DIR (which is in the build tree). If the html tree -# doesn't exist in the build tree, then we're using an html tree in -# the source tree, and we don't need to copy over the doxygen.css -# because we didn't build the html tree (e.g., the html tree came -# pre-bundled in a tarball). -# - @HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_TAG): $(BUILT_SOURCES) $(dox_inputs) $(PREBUILT_IMAGES) @HWLOC_BUILD_DOXYGEN_TRUE@ rm -fr $(DOX_DIR) @HWLOC_BUILD_DOXYGEN_TRUE@ $(DOXYGEN) $(DOX_CONFIG) @@ -2511,10 +2478,6 @@ @HWLOC_BUILD_DOXYGEN_TRUE@ @mv $(DOX_MAN_DIR)/man3/hwloc* $(DOX_MAN_DIR)/man3/HWLOC* $(DOX_DIR)/man.tmp/ @HWLOC_BUILD_DOXYGEN_TRUE@ @rm -rf $(DOX_MAN_DIR)/man3 @HWLOC_BUILD_DOXYGEN_TRUE@ @mv $(DOX_DIR)/man.tmp $(DOX_MAN_DIR)/man3 -@HWLOC_BUILD_DOXYGEN_TRUE@ @echo "Copying custom doxygen.css..." -@HWLOC_BUILD_DOXYGEN_TRUE@ if test -d $(DOX_HTML_DIR) -a -f $(DOX_HTML_DIR)/doxygen.css; then \ -@HWLOC_BUILD_DOXYGEN_TRUE@ cp -f $(srcdir)/doxygen.css $(DOX_HTML_DIR); \ -@HWLOC_BUILD_DOXYGEN_TRUE@ fi # # Rules for building the PDF @@ -2639,24 +2602,27 @@ @HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_A4PDF): $(DOX_TAG) $(DOX_LETTERPDF) # -# Rules for creating the top-level README file. There does not appear -# to be an easy way to know if AC_PATH_PROG found something in -# configure.ac (!), so put a run-time check here to see if we have -# w3c. +# Rules for creating the top-level README file. +# Take the main html doc page, ignore headers and footers, and add our owns. # # Just like BUILD_DOXYGEN, BUILD_README will automatically be false if # we're not building standalone. # @HWLOC_BUILD_README_TRUE@readme: $(HWLOC_top_srcdir)/README @HWLOC_BUILD_README_TRUE@$(HWLOC_top_srcdir)/README: $(DOX_TAG) +@HWLOC_BUILD_README_TRUE@ echo "This is a truncated and poorly-formatted version of the documentation main page." > $@ +@HWLOC_BUILD_README_TRUE@ echo "See https://www.open-mpi.org/projects/hwloc/doc/ for more." >> $@ +@HWLOC_BUILD_README_TRUE@ echo >> $@ +@HWLOC_BUILD_README_TRUE@ echo >> $@ @HWLOC_BUILD_README_TRUE@ sed -n -f $(srcdir)/README.sed $(DOX_HTML_DIR)/index.html > $(DOX_HTML_README) @HWLOC_BUILD_README_TRUE@ LC_ALL=C $(HWLOC_W3_GENERATOR) $(DOX_HTML_README) \ -@HWLOC_BUILD_README_TRUE@ | $(SED) -n -e 's/^ //' -e '/^Introduction$$/,$$p' \ +@HWLOC_BUILD_README_TRUE@ | $(SED) -n -e 's/^ //' -e '/^hwloc Overview$$/,$$p' \ @HWLOC_BUILD_README_TRUE@ | $(SED) -e '/^--*-$$/,$$ d' \ -@HWLOC_BUILD_README_TRUE@ > $@ +@HWLOC_BUILD_README_TRUE@ >> $@ @HWLOC_BUILD_README_TRUE@ echo >> $@ @HWLOC_BUILD_README_TRUE@ echo >> $@ -@HWLOC_BUILD_README_TRUE@ echo "See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation." >> $@ +@HWLOC_BUILD_README_TRUE@ echo "See https://www.open-mpi.org/projects/hwloc/doc/ for more hwloc documentation," >> $@ +@HWLOC_BUILD_README_TRUE@ echo "actual links to related pages, images, etc." >> $@ @HWLOC_BUILD_README_TRUE@ rm -f $(DOX_HTML_README) # When we don't have what's needed to build the README, nothing to do diff -Nru hwloc-2.9.2/doc/README.sed hwloc-2.10.0/doc/README.sed --- hwloc-2.9.2/doc/README.sed 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/doc/README.sed 2023-12-05 12:32:19.000000000 +0000 @@ -1,4 +1,5 @@ s/\–/--/g s/©/(c)/g s/é/é/g +s/
\endhtmlonly +\section gitclone_installation Installing from a Git clone + +Additionally, the code can be directly cloned from Git: + +\verbatim +shell$ git clone https://github.com/open-mpi/hwloc.git +shell$ cd hwloc +shell$ ./autogen.sh +\endverbatim + +Note that GNU Autoconf >=2.63, Automake >=1.11 and Libtool >=2.2.6 are +required when building from a Git clone. + +Nightly development snapshots are available on the web site, +they can be configured and built without any need for Git +or GNU Autotools. @@ -516,12 +605,17 @@ a NUMA memory node, etc. The different types detected by hwloc are detailed in the ::hwloc_obj_type_t enumeration. + Objects are topologically sorted by locality (CPU and node sets) + into a tree (see \ref termsanddefs_tree). + + +
Object Kind
+
There are four kinds of Objects: Memory (NUMA nodes and Memory-side caches), I/O (Bridges, PCI and OS devices), Misc, and Normal (everything else, including Machine, Package, Die, Core, PU, CPU Caches, etc.). Normal and Memory objects have (non-NULL) CPU sets and nodesets, while I/O and Misc don't. - Objects are topologically sorted by locality (CPU and node sets) - into a tree (see \ref termsanddefs_tree). + \sa hwlocality_helper_types.
Processing Unit (PU)
@@ -1025,6 +1119,31 @@ Bit 2 enables the use of target/initiator information. +
HWLOC_MEMTIERS_GUESS=none
+
HWLOC_MEMTIERS_GUESS=all
+
Disable or enable all heuristics to guess memory subtypes and tiers. + By default, hwloc only uses heuristics that are likely correct + and disables those that are unlikely. +
+ + +
HWLOC_MEMTIERS=0x0f=HBM;0xf=DRAM
+
Enforce the memory tiers from the given semi-colon separated list. + Each entry specifies a bitmask (nodeset) of NUMA nodes and their subtype. + Nodes not listed in any entry are not placed in any tier. + + If an empty value or none is given, tiers are entirely disabled. +
+ +
HWLOC_MEMTIERS_REFRESH=1
+
Force the rebuilding of memory tiers. + This is mostly useful when importing a XML topology from an old hwloc + version which was not able to guess memory subtypes and tiers. +
+
HWLOC_GROUPING=1
enables or disables objects grouping based on distances. By default, hwloc uses distance matrices between objects (either read @@ -1088,6 +1207,13 @@ If set to 0, max frequencies are entirely ignored.
+
HWLOC_CPUKINDS_HOMOGENEOUS=0
+
uniformize max frequency, base frequency and Linux capacity to + force a single homogeneous kind of CPUs. + This is enabled by default on NVIDIA Grace but may be disabled + if set to 0 (or enabled on other platforms if set to 1). +
+
HWLOC_PCI_LOCALITY=<domain/bus> <cpuset>;...
HWLOC_PCI_LOCALITY=/path/to/pci/locality/file
changes the locality of I/O devices behing the specified PCI buses. @@ -1277,15 +1403,15 @@ -\htmlonly -
-\endhtmlonly -\section netloc_summary Netloc Summary - -The Portable Network Locality (netloc) software package provides network -topology discovery tools, and an abstract representation of those networks -topologies for a range of network types and configurations. It is provided as a -companion to the Portable Hardware Locality (hwloc) package. These two software -packages work together to provide a comprehensive view of the HPC system -topology, spanning from the processor cores in one server to the cores in -another - including the complex network(s) in between. - -Towards this end, netloc is divided into two sets of components. The first -tools are for the admin to extract the information about the topology of the -machines with topology discovery tools for each network type and discovery -technique (called readers). The second set of tools is for the user to exploit -the collected information: to display the topology or create a -topology-aware mapping of the processes of an application. - -\image html netloc_design.png -\image latex netloc_design.png "" width=9cm - - - - -\htmlonly -
-\endhtmlonly -\subsection supportednetworks Supported Networks - -For now, only InfiniBand (See \ref netloc_setup) is supported, but it is -planned to be extended very soon. - - - - -\htmlonly -
-\endhtmlonly -\section netloc_installation Netloc Installation - -The generic installation procedure for both hwloc and netloc -is described in \ref common_installation. - -Note that netloc is currently not supported on as many platforms as -the original hwloc project. -netloc is enabled by default when supported, or can be disabled -by passing \--disable-netloc to the configure command-line. - - - - -\htmlonly -
-\endhtmlonly -\section netloc_setup Setup - -To use Netloc tools, we need two steps. The first step consists in getting -information about network directly from tools distributed by manufacturers. For -Infiniband, for instance, this operation needs privileges to access to the -network device. For this step we have wrappers in Netloc that will call the -right tools with the right options. - -The second step will transform the raw files generated by manufacturer tools, -into files in a format readable by Netloc tools, and that will not depend on -network technologies. - -To be clear, let's take an example with Infiniband. This first step is handled by -\c netloc_ib_gather_raw that will call \c ibnetdiscover and \c ibroutes tools -to generate the necessary raw data files. The step has to be run by an -administrator, since the Infiniband tools need to access to the network device. - -\verbatim -shell$ netloc_ib_gather_raw --help -Usage: netloc_ib_gather_raw [options] - Dumps topology information to /ib-raw/ - Subnets are guessed from the /hwloc/ directory where - the hwloc XML exports of some nodes are stored. -Options: - --sudo - Pass sudo to internal ibnetdiscover and ibroute invocations. - Useful when the entire script cannot run as root. - --hwloc-dir - Use instead of /hwloc/ for hwloc XML exports. - --force-subnet [:]: to force the discovery - Do not guess subnets from hwloc XML exports. - Force discovery on local board port - and optionally force the subnet id - instead of reading it from the first GID. - Examples: --force-subnet mlx4_0:1 - --force-subnet fe80:0000:0000:0000:mlx4_0:1 - --ibnetdiscover /path/to/ibnetdiscover - --ibroute /path/to/ibroute - Specify exact location of programs. Default is /usr/bin/ - --sleep - Sleep for seconds between invocations of programs probing the network - --ignore-errors - Ignore errors from ibnetdiscover and ibroute, assume their outputs are ok - --force -f - Always rediscover to overwrite existing files without asking - --verbose -v - Add verbose messages - --dry-run - Do not actually run programs or modify anything - --help -h - Show this help - -shell$ ./netloc_ib_gather_raw /home/netloc/data -WARNING: Not running as root. -Using /home/netloc/data/hwloc as hwloc lstopo XML directory. - -Exporting local node hwloc XML... - Running lstopo-no-graphics... - -Found 1 subnets in hwloc directory: - Subnet fe80:0000:0000:0000 is locally accessible from board qib0 port 1. - -Looking at fe80:0000:0000:0000 (through local board qib0 port 1)... - Running ibnetdiscover... - Getting routes... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L112' LID 18... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L108' LID 20... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L102' LID 23... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L104' LID 25... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L106' LID 24... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L114' LID 22... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L116' LID 21... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L109' LID 12... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L111' LID 11... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L107' LID 13... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L103' LID 17... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L105' LID 16... - Running ibroute for switch 'QLogic 12800-180 GUID=0x00066a00e8001310 L113' LID 15... -\endverbatim - -The second step, that can be done by a regular user, is done by the tool \c -netloc_ib_extract_dats. - -\verbatim -shell$ netloc_ib_extract_dats --help -Usage: netloc_ib_extract_dats [--hwloc-dir -] - hwloc-dir can be an absolute path or a relative path from output path - -shell$ netloc_ib_extract_dats /home/netloc/data/ib-raw /home/netloc/data/netloc \ - --hwloc-dir ../hwloc -Read subnet: fe80:0000:0000:0000 -2 partitions found - 'node' - 'admin' -\endverbatim - - - - -\htmlonly -
-\endhtmlonly -\section netloc_draw Topology display - -Netloc provides a tool, \c netloc_draw.html, that displays a topology in a web -browser, by using a JSON file. - -\subsection netloc_draw_setup Generate the JSON file - -In order to display a topology, Netloc needs to generate a JSON file -corresponding to a topology. For this operation, the user must run \c -netloc_draw_to_json. - -\verbatim -shell$ netloc_draw_to_json --help -Usage: netloc_draw_to_json - -shell$ netloc_draw_to_json /home/netloc/data/netloc -\endverbatim - -The \c netloc_draw_to_json command will write a JSON file for each topology -file found in the input directory. The output files, written also in the input -directory, can be open by \c netloc_draw.html in a web browser. - -\subsection netloc_draw_tool Using netloc_draw - -Once the JSON file is opened, the rendering is generated by the Javascript vis -library for computing the position of the nodes. From the interface, it is -possible to search for a specific node, to color the nodes, to expand merged -switches, to show statistics, to export as an image... The user can interact -with the nodes by moving them. For now, there are bugs and other nodes might -move too. - -The placement of the nodes is done statically if the topology is detected as a -tree. If not, vis.js will use physics to find good positions, and it can be very -time consuming. - -\image html netloc_draw.png -\image latex netloc_draw.png "" width=15cm - - - - - - - -\page netloc_scotch Netloc with Scotch - - - -\htmlonly -
-\endhtmlonly - -Scotch is a toolbox for graph partitioning [XXX], that can do mapping between a -communication graph and an architecture. Netloc interfaces with Scotch, by -getting the topology of the machine and building the Scotch architecture. It is -also possible to directly build a mapping file that can be given to \c mpirun. - - -\htmlonly -
-\endhtmlonly -\section scotch_intro Introduction - -Scotch is able to deal architectures to represent the topology of a complete -machine. Scotch handles several types of topologies: complete graphs, -hypercubes, fat trees, meshes, torus, and random graphs. Moreover, Scotch is -able to manage parts of architectures that are called sub-architectures. Thus, -from a complete architecture, we can create a sub-architecture that will -represent the available resources of the complete machine. - - -\htmlonly -
-\endhtmlonly -\section scotch_setup Setup - -The first step in order to use Netloc tools is to discover the network. For -this task, we provide tools called netloc_gather that are wrappers to the -dedicated tools provided by the manufacturer of the network, that generate the -raw data given by the devices. This task needs privileges to access to the -network devices. Once, this task is completed, the raw data is converted in a -generic format independent to the fabric by extract_dats. Figure 1 shows how -the different modules of Netloc are linked, and what are the tools provided by -Netloc. - - -\htmlonly -
-\endhtmlonly -\section scotch_tools_api Tools and API - -When the machine is discovered and all the needed files are generated as seen -previously, a user can call the netlocscotch functions from the API and -interact with Scotch. - -\subsection netlocscotch_arch Build Scotch architectures - -Netloc provides a function to export the built topology into the Scotch format. -That will give the possibility to the user to play with the topology in Scotch. -Since Netloc matches the discovered topology with known topologies, the Scotch -architecture won’t be random graphs but known topologies also in Scotch that -will lead to optimized graph algorithms. This function is called -netlocscotch_build_arch. - -When the network topology is a tree, the topology converted by netlocscotch is -the complete topology of the machine containing intranode topologies from -hwloc. In this case, merging the two levels results in a bigger tree. For other -network topologies, the global graph created for Scotch is a generic graph -since it is not (at this moment) possible to create nested known -architectures. - -\subsection netlocscotch_subarch Build Scotch sub-architectures - -Most of the time, the user does not have access to the complete machine. He -uses a resource manager to run his application and he will gain access only to -a set of nodes. In this case getting the Scotch architecture of the complete -machine is not relevant. Fortunately, Netloc is also able to build a Scotch -sub-architecture that will contain only the available nodes. For this operation -the user needs to run a specific program, netloc_get_resources, that will -record in a file, the lists of available nodes and available cores by using MPI -and hwloc. From this file, the function netlocscotch_build_subarch will build -the Scotch sub-architecture. - -\subsection netlocscotch_mapping Mapping of processes - -A main goal in having all these data about the network topology, especially in -Scotch structures, is to help the process placement. For that, we use the -mapping of a process graph to the architecture provided by Scotch. As we have -seen previously, Netloc is able to detect the structure of the topology and -will build the adapted Scotch architecture that will be more efficient than a -random structure. - -In case, the network topology is not a tree, netlocscotch converts the complete -topology into a generic graph. The drawback in that is the Scotch graph -algorithms are less efficient. To overcome that, netlocscotch does two steps of -mapping: first it maps the processes to the nodes, and then for each node maps -the processes to the cores. We have to conduct tests to check if the method -gives better results than using a generic graph directly. - -The other input needed in Scotch is the process graph. Since we want to -optimize the placement to decrease the communication time, a good metric for -building the application graph is the amount of communications between all -pairs of processes. Studies still have to be done to choose, in the most -efficient way, what we take into account to define the amount of communications -between the number of messages, the size of messages... This information will -be transformed into a process graph. - -Once we have a good mapping computed by Scotch, we can give it to the user, or -Netloc can even generate the corresponding rank file useful to MPI. - -*/ diff -Nru hwloc-2.9.2/hwloc/Makefile.in hwloc-2.10.0/hwloc/Makefile.in --- hwloc-2.9.2/hwloc/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -145,8 +145,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -461,7 +460,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -588,17 +586,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -667,7 +654,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -690,7 +676,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) # Beware that files are not rebuilt automatically when reconfiguring with different paths in these flags. AM_CPPFLAGS = $(HWLOC_CPPFLAGS) -DHWLOC_INSIDE_LIBHWLOC \ diff -Nru hwloc-2.9.2/hwloc/components.c hwloc-2.10.0/hwloc/components.c --- hwloc-2.9.2/hwloc/components.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/components.c 2023-12-05 12:32:19.000000000 +0000 @@ -94,8 +94,7 @@ { hwloc_dlhandle handle; char *filename = NULL; - (void) asprintf(&filename, "%s.so", _filename); - if (!filename) + if (asprintf(&filename, "%s.so", _filename) < 0) return NULL; handle = dlopen(filename, RTLD_NOW|RTLD_LOCAL); free(filename); diff -Nru hwloc-2.9.2/hwloc/diff.c hwloc-2.10.0/hwloc/diff.c --- hwloc-2.9.2/hwloc/diff.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/diff.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2013-2022 Inria. All rights reserved. + * Copyright © 2013-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -409,6 +409,30 @@ } } } + } + + if (!err) { + /* cpukinds */ + if (topo1->nr_cpukinds != topo2->nr_cpukinds) + goto roottoocomplex; + for(i=0; inr_cpukinds; i++) { + struct hwloc_internal_cpukind_s *ic1 = &topo1->cpukinds[i]; + struct hwloc_internal_cpukind_s *ic2 = &topo2->cpukinds[i]; + unsigned j; + if (!hwloc_bitmap_isequal(ic1->cpuset, ic2->cpuset) + || ic1->efficiency != ic2->efficiency + || ic1->forced_efficiency != ic2->forced_efficiency + || ic1->ranking_value != ic2->ranking_value + || ic1->nr_infos != ic2->nr_infos) + goto roottoocomplex; + for(j=0; jnr_infos; j++) { + struct hwloc_info_s *info1 = &ic1->infos[j], *info2 = &ic2->infos[j]; + if (strcmp(info1->name, info2->name) + || strcmp(info1->value, info2->value)) { + goto roottoocomplex; + } + } + } } return err; diff -Nru hwloc-2.9.2/hwloc/memattrs.c hwloc-2.10.0/hwloc/memattrs.c --- hwloc-2.9.2/hwloc/memattrs.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/memattrs.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2020-2022 Inria. All rights reserved. + * Copyright © 2020-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -1219,24 +1219,82 @@ * Using memattrs to identify HBM/DRAM */ +enum hwloc_memory_tier_type_e { + /* WARNING: keep higher BW types first for compare_tiers_by_bw_and_type() when BW info is missing */ + HWLOC_MEMORY_TIER_HBM = 1UL<<0, + HWLOC_MEMORY_TIER_DRAM = 1UL<<1, + HWLOC_MEMORY_TIER_GPU = 1UL<<2, + HWLOC_MEMORY_TIER_SPM = 1UL<<3, /* Specific-Purpose Memory is usually HBM, we'll use BW to confirm or force*/ + HWLOC_MEMORY_TIER_NVM = 1UL<<4, + HWLOC_MEMORY_TIER_CXL = 1UL<<5 +}; +typedef unsigned long hwloc_memory_tier_type_t; +#define HWLOC_MEMORY_TIER_UNKNOWN 0UL + +static const char * hwloc_memory_tier_type_snprintf(hwloc_memory_tier_type_t type) +{ + switch (type) { + case HWLOC_MEMORY_TIER_DRAM: return "DRAM"; + case HWLOC_MEMORY_TIER_HBM: return "HBM"; + case HWLOC_MEMORY_TIER_GPU: return "GPUMemory"; + case HWLOC_MEMORY_TIER_SPM: return "SPM"; + case HWLOC_MEMORY_TIER_NVM: return "NVM"; + case HWLOC_MEMORY_TIER_CXL: + case HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_DRAM: return "CXL-DRAM"; + case HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_HBM: return "CXL-HBM"; + case HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_GPU: return "CXL-GPUMemory"; + case HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_SPM: return "CXL-SPM"; + case HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_NVM: return "CXL-NVM"; + default: return NULL; + } +} + +static hwloc_memory_tier_type_t hwloc_memory_tier_type_sscanf(const char *name) +{ + if (!strcasecmp(name, "DRAM")) + return HWLOC_MEMORY_TIER_DRAM; + if (!strcasecmp(name, "HBM")) + return HWLOC_MEMORY_TIER_HBM; + if (!strcasecmp(name, "GPUMemory")) + return HWLOC_MEMORY_TIER_GPU; + if (!strcasecmp(name, "SPM")) + return HWLOC_MEMORY_TIER_SPM; + if (!strcasecmp(name, "NVM")) + return HWLOC_MEMORY_TIER_NVM; + if (!strcasecmp(name, "CXL-DRAM")) + return HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_DRAM; + if (!strcasecmp(name, "CXL-HBM")) + return HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_HBM; + if (!strcasecmp(name, "CXL-GPUMemory")) + return HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_GPU; + if (!strcasecmp(name, "CXL-SPM")) + return HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_SPM; + if (!strcasecmp(name, "CXL-NVM")) + return HWLOC_MEMORY_TIER_CXL|HWLOC_MEMORY_TIER_NVM; + return 0; +} + +/* factorized tier, grouping multiple nodes */ struct hwloc_memory_tier_s { + hwloc_nodeset_t nodeset; + uint64_t local_bw_min, local_bw_max; + uint64_t local_lat_min, local_lat_max; + hwloc_memory_tier_type_t type; +}; + +/* early tier discovery, one entry per node */ +struct hwloc_memory_node_info_s { hwloc_obj_t node; uint64_t local_bw; - enum hwloc_memory_tier_type_e { - /* warning the order is important for guess_memory_tiers() after qsort() */ - HWLOC_MEMORY_TIER_UNKNOWN, - HWLOC_MEMORY_TIER_DRAM, - HWLOC_MEMORY_TIER_HBM, - HWLOC_MEMORY_TIER_SPM, /* Specific-Purpose Memory is usually HBM, we'll use BW to confirm */ - HWLOC_MEMORY_TIER_NVM, - HWLOC_MEMORY_TIER_GPU, - } type; + uint64_t local_lat; + hwloc_memory_tier_type_t type; + unsigned rank; }; -static int compare_tiers(const void *_a, const void *_b) +static int compare_node_infos_by_type_and_bw(const void *_a, const void *_b) { - const struct hwloc_memory_tier_s *a = _a, *b = _b; - /* sort by type of tier first */ + const struct hwloc_memory_node_info_s *a = _a, *b = _b; + /* sort by type of node first */ if (a->type != b->type) return a->type - b->type; /* then by bandwidth */ @@ -1247,180 +1305,560 @@ return 0; } -int -hwloc_internal_memattrs_guess_memory_tiers(hwloc_topology_t topology) +static int compare_tiers_by_bw_and_type(const void *_a, const void *_b) { - struct hwloc_internal_memattr_s *imattr; - struct hwloc_memory_tier_s *tiers; - unsigned i, j, n; - const char *env; - int spm_is_hbm = -1; /* -1 will guess from BW, 0 no, 1 forced */ - int mark_dram = 1; - unsigned first_spm, first_nvm; - hwloc_uint64_t max_unknown_bw, min_spm_bw; - - env = getenv("HWLOC_MEMTIERS_GUESS"); - if (env) { - if (!strcmp(env, "none")) { - return 0; - } else if (!strcmp(env, "default")) { - /* nothing */ - } else if (!strcmp(env, "spm_is_hbm")) { - hwloc_debug("Assuming SPM-tier is HBM, ignore bandwidth\n"); - spm_is_hbm = 1; - } else if (HWLOC_SHOW_CRITICAL_ERRORS()) { - fprintf(stderr, "hwloc: Failed to recognize HWLOC_MEMTIERS_GUESS value %s\n", env); - } + const struct hwloc_memory_tier_s *a = _a, *b = _b; + /* sort by (average) BW first */ + if (a->local_bw_min && b->local_bw_min) { + if (a->local_bw_min + a->local_bw_max > b->local_bw_min + b->local_bw_max) + return -1; + else if (a->local_bw_min + a->local_bw_max < b->local_bw_min + b->local_bw_max) + return 1; } + /* then by tier type */ + if (a->type != b->type) + return a->type - b->type; + return 0; +} - imattr = &topology->memattrs[HWLOC_MEMATTR_ID_BANDWIDTH]; - - if (!(imattr->iflags & HWLOC_IMATTR_FLAG_CACHE_VALID)) - hwloc__imattr_refresh(topology, imattr); +static struct hwloc_memory_tier_s * +hwloc__group_memory_tiers(hwloc_topology_t topology, + unsigned *nr_tiers_p) +{ + struct hwloc_internal_memattr_s *imattr_bw, *imattr_lat; + struct hwloc_memory_node_info_s *nodeinfos; + struct hwloc_memory_tier_s *tiers; + unsigned nr_tiers; + float bw_threshold = 0.1; + float lat_threshold = 0.1; + const char *env; + unsigned i, j, n; n = hwloc_get_nbobjs_by_depth(topology, HWLOC_TYPE_DEPTH_NUMANODE); assert(n); - tiers = malloc(n * sizeof(*tiers)); - if (!tiers) - return -1; + env = getenv("HWLOC_MEMTIERS_BANDWIDTH_THRESHOLD"); + if (env) + bw_threshold = atof(env); + + env = getenv("HWLOC_MEMTIERS_LATENCY_THRESHOLD"); + if (env) + lat_threshold = atof(env); + + imattr_bw = &topology->memattrs[HWLOC_MEMATTR_ID_BANDWIDTH]; + imattr_lat = &topology->memattrs[HWLOC_MEMATTR_ID_LATENCY]; + + if (!(imattr_bw->iflags & HWLOC_IMATTR_FLAG_CACHE_VALID)) + hwloc__imattr_refresh(topology, imattr_bw); + if (!(imattr_lat->iflags & HWLOC_IMATTR_FLAG_CACHE_VALID)) + hwloc__imattr_refresh(topology, imattr_lat); + + nodeinfos = malloc(n * sizeof(*nodeinfos)); + if (!nodeinfos) + return NULL; for(i=0; isubtype && !strcmp(node->subtype, "GPUMemory")) - tiers[i].type = HWLOC_MEMORY_TIER_GPU; + nodeinfos[i].type = HWLOC_MEMORY_TIER_GPU; + else if (daxtype && !strcmp(daxtype, "NVM")) + nodeinfos[i].type = HWLOC_MEMORY_TIER_NVM; + else if (daxtype && !strcmp(daxtype, "SPM")) + nodeinfos[i].type = HWLOC_MEMORY_TIER_SPM; + /* add CXL flag */ + if (hwloc_obj_get_info_by_name(node, "CXLDevice") != NULL) { + /* CXL is always SPM for now. HBM and DRAM not possible here yet. + * Hence remove all but NVM first. + */ + nodeinfos[i].type &= HWLOC_MEMORY_TIER_NVM; + nodeinfos[i].type |= HWLOC_MEMORY_TIER_CXL; + } - if (spm_is_hbm == -1) { - for(j=0; jnr_targets; j++) - if (imattr->targets[j].obj == node) { - imtg = &imattr->targets[j]; - break; - } - if (imtg && !hwloc_bitmap_iszero(node->cpuset)) { - iloc.type = HWLOC_LOCATION_TYPE_CPUSET; - iloc.location.cpuset = node->cpuset; - imi = hwloc__memattr_target_get_initiator(imtg, &iloc, 0); - if (imi) - tiers[i].local_bw = imi->value; + /* get local bandwidth */ + imtg = NULL; + for(j=0; jnr_targets; j++) + if (imattr_bw->targets[j].obj == node) { + imtg = &imattr_bw->targets[j]; + break; + } + if (imtg && !hwloc_bitmap_iszero(node->cpuset)) { + struct hwloc_internal_memattr_initiator_s *imi; + iloc.type = HWLOC_LOCATION_TYPE_CPUSET; + iloc.location.cpuset = node->cpuset; + imi = hwloc__memattr_target_get_initiator(imtg, &iloc, 0); + if (imi) + nodeinfos[i].local_bw = imi->value; + } + /* get local latency */ + imtg = NULL; + for(j=0; jnr_targets; j++) + if (imattr_lat->targets[j].obj == node) { + imtg = &imattr_lat->targets[j]; + break; } + if (imtg && !hwloc_bitmap_iszero(node->cpuset)) { + struct hwloc_internal_memattr_initiator_s *imi; + iloc.type = HWLOC_LOCATION_TYPE_CPUSET; + iloc.location.cpuset = node->cpuset; + imi = hwloc__memattr_target_get_initiator(imtg, &iloc, 0); + if (imi) + nodeinfos[i].local_lat = imi->value; } } - /* sort tiers */ - qsort(tiers, n, sizeof(*tiers), compare_tiers); - hwloc_debug("Sorting memory tiers...\n"); + /* Sort nodes. + * We could also sort by the existing subtype. + * KNL is the only case where subtypes are set in backends, but we set memattrs as well there. + * Also HWLOC_MEMTIERS_REFRESH would be a special value to ignore existing subtypes. + */ + hwloc_debug("Sorting memory node infos...\n"); + qsort(nodeinfos, n, sizeof(*nodeinfos), compare_node_infos_by_type_and_bw); +#ifdef HWLOC_DEBUG for(i=0; ilogical_index, tiers[i].node->os_index, - tiers[i].type, (unsigned long long) tiers[i].local_bw); - - /* now we have UNKNOWN tiers (sorted by BW), then SPM tiers (sorted by BW), then NVM, then GPU */ + nodeinfos[i].node->logical_index, nodeinfos[i].node->os_index, + nodeinfos[i].type, + (unsigned long long) nodeinfos[i].local_bw, + (unsigned long long) nodeinfos[i].local_lat); +#endif + /* now we have UNKNOWN nodes (sorted by BW only), then known ones */ + + /* iterate among them and add a rank value. + * start from rank 0 and switch to next rank when the type changes or when the BW or latendy difference is > threshold */ + hwloc_debug("Starting memory tier #0 and iterating over nodes...\n"); + nodeinfos[0].rank = 0; + for(i=1; ilogical_index, nodeinfos[i].node->os_index); + nodeinfos[i].rank++; + continue; + } + /* comparing bandwidth */ + if (nodeinfos[i].local_bw && nodeinfos[i-1].local_bw) { + float bw_ratio = (float)nodeinfos[i].local_bw/(float)nodeinfos[i-1].local_bw; + if (bw_ratio < 1.) + bw_ratio = 1./bw_ratio; + if (bw_ratio > 1.0 + bw_threshold) { + nodeinfos[i].rank++; + hwloc_debug(" Switching to memory tier #%u starting with node L#%u P#%u because of bandwidth\n", + nodeinfos[i].rank, nodeinfos[i].node->logical_index, nodeinfos[i].node->os_index); + continue; + } + } + /* comparing latency */ + if (nodeinfos[i].local_lat && nodeinfos[i-1].local_lat) { + float lat_ratio = (float)nodeinfos[i].local_lat/(float)nodeinfos[i-1].local_lat; + if (lat_ratio < 1.) + lat_ratio = 1./lat_ratio; + if (lat_ratio > 1.0 + lat_threshold) { + hwloc_debug(" Switching to memory tier #%u starting with node L#%u P#%u because of latency\n", + nodeinfos[i].rank, nodeinfos[i].node->logical_index, nodeinfos[i].node->os_index); + nodeinfos[i].rank++; + continue; + } + } + } + /* FIXME: if there are cpuset-intersecting nodes in same tier, split again? */ + hwloc_debug(" Found %u tiers total\n", nodeinfos[n-1].rank + 1); - /* iterate over UNKNOWN tiers, and find their BW */ - for(i=0; i HWLOC_MEMORY_TIER_UNKNOWN) - break; + /* now group nodeinfos into factorized tiers */ + nr_tiers = nodeinfos[n-1].rank + 1; + tiers = calloc(nr_tiers, sizeof(*tiers)); + if (!tiers) + goto out_with_nodeinfos; + for(i=0; i 0) - max_unknown_bw = tiers[0].local_bw; - else - max_unknown_bw = 0; + for(i=0; ios_index); + assert(tiers[rank].type == HWLOC_MEMORY_TIER_UNKNOWN + || tiers[rank].type == nodeinfos[i].type); + tiers[rank].type = nodeinfos[i].type; + /* nodeinfos are sorted in BW order, no need to compare */ + if (!tiers[rank].local_bw_min) + tiers[rank].local_bw_min = nodeinfos[i].local_bw; + tiers[rank].local_bw_max = nodeinfos[i].local_bw; + /* compare latencies to update min/max */ + if (!tiers[rank].local_lat_min || nodeinfos[i].local_lat < tiers[rank].local_lat_min) + tiers[rank].local_lat_min = nodeinfos[i].local_lat; + if (!tiers[rank].local_lat_max || nodeinfos[i].local_lat > tiers[rank].local_lat_max) + tiers[rank].local_lat_max = nodeinfos[i].local_lat; + } + + free(nodeinfos); + *nr_tiers_p = nr_tiers; + return tiers; + + out_with_tiers: + for(i=0; i HWLOC_MEMORY_TIER_SPM) - break; +static int +hwloc__guess_dram_hbm_tiers(struct hwloc_memory_tier_s *tier1, + struct hwloc_memory_tier_s *tier2, + unsigned long flags) +{ + struct hwloc_memory_tier_s *tmp; + + if (!tier1->local_bw_min || !tier2->local_bw_min) { + hwloc_debug(" Missing BW info\n"); + return -1; } - first_nvm = i; - /* get min BW from last */ - if (first_nvm > first_spm) - min_spm_bw = tiers[first_nvm-1].local_bw; - else - min_spm_bw = 0; - /* FIXME: if there's more than 10% between some sets of nodes inside a tier, split it? */ - /* FIXME: if there are cpuset-intersecting nodes in same tier, abort? */ + /* reorder tiers by BW */ + if (tier1->local_bw_min > tier2->local_bw_min) { + tmp = tier1; tier1 = tier2; tier2 = tmp; + } + /* tier1 < tier2 */ - if (spm_is_hbm == -1) { - /* if we have BW for all SPM and UNKNOWN - * and all SPM BW are 2x superior to all UNKNOWN BW - */ - hwloc_debug("UNKNOWN-memory-tier max bandwidth %llu\n", (unsigned long long) max_unknown_bw); - hwloc_debug("SPM-memory-tier min bandwidth %llu\n", (unsigned long long) min_spm_bw); - if (max_unknown_bw > 0 && min_spm_bw > 0 && max_unknown_bw*2 < min_spm_bw) { - hwloc_debug("assuming SPM means HBM and !SPM means DRAM since bandwidths are very different\n"); - spm_is_hbm = 1; - } else { - hwloc_debug("cannot assume SPM means HBM\n"); - spm_is_hbm = 0; - } + hwloc_debug(" tier1 BW %llu-%llu vs tier2 BW %llu-%llu\n", + (unsigned long long) tier1->local_bw_min, + (unsigned long long) tier1->local_bw_max, + (unsigned long long) tier2->local_bw_min, + (unsigned long long) tier2->local_bw_max); + if (tier2->local_bw_min <= tier1->local_bw_max * 2) { + /* tier2 BW isn't 2x tier1, we cannot guess HBM */ + hwloc_debug(" BW difference isn't >2x\n"); + return -1; } + /* tier2 BW is >2x tier1 */ - if (spm_is_hbm) { - for(i=0; inodeset, 0)) { + /* node0 is not DRAM, and we assume that's not possible */ + hwloc_debug(" node0 shouldn't have HBM BW\n"); + return -1; } - if (first_spm == n) - mark_dram = 0; + /* assume tier1 == DRAM and tier2 == HBM */ + tier1->type = HWLOC_MEMORY_TIER_DRAM; + tier2->type = HWLOC_MEMORY_TIER_HBM; + hwloc_debug(" Success\n"); + return 0; +} - /* now apply subtypes */ - for(i=0; isubtype) /* don't overwrite the existing subtype */ - continue; +static int +hwloc__guess_memory_tiers_types(hwloc_topology_t topology __hwloc_attribute_unused, + unsigned nr_tiers, + struct hwloc_memory_tier_s *tiers) +{ + unsigned long flags; + const char *env; + unsigned nr_unknown, nr_spm; + struct hwloc_memory_tier_s *unknown_tier[2], *spm_tier; + unsigned i; + + flags = 0; + env = getenv("HWLOC_MEMTIERS_GUESS"); + if (env) { + if (!strcmp(env, "none")) + return 0; + /* by default, we don't guess anything unsure */ + if (!strcmp(env, "all")) + /* enable all typical cases */ + flags = ~0UL; + if (strstr(env, "spm_is_hbm")) { + hwloc_debug("Assuming SPM-tier is HBM, ignore bandwidth\n"); + flags |= HWLOC_GUESS_MEMTIERS_FLAG_SPM_IS_HBM; + } + if (strstr(env, "node0_is_dram")) { + hwloc_debug("Assuming node0 is DRAM\n"); + flags |= HWLOC_GUESS_MEMTIERS_FLAG_NODE0_IS_DRAM; + } + } + + if (nr_tiers == 1) + /* Likely DRAM only, but could also be HBM-only in non-SPM mode. + * We cannot be sure, but it doesn't matter since there's a single tier. + */ + return 0; + + nr_unknown = nr_spm = 0; + unknown_tier[0] = unknown_tier[1] = spm_tier = NULL; + for(i=0; i DRAM or HBM? HBM won't be SPM on HBM-only CPUs + * unknown + CXL DRAM => DRAM or HBM? + */ + if (nr_unknown == 2 && !nr_spm) { + /* 2 unknown, could be DRAM + non-SPM HBM */ + hwloc_debug(" Trying to guess 2 unknown tiers using BW\n"); + hwloc__guess_dram_hbm_tiers(unknown_tier[0], unknown_tier[1], flags); + } else if (nr_unknown == 1 && nr_spm == 1) { + /* 1 unknown + 1 SPM, could be DRAM + SPM HBM */ + hwloc_debug(" Trying to guess 1 unknown + 1 SPM tiers using BW\n"); + hwloc__guess_dram_hbm_tiers(unknown_tier[0], spm_tier, flags); + } + + if (flags & HWLOC_GUESS_MEMTIERS_FLAG_SPM_IS_HBM) { + /* force mark SPM as HBM */ + for(i=0; ios_index)) { + const char *subtype = hwloc_memory_tier_type_snprintf(tiers[j].type); + if (!node->subtype || force) { /* don't overwrite the existing subtype unless forced */ + if (subtype) { /* don't set a subtype for unknown tiers */ + hwloc_debug(" marking node L#%u P#%u as %s (was %s)\n", node->logical_index, node->os_index, subtype, node->subtype); + free(node->subtype); + node->subtype = strdup(subtype); + } + } else + hwloc_debug(" node L#%u P#%u already marked as %s, not setting %s\n", + node->logical_index, node->os_index, node->subtype, subtype); + if (nr_tiers > 1) { + char tmp[20]; + snprintf(tmp, sizeof(tmp), "%u", j); + hwloc__add_info_nodup(&node->infos, &node->infos_count, "MemoryTier", tmp, 1); + } + break; /* each node is in a single tier */ + } } - if (type) { - hwloc_debug("Marking node L#%u P#%u as %s\n", tiers[i].node->logical_index, tiers[i].node->os_index, type); - tiers[i].node->subtype = strdup(type); + } +} + +int +hwloc_internal_memattrs_guess_memory_tiers(hwloc_topology_t topology, int force_subtype) +{ + struct hwloc_memory_tier_s *tiers; + unsigned nr_tiers; + unsigned i; + const char *env; + + env = getenv("HWLOC_MEMTIERS"); + if (env) { + if (!strcmp(env, "none")) + goto out; + tiers = hwloc__force_memory_tiers(topology, &nr_tiers, env); + if (tiers) { + assert(nr_tiers > 0); + force_subtype = 1; + goto ready; } } + tiers = hwloc__group_memory_tiers(topology, &nr_tiers); + if (!tiers) + goto out; + + hwloc__guess_memory_tiers_types(topology, nr_tiers, tiers); + + /* sort tiers by BW first, then by type */ + hwloc_debug("Sorting memory tiers...\n"); + qsort(tiers, nr_tiers, sizeof(*tiers), compare_tiers_by_bw_and_type); + + ready: +#ifdef HWLOC_DEBUG + for(i=0; iphase == HWLOC_DISC_PHASE_IO); hwloc_topology_get_type_filter(topology, HWLOC_OBJ_OS_DEVICE, &filter); if (filter == HWLOC_TYPE_FILTER_KEEP_NONE) return 0; + hwloc__levelzero_osdev_array_init(&oarray); + + hwloc__levelzero_ports_init(&hports); + +#ifdef HWLOC_HAVE_ZESINIT + res = zesInit(0); + if (res != ZE_RESULT_SUCCESS) { + hwloc_debug("hwloc/levelzero: Failed to initialize LevelZero Sysman in zesInit(): 0x%x\n", (unsigned)res); + hwloc_debug("hwloc/levelzero: Continuing. Hopefully ZES_ENABLE_SYSMAN=1\n"); + } +#endif /* HWLOC_HAVE_ZESINIT */ + /* Tell L0 to create sysman devices. * If somebody already initialized L0 without Sysman, * zesDeviceGetProperties() will fail and warn in hwloc__levelzero_properties_get(). @@ -679,6 +687,15 @@ continue; } +#if 0 + /* No interesting info attr to get from driver properties for now. + * 2022/12/09: Driver UUID is driver version (major>>24|minor>>16|build) | a-uuid-timestamp>>32 + * hence it's not stable across multiple runs + */ + ze_driver_properties_t drprop; + res = zeDriverGetProperties(drh[i], &drprop); +#endif + for(j=0; j #include #include +#include +#include struct hwloc_linux_backend_data_s { char *root_path; /* NULL if unused */ @@ -52,10 +54,12 @@ HWLOC_LINUX_ARCH_ARM, HWLOC_LINUX_ARCH_POWER, HWLOC_LINUX_ARCH_S390, + HWLOC_LINUX_ARCH_LOONGARCH, HWLOC_LINUX_ARCH_UNKNOWN } arch; int is_knl; int is_amd_with_CU; + int is_fake_numa_uniform; /* 0 if not fake, -1 if fake non-uniform, N if fake=U */ int use_numa_distances; int use_numa_distances_for_cpuless; int use_numa_initiators; @@ -514,11 +518,16 @@ static __hwloc_inline int hwloc_readlink(const char *p, char *l, size_t ll, int d __hwloc_attribute_unused) { + ssize_t err; + /* readlink doesn't put the ending \0. read ll-1 and add it. */ #ifdef HAVE_OPENAT - return hwloc_readlinkat(p, l, ll, d); + err = hwloc_readlinkat(p, l, ll-1, d); #else - return readlink(p, l, ll); + err = readlink(p, l, ll-1); #endif + if (err >= 0) + l[err] = '\0'; + return err; } @@ -870,6 +879,8 @@ setsize = CPU_ALLOC_SIZE(last+1); plinux_set = CPU_ALLOC(last+1); + if (!plinux_set) + return -1; CPU_ZERO_S(setsize, plinux_set); hwloc_bitmap_foreach_begin(cpu, hwloc_set) @@ -950,7 +961,10 @@ while (1) { cpu_set_t *set = CPU_ALLOC(nr_cpus); size_t setsize = CPU_ALLOC_SIZE(nr_cpus); - int err = sched_getaffinity(0, setsize, set); /* always works, unless setsize is too small */ + int err; + if (!set) + return -1; /* caller will return an error, and we'll try again later */ + err = sched_getaffinity(0, setsize, set); /* always works, unless setsize is too small */ CPU_FREE(set); nr_cpus = setsize * 8; /* that's the value that was actually tested */ if (!err) @@ -978,8 +992,12 @@ /* find the kernel nr_cpus so as to use a large enough cpu_set size */ kernel_nr_cpus = hwloc_linux_find_kernel_nr_cpus(topology); + if (kernel_nr_cpus < 0) + return -1; setsize = CPU_ALLOC_SIZE(kernel_nr_cpus); plinux_set = CPU_ALLOC(kernel_nr_cpus); + if (!plinux_set) + return -1; err = sched_getaffinity(tid, setsize, plinux_set); @@ -1333,6 +1351,8 @@ setsize = CPU_ALLOC_SIZE(last+1); plinux_set = CPU_ALLOC(last+1); + if (!plinux_set) + return -1; CPU_ZERO_S(setsize, plinux_set); hwloc_bitmap_foreach_begin(cpu, hwloc_set) @@ -1424,6 +1444,8 @@ setsize = CPU_ALLOC_SIZE(last+1); plinux_set = CPU_ALLOC(last+1); + if (!plinux_set) + return -1; err = pthread_getaffinity_np(tid, setsize, plinux_set); if (err) { @@ -2727,6 +2749,54 @@ hwloc__get_dmi_id_one_info(data, obj, path, pathlen, "sys_vendor", "DMISysVendor"); } +static void +hwloc__get_soc_one_info(struct hwloc_linux_backend_data_s *data, + hwloc_obj_t obj, + char *path, int n, const char *info_suffix) +{ + char soc_line[64]; + char infoname[64]; + + if (hwloc_read_path_by_length(path, soc_line, sizeof(soc_line), data->root_fd) <= 0) + return; + + if (soc_line[0] != '\0') { + char *tmp = strchr(soc_line, '\n'); + if (tmp) + *tmp = '\0'; + snprintf(infoname, sizeof(infoname), "SoC%d%s", n, info_suffix); + hwloc_obj_add_info(obj, infoname, soc_line); + } +} + +static void +hwloc__get_soc_info(struct hwloc_linux_backend_data_s *data, hwloc_obj_t obj) +{ + char path[128]; + struct dirent *dirent; + DIR *dir; + + /* single SoC, add topology info */ + strcpy(path, "/sys/bus/soc/devices"); + dir = hwloc_opendir(path, data->root_fd); + if (!dir) + return; + + while ((dirent = readdir(dir)) != NULL) { + int i; + if (sscanf(dirent->d_name, "soc%d", &i) != 1) + continue; + + snprintf(path, sizeof(path), "/sys/bus/soc/devices/soc%d/soc_id", i); + hwloc__get_soc_one_info(data, obj, path, i, "ID"); + snprintf(path, sizeof(path), "/sys/bus/soc/devices/soc%d/family", i); + hwloc__get_soc_one_info(data, obj, path, i, "Family"); + snprintf(path, sizeof(path), "/sys/bus/soc/devices/soc%d/revision", i); + hwloc__get_soc_one_info(data, obj, path, i, "Revision"); + } + closedir(dir); +} + /*************************************** * KNL NUMA quirks @@ -3253,6 +3323,10 @@ */ hwloc_bitmap_copy(mcdram->cpuset, ddr->cpuset); + /* also mark ddr as DRAM to match what we do in memattrs.c */ + assert(ddr); + ddr->subtype = strdup("DRAM"); + /* Add a Group for Cluster containing this MCDRAM + DDR */ cluster = hwloc_alloc_setup_object(topology, HWLOC_OBJ_GROUP, HWLOC_UNKNOWN_INDEX); hwloc_obj_add_other_obj_sets(cluster, ddr); @@ -3699,6 +3773,92 @@ } static int +annotate_cxl_dax(hwloc_obj_t obj, unsigned region, int root_fd) +{ + char path[300]; + char bdfs[(12+1)*16]; /* 16 interleaved devices max, 12 chars par BDF, comma-separated + ending \0 */ + char *curbdfptr = bdfs; + unsigned interleave_ways = 0; + unsigned i; + *curbdfptr = '\0'; + + for(i=0; ; i++) { + char decoder[20]; /* "decoderX.Y" */ + char decoderpath[256], *endpoint; + char uportpath[256], *pcirootbus, *pcibdf; + unsigned pcidomain, pcibus, pcidevice, pcifunc; + char *slash, *end; + int err; + + /* read the i-th decoder name from file target */ + snprintf(path, sizeof(path), "/sys/bus/cxl/devices/region%u/target%u", region, i); + if (hwloc_read_path_by_length(path, decoder, sizeof(decoder), root_fd) < 0) + break; + end = strchr(decoder, '\n'); + if (end) + *end = '\0'; + hwloc_debug("hwloc/dax/cxl: found decoder `%s' for region#%u target#%u\n", decoder, region, i); + + /* get the endpoint symlink which ends with "/portT/endpointX/decoderY.X/" */ + snprintf(path, sizeof(path), "/sys/bus/cxl/devices/%s", decoder); + err = hwloc_readlink(path, decoderpath, sizeof(decoderpath), root_fd); + if (err < 0) + break; + endpoint = strstr(decoderpath, "endpoint"); + if (!endpoint) + break; + slash = strchr(endpoint, '/'); + if (!slash) + break; + *slash = '\0'; + hwloc_debug("hwloc/dax/cxl: found endpoint `%s'\n", endpoint); + + /* get the PCI in the endpointX/uport symlink "../../../pci/../memX" */ + snprintf(path, sizeof(path), "/sys/bus/cxl/devices/%s/uport", endpoint); + err = hwloc_readlink(path, uportpath, sizeof(uportpath), root_fd); + if (err < 0) + break; + hwloc_debug("hwloc/dax/cxl: lookind for BDF at the end of uport `%s'\n", uportpath); + pcirootbus = strstr(uportpath, "/pci"); + if (!pcirootbus) + break; + slash = pcirootbus + 11; /* "/pciXXXX:YY/" */ + if (*slash != '/') + break; + pcibdf = NULL; + while (sscanf(slash, "/%x:%x:%x.%x/", &pcidomain, &pcibus, &pcidevice, &pcifunc) == 4) { + pcibdf = slash+1; + slash += 13; + } + *slash = '\0'; + if (pcibdf) { + if (interleave_ways) { + if (interleave_ways >= 16) { + if (HWLOC_SHOW_CRITICAL_ERRORS()) + fprintf(stderr, "Found more than 16 interleaved devices for region%u, ignoring the last ones.\n", region); + break; + } + *(curbdfptr++) = ','; + } + strcpy(curbdfptr, pcibdf); + curbdfptr += 12; + interleave_ways++; + } + } + + if (interleave_ways) { + if (interleave_ways > 1) { + char tmp[12]; /* interleave ways is 16 max */ + snprintf(tmp, sizeof(tmp), "%u", interleave_ways); + hwloc_obj_add_info(obj, "CXLDeviceInterleaveWays", tmp); + } + hwloc_obj_add_info(obj, "CXLDevice", bdfs); + } + + return 0; +} + +static int dax_is_kmem(const char *name, int fsroot_fd) { char path[300]; @@ -3713,7 +3873,7 @@ { char daxpath[300]; char link[PATH_MAX]; - char *begin, *end; + char *begin, *end, *region; const char *type; int err; @@ -3727,7 +3887,11 @@ * ../../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region2/dax2.0/dax2.0/ for NVDIMMs * ../../../devices/platform/e820_pmem/ndbus0/region0/dax0.0/dax0.0/ for fake NVM (memmap=size!start kernel parameter) * ../../../devices/platform/hmem.0/dax0.0/ for "soft-reserved" specific-purpose memory + * ../../../devices/platform/ACPI0017:00/root0/decoder0.0/region0/dax_region0/dax0.0/ for CXL RAM + * ../../../devices/platform/ACPI0017:00/root0/nvdimm-bridge0/ndbus0/region0/dax0.0/dax0.0/ for CXL PMEM */ + + /* remove beginning and end of link to populate DAXParent */ begin = link; /* remove the starting ".." (likely multiple) */ while (!strncmp(begin, "../", 3)) @@ -3737,9 +3901,9 @@ begin += 8; if (!strncmp(begin, "platform/", 9)) begin += 9; - /* remove the ending "daxX.Y" (either one or two) */ + /* stop at the ending "/daxX.Y" */ end = strstr(begin, name); - if (end) { + if (end && end != begin && end[-1] == '/') { *end = '\0'; if (end != begin && end[-1] == '/') end[-1] = '\0'; @@ -3749,6 +3913,15 @@ type = strstr(begin, "ndbus") ? "NVM" : "SPM"; hwloc_obj_add_info(obj, "DAXType", type); + /* try to get some CXL info from the region */ + region = strstr(begin, "/region"); + if (region) { + unsigned i = strtoul(region+7, &end, 10); + if (end != region+7) + annotate_cxl_dax(obj, i, fsroot_fd); + } + + /* insert DAXParent last because it's likely less useful than others */ hwloc_obj_add_info(obj, "DAXParent", begin); /* @@ -3980,11 +4153,26 @@ unsigned failednodes = 0; unsigned i; DIR *dir; - int allow_overlapping_node_cpusets = (getenv("HWLOC_DEBUG_ALLOW_OVERLAPPING_NODE_CPUSETS") != NULL); + char *env; + int allow_overlapping_node_cpusets = 0; int need_memcaches = hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_MEMCACHE); + int need_memattrs = !(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS); hwloc_debug("\n\n * Topology extraction from /sys/devices/system/node *\n\n"); + if (data->is_fake_numa_uniform) { + hwloc_debug("Disabling memory-side caches, memory attributes and HMAT initiators because of fake numa\n"); + need_memcaches = 0; + need_memattrs = 0; + data->use_numa_initiators = 0; + allow_overlapping_node_cpusets = 2; /* accept without warning */ + } + + env = getenv("HWLOC_DEBUG_ALLOW_OVERLAPPING_NODE_CPUSETS"); + if (env) { + allow_overlapping_node_cpusets = atoi(env); /* 0 drop non-first overlapping nodes, 1 allows with warning, 2 allows without warning */ + } + /* NUMA nodes cannot be filtered out */ indexes = list_sysfsnode(topology, data, &nbnodes); if (!indexes) @@ -4032,7 +4220,7 @@ failednodes++; continue; } - if (HWLOC_SHOW_CRITICAL_ERRORS()) + if (allow_overlapping_node_cpusets < 2 && HWLOC_SHOW_CRITICAL_ERRORS()) fprintf(stderr, "hwloc/linux: node P#%u cpuset intersects with previous nodes, forcing its acceptance\n", osnode); } hwloc_bitmap_or(nodes_cpuset, nodes_cpuset, cpuset); @@ -4052,8 +4240,9 @@ dir = hwloc_opendir("/proc/driver/nvidia/gpus", data->root_fd); if (dir) { struct dirent *dirent; - char *env = getenv("HWLOC_KEEP_NVIDIA_GPU_NUMA_NODES"); - int keep = env && atoi(env); + int keep; + env = getenv("HWLOC_KEEP_NVIDIA_GPU_NUMA_NODES"); + keep = env && atoi(env); while ((dirent = readdir(dir)) != NULL) { char nvgpunumapath[300], line[256]; int err; @@ -4124,8 +4313,9 @@ if (data->is_knl) { /* apply KNL quirks */ - char *env = getenv("HWLOC_KNL_NUMA_QUIRK"); - int noquirk = (env && !atoi(env)); + int noquirk; + env = getenv("HWLOC_KNL_NUMA_QUIRK"); + noquirk = (env && !atoi(env)); if (!noquirk) { hwloc_linux_knl_numa_quirk(topology, data, nodes, nbnodes, distances, &failednodes); free(distances); @@ -4183,7 +4373,7 @@ trees[nr_trees++] = tree; } /* By the way, get their memattrs now that cpuset is fixed */ - if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS)) + if (need_memattrs) read_node_local_memattrs(topology, data, node); } @@ -4235,6 +4425,16 @@ * sysfs CPU frequencies for cpukinds */ +struct hwloc_linux_cpukinds_by_pu { + unsigned pu; + unsigned long max_freq; + unsigned long base_freq; + unsigned long capacity; + int done; /* temporary bit to identify PU that were processed by the current algorithm + * (only hwloc_linux_cpukinds_adjust_maxfreqs() for now) + */ +}; + struct hwloc_linux_cpukinds { struct hwloc_linux_cpukind { unsigned long value; @@ -4294,6 +4494,20 @@ } static void +hwloc_linux_cpukinds_register_one(struct hwloc_topology *topology, + hwloc_bitmap_t cpuset, + int efficiency, + char *infoname, + char *infovalue) +{ + struct hwloc_info_s infoattr; + infoattr.name = infoname; + infoattr.value = infovalue; + hwloc_internal_cpukinds_register(topology, cpuset, efficiency, &infoattr, 1, 0); + /* the cpuset is given to the callee */ +} + +static void hwloc_linux_cpukinds_register(struct hwloc_linux_cpukinds *cpukinds, struct hwloc_topology *topology, const char *name, @@ -4305,15 +4519,12 @@ qsort(cpukinds->sets, cpukinds->nr_sets, sizeof(*cpukinds->sets), hwloc_linux_cpukinds_compar); for(i=0; inr_sets; i++) { - struct hwloc_info_s infoattr; char value[32]; - infoattr.name = (char *) name; - infoattr.value = value; snprintf(value, sizeof(value), "%lu", cpukinds->sets[i].value); /* value (at least cpu_capacity) may be > INT_MAX, too large for a forced_efficiency, hence use i instead */ - hwloc_internal_cpukinds_register(topology, cpukinds->sets[i].cpuset, - forced_efficiency ? (int) i : HWLOC_CPUKIND_EFFICIENCY_UNKNOWN, - &infoattr, 1, 0); + hwloc_linux_cpukinds_register_one(topology, cpukinds->sets[i].cpuset, + forced_efficiency ? (int) i : HWLOC_CPUKIND_EFFICIENCY_UNKNOWN, + (char *) name, value); /* the cpuset is given to the callee */ cpukinds->sets[i].cpuset = NULL; } @@ -4333,101 +4544,133 @@ free (cpukinds->sets); } -/* merge all PUs of cpuset inside a single cpukinds set with the given value */ -static void -hwloc_linux_cpukinds_merge_values(struct hwloc_linux_cpukinds *cpukinds, - hwloc_const_cpuset_t cpuset, - unsigned long value) -{ - unsigned first, i; - hwloc_bitmap_t tmpset = hwloc_bitmap_alloc(); - if (!tmpset) - return; - - /* find a set with that value */ - for(first=0; firstnr_sets; first++) - if (cpukinds->sets[first].value == value) - break; - /* it must exist since we're downgrading some values to an existing one */ - assert(first < cpukinds->nr_sets); - - /* merge affected sets with the existing one */ - for(i=0; inr_sets; i++) { - if (i == first) - continue; - - hwloc_bitmap_and(tmpset, cpukinds->sets[i].cpuset, cpuset); - if (hwloc_bitmap_iszero(tmpset)) - /* not affected */ - continue; - - hwloc_bitmap_or(cpukinds->sets[first].cpuset, cpukinds->sets[first].cpuset, tmpset); - hwloc_bitmap_andnot(cpukinds->sets[i].cpuset, cpukinds->sets[i].cpuset, tmpset); - if (hwloc_bitmap_iszero(cpukinds->sets[i].cpuset)) { - /* became empty, remove it, and move remaining sets by one */ - hwloc_bitmap_free(cpukinds->sets[i].cpuset); - memmove(&cpukinds->sets[i], &cpukinds->sets[i+1], (cpukinds->nr_sets-i-1)*sizeof(cpukinds->sets[i])); - cpukinds->nr_sets--; - if (inr_sets; i++) { - unsigned long min_maxfreq = UINT_MAX, max_maxfreq = 0; - - for(j=0; jnr_sets; j++) { - if (!hwloc_bitmap_intersects(cpufreqs_base->sets[i].cpuset, cpufreqs_max->sets[j].cpuset)) + unsigned i, next = 0, done = 0; + while (done < nr_pus) { + /* start a new group of same base_frequency at next */ + unsigned first = next; + unsigned long cur_base_freq = by_pu[first].base_freq; + unsigned long min_maxfreq = by_pu[first].max_freq; + unsigned long max_maxfreq = by_pu[first].max_freq; + by_pu[first].done = 1; + done++; + next = 0; + for(i=first+1; isets[j].value < min_maxfreq) - min_maxfreq = cpufreqs_max->sets[j].value; - if (cpufreqs_max->sets[j].value > max_maxfreq) - max_maxfreq = cpufreqs_max->sets[j].value; + if (by_pu[i].base_freq == cur_base_freq) { + if (by_pu[i].max_freq > max_maxfreq) + max_maxfreq = by_pu[i].max_freq; + else if (by_pu[i].max_freq < min_maxfreq) + min_maxfreq = by_pu[i].max_freq; + by_pu[i].done = 1; + done++; + } else { + if (!next) + next = i; + } } - if (min_maxfreq == UINT_MAX) - continue; if (min_maxfreq == max_maxfreq) { hwloc_debug("linux/cpufreq: max frequencies always %lu when base=%lu\n", - min_maxfreq, cpufreqs_base->sets[i].value); + min_maxfreq, cur_base_freq); } else { float ratio = ((float)(max_maxfreq-min_maxfreq)/(float)min_maxfreq); hwloc_debug("linux/cpufreq: max frequencies in [%lu-%lu] when base=%lu\n", - min_maxfreq, max_maxfreq, cpufreqs_base->sets[i].value); + min_maxfreq, max_maxfreq, cur_base_freq); if (ratio*100 < (float)adjust_max) { hwloc_debug("linux/cpufreq: max frequencies overrated up to %u%% < %u%%, adjust all to %lu\n", (unsigned)(ratio*100), adjust_max, min_maxfreq); - hwloc_linux_cpukinds_merge_values(cpufreqs_max, cpufreqs_base->sets[i].cpuset, min_maxfreq); + /* update max_freq of all PUs with this base_freq */ + for(i=first; i max_freq) + max_freq = by_pu[i].max_freq; + /* use the highest capacity for all cores */ + if (by_pu[i].capacity > capacity) + capacity = by_pu[i].capacity; + } + hwloc_debug("linux/cpukinds: forcing homogeneous max_freq %lu base_freq %lu capacity %lu\n", + max_freq, base_freq, capacity); + + if (max_freq) { + hwloc_bitmap_t rootset = hwloc_bitmap_dup(topology->levels[0][0]->cpuset); + if (rootset) { + char value[64]; + snprintf(value, sizeof(value), "%lu", max_freq/1000); + hwloc_linux_cpukinds_register_one(topology, rootset, + HWLOC_CPUKIND_EFFICIENCY_UNKNOWN, + (char *) "FrequencyMaxMHz", value); + /* the cpuset is given to the callee */ + } + } + if (base_freq != ULONG_MAX) { + hwloc_bitmap_t rootset = hwloc_bitmap_dup(topology->levels[0][0]->cpuset); + if (rootset) { + char value[64]; + snprintf(value, sizeof(value), "%lu", base_freq/1000); + hwloc_linux_cpukinds_register_one(topology, rootset, + HWLOC_CPUKIND_EFFICIENCY_UNKNOWN, + (char *) "FrequencyBaseMHz", value); + /* the cpuset is given to the callee */ + } + } + if (capacity) { + hwloc_bitmap_t rootset = hwloc_bitmap_dup(topology->levels[0][0]->cpuset); + if (rootset) { + char value[64]; + snprintf(value, sizeof(value), "%lu", capacity); + hwloc_linux_cpukinds_register_one(topology, rootset, + HWLOC_CPUKIND_EFFICIENCY_UNKNOWN, + (char *) "LinuxCapacity", value); + /* the cpuset is given to the callee */ + } + } +} + static int look_sysfscpukinds(struct hwloc_topology *topology, struct hwloc_linux_backend_data_s *data) { + int nr_pus; + struct hwloc_linux_cpukinds_by_pu *by_pu; struct hwloc_linux_cpukinds cpufreqs_max, cpufreqs_base, cpu_capacity; int max_without_basefreq = 0; /* any cpu where we have maxfreq without basefreq? */ char str[293]; char *env; + hwloc_bitmap_t atom_pmu_set, core_pmu_set; int maxfreq_enabled = -1; /* -1 means adjust (default), 0 means ignore, 1 means enforce */ unsigned adjust_max = 10; - int i; + int force_homogeneous; + const char *info; + int pu, i; env = getenv("HWLOC_CPUKINDS_MAXFREQ"); if (env) { @@ -4447,28 +4690,62 @@ hwloc_debug("linux/cpufreq: max frequency values will be adjusted by up to %u%%\n", adjust_max); - /* look at the PU base+max frequency */ - hwloc_linux_cpukinds_init(&cpufreqs_max); - hwloc_linux_cpukinds_init(&cpufreqs_base); - hwloc_bitmap_foreach_begin(i, topology->levels[0][0]->cpuset) { - unsigned maxfreq = 0, basefreq = 0; + nr_pus = hwloc_bitmap_weight(topology->levels[0][0]->cpuset); + assert(nr_pus > 0); + by_pu = calloc(nr_pus, sizeof(*by_pu)); + if (!by_pu) + return -1; + + /* gather all sysfs info in the by_pu array */ + i = 0; + hwloc_bitmap_foreach_begin(pu, topology->levels[0][0]->cpuset) { + unsigned maxfreq = 0, basefreq = 0, capacity = 0;; + by_pu[i].pu = pu; + /* cpuinfo_max_freq is the hardware max. scaling_max_freq is the software policy current max */ sprintf(str, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", i); if (hwloc_read_path_as_uint(str, &maxfreq, data->root_fd) >= 0) - if (maxfreq) - hwloc_linux_cpukinds_add(&cpufreqs_max, i, maxfreq/1000); + by_pu[i].max_freq = maxfreq; /* base_frequency is intel_pstate specific */ sprintf(str, "/sys/devices/system/cpu/cpu%d/cpufreq/base_frequency", i); if (hwloc_read_path_as_uint(str, &basefreq, data->root_fd) >= 0) - if (basefreq) - hwloc_linux_cpukinds_add(&cpufreqs_base, i, basefreq/1000); + by_pu[i].base_freq = basefreq; if (maxfreq && !basefreq) max_without_basefreq = 1; + /* capacity */ + sprintf(str, "/sys/devices/system/cpu/cpu%d/cpu_capacity", i); + if (hwloc_read_path_as_uint(str, &capacity, data->root_fd) >= 0) + by_pu[i].capacity = capacity; + i++; } hwloc_bitmap_foreach_end(); + assert(i == nr_pus); + + /* NVIDIA Grace is homogeneous with slight variations of max frequency, ignore those */ + info = hwloc_obj_get_info_by_name(topology->levels[0][0], "SoC0ID"); + force_homogeneous = info && !strcmp(info, "jep106:036b:0241"); + /* force homogeneity ? */ + env = getenv("HWLOC_CPUKINDS_HOMOGENEOUS"); + if (env) + force_homogeneous = atoi(env); + if (force_homogeneous) { + hwloc_linux_cpukinds_force_homogeneous(topology, (unsigned) nr_pus, by_pu); + free(by_pu); + return 0; + } - if (maxfreq_enabled == -1 && cpufreqs_max.nr_sets && !max_without_basefreq) + if (maxfreq_enabled == -1 && !max_without_basefreq) /* we have basefreq, check maxfreq and ignore/fix it if turboboost 3.0 makes the max different on different cores */ - hwloc_linux_cpukinds_adjust_maxfreqs(&cpufreqs_max, &cpufreqs_base, adjust_max); + hwloc_linux_cpukinds_adjust_maxfreqs(nr_pus, by_pu, adjust_max); + + /* now store base+max frequency */ + hwloc_linux_cpukinds_init(&cpufreqs_max); + hwloc_linux_cpukinds_init(&cpufreqs_base); + for(i=0; ilevels[0][0]->cpuset) { - unsigned capacity; - sprintf(str, "/sys/devices/system/cpu/cpu%d/cpu_capacity", i); - if (hwloc_read_path_as_uint(str, &capacity, data->root_fd) >= 0) - hwloc_linux_cpukinds_add(&cpu_capacity, i, capacity); - } hwloc_bitmap_foreach_end(); + for(i=0; iroot_fd); + core_pmu_set = hwloc__alloc_read_path_as_cpulist("/sys/devices/cpu_core/cpus", data->root_fd); + if (atom_pmu_set) { + hwloc_linux_cpukinds_register_one(topology, atom_pmu_set, + HWLOC_CPUKIND_EFFICIENCY_UNKNOWN, + (char *) "CoreType", (char *) "IntelAtom"); + /* the cpuset is given to the callee */ + } else { + hwloc_bitmap_free(atom_pmu_set); + } + if (core_pmu_set) { + hwloc_linux_cpukinds_register_one(topology, core_pmu_set, + HWLOC_CPUKIND_EFFICIENCY_UNKNOWN, + (char *) "CoreType", (char *) "IntelCore"); + /* the cpuset is given to the callee */ + } else { + hwloc_bitmap_free(core_pmu_set); + } + return 0; } @@ -4853,7 +5150,8 @@ } /* look at the caches */ - for(j=0; j<10; j++) { + if (topology->want_some_cpu_caches) { + for(j=0; j<10; j++) { char str2[20]; /* enough for a level number (one digit) or a type (Data/Instruction/Unified) */ hwloc_bitmap_t cacheset; @@ -4968,6 +5266,7 @@ } hwloc_bitmap_free(cacheset); } + } } hwloc_bitmap_foreach_end(); @@ -5108,6 +5407,21 @@ return 0; } +static int +hwloc_linux_parse_cpuinfo_loongarch(const char *prefix, const char *value, + struct hwloc_info_s **infos, unsigned *infos_count, + int is_global __hwloc_attribute_unused) +{ + if (!strcmp("Model Name", prefix)) { + if (value[0]) + hwloc__add_info(infos, infos_count, "CPUModel", value); + } else if (!strcmp("CPU Family", prefix)) { + if (value[0]) + hwloc__add_info(infos, infos_count, "CPUFamily", value); + } + return 0; +} + /* * avr32: "chip type\t:" => OK * blackfin: "model name\t:" => OK @@ -5254,6 +5568,9 @@ case HWLOC_LINUX_ARCH_IA64: parse_cpuinfo_func = hwloc_linux_parse_cpuinfo_ia64; break; + case HWLOC_LINUX_ARCH_LOONGARCH: + parse_cpuinfo_func = hwloc_linux_parse_cpuinfo_loongarch; + break; default: parse_cpuinfo_func = hwloc_linux_parse_cpuinfo_generic; } @@ -5412,6 +5729,8 @@ data->arch = HWLOC_LINUX_ARCH_POWER; else if (!strncmp(data->utsname.machine, "s390", 4)) data->arch = HWLOC_LINUX_ARCH_S390; + else if (!strncmp(data->utsname.machine, "loongarch", 9)) + data->arch = HWLOC_LINUX_ARCH_LOONGARCH; else if (!strcmp(data->utsname.machine, "ia64")) data->arch = HWLOC_LINUX_ARCH_IA64; } @@ -5538,6 +5857,42 @@ return -1; } +static void +hwloc_linuxfs_check_kernel_cmdline(struct hwloc_linux_backend_data_s *data) +{ + FILE *file; + char cmdline[4096]; + char *fakenuma; + + file = hwloc_fopen("/proc/cmdline", "r", data->root_fd); + if (!file) + return; + + cmdline[0] = 0; + if (!fgets(cmdline, sizeof(cmdline), file)) + goto out; + + fakenuma = strstr(cmdline, "numa=fake="); + if (fakenuma) { + /* in fake numa emulation, SLIT is updated but HMAT isn't, hence we need to disable/fix things later */ + unsigned width = 0; + char type = 0; + if (sscanf(fakenuma+10, "%u%c", &width, &type) == 2 && type == 'U') { + /* if U, each node is split in 8 nodes, we can still do things in this case */ + data->is_fake_numa_uniform = width; + } else { + /* otherwise fake nodes are created by just dividing the entire RAM, + * without respecting locality at all + */ + data->is_fake_numa_uniform = -1; + } + hwloc_debug("Found fake numa %d\n", data->is_fake_numa_uniform); + } + + out: + fclose(file); +} + static int hwloc_linuxfs_look_cpu(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus) { @@ -5589,6 +5944,13 @@ * Platform information for later */ hwloc_gather_system_info(topology, data); + /* soc info needed for cpukinds quirks in look_sysfscpukinds() */ + hwloc__get_soc_info(data, topology->levels[0][0]); + + /********************************** + * Detect things in /proc/cmdline + */ + hwloc_linuxfs_check_kernel_cmdline(data); /********************** * /proc/cpuinfo @@ -5791,7 +6153,6 @@ if (err < 0) return NULL; } - path[err] = '\0'; if (!(osdev_flags & HWLOC_LINUXFS_OSDEV_FLAG_FIND_VIRTUAL)) { if (strstr(path, "/virtual/")) @@ -5891,7 +6252,7 @@ char model[64] = ""; char serial[64] = ""; char revision[64] = ""; - char blocktype[64] = ""; + char blocktype[128] = ""; unsigned sectorsize = 0; unsigned major_id, minor_id; int is_nvm = 0; @@ -6639,6 +7000,14 @@ hwloc_obj_add_info(obj, "CXLPMEMSize", tmp); } } + + snprintf(path, sizeof(path), "%s/serial", osdevpath); + if (hwloc_read_path_by_length(path, tmp, sizeof(tmp), root_fd) > 0) { + char *end = strchr(tmp, '\n'); + if (end) + *end = '\0'; + hwloc_obj_add_info(obj, "SerialNumber", tmp); + } } static int @@ -6693,9 +7062,13 @@ unsigned char serial_str_num; unsigned char asset_tag_str_num; unsigned char part_num_str_num; - /* don't include the following fields since we don't need them, - * some old implementations may miss them. + /* Here is the end of SMBIOS 2.3 fields (27 bytes), + * those are required for hwloc. + * Anything below (SMBIOS 2.6+) is optional for hwloc, + * we must to check header->length before reading them. */ + unsigned char attributes; + unsigned char extended_size[4]; }; static int check_dmi_entry(const char *buffer) @@ -6709,6 +7082,120 @@ return 1; } +static const char *dmi_memory_device_form_factor(uint8_t code) +{ + static const char *form_factor[] = { + "Other", /* 0x01 */ + "Unknown", + "SIMM", + "SIP", + "Chip", + "DIP", + "ZIP", + "Proprietary Card", + "DIMM", + "TSOP", + "Row Of Chips", + "RIMM", + "SODIMM", + "SRIMM", + "FB-DIMM", + "Die", /* 0x10 */ + /* updated for SMBIOS 3.7.0 20230721 */ + }; + + if (code >= 1 && code <= sizeof(form_factor)/sizeof(form_factor[0])) + return form_factor[code - 1]; + return NULL; /* return NULL to distinguish unsupported values from the official "Unknown" value above */ +} + +static const char *dmi_memory_device_type(uint8_t code) +{ + static const char *type[] = { + "Other", /* 0x01 */ + "Unknown", + "DRAM", + "EDRAM", + "VRAM", + "SRAM", + "RAM", + "ROM", + "Flash", + "EEPROM", + "FEPROM", + "EPROM", + "CDRAM", + "3DRAM", + "SDRAM", + "SGRAM", + "RDRAM", + "DDR", + "DDR2", + "DDR2 FB-DIMM", + "Reserved", + "Reserved", + "Reserved", + "DDR3", + "FBD2", + "DDR4", + "LPDDR", + "LPDDR2", + "LPDDR3", + "LPDDR4", + "Logical non-volatile device", + "HBM", + "HBM2", + "DDR5", + "LPDDR5", + "HBM3" /* 0x24 */ + /* updated for SMBIOS 3.7.0 20230721 */ + }; + + if (code >= 1 && code <= sizeof(type)/sizeof(type[0])) + return type[code - 1]; + return NULL; /* return NULL to distinguish unsupported values from the official "Unknown" value above */ +} + +/* SMBIOS structures are stored in little-endian, at least since 2.8. + * Only used for memory size and extended_size so far. + */ +#define get_smbios_uint16_t(x) htole16(*(uint16_t*)(x)) +#define get_smbios_uint32_t(x) htole32(*(uint32_t*)(x)) + +static int dmi_memory_device_size(char *buffer, size_t len, + const struct hwloc_firmware_dmi_mem_device_header *header) +{ + uint64_t memory_size = 0; + uint16_t code = get_smbios_uint16_t(header->size); + + if (code == 0xFFFF) + return -1; + + if (header->length >= offsetof(struct hwloc_firmware_dmi_mem_device_header, extended_size) + sizeof(header->extended_size) && code == 0x7FFF) { + memory_size = get_smbios_uint32_t(header->extended_size) & 0x7FFFFFFF; /* MiB */ + memory_size <<= 10; + } else { + memory_size = code & 0x7FFF; + if (!(code & 0x8000)) /* MiB (otherwise KiB) */ + memory_size <<= 10; + } + snprintf(buffer, len, "%llu", (unsigned long long) memory_size); + return 0; +} + +static int dmi_memory_device_rank(char *buffer, size_t len, + const struct hwloc_firmware_dmi_mem_device_header *header) +{ + uint8_t code; + if (header->length < offsetof(struct hwloc_firmware_dmi_mem_device_header, attributes) + sizeof(header->attributes)) + return -1; + code = header->attributes; + if (!code) + return -1; + snprintf(buffer, len, "%u", code & 0x0F); + return 0; +} + static int hwloc__get_firmware_dmi_memory_info_one(struct hwloc_topology *topology, unsigned idx, const char *path, FILE *fd, @@ -6716,6 +7203,7 @@ { unsigned slen; char buffer[256]; /* enough for memory device strings, or at least for each of them */ + const char *retbuf; unsigned foff; /* offset in raw file */ unsigned boff; /* offset in buffer read from raw file */ unsigned i; @@ -6798,6 +7286,17 @@ goto out_with_infos; } + retbuf = dmi_memory_device_form_factor(header->ff); + if (retbuf) + hwloc__add_info(&infos, &infos_count, "FormFactor", retbuf); + retbuf = dmi_memory_device_type(header->mem_type); + if (retbuf) + hwloc__add_info(&infos, &infos_count, "Type", retbuf); + if (!dmi_memory_device_size(buffer, sizeof(buffer), header)) + hwloc__add_info(&infos, &infos_count, "Size", buffer); + if (!dmi_memory_device_rank(buffer, sizeof(buffer), header)) + hwloc__add_info(&infos, &infos_count, "Rank", buffer); + misc = hwloc_alloc_setup_object(topology, HWLOC_OBJ_MISC, idx); if (!misc) goto out_with_infos; @@ -6841,7 +7340,9 @@ fclose(fd); break; } - if (header.length < sizeof(header)) { + + HWLOC_BUILD_ASSERT(offsetof(struct hwloc_firmware_dmi_mem_device_header, part_num_str_num) + sizeof(header.part_num_str_num) == 27); + if (header.length < 27) { /* invalid, or too old entry/spec that doesn't contain what we need */ fclose(fd); break; @@ -7212,6 +7713,7 @@ data->arch = HWLOC_LINUX_ARCH_UNKNOWN; data->is_knl = 0; data->is_amd_with_CU = 0; + data->is_fake_numa_uniform = 0; data->is_real_fsroot = 1; data->root_path = NULL; fsroot_path = getenv("HWLOC_FSROOT"); diff -Nru hwloc-2.9.2/hwloc/topology-pci.c hwloc-2.10.0/hwloc/topology-pci.c --- hwloc-2.9.2/hwloc/topology-pci.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-pci.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2022 Inria. All rights reserved. + * Copyright © 2009-2023 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 @@ -146,12 +146,6 @@ struct pci_device *pcidev; struct pci_id_match m; - m.subvendor_id = PCI_MATCH_ANY; - m.subdevice_id = PCI_MATCH_ANY; - m.device_class = 0; - m.device_class_mask = 0; - m.match_data = 0; - hwloc_topology_get_type_filter(topology, HWLOC_OBJ_PCI_DEVICE, &pfilter); hwloc_topology_get_type_filter(topology, HWLOC_OBJ_BRIDGE, &bfilter); if (bfilter == HWLOC_TYPE_FILTER_KEEP_NONE @@ -166,6 +160,12 @@ hwloc_debug("%s", "\nScanning PCI buses...\n"); + m.subvendor_id = PCI_MATCH_ANY; + m.subdevice_id = PCI_MATCH_ANY; + m.device_class = 0; + m.device_class_mask = 0; + m.match_data = 0; + /* pciaccess isn't thread-safe. it uses a single global variable that doesn't have * refcounting, and is dynamically reallocated when vendor/device names are needed, etc. */ @@ -232,17 +232,13 @@ /* filtered? */ if (type == HWLOC_OBJ_PCI_DEVICE) { - enum hwloc_type_filter_e filter; - hwloc_topology_get_type_filter(topology, HWLOC_OBJ_PCI_DEVICE, &filter); - if (filter == HWLOC_TYPE_FILTER_KEEP_NONE) + if (pfilter == HWLOC_TYPE_FILTER_KEEP_NONE) continue; - if (filter == HWLOC_TYPE_FILTER_KEEP_IMPORTANT + if (pfilter == HWLOC_TYPE_FILTER_KEEP_IMPORTANT && !hwloc_filter_check_pcidev_subtype_important(device_class)) continue; } else if (type == HWLOC_OBJ_BRIDGE) { - enum hwloc_type_filter_e filter; - hwloc_topology_get_type_filter(topology, HWLOC_OBJ_BRIDGE, &filter); - if (filter == HWLOC_TYPE_FILTER_KEEP_NONE) + if (bfilter == HWLOC_TYPE_FILTER_KEEP_NONE) continue; /* HWLOC_TYPE_FILTER_KEEP_IMPORTANT filtered later in the core */ } diff -Nru hwloc-2.9.2/hwloc/topology-rsmi.c hwloc-2.10.0/hwloc/topology-rsmi.c --- hwloc-2.9.2/hwloc/topology-rsmi.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-rsmi.c 2023-12-05 12:32:19.000000000 +0000 @@ -160,7 +160,7 @@ if (rsmi_rc != RSMI_STATUS_SUCCESS) { return -1; } - sprintf(buffer, "%lx", id); + sprintf(buffer, "%llx", (unsigned long long) id); return 0; } @@ -200,7 +200,7 @@ } return -1; } - sprintf(buffer, "%lx", hive_id); + sprintf(buffer, "%llx", (unsigned long long) hive_id); return 0; } diff -Nru hwloc-2.9.2/hwloc/topology-synthetic.c hwloc-2.10.0/hwloc/topology-synthetic.c --- hwloc-2.9.2/hwloc/topology-synthetic.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-synthetic.c 2023-12-05 12:32:19.000000000 +0000 @@ -23,6 +23,7 @@ unsigned depth; /* For caches/groups */ hwloc_obj_cache_type_t cachetype; /* For caches */ hwloc_uint64_t memorysize; /* For caches/memory */ + hwloc_uint64_t memorysidecachesize; /* Single level of memory-side-cache in-front of a NUMA node */ }; struct hwloc_synthetic_indexes_s { @@ -380,6 +381,9 @@ } else if (!iscache && !strncmp("memory=", attrs, 7)) { memorysize = hwloc_synthetic_parse_memory_attr(attrs+7, &attrs); + } else if (!strncmp("memorysidecachesize=", attrs, 20)) { + sattr->memorysidecachesize = hwloc_synthetic_parse_memory_attr(attrs+20, &attrs); + } else if (!strncmp("indexes=", attrs, 8)) { index_string = attrs+8; attrs += 8; @@ -490,6 +494,7 @@ data->level[0].indexes.string = NULL; data->level[0].indexes.array = NULL; data->level[0].attr.memorysize = 0; + data->level[0].attr.memorysidecachesize = 0; data->level[0].attached = NULL; type_count[HWLOC_OBJ_MACHINE] = 1; if (*description == '(') { @@ -539,6 +544,7 @@ if (attached) { attached->attr.type = type; attached->attr.memorysize = 0; + attached->attr.memorysidecachesize = 0; /* attached->attr.depth and .cachetype unused */ attached->next = NULL; pprev = &data->level[count-1].attached; @@ -636,6 +642,7 @@ data->level[count].indexes.string = NULL; data->level[count].indexes.array = NULL; data->level[count].attr.memorysize = 0; + data->level[count].attr.memorysidecachesize = 0; if (*next_pos == '(') { err = hwloc_synthetic_parse_attrs(next_pos+1, &next_pos, &data->level[count].attr, &data->level[count].indexes, verbose); if (err < 0) @@ -821,6 +828,7 @@ data->level[1].indexes.string = NULL; data->level[1].indexes.array = NULL; data->level[1].attr.memorysize = 0; + data->level[1].attr.memorysidecachesize = 0; data->level[1].totalwidth = data->level[0].totalwidth; /* update arity to insert a single NUMA node per parent */ data->level[1].arity = data->level[0].arity; @@ -868,6 +876,12 @@ obj->attr->numanode.page_types[0].size = 4096; obj->attr->numanode.page_types[0].count = sattr->memorysize / 4096; break; + case HWLOC_OBJ_MEMCACHE: + obj->attr->cache.depth = 1; + obj->attr->cache.linesize = 64; + obj->attr->cache.type = HWLOC_OBJ_CACHE_UNIFIED; + obj->attr->cache.size = sattr->memorysidecachesize; + break; case HWLOC_OBJ_PACKAGE: case HWLOC_OBJ_DIE: break; @@ -935,6 +949,14 @@ hwloc__insert_object_by_cpuset(topology, NULL, child, "synthetic:attached"); + if (attached->attr.memorysidecachesize) { + hwloc_obj_t mscachechild = hwloc_alloc_setup_object(topology, HWLOC_OBJ_MEMCACHE, HWLOC_UNKNOWN_INDEX); + mscachechild->cpuset = hwloc_bitmap_dup(set); + mscachechild->nodeset = hwloc_bitmap_dup(child->nodeset); + hwloc_synthetic_set_attr(&attached->attr, mscachechild); + hwloc__insert_object_by_cpuset(topology, NULL, mscachechild, "synthetic:attached:mscache"); + } + hwloc_synthetic_insert_attached(topology, data, attached->next, set); } @@ -986,6 +1008,14 @@ hwloc_synthetic_set_attr(&curlevel->attr, obj); hwloc__insert_object_by_cpuset(topology, NULL, obj, "synthetic"); + + if (type == HWLOC_OBJ_NUMANODE && curlevel->attr.memorysidecachesize) { + hwloc_obj_t mscachechild = hwloc_alloc_setup_object(topology, HWLOC_OBJ_MEMCACHE, HWLOC_UNKNOWN_INDEX); + mscachechild->cpuset = hwloc_bitmap_dup(set); + mscachechild->nodeset = hwloc_bitmap_dup(obj->nodeset); + hwloc_synthetic_set_attr(&curlevel->attr, mscachechild); + hwloc__insert_object_by_cpuset(topology, NULL, mscachechild, "synthetic:mscache"); + } } hwloc_synthetic_insert_attached(topology, data, curlevel->attached, set); @@ -1226,6 +1256,7 @@ static int hwloc__export_synthetic_obj_attr(struct hwloc_topology * topology, + unsigned long flags, hwloc_obj_t obj, char *buffer, size_t buflen) { @@ -1233,6 +1264,7 @@ const char * prefix = "("; char cachesize[64] = ""; char memsize[64] = ""; + char memorysidecachesize[64] = ""; int needindexes = 0; if (hwloc__obj_type_is_cache(obj->type) && obj->attr->cache.size) { @@ -1245,6 +1277,19 @@ prefix, (unsigned long long) obj->attr->numanode.local_memory); prefix = separator; } + if (obj->type == HWLOC_OBJ_NUMANODE && !(flags & HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1)) { + hwloc_obj_t memorysidecache = obj->parent; + hwloc_uint64_t size = 0; + while (memorysidecache && memorysidecache->type == HWLOC_OBJ_MEMCACHE) { + size += memorysidecache->attr->cache.size; + memorysidecache = memorysidecache->parent; + } + if (size) { + snprintf(memorysidecachesize, sizeof(memorysidecachesize), "%smemorysidecachesize=%llu", + prefix, (unsigned long long) size); + prefix = separator; + } + } if (!obj->logical_index /* only display indexes once per level (not for non-first NUMA children, etc.) */ && (obj->type == HWLOC_OBJ_PU || obj->type == HWLOC_OBJ_NUMANODE)) { hwloc_obj_t cur = obj; @@ -1256,12 +1301,12 @@ cur = cur->next_cousin; } } - if (*cachesize || *memsize || needindexes) { + if (*cachesize || *memsize || *memorysidecachesize || needindexes) { ssize_t tmplen = buflen; char *tmp = buffer; int res, ret = 0; - res = hwloc_snprintf(tmp, tmplen, "%s%s%s", cachesize, memsize, needindexes ? "" : ")"); + res = hwloc_snprintf(tmp, tmplen, "%s%s%s%s", cachesize, memsize, memorysidecachesize, needindexes ? "" : ")"); if (hwloc__export_synthetic_update_status(&ret, &tmp, &tmplen, res) < 0) return -1; @@ -1335,7 +1380,7 @@ if (!(flags & HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS)) { /* obj attributes */ - res = hwloc__export_synthetic_obj_attr(topology, obj, tmp, tmplen); + res = hwloc__export_synthetic_obj_attr(topology, flags, obj, tmp, tmplen); if (hwloc__export_synthetic_update_status(&ret, &tmp, &tmplen, res) < 0) return -1; } @@ -1360,7 +1405,7 @@ if (flags & HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1) { /* v1: export a single NUMA child */ - if (parent->memory_arity > 1 || mchild->type != HWLOC_OBJ_NUMANODE) { + if (parent->memory_arity > 1) { /* not supported */ if (verbose) fprintf(stderr, "Cannot export to synthetic v1 if multiple memory children are attached to the same location.\n"); @@ -1371,6 +1416,9 @@ if (needprefix) hwloc__export_synthetic_add_char(&ret, &tmp, &tmplen, ' '); + /* ignore memcaches and export the NUMA node */ + while (mchild->type != HWLOC_OBJ_NUMANODE) + mchild = mchild->memory_first_child; res = hwloc__export_synthetic_obj(topology, flags, mchild, 1, tmp, tmplen); if (hwloc__export_synthetic_update_status(&ret, &tmp, &tmplen, res) < 0) return -1; @@ -1378,21 +1426,19 @@ } while (mchild) { - /* FIXME: really recurse to export memcaches and numanode, + /* The core doesn't support shared memcache for now (because ACPI and Linux don't). + * So, for each mchild here, recurse only in the first children at each level. + * + * FIXME: whenever supported by the core, really recurse to export memcaches and numanode, * but it requires clever parsing of [ memcache [numa] [numa] ] during import, * better attaching of things to describe the hierarchy. */ hwloc_obj_t numanode = mchild; - /* only export the first NUMA node leaf of each memory child. - * memcache are ignored. non-first child of memcaches are also ignored. + /* Only export the first NUMA node leaf of each memory child. + * Memcaches are ignored here, they will be summed and exported as a single attribute + * of the NUMA node in hwloc__export_synthetic_obj(). */ while (numanode && numanode->type != HWLOC_OBJ_NUMANODE) { - if (verbose) { - static int warned = 0; - if (!warned) - fprintf(stderr, "Ignoring memory objects that are not NUMA nodes.\n"); - warned = 1; - } if (verbose && numanode->memory_arity > 1) { static int warned = 0; if (!warned) @@ -1531,17 +1577,21 @@ if (flags & HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_V1) { /* v1 requires all NUMA at the same level */ - hwloc_obj_t node; + hwloc_obj_t node, parent; signed pdepth; node = hwloc_get_obj_by_type(topology, HWLOC_OBJ_NUMANODE, 0); assert(node); - assert(hwloc__obj_type_is_normal(node->parent->type)); /* only depth-1 memory children for now */ - pdepth = node->parent->depth; + parent = node->parent; + while (!hwloc__obj_type_is_normal(parent->type)) + parent = parent->parent; + pdepth = parent->depth; while ((node = node->next_cousin) != NULL) { - assert(hwloc__obj_type_is_normal(node->parent->type)); /* only depth-1 memory children for now */ - if (node->parent->depth != pdepth) { + parent = node->parent; + while (!hwloc__obj_type_is_normal(parent->type)) + parent = parent->parent; + if (parent->depth != pdepth) { if (verbose) fprintf(stderr, "Cannot export to synthetic v1 if memory is attached to parents at different depths.\n"); errno = EINVAL; @@ -1554,7 +1604,7 @@ if (!(flags & HWLOC_TOPOLOGY_EXPORT_SYNTHETIC_FLAG_NO_ATTRS)) { /* obj attributes */ - res = hwloc__export_synthetic_obj_attr(topology, obj, tmp, tmplen); + res = hwloc__export_synthetic_obj_attr(topology, flags, obj, tmp, tmplen); if (res > 0) needprefix = 1; if (hwloc__export_synthetic_update_status(&ret, &tmp, &tmplen, res) < 0) diff -Nru hwloc-2.9.2/hwloc/topology-windows.c hwloc-2.10.0/hwloc/topology-windows.c --- hwloc-2.9.2/hwloc/topology-windows.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-windows.c 2023-12-05 12:32:19.000000000 +0000 @@ -987,7 +987,11 @@ OSVERSIONINFOEX osvi; char versionstr[20]; char hostname[122] = ""; - unsigned hostname_size = sizeof(hostname); +#if !defined(__CYGWIN__) + DWORD hostname_size = sizeof(hostname); +#else + size_t hostname_size = sizeof(hostname); +#endif int has_efficiencyclass = 0; struct hwloc_win_efficiency_classes eclasses; char *env = getenv("HWLOC_WINDOWS_PROCESSOR_GROUP_OBJS"); @@ -1051,12 +1055,16 @@ unsigned efficiency_class = 0; GROUP_AFFINITY *GroupMask; - /* Ignore unknown caches */ - if (procInfo->Relationship == RelationCache - && procInfo->Cache.Type != CacheUnified - && procInfo->Cache.Type != CacheData - && procInfo->Cache.Type != CacheInstruction) - continue; + if (procInfo->Relationship == RelationCache) { + if (!topology->want_some_cpu_caches) + /* TODO: check if RelationAll&~RelationCache works? */ + continue; + if (procInfo->Cache.Type != CacheUnified + && procInfo->Cache.Type != CacheData + && procInfo->Cache.Type != CacheInstruction) + /* Ignore unknown caches */ + continue; + } id = HWLOC_UNKNOWN_INDEX; switch (procInfo->Relationship) { diff -Nru hwloc-2.9.2/hwloc/topology-x86.c hwloc-2.10.0/hwloc/topology-x86.c --- hwloc-2.9.2/hwloc/topology-x86.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-x86.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2010-2022 Inria. All rights reserved. + * Copyright © 2010-2023 Inria. All rights reserved. * Copyright © 2010-2013 Université Bordeaux * Copyright © 2010-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -38,6 +38,12 @@ int apicid_unique; char *src_cpuiddump_path; int is_knl; + int is_hybrid; + int found_die_ids; + int found_complex_ids; + int found_unit_ids; + int found_module_ids; + int found_tile_ids; }; /************************************ @@ -210,7 +216,8 @@ #define TILE 4 #define MODULE 5 #define DIE 6 -#define HWLOC_X86_PROCINFO_ID_NR 7 +#define COMPLEX 7 +#define HWLOC_X86_PROCINFO_ID_NR 8 unsigned ids[HWLOC_X86_PROCINFO_ID_NR]; unsigned *otherids; unsigned levels; @@ -314,7 +321,7 @@ /* the code below doesn't want any other cache yet */ assert(!infos->numcaches); - for (cachenum = 0; ; cachenum++) { + for (cachenum = 0; cachenum<16 /* guard */; cachenum++) { eax = 0x8000001d; ecx = cachenum; cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump); @@ -325,7 +332,7 @@ cache = infos->cache = malloc(infos->numcaches * sizeof(*infos->cache)); if (cache) { - for (cachenum = 0; ; cachenum++) { + for (cachenum = 0; cachenum<16 /* guard */; cachenum++) { unsigned long linesize, linepart, ways, sets; eax = 0x8000001d; ecx = cachenum; @@ -378,7 +385,7 @@ unsigned cachenum; struct cacheinfo *cache; - for (cachenum = 0; ; cachenum++) { + for (cachenum = 0; cachenum<16 /* guard */; cachenum++) { eax = 0x04; ecx = cachenum; cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump); @@ -400,7 +407,7 @@ infos->cache = tmpcaches; cache = &infos->cache[oldnumcaches]; - for (cachenum = 0; ; cachenum++) { + for (cachenum = 0; cachenum<16 /* guard */; cachenum++) { unsigned long linesize, linepart, ways, sets; eax = 0x04; ecx = cachenum; @@ -480,7 +487,7 @@ } /* AMD unit/node from CPUID 0x8000001e leaf (topoext) */ -static void read_amd_cores_topoext(struct procinfo *infos, unsigned long flags, struct cpuiddump *src_cpuiddump) +static void read_amd_cores_topoext(struct hwloc_x86_backend_data_s *data, struct procinfo *infos, unsigned long flags, struct cpuiddump *src_cpuiddump) { unsigned apic_id, nodes_per_proc = 0; unsigned eax, ebx, ecx, edx; @@ -510,6 +517,7 @@ unsigned cores_per_unit; /* coreid was obtained from read_amd_cores_legacy() earlier */ infos->ids[UNIT] = ebx & 0xff; + data->found_unit_ids = 1; cores_per_unit = ((ebx >> 8) & 0xff) + 1; hwloc_debug("topoext %08x, %u nodes, node %u, %u cores in unit %u\n", apic_id, nodes_per_proc, infos->ids[NODE], cores_per_unit, infos->ids[UNIT]); /* coreid and unitid are package-wide (core 0-15 and unit 0-7 on 16-core 2-NUMAnode processor). @@ -524,20 +532,35 @@ } } -/* Intel core/thread or even die/module/tile from CPUID 0x0b or 0x1f leaves (v1 and v2 extended topology enumeration) */ -static void read_intel_cores_exttopoenum(struct procinfo *infos, unsigned leaf, struct cpuiddump *src_cpuiddump) +/* Intel core/thread or even die/module/tile from CPUID 0x0b or 0x1f leaves (v1 and v2 extended topology enumeration) + * or AMD complex/ccd from CPUID 0x80000026 (extended CPU topology) + */ +static void read_extended_topo(struct hwloc_x86_backend_data_s *data, struct procinfo *infos, unsigned leaf, enum cpuid_type cpuid_type, struct cpuiddump *src_cpuiddump) { - unsigned level, apic_nextshift, apic_number, apic_type, apic_id = 0, apic_shift = 0, id; + unsigned level, apic_nextshift, apic_type, apic_id = 0, apic_shift = 0, id; unsigned threadid __hwloc_attribute_unused = 0; /* shut-up compiler */ unsigned eax, ebx, ecx = 0, edx; int apic_packageshift = 0; - for (level = 0; ; level++) { + for (level = 0; level<32 /* guard */; level++) { ecx = level; eax = leaf; cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump); - if (!eax && !ebx) - break; + /* Intel specifies that the 0x0b/0x1f loop should stop when we get "invalid domain" (0 in ecx[8:15]) + * (if so, we also get 0 in eax/ebx for invalid subleaves). + * However AMD rather says that the 0x80000026/0x0b loop should stop when we get "no thread at this level" (0 in ebx[0:15]). + * Zhaoxin follows the Intel specs but also returns "no thread at this level" for the last *valid* level (at least on KH-4000). + * From the Linux kernel code, it's very likely that AMD also returns "invalid domain" + * (because detect_extended_topology() uses that for all x86 CPUs) + * but keep with the official doc until AMD can clarify that (see #593). + */ + if (cpuid_type == amd) { + if (!(ebx & 0xffff)) + break; + } else { + if (!(ecx & 0xff00)) + break; + } apic_packageshift = eax & 0x1f; } @@ -545,47 +568,73 @@ infos->otherids = malloc(level * sizeof(*infos->otherids)); if (infos->otherids) { infos->levels = level; - for (level = 0; ; level++) { + for (level = 0; level<32 /* guard */; level++) { ecx = level; eax = leaf; cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump); - if (!eax && !ebx) - break; + if (cpuid_type == amd) { + if (!(ebx & 0xffff)) + break; + } else { + if (!(ecx & 0xff00)) + break; + } apic_nextshift = eax & 0x1f; - apic_number = ebx & 0xffff; apic_type = (ecx & 0xff00) >> 8; apic_id = edx; id = (apic_id >> apic_shift) & ((1 << (apic_packageshift - apic_shift)) - 1); - hwloc_debug("x2APIC %08x %u: nextshift %u num %2u type %u id %2u\n", apic_id, level, apic_nextshift, apic_number, apic_type, id); + hwloc_debug("x2APIC %08x %u: nextshift %u nextnumber %2u type %u id %2u\n", + apic_id, + level, + apic_nextshift, + ebx & 0xffff /* number of threads in next level */, + apic_type, + id); infos->apicid = apic_id; infos->otherids[level] = UINT_MAX; - switch (apic_type) { - case 1: - threadid = id; - /* apic_number is the actual number of threads per core */ - break; - case 2: - infos->ids[CORE] = id; - /* apic_number is the actual number of threads per die */ - break; - case 3: - infos->ids[MODULE] = id; - /* apic_number is the actual number of threads per tile */ - break; - case 4: - infos->ids[TILE] = id; - /* apic_number is the actual number of threads per die */ - break; - case 5: - infos->ids[DIE] = id; - /* apic_number is the actual number of threads per package */ - break; - default: - hwloc_debug("x2APIC %u: unknown type %u\n", level, apic_type); - infos->otherids[level] = apic_id >> apic_shift; - break; - } - apic_shift = apic_nextshift; + switch (apic_type) { + case 1: + threadid = id; + break; + case 2: + infos->ids[CORE] = id; + break; + case 3: + if (leaf == 0x80000026) { + data->found_complex_ids = 1; + infos->ids[COMPLEX] = id; + } else { + data->found_module_ids = 1; + infos->ids[MODULE] = id; + } + break; + case 4: + if (leaf == 0x80000026) { + data->found_die_ids = 1; + infos->ids[DIE] = id; + } else { + data->found_tile_ids = 1; + infos->ids[TILE] = id; + } + break; + case 5: + if (leaf == 0x80000026) { + goto unknown_type; + } else { + data->found_die_ids = 1; + infos->ids[DIE] = id; + } + break; + case 6: + /* TODO: "DieGrp" on Intel */ + /* fallthrough */ + default: + unknown_type: + hwloc_debug("x2APIC %u: unknown type %u\n", level, apic_type); + infos->otherids[level] = apic_id >> apic_shift; + break; + } + apic_shift = apic_nextshift; } infos->apicid = apic_id; infos->ids[PKG] = apic_id >> apic_shift; @@ -704,12 +753,13 @@ } if (highest_cpuid >= 0x1a && has_hybrid(features)) { - /* Get hybrid cpu information from cpuid 0x1a */ + /* Get hybrid cpu information from cpuid 0x1a on Intel */ eax = 0x1a; ecx = 0; cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump); infos->hybridcoretype = eax >> 24; infos->hybridnativemodel = eax & 0xffffff; + data->is_hybrid = 1; } /********************************************************************************* @@ -731,23 +781,30 @@ * * Only needed when x2apic supported if NUMA nodes are needed. */ - read_amd_cores_topoext(infos, flags, src_cpuiddump); + read_amd_cores_topoext(data, infos, flags, src_cpuiddump); } - if ((cpuid_type == intel) && highest_cpuid >= 0x1f) { + if ((cpuid_type == amd) && highest_ext_cpuid >= 0x80000026) { + /* Get socket/die/complex/core/thread information from cpuid 0x80000026 + * (AMD Extended CPU Topology) + */ + read_extended_topo(data, infos, 0x80000026, cpuid_type, src_cpuiddump); + + } else if ((cpuid_type == intel || cpuid_type == zhaoxin) && highest_cpuid >= 0x1f) { /* Get package/die/module/tile/core/thread information from cpuid 0x1f * (Intel v2 Extended Topology Enumeration) */ - read_intel_cores_exttopoenum(infos, 0x1f, src_cpuiddump); + read_extended_topo(data, infos, 0x1f, cpuid_type, src_cpuiddump); } else if ((cpuid_type == intel || cpuid_type == amd || cpuid_type == zhaoxin) && highest_cpuid >= 0x0b && has_x2apic(features)) { /* Get package/core/thread information from cpuid 0x0b * (Intel v1 Extended Topology Enumeration) */ - read_intel_cores_exttopoenum(infos, 0x0b, src_cpuiddump); + read_extended_topo(data, infos, 0x0b, cpuid_type, src_cpuiddump); } + if (backend->topology->want_some_cpu_caches) { /************************************** * Get caches from CPU-specific leaves */ @@ -845,6 +902,7 @@ } } } + } if (hwloc_bitmap_isset(data->apicid_set, infos->apicid)) data->apicid_unique = 0; @@ -1046,21 +1104,34 @@ if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_GROUP)) { if (fulldiscovery) { - /* Look for AMD Compute units inside packages */ - hwloc_bitmap_copy(remaining_cpuset, complete_cpuset); - hwloc_x86_add_groups(topology, infos, nbprocs, remaining_cpuset, - UNIT, "Compute Unit", - HWLOC_GROUP_KIND_AMD_COMPUTE_UNIT, 0); - /* Look for Intel Modules inside packages */ - hwloc_bitmap_copy(remaining_cpuset, complete_cpuset); - hwloc_x86_add_groups(topology, infos, nbprocs, remaining_cpuset, - MODULE, "Module", - HWLOC_GROUP_KIND_INTEL_MODULE, 0); - /* Look for Intel Tiles inside packages */ - hwloc_bitmap_copy(remaining_cpuset, complete_cpuset); - hwloc_x86_add_groups(topology, infos, nbprocs, remaining_cpuset, - TILE, "Tile", - HWLOC_GROUP_KIND_INTEL_TILE, 0); + if (data->found_unit_ids) { + /* Look for AMD Complex inside packages */ + hwloc_bitmap_copy(remaining_cpuset, complete_cpuset); + hwloc_x86_add_groups(topology, infos, nbprocs, remaining_cpuset, + COMPLEX, "Complex", + HWLOC_GROUP_KIND_AMD_COMPLEX, 0); + } + if (data->found_unit_ids) { + /* Look for AMD Compute units inside packages */ + hwloc_bitmap_copy(remaining_cpuset, complete_cpuset); + hwloc_x86_add_groups(topology, infos, nbprocs, remaining_cpuset, + UNIT, "Compute Unit", + HWLOC_GROUP_KIND_AMD_COMPUTE_UNIT, 0); + } + if (data->found_module_ids) { + /* Look for Intel Modules inside packages */ + hwloc_bitmap_copy(remaining_cpuset, complete_cpuset); + hwloc_x86_add_groups(topology, infos, nbprocs, remaining_cpuset, + MODULE, "Module", + HWLOC_GROUP_KIND_INTEL_MODULE, 0); + } + if (data->found_tile_ids) { + /* Look for Intel Tiles inside packages */ + hwloc_bitmap_copy(remaining_cpuset, complete_cpuset); + hwloc_x86_add_groups(topology, infos, nbprocs, remaining_cpuset, + TILE, "Tile", + HWLOC_GROUP_KIND_INTEL_TILE, 0); + } /* Look for unknown objects */ if (infos[one].otherids) { @@ -1094,7 +1165,8 @@ } } - if (hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_DIE)) { + if (data->found_die_ids + && hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_DIE)) { /* Look for Intel Dies inside packages */ if (fulldiscovery) { hwloc_bitmap_t die_cpuset; @@ -1349,40 +1421,45 @@ if (data->apicid_unique) { summarize(backend, infos, flags); - if (has_hybrid(features) && !(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_CPUKINDS)) { + if (data->is_hybrid + && !(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_CPUKINDS)) { /* use hybrid info for cpukinds */ - hwloc_bitmap_t atomset = hwloc_bitmap_alloc(); - hwloc_bitmap_t coreset = hwloc_bitmap_alloc(); - for(i=0; iapicid_unique, do nothing and return success, so that the caller does nothing either */ - return 0; } @@ -1459,7 +1536,15 @@ unsigned i; unsigned highest_cpuid; unsigned highest_ext_cpuid; - /* This stores cpuid features with the same indexing as Linux */ + /* This stores cpuid features with the same indexing as Linux: + * [0] = 0x1 edx + * [1] = 0x80000001 edx + * [4] = 0x1 ecx + * [6] = 0x80000001 ecx + * [9] = 0x7/0 ebx + * [16] = 0x7/0 ecx + * [18] = 0x7/0 edx + */ unsigned features[19] = { 0 }; struct procinfo *infos = NULL; enum cpuid_type cpuid_type = unknown; @@ -1579,6 +1664,7 @@ ecx = 0; cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump); features[9] = ebx; + features[16] = ecx; features[18] = edx; } @@ -1816,9 +1902,15 @@ /* default values */ data->is_knl = 0; + data->is_hybrid = 0; data->apicid_set = hwloc_bitmap_alloc(); data->apicid_unique = 1; data->src_cpuiddump_path = NULL; + data->found_die_ids = 0; + data->found_complex_ids = 0; + data->found_unit_ids = 0; + data->found_module_ids = 0; + data->found_tile_ids = 0; src_cpuiddump_path = getenv("HWLOC_CPUID_PATH"); if (src_cpuiddump_path) { diff -Nru hwloc-2.9.2/hwloc/topology-xml-libxml.c hwloc-2.10.0/hwloc/topology-xml-libxml.c --- hwloc-2.9.2/hwloc/topology-xml-libxml.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-xml-libxml.c 2023-12-05 12:32:19.000000000 +0000 @@ -272,7 +272,7 @@ if (xmlpath) doc = xmlReadFile(xmlpath, NULL, XML_PARSE_NOBLANKS); else if (xmlbuffer) - doc = xmlReadMemory(xmlbuffer, xmlbuflen, "", NULL, XML_PARSE_NOBLANKS); + doc = xmlReadMemory(xmlbuffer, xmlbuflen-1 /* don't include \0 */, "", NULL, XML_PARSE_NOBLANKS); if (!doc) { if (!errno) @@ -368,7 +368,7 @@ if (xmlpath) doc = xmlReadFile(xmlpath, NULL, XML_PARSE_NOBLANKS); else if (xmlbuffer) - doc = xmlReadMemory(xmlbuffer, xmlbuflen, "", NULL, XML_PARSE_NOBLANKS); + doc = xmlReadMemory(xmlbuffer, xmlbuflen-1 /* don't include \0 */, "", NULL, XML_PARSE_NOBLANKS); if (!doc) { if (!errno) diff -Nru hwloc-2.9.2/hwloc/topology-xml-nolibxml.c hwloc-2.10.0/hwloc/topology-xml-nolibxml.c --- hwloc-2.9.2/hwloc/topology-xml-nolibxml.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-xml-nolibxml.c 2023-12-05 12:32:19.000000000 +0000 @@ -411,12 +411,12 @@ bdata->data = nbdata; if (xmlbuffer) { - nbdata->buffer = malloc(xmlbuflen+1); + nbdata->buffer = malloc(xmlbuflen); if (!nbdata->buffer) goto out_with_nbdata; - nbdata->buflen = xmlbuflen+1; + nbdata->buflen = xmlbuflen; memcpy(nbdata->buffer, xmlbuffer, xmlbuflen); - nbdata->buffer[xmlbuflen] = '\0'; + nbdata->buffer[xmlbuflen-1] = '\0'; /* make sure it's there as requested in the API */ } else { int err = hwloc_nolibxml_read_file(xmlpath, &nbdata->buffer, &nbdata->buflen); @@ -453,8 +453,9 @@ buffer = malloc(xmlbuflen); if (!buffer) goto out; - memcpy(buffer, xmlbuffer, xmlbuflen); buflen = xmlbuflen; + memcpy(buffer, xmlbuffer, xmlbuflen); + buffer[xmlbuflen-1] = '\0'; /* make sure it's there as requested in the API */ } else { ret = hwloc_nolibxml_read_file(xmlpath, &buffer, &buflen); diff -Nru hwloc-2.9.2/hwloc/topology-xml.c hwloc-2.10.0/hwloc/topology-xml.c --- hwloc-2.9.2/hwloc/topology-xml.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology-xml.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2022 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2011, 2020 Université Bordeaux * Copyright © 2009-2018 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -562,7 +562,13 @@ char *attrname, *attrvalue; if (state->global->next_attr(state, &attrname, &attrvalue) < 0) break; - if (!strcmp(attrname, "size")) + if (!strcmp(attrname, "info")) { + char *infoname, *infovalue; + int ret = hwloc___xml_import_info(&infoname, &infovalue, state); + if (ret < 0) + return -1; + /* ignored */ + } else if (!strcmp(attrname, "size")) size = strtoull(attrvalue, NULL, 10); else if (!strcmp(attrname, "count")) count = strtoull(attrvalue, NULL, 10); @@ -1160,6 +1166,48 @@ data->last_numanode = obj; } + /* 3.0 forward compatibility */ + if (data->version_major >= 3 && obj->type == HWLOC_OBJ_OS_DEVICE) { + /* osdev.type changed into bitmak in 3.0 */ + if (obj->attr->osdev.type & 3 /* STORAGE|MEMORY for BLOCK */) { + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_BLOCK; + } else if (obj->attr->osdev.type & 8 /* COPROC for COPROC and rsmi/nvml GPUs */) { + if (obj->subtype && (!strcmp(obj->subtype, "RSMI") || !strcmp(obj->subtype, "NVML"))) + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_GPU; + else + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_COPROC; + } else if (obj->attr->osdev.type & 4 /* GPU for non-COPROC GPUs */) { + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_GPU; + } else if (obj->attr->osdev.type & 32 /* OFED */) { + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_OPENFABRICS; + } else if (obj->attr->osdev.type & 16 /* NET for NET and BXI v2-fake-OFED */) { + if (obj->subtype && !strcmp(obj->subtype, "BXI")) + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_OPENFABRICS; + else + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_NETWORK; + } else if (obj->attr->osdev.type & 64 /* DMA */) { + obj->attr->osdev.type = HWLOC_OBJ_OSDEV_DMA; + } else { /* none or unknown */ + obj->attr->osdev.type = (hwloc_obj_osdev_type_t) -1; + } + /* Backend info only in root */ + if (obj->subtype && !hwloc_obj_get_info_by_name(obj, "Backend")) { + if (!strcmp(obj->subtype, "CUDA")) { + hwloc_obj_add_info(obj, "Backend", "CUDA"); + } else if (!strcmp(obj->subtype, "NVML")) { + hwloc_obj_add_info(obj, "Backend", "NVML"); + } else if (!strcmp(obj->subtype, "OpenCL")) { + hwloc_obj_add_info(obj, "Backend", "OpenCL"); + } else if (!strcmp(obj->subtype, "RSMI")) { + hwloc_obj_add_info(obj, "Backend", "RSMI"); + } else if (!strcmp(obj->subtype, "LevelZero")) { + hwloc_obj_add_info(obj, "Backend", "LevelZero"); + } else if (!strcmp(obj->subtype, "Display")) { + hwloc_obj_add_info(obj, "Backend", "GL"); + } + } + } + if (!hwloc_filter_check_keep_object(topology, obj)) { /* Ignore this object instead of inserting it. * @@ -1433,7 +1481,14 @@ if (ret <= 0) break; - if (!strcmp(tag, "indexes")) + if (!strcmp(tag, "info")) { + char *infoname, *infovalue; + ret = hwloc___xml_import_info(&infoname, &infovalue, state); + if (ret < 0) + goto out_with_arrays; + /* ignored */ + continue; + } else if (!strcmp(tag, "indexes")) is_index = 1; else if (!strcmp(tag, "u64values")) is_u64values = 1; @@ -1766,6 +1821,10 @@ if (!strcmp(tag, "memattr_value")) { ret = hwloc__xml_import_memattr_value(topology, id, flags, &childstate); + } else if (!strcmp(tag, "info")) { + char *infoname, *infovalue; + ret = hwloc___xml_import_info(&infoname, &infovalue, &childstate); + /* ignored */ } else { if (hwloc__xml_verbose()) fprintf(stderr, "%s: memattr with unrecognized child %s\n", @@ -2094,9 +2153,10 @@ if (ret < 0) goto failed; - if (data->version_major > 2) { + if (data->version_major > 3 + || (data->version_major == 3 && data->version_minor > 0)) { if (hwloc__xml_verbose()) - fprintf(stderr, "%s: cannot import XML version %u.%u > 2\n", + fprintf(stderr, "%s: cannot import XML version %u.%u > 3.0\n", data->msgprefix, data->version_major, data->version_minor); goto err; } @@ -2144,6 +2204,13 @@ ret = hwloc__xml_import_cpukind(topology, &childstate); if (ret < 0) goto failed; + } else if (!strcmp(tag, "info")) { + char *infoname, *infovalue; + ret = hwloc___xml_import_info(&infoname, &infovalue, &childstate); + if (ret < 0) + goto failed; + /* move 3.x topology info back to the root object */ + hwloc_obj_add_info(topology->levels[0][0], infoname, infovalue); } else { if (hwloc__xml_verbose()) fprintf(stderr, "%s: ignoring unknown tag `%s' after root object.\n", diff -Nru hwloc-2.9.2/hwloc/topology.c hwloc-2.10.0/hwloc/topology.c --- hwloc-2.9.2/hwloc/topology.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/hwloc/topology.c 2023-12-05 12:32:19.000000000 +0000 @@ -146,21 +146,24 @@ char typestr[64]; char *cpusetstr; char *nodesetstr = NULL; + char indexstr[64] = ""; + char groupstr[64] = ""; hwloc_obj_type_snprintf(typestr, sizeof(typestr), obj, 0); hwloc_bitmap_asprintf(&cpusetstr, obj->cpuset); + if (obj->os_index != HWLOC_UNKNOWN_INDEX) + snprintf(indexstr, sizeof(indexstr), "P#%u ", obj->os_index); + if (obj->type == HWLOC_OBJ_GROUP) + snprintf(groupstr, sizeof(groupstr), "groupkind %u-%u ", obj->attr->group.kind, obj->attr->group.subkind); if (obj->nodeset) /* may be missing during insert */ hwloc_bitmap_asprintf(&nodesetstr, obj->nodeset); - if (obj->os_index != HWLOC_UNKNOWN_INDEX) - snprintf(buf, buflen, "%s (P#%u cpuset %s%s%s)", - typestr, obj->os_index, cpusetstr, - nodesetstr ? " nodeset " : "", - nodesetstr ? nodesetstr : ""); - else - snprintf(buf, buflen, "%s (cpuset %s%s%s)", - typestr, cpusetstr, - nodesetstr ? " nodeset " : "", - nodesetstr ? nodesetstr : ""); + snprintf(buf, buflen, "%s (%s%s%s%s%scpuset %s%s%s)", + typestr, + indexstr, + obj->subtype ? "subtype " : "", obj->subtype ? obj->subtype : "", obj->subtype ? " " : "", + groupstr, + cpusetstr, + nodesetstr ? " nodeset " : "", nodesetstr ? nodesetstr : ""); free(cpusetstr); free(nodesetstr); } @@ -178,8 +181,9 @@ fprintf(stderr, "****************************************************************************\n"); fprintf(stderr, "* hwloc %s received invalid information from the operating system.\n", HWLOC_VERSION); fprintf(stderr, "*\n"); - fprintf(stderr, "* Failed with: %s\n", msg); - fprintf(stderr, "* while inserting %s at %s\n", newstr, oldstr); + fprintf(stderr, "* Failed with error: %s\n", msg); + fprintf(stderr, "* while inserting %s\n", newstr); + fprintf(stderr, "* at %s\n", oldstr); fprintf(stderr, "* coming from: %s\n", reason); fprintf(stderr, "*\n"); fprintf(stderr, "* The following FAQ entry in the hwloc documentation may help:\n"); @@ -679,7 +683,8 @@ void hwloc_free_object_and_children(hwloc_obj_t obj) { - unlink_and_free_object_and_children(&obj); + if (obj) + unlink_and_free_object_and_children(&obj); } /* Free an object, its next siblings and their children without unlinking from parent. @@ -1925,6 +1930,22 @@ return hwloc_alloc_setup_object(topology, HWLOC_OBJ_GROUP, HWLOC_UNKNOWN_INDEX); } +int +hwloc_topology_free_group_object(struct hwloc_topology *topology, hwloc_obj_t obj) +{ + if (!topology->is_loaded) { + /* this could actually work, see insert() below */ + errno = EINVAL; + return -1; + } + if (topology->adopted_shmem_addr) { + errno = EPERM; + return -1; + } + hwloc_free_unlinked_object(obj); + return 0; +} + static void hwloc_propagate_symmetric_subtree(hwloc_topology_t topology, hwloc_obj_t root); static void propagate_total_memory(hwloc_obj_t obj); static void hwloc_set_group_depth(hwloc_topology_t topology); @@ -1945,6 +1966,7 @@ return NULL; } if (topology->adopted_shmem_addr) { + hwloc_free_unlinked_object(obj); errno = EPERM; return NULL; } @@ -1998,6 +2020,7 @@ res = hwloc__insert_object_by_cpuset(topology, NULL, obj, NULL /* do not show errors on stdout */); } else { /* just merge root */ + hwloc_free_unlinked_object(obj); res = root; } @@ -3739,6 +3762,7 @@ hwloc__topology_filter_init(topology); + /* always initialize since we don't know flags to disable those yet */ hwloc_internal_distances_init(topology); hwloc_internal_memattrs_init(topology); hwloc_internal_cpukinds_init(topology); @@ -3951,8 +3975,12 @@ hwloc_topology_set_cache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter) { unsigned i; + if (topology->is_loaded) { + errno = EBUSY; + return -1; + } for(i=HWLOC_OBJ_L1CACHE; i<=HWLOC_OBJ_L3ICACHE; i++) - hwloc_topology_set_type_filter(topology, (hwloc_obj_type_t) i, filter); + hwloc__topology_set_type_filter(topology, (hwloc_obj_type_t) i, filter); return 0; } @@ -3960,17 +3988,25 @@ hwloc_topology_set_icache_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter) { unsigned i; + if (topology->is_loaded) { + errno = EBUSY; + return -1; + } for(i=HWLOC_OBJ_L1ICACHE; i<=HWLOC_OBJ_L3ICACHE; i++) - hwloc_topology_set_type_filter(topology, (hwloc_obj_type_t) i, filter); + hwloc__topology_set_type_filter(topology, (hwloc_obj_type_t) i, filter); return 0; } int hwloc_topology_set_io_types_filter(hwloc_topology_t topology, enum hwloc_type_filter_e filter) { - hwloc_topology_set_type_filter(topology, HWLOC_OBJ_BRIDGE, filter); - hwloc_topology_set_type_filter(topology, HWLOC_OBJ_PCI_DEVICE, filter); - hwloc_topology_set_type_filter(topology, HWLOC_OBJ_OS_DEVICE, filter); + if (topology->is_loaded) { + errno = EBUSY; + return -1; + } + hwloc__topology_set_type_filter(topology, HWLOC_OBJ_BRIDGE, filter); + hwloc__topology_set_type_filter(topology, HWLOC_OBJ_PCI_DEVICE, filter); + hwloc__topology_set_type_filter(topology, HWLOC_OBJ_OS_DEVICE, filter); return 0; } @@ -3991,9 +4027,12 @@ { /* no need to set to NULL after free() since callers will call setup_defaults() or just destroy the rest of the topology */ unsigned l; + + /* always destroy cpukinds/distances/memattrs since there are always initialized during init() */ hwloc_internal_cpukinds_destroy(topology); hwloc_internal_distances_destroy(topology); hwloc_internal_memattrs_destroy(topology); + hwloc_free_object_and_children(topology->levels[0][0]); hwloc_bitmap_free(topology->allowed_cpuset); hwloc_bitmap_free(topology->allowed_nodeset); @@ -4033,6 +4072,7 @@ { struct hwloc_disc_status dstatus; const char *env; + unsigned i; int err; if (topology->is_loaded) { @@ -4041,8 +4081,18 @@ } /* initialize envvar-related things */ - hwloc_internal_distances_prepare(topology); - hwloc_internal_memattrs_prepare(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_DISTANCES)) + hwloc_internal_distances_prepare(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS)) + hwloc_internal_memattrs_prepare(topology); + + /* check if any cpu cache filter is not NONE */ + topology->want_some_cpu_caches = 0; + for(i=HWLOC_OBJ_L1CACHE; i<=HWLOC_OBJ_L3ICACHE; i++) + if (topology->type_filter[i] != HWLOC_TYPE_FILTER_KEEP_NONE) { + topology->want_some_cpu_caches = 1; + break; + } if (getenv("HWLOC_XML_USERDATA_NOT_DECODED")) topology->userdata_not_decoded = 1; @@ -4119,23 +4169,32 @@ #endif hwloc_topology_check(topology); - /* Rank cpukinds */ - hwloc_internal_cpukinds_rank(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_CPUKINDS)) { + /* Rank cpukinds */ + hwloc_internal_cpukinds_rank(topology); + } - /* Mark distances objs arrays as invalid since we may have removed objects - * from the topology after adding the distances (remove_empty, etc). - * It would be hard to actually verify whether it's needed. - */ - hwloc_internal_distances_invalidate_cached_objs(topology); - /* And refresh distances so that multithreaded concurrent distances_get() - * don't refresh() concurrently (disallowed). - */ - hwloc_internal_distances_refresh(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_DISTANCES)) { + /* Mark distances objs arrays as invalid since we may have removed objects + * from the topology after adding the distances (remove_empty, etc). + * It would be hard to actually verify whether it's needed. + */ + hwloc_internal_distances_invalidate_cached_objs(topology); + /* And refresh distances so that multithreaded concurrent distances_get() + * don't refresh() concurrently (disallowed). + */ + hwloc_internal_distances_refresh(topology); + } - /* Same for memattrs */ - hwloc_internal_memattrs_need_refresh(topology); - hwloc_internal_memattrs_refresh(topology); - hwloc_internal_memattrs_guess_memory_tiers(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS)) { + int force_memtiers = (getenv("HWLOC_MEMTIERS_REFRESH") != NULL); + /* Same for memattrs */ + hwloc_internal_memattrs_need_refresh(topology); + hwloc_internal_memattrs_refresh(topology); + /* update memtiers unless XML */ + if (force_memtiers || strcmp(topology->backends->component->name, "xml")) + hwloc_internal_memattrs_guess_memory_tiers(topology, force_memtiers); + } topology->is_loaded = 1; @@ -4424,13 +4483,18 @@ if (hwloc_filter_levels_keep_structure(topology) < 0) /* takes care of reconnecting internally */ goto out; - /* some objects may have disappeared, we need to update distances objs arrays */ - hwloc_internal_distances_invalidate_cached_objs(topology); - hwloc_internal_memattrs_need_refresh(topology); + /* some objects may have disappeared and sets were modified, + * we need to update distances, etc */ + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_DISTANCES)) + hwloc_internal_distances_invalidate_cached_objs(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS)) + hwloc_internal_memattrs_need_refresh(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_CPUKINDS)) + hwloc_internal_cpukinds_restrict(topology); + hwloc_propagate_symmetric_subtree(topology, topology->levels[0][0]); propagate_total_memory(topology->levels[0][0]); - hwloc_internal_cpukinds_restrict(topology); #ifndef HWLOC_DEBUG if (getenv("HWLOC_DEBUG_CHECK")) @@ -4518,9 +4582,12 @@ int hwloc_topology_refresh(struct hwloc_topology *topology) { - hwloc_internal_cpukinds_rank(topology); - hwloc_internal_distances_refresh(topology); - hwloc_internal_memattrs_refresh(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_CPUKINDS)) + hwloc_internal_cpukinds_rank(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_DISTANCES)) + hwloc_internal_distances_refresh(topology); + if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS)) + hwloc_internal_memattrs_refresh(topology); return 0; } @@ -5072,6 +5139,9 @@ for(i=HWLOC_OBJ_TYPE_MIN; iis_loaded) + return; + depth = hwloc_topology_get_depth(topology); assert(!topology->modified); diff -Nru hwloc-2.9.2/include/Makefile.am hwloc-2.10.0/include/Makefile.am --- hwloc-2.9.2/include/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -10,10 +10,6 @@ if HWLOC_BUILD_STANDALONE include_HEADERS = hwloc.h -if BUILD_NETLOCSCOTCH -include_HEADERS += netloc.h netlocscotch.h -endif - include_hwlocdir = $(includedir)/hwloc include_hwloc_HEADERS = \ hwloc/bitmap.h \ @@ -47,10 +43,7 @@ private/components.h \ private/internal-components.h \ private/cpuid-x86.h \ - private/windows.h \ - private/netloc.h \ - netloc/utarray.h \ - netloc/uthash.h + private/windows.h if HWLOC_HAVE_LINUX include_hwloc_HEADERS += \ diff -Nru hwloc-2.9.2/include/Makefile.in hwloc-2.10.0/include/Makefile.in --- hwloc-2.9.2/include/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -98,16 +98,15 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@BUILD_NETLOCSCOTCH_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@am__append_1 = netloc.h netlocscotch.h -@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_LINUX_TRUE@am__append_2 = \ +@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_LINUX_TRUE@am__append_1 = \ @HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_LINUX_TRUE@ hwloc/linux.h \ @HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_LINUX_TRUE@ hwloc/linux-libnuma.h -@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_SOLARIS_TRUE@am__append_3 = \ +@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_SOLARIS_TRUE@am__append_2 = \ @HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_SOLARIS_TRUE@ private/solaris-chiptype.h -@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_SCHED_SETAFFINITY_TRUE@am__append_4 = hwloc/glibc-sched.h -@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_WINDOWS_TRUE@am__append_5 = \ +@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_SCHED_SETAFFINITY_TRUE@am__append_3 = hwloc/glibc-sched.h +@HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_WINDOWS_TRUE@am__append_4 = \ @HWLOC_BUILD_STANDALONE_TRUE@@HWLOC_HAVE_WINDOWS_TRUE@ hwloc/windows.h subdir = include @@ -123,8 +122,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__include_HEADERS_DIST) \ @@ -154,7 +152,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__include_HEADERS_DIST = hwloc.h netloc.h netlocscotch.h +am__include_HEADERS_DIST = hwloc.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -196,8 +194,7 @@ am__noinst_HEADERS_DIST = private/private.h private/debug.h \ private/misc.h private/xml.h private/components.h \ private/internal-components.h private/cpuid-x86.h \ - private/windows.h private/netloc.h netloc/utarray.h \ - netloc/uthash.h + private/windows.h HEADERS = $(include_HEADERS) $(include_hwloc_HEADERS) \ $(nodist_include_hwloc_autogen_HEADERS) $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) @@ -223,7 +220,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -350,17 +346,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -429,7 +414,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -452,8 +436,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ -@HWLOC_BUILD_STANDALONE_TRUE@include_HEADERS = hwloc.h $(am__append_1) +@HWLOC_BUILD_STANDALONE_TRUE@include_HEADERS = hwloc.h @HWLOC_BUILD_STANDALONE_TRUE@include_hwlocdir = $(includedir)/hwloc @HWLOC_BUILD_STANDALONE_TRUE@include_hwloc_HEADERS = hwloc/bitmap.h \ @HWLOC_BUILD_STANDALONE_TRUE@ hwloc/helper.h hwloc/inlines.h \ @@ -466,8 +449,8 @@ @HWLOC_BUILD_STANDALONE_TRUE@ hwloc/rsmi.h hwloc/levelzero.h \ @HWLOC_BUILD_STANDALONE_TRUE@ hwloc/plugins.h hwloc/gl.h \ @HWLOC_BUILD_STANDALONE_TRUE@ hwloc/rename.h hwloc/deprecated.h \ -@HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_2) $(am__append_3) \ -@HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_4) $(am__append_5) +@HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_1) $(am__append_2) \ +@HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_3) $(am__append_4) @HWLOC_BUILD_STANDALONE_TRUE@include_hwloc_autogendir = $(includedir)/hwloc/autogen @HWLOC_BUILD_STANDALONE_TRUE@nodist_include_hwloc_autogen_HEADERS = hwloc/autogen/config.h @HWLOC_BUILD_STANDALONE_TRUE@noinst_HEADERS = \ @@ -478,10 +461,7 @@ @HWLOC_BUILD_STANDALONE_TRUE@ private/components.h \ @HWLOC_BUILD_STANDALONE_TRUE@ private/internal-components.h \ @HWLOC_BUILD_STANDALONE_TRUE@ private/cpuid-x86.h \ -@HWLOC_BUILD_STANDALONE_TRUE@ private/windows.h \ -@HWLOC_BUILD_STANDALONE_TRUE@ private/netloc.h \ -@HWLOC_BUILD_STANDALONE_TRUE@ netloc/utarray.h \ -@HWLOC_BUILD_STANDALONE_TRUE@ netloc/uthash.h +@HWLOC_BUILD_STANDALONE_TRUE@ private/windows.h all: all-am diff -Nru hwloc-2.9.2/include/hwloc/bitmap.h hwloc-2.10.0/include/hwloc/bitmap.h --- hwloc-2.9.2/include/hwloc/bitmap.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc/bitmap.h 2023-12-05 12:32:19.000000000 +0000 @@ -445,6 +445,8 @@ /** \brief Test whether bitmaps \p bitmap1 and \p bitmap2 intersects. * * \return 1 if bitmaps intersect, 0 otherwise. + * + * \note The empty bitmap does not intersect any other bitmap. */ HWLOC_DECLSPEC int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure; diff -Nru hwloc-2.9.2/include/hwloc/diff.h hwloc-2.10.0/include/hwloc/diff.h --- hwloc-2.9.2/include/hwloc/diff.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc/diff.h 2023-12-05 12:32:19.000000000 +0000 @@ -257,6 +257,11 @@ /** \brief Load a list of topology differences from a XML buffer. * + * Build a list of differences from the XML memory buffer given + * at \p xmlbuffer and of length \p buflen (including an ending \0). + * This buffer may have been filled earlier with + * hwloc_topology_diff_export_xmlbuffer(). + * * If not \c NULL, \p refname will be filled with the identifier * string of the reference topology for the difference file, * if any was specified in the XML file. diff -Nru hwloc-2.9.2/include/hwloc/helper.h hwloc-2.10.0/include/hwloc/helper.h --- hwloc-2.9.2/include/hwloc/helper.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc/helper.h 2023-12-05 12:32:19.000000000 +0000 @@ -26,6 +26,86 @@ #endif +/** \defgroup hwlocality_helper_types Kinds of object Type + * @{ + * + * Each object type is + * either Normal (i.e. hwloc_obj_type_is_normal() returns 1), + * or Memory (i.e. hwloc_obj_type_is_memory() returns 1) + * or I/O (i.e. hwloc_obj_type_is_io() returns 1) + * or Misc (i.e. equal to ::HWLOC_OBJ_MISC). + * It cannot be of more than one of these kinds. + * + * See also Object Kind in \ref termsanddefs. + */ + +/** \brief Check whether an object type is Normal. + * + * Normal objects are objects of the main CPU hierarchy + * (Machine, Package, Core, PU, CPU caches, etc.), + * but they are not NUMA nodes, I/O devices or Misc objects. + * + * They are attached to parent as Normal children, + * not as Memory, I/O or Misc children. + * + * \return 1 if an object of type \p type is a Normal object, 0 otherwise. + */ +HWLOC_DECLSPEC int +hwloc_obj_type_is_normal(hwloc_obj_type_t type); + +/** \brief Check whether an object type is I/O. + * + * I/O objects are objects attached to their parents + * in the I/O children list. + * This current includes Bridges, PCI and OS devices. + * + * \return 1 if an object of type \p type is a I/O object, 0 otherwise. + */ +HWLOC_DECLSPEC int +hwloc_obj_type_is_io(hwloc_obj_type_t type); + +/** \brief Check whether an object type is Memory. + * + * Memory objects are objects attached to their parents + * in the Memory children list. + * This current includes NUMA nodes and Memory-side caches. + * + * \return 1 if an object of type \p type is a Memory object, 0 otherwise. + */ +HWLOC_DECLSPEC int +hwloc_obj_type_is_memory(hwloc_obj_type_t type); + +/** \brief Check whether an object type is a CPU Cache (Data, Unified or Instruction). + * + * Memory-side caches are not CPU caches. + * + * \return 1 if an object of type \p type is a Cache, 0 otherwise. + */ +HWLOC_DECLSPEC int +hwloc_obj_type_is_cache(hwloc_obj_type_t type); + +/** \brief Check whether an object type is a CPU Data or Unified Cache. + * + * Memory-side caches are not CPU caches. + * + * \return 1 if an object of type \p type is a CPU Data or Unified Cache, 0 otherwise. + */ +HWLOC_DECLSPEC int +hwloc_obj_type_is_dcache(hwloc_obj_type_t type); + +/** \brief Check whether an object type is a CPU Instruction Cache, + * + * Memory-side caches are not CPU caches. + * + * \return 1 if an object of type \p type is a CPU Instruction Cache, 0 otherwise. + */ +HWLOC_DECLSPEC int +hwloc_obj_type_is_icache(hwloc_obj_type_t type); + +/** @} */ + + + /** \defgroup hwlocality_helper_find_inside Finding Objects inside a CPU set * @{ */ @@ -504,9 +584,9 @@ if (prev) { if (prev->type == HWLOC_OBJ_MISC) state = 3; - else if (prev->type == HWLOC_OBJ_BRIDGE || prev->type == HWLOC_OBJ_PCI_DEVICE || prev->type == HWLOC_OBJ_OS_DEVICE) + else if (hwloc_obj_type_is_io(prev->type)) state = 2; - else if (prev->type == HWLOC_OBJ_NUMANODE) + else if (hwloc_obj_type_is_memory(prev->type)) state = 1; obj = prev->next_sibling; } else { @@ -529,84 +609,6 @@ /** @} */ - - -/** \defgroup hwlocality_helper_types Kinds of object Type - * @{ - * - * Each object type is - * either Normal (i.e. hwloc_obj_type_is_normal() returns 1), - * or Memory (i.e. hwloc_obj_type_is_memory() returns 1) - * or I/O (i.e. hwloc_obj_type_is_io() returns 1) - * or Misc (i.e. equal to ::HWLOC_OBJ_MISC). - * It cannot be of more than one of these kinds. - */ - -/** \brief Check whether an object type is Normal. - * - * Normal objects are objects of the main CPU hierarchy - * (Machine, Package, Core, PU, CPU caches, etc.), - * but they are not NUMA nodes, I/O devices or Misc objects. - * - * They are attached to parent as Normal children, - * not as Memory, I/O or Misc children. - * - * \return 1 if an object of type \p type is a Normal object, 0 otherwise. - */ -HWLOC_DECLSPEC int -hwloc_obj_type_is_normal(hwloc_obj_type_t type); - -/** \brief Check whether an object type is I/O. - * - * I/O objects are objects attached to their parents - * in the I/O children list. - * This current includes Bridges, PCI and OS devices. - * - * \return 1 if an object of type \p type is a I/O object, 0 otherwise. - */ -HWLOC_DECLSPEC int -hwloc_obj_type_is_io(hwloc_obj_type_t type); - -/** \brief Check whether an object type is Memory. - * - * Memory objects are objects attached to their parents - * in the Memory children list. - * This current includes NUMA nodes and Memory-side caches. - * - * \return 1 if an object of type \p type is a Memory object, 0 otherwise. - */ -HWLOC_DECLSPEC int -hwloc_obj_type_is_memory(hwloc_obj_type_t type); - -/** \brief Check whether an object type is a CPU Cache (Data, Unified or Instruction). - * - * Memory-side caches are not CPU caches. - * - * \return 1 if an object of type \p type is a Cache, 0 otherwise. - */ -HWLOC_DECLSPEC int -hwloc_obj_type_is_cache(hwloc_obj_type_t type); - -/** \brief Check whether an object type is a CPU Data or Unified Cache. - * - * Memory-side caches are not CPU caches. - * - * \return 1 if an object of type \p type is a CPU Data or Unified Cache, 0 otherwise. - */ -HWLOC_DECLSPEC int -hwloc_obj_type_is_dcache(hwloc_obj_type_t type); - -/** \brief Check whether an object type is a CPU Instruction Cache, - * - * Memory-side caches are not CPU caches. - * - * \return 1 if an object of type \p type is a CPU Instruction Cache, 0 otherwise. - */ -HWLOC_DECLSPEC int -hwloc_obj_type_is_icache(hwloc_obj_type_t type); - -/** @} */ - /** \defgroup hwlocality_helper_find_cache Looking at Cache Objects diff -Nru hwloc-2.9.2/include/hwloc/levelzero.h hwloc-2.10.0/include/hwloc/levelzero.h --- hwloc-2.9.2/include/hwloc/levelzero.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc/levelzero.h 2023-12-05 12:32:19.000000000 +0000 @@ -44,8 +44,9 @@ * the Level Zero device \p device. * * Topology \p topology and device \p device must match the local machine. - * The Level Zero must have been initialized with Sysman enabled - * (ZES_ENABLE_SYSMAN=1 in the environment). + * The Level Zero library must have been initialized with Sysman enabled + * (by calling zesInit(0) if supported, + * or by setting ZES_ENABLE_SYSMAN=1 in the environment). * I/O devices detection and the Level Zero component are not needed in the * topology. * diff -Nru hwloc-2.9.2/include/hwloc/memattrs.h hwloc-2.10.0/include/hwloc/memattrs.h --- hwloc-2.9.2/include/hwloc/memattrs.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc/memattrs.h 2023-12-05 12:32:19.000000000 +0000 @@ -54,6 +54,10 @@ * Attribute values for these nodes, if any, may then be obtained with * hwloc_memattr_get_value() and manually compared with the desired criteria. * + * Memory attributes are also used internally to build Memory Tiers which provide + * an easy way to distinguish NUMA nodes of different kinds, as explained + * in \ref heteromem. + * * \sa An example is available in doc/examples/memory-attributes.c in the source tree. * * \note The API also supports specific objects as initiator, diff -Nru hwloc-2.9.2/include/hwloc/plugins.h hwloc-2.10.0/include/hwloc/plugins.h --- hwloc-2.9.2/include/hwloc/plugins.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc/plugins.h 2023-12-05 12:32:19.000000000 +0000 @@ -164,7 +164,7 @@ */ unsigned excluded_phases; - /** \brief OR'ed set of hwloc_disc_status_flag_e */ + /** \brief OR'ed set of ::hwloc_disc_status_flag_e */ unsigned long flags; }; diff -Nru hwloc-2.9.2/include/hwloc/rename.h hwloc-2.10.0/include/hwloc/rename.h --- hwloc-2.9.2/include/hwloc/rename.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc/rename.h 2023-12-05 12:32:19.000000000 +0000 @@ -176,6 +176,7 @@ #define hwloc_topology_insert_misc_object HWLOC_NAME(topology_insert_misc_object) #define hwloc_topology_alloc_group_object HWLOC_NAME(topology_alloc_group_object) +#define hwloc_topology_free_group_object HWLOC_NAME(topology_free_group_object) #define hwloc_topology_insert_group_object HWLOC_NAME(topology_insert_group_object) #define hwloc_obj_add_other_obj_sets HWLOC_NAME(obj_add_other_obj_sets) #define hwloc_topology_refresh HWLOC_NAME(topology_refresh) diff -Nru hwloc-2.9.2/include/hwloc.h hwloc-2.10.0/include/hwloc.h --- hwloc-2.9.2/include/hwloc.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/hwloc.h 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2022 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2020 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -263,6 +263,11 @@ * This is the smallest object representing Memory resources, * it cannot have any child except Misc objects. * However it may have Memory-side cache parents. + * + * NUMA nodes may correspond to different kinds of memory + * (DRAM, HBM, CXL-DRAM, etc.). When hwloc is able to guess + * that kind, it is specified in the subtype field of the object. + * See also \ref attributes_normal in the main documentation. * * There is always at least one such object in the topology * even if the machine is not NUMA. @@ -338,6 +343,12 @@ HWLOC_OBJ_DIE, /**< \brief Die within a physical package. * A subpart of the physical package, that contains multiple cores. + * + * Some operating systems (e.g. Linux) may expose a single die per package + * even if the hardware does not support dies at all. To avoid showing + * such non-existing dies, the corresponding hwloc backend may filter them out. + * This is functionally equivalent to ::HWLOC_TYPE_FILTER_KEEP_STRUCTURE + * being enforced. */ HWLOC_OBJ_TYPE_MAX /**< \private Sentinel value */ @@ -599,7 +610,7 @@ * \note Its value must not be changed, hwloc_bitmap_dup() must be used instead. */ - struct hwloc_info_s *infos; /**< \brief Array of stringified info type=name. */ + struct hwloc_info_s *infos; /**< \brief Array of info attributes (name and value strings). */ unsigned infos_count; /**< \brief Size of infos array. */ /* misc */ @@ -656,33 +667,48 @@ /** \brief PCI Device specific Object Attributes */ struct hwloc_pcidev_attr_s { #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN - unsigned short domain; /* Only 16bits PCI domains are supported by default */ + unsigned short domain; /**< \brief Domain number (xxxx in the PCI BDF notation xxxx:yy:zz.t). + * Only 16bits PCI domains are supported by default. */ #else - unsigned int domain; /* 32bits PCI domain support break the library ABI, hence it's disabled by default */ + unsigned int domain; /**< \brief Domain number (xxxx in the PCI BDF notation xxxx:yy:zz.t). + * 32bits PCI domain support break the library ABI, hence it's disabled by default. */ #endif - unsigned char bus, dev, func; - unsigned short class_id; - unsigned short vendor_id, device_id, subvendor_id, subdevice_id; - unsigned char revision; - float linkspeed; /* in GB/s */ + unsigned char bus; /**< \brief Bus number (yy in the PCI BDF notation xxxx:yy:zz.t). */ + unsigned char dev; /**< \brief Device number (zz in the PCI BDF notation xxxx:yy:zz.t). */ + unsigned char func; /**< \brief Function number (t in the PCI BDF notation xxxx:yy:zz.t). */ + unsigned short class_id; /**< \brief The class number (first two bytes, without the prog_if). */ + unsigned short vendor_id; /**< \brief Vendor ID (xxxx in [xxxx:yyyy]). */ + unsigned short device_id; /**< \brief Device ID (yyyy in [xxxx:yyyy]). */ + unsigned short subvendor_id; /**< \brief Sub-Vendor ID. */ + unsigned short subdevice_id; /**< \brief Sub-Device ID. */ + unsigned char revision; /**< \brief Revision number. */ + float linkspeed; /**< \brief Link speed in GB/s. + * This datarate is the currently configured speed of the entire PCI link + * (sum of the bandwidth of all PCI lanes in that link). + * It may change during execution since some devices are able to + * slow their PCI links down when idle. + */ } pcidev; /** \brief Bridge specific Object Attributes */ struct hwloc_bridge_attr_s { union { - struct hwloc_pcidev_attr_s pci; + struct hwloc_pcidev_attr_s pci; /**< \brief PCI attribute of the upstream part as a PCI device. */ } upstream; - hwloc_obj_bridge_type_t upstream_type; + hwloc_obj_bridge_type_t upstream_type; /**< \brief Upstream Bridge type. */ union { struct { #ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN - unsigned short domain; /* Only 16bits PCI domains are supported by default */ + unsigned short domain; /**< \brief Domain number the downstream PCI buses. + * Only 16bits PCI domains are supported by default. */ #else - unsigned int domain; /* 32bits PCI domain support break the library ABI, hence it's disabled by default */ + unsigned int domain; /**< \brief Domain number the downstream PCI buses. + * 32bits PCI domain support break the library ABI, hence it's disabled by default */ #endif - unsigned char secondary_bus, subordinate_bus; + unsigned char secondary_bus; /**< \brief First PCI bus number below the bridge. */ + unsigned char subordinate_bus; /**< \brief Highest PCI bus number below the bridge. */ } pci; } downstream; - hwloc_obj_bridge_type_t downstream_type; + hwloc_obj_bridge_type_t downstream_type; /**< \brief Downstream Bridge type. */ unsigned depth; } bridge; /** \brief OS Device specific Object Attributes */ @@ -691,7 +717,7 @@ } osdev; }; -/** \brief Object info +/** \brief Object info attribute (name and value strings) * * \sa hwlocality_info_attr */ @@ -1098,26 +1124,26 @@ -/** \defgroup hwlocality_info_attr Consulting and Adding Key-Value Info Attributes +/** \defgroup hwlocality_info_attr Consulting and Adding Info Attributes * * @{ */ -/** \brief Search the given key name in object infos and return the corresponding value. +/** \brief Search the given name in object infos and return the corresponding value. * - * If multiple keys match the given name, only the first one is returned. + * If multiple info attributes match the given name, only the first one is returned. * * \return A pointer to the value string if it exists. - * \return \c NULL if no such key exists. + * \return \c NULL if no such info attribute exists. * * \note The string should not be freed by the caller, it belongs to the hwloc library. */ static __hwloc_inline const char * hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name) __hwloc_attribute_pure; -/** \brief Add the given info name and value pair to the given object. +/** \brief Add the given name and value pair to the given object info attributes. * - * The info is appended to the existing info array even if another key + * The info pair is appended to the existing info array even if another pair * with the same name already exists. * * The input strings are copied before being added in the object infos. @@ -1125,10 +1151,10 @@ * \return \c 0 on success, \c -1 on error. * * \note This function may be used to enforce object colors in the lstopo - * graphical output by using "lstopoStyle" as a name and "Background=#rrggbb" + * graphical output by adding "lstopoStyle" as a name and "Background=#rrggbb" * as a value. See CUSTOM COLORS in the lstopo(1) manpage for details. * - * \note If \p value contains some non-printable characters, they will + * \note If \p name or \p value contain some non-printable characters, they will * be dropped when exporting to XML, see hwloc_topology_export_xml() in hwloc/export.h. */ HWLOC_DECLSPEC int hwloc_obj_add_info(hwloc_obj_t obj, const char *name, const char *value); @@ -1484,6 +1510,12 @@ HWLOC_MEMBIND_FIRSTTOUCH = 1, /** \brief Allocate memory on the specified nodes. + * + * The actual behavior may slightly vary between operating systems, + * especially when (some of) the requested nodes are full. + * On Linux, by default, the MPOL_PREFERRED_MANY (or MPOL_PREFERRED) policy + * is used. However, if the hwloc strict flag is also given, the Linux + * MPOL_BIND policy is rather used. * \hideinitializer */ HWLOC_MEMBIND_BIND = 2, @@ -1866,6 +1898,10 @@ * \note -1 is returned and errno is set to \c ENOSYS on platforms that do not * support this feature. * + * \note The PID will not actually be used until hwloc_topology_load(). + * If the corresponding process exits in the meantime, hwloc will ignore the PID. + * If another process reuses the PID, the view of that process will be used. + * * \return 0 on success, -1 on error. */ HWLOC_DECLSPEC int hwloc_topology_set_pid(hwloc_topology_t __hwloc_restrict topology, hwloc_pid_t pid); @@ -1929,15 +1965,20 @@ * \note On success, the XML component replaces the previously enabled * component (if any), but the topology is not actually modified until * hwloc_topology_load(). + * + * \note If an invalid XML input file is given, the error may be reported + * either here or later by hwloc_topology_load() depending on the XML library + * used by hwloc. */ HWLOC_DECLSPEC int hwloc_topology_set_xml(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict xmlpath); /** \brief Enable XML based topology using a memory buffer (instead of * a file, as with hwloc_topology_set_xml()). * - * Gather topology information from the XML memory buffer given at \p - * buffer and of length \p size. This buffer may have been filled - * earlier with hwloc_topology_export_xmlbuffer() in hwloc/export.h. + * Gather topology information from the XML memory buffer given at + * \p buffer and of length \p size (including an ending \0). + * This buffer may have been filled earlier with + * hwloc_topology_export_xmlbuffer() in hwloc/export.h. * * Note that this function does not actually load topology * information; it just tells hwloc where to load it from. You'll @@ -1958,6 +1999,10 @@ * \note On success, the XML component replaces the previously enabled * component (if any), but the topology is not actually modified until * hwloc_topology_load(). + * + * \note If an invalid XML input file is given, the error may be reported + * either here or later by hwloc_topology_load() depending on the XML library + * used by hwloc. */ HWLOC_DECLSPEC int hwloc_topology_set_xmlbuffer(hwloc_topology_t __hwloc_restrict topology, const char * __hwloc_restrict buffer, int size); @@ -2165,9 +2210,10 @@ */ HWLOC_TOPOLOGY_FLAG_NO_DISTANCES = (1UL<<7), - /** \brief Ignore memory attributes. + /** \brief Ignore memory attributes and tiers. * - * Ignore memory attribues from the operating systems (and from XML). + * Ignore memory attribues from the operating systems (and from XML) + * Hence also do not try to build memory tiers. */ HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS = (1UL<<8), @@ -2356,8 +2402,8 @@ /** \brief Type filtering flags. * * By default, most objects are kept (::HWLOC_TYPE_FILTER_KEEP_ALL). - * Instruction caches, I/O and Misc objects are ignored by default (::HWLOC_TYPE_FILTER_KEEP_NONE). - * Die and Group levels are ignored unless they bring structure (::HWLOC_TYPE_FILTER_KEEP_STRUCTURE). + * Instruction caches, memory-side caches, I/O and Misc objects are ignored by default (::HWLOC_TYPE_FILTER_KEEP_NONE). + * Group levels are ignored unless they bring structure (::HWLOC_TYPE_FILTER_KEEP_STRUCTURE). * * Note that group objects are also ignored individually (without the entire level) * when they do not bring structure. @@ -2521,11 +2567,22 @@ * are not included (or partially included) in the CPU set \p set. * All objects CPU and node sets are restricted accordingly. * + * By default, \p set is a CPU set. It means that the set of PUs in + * the topology is restricted. Once some PUs got removed, their parents + * may also get removed recursively if they became child-less. + * * If ::HWLOC_RESTRICT_FLAG_BYNODESET is passed in \p flags, * \p set is considered a nodeset instead of a CPU set. + * It means that the set of NUMA nodes in the topology is restricted + * (instead of PUs). Once some NUMA nodes got removed, their parents + * may also get removed recursively if they became child-less. * * \p flags is a OR'ed set of ::hwloc_restrict_flags_e. * + * \note Restricting the topology removes some locality information, + * hence the remaining objects may get reordered (including PUs and NUMA nodes), + * and their logical indexes may change. + * * \note This call may not be reverted by restricting back to a larger * set. Once dropped during restriction, objects may not be brought * back, except by loading another topology with hwloc_topology_load(). @@ -2610,13 +2667,33 @@ * This function returns a new Group object. * * The caller should (at least) initialize its sets before inserting - * the object in the topology. See hwloc_topology_insert_group_object(). + * the object in the topology, see hwloc_topology_insert_group_object(). + * Or it may decide not to insert and just free the group object + * by calling hwloc_topology_free_group_object(). * * \return The allocated object on success. * \return \c NULL on error. - */ + * + * \note If successfully inserted by hwloc_topology_insert_group_object(), + * the object will be freed when the entire topology is freed. + * If insertion failed (e.g. \c NULL or empty CPU and node-sets), + * it is freed before returning the error. + */ HWLOC_DECLSPEC hwloc_obj_t hwloc_topology_alloc_group_object(hwloc_topology_t topology); +/** \brief Free a group object allocated with hwloc_topology_alloc_group_object(). + * + * This function is only useful if the group object was not given + * to hwloc_topology_insert_group_object() as planned. + * + * \note \p topology must be the same as the one previously passed + * to hwloc_topology_alloc_group_object(). + * + * \return \c 0 on success. + * \return \c -1 on error, for instance if an invalid topology is given. + */ +HWLOC_DECLSPEC int hwloc_topology_free_group_object(hwloc_topology_t topology, hwloc_obj_t group); + /** \brief Add more structure to the topology by adding an intermediate Group * * The caller should first allocate a new Group object with hwloc_topology_alloc_group_object(). @@ -2637,7 +2714,7 @@ * The \p subtype object attribute may be defined (to a dynamically * allocated string) to display something else than "Group" as the * type name for this object in lstopo. - * Custom name/value info pairs may be added with hwloc_obj_add_info() after + * Custom name-value info pairs may be added with hwloc_obj_add_info() after * insertion. * * The group \p dont_merge attribute may be set to \c 1 to prevent @@ -2650,6 +2727,18 @@ * as \c 0xffffffff to tell hwloc that this new Group should always * be discarded in favor of any existing Group with the same locality. * + * \note Inserting a group adds some locality information to the topology, + * hence the existing objects may get reordered (including PUs and NUMA nodes), + * and their logical indexes may change. + * + * \note If the insertion fails, the input group object is freed. + * + * \note If the group object should be discarded instead of inserted, + * it may be passed to hwloc_topology_free_group_object() instead. + * + * \note \p topology must be the same as the one previously passed + * to hwloc_topology_alloc_group_object(). + * * \return The inserted object if it was properly inserted. * * \return An existing object if the Group was merged or discarded diff -Nru hwloc-2.9.2/include/netloc/utarray.h hwloc-2.10.0/include/netloc/utarray.h --- hwloc-2.9.2/include/netloc/utarray.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/netloc/utarray.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -/* -Copyright (c) 2008-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* a dynamic array implementation using macros - */ -#ifndef UTARRAY_H -#define UTARRAY_H - -#define UTARRAY_VERSION 1.9.9 - -#ifdef __GNUC__ -#define _UNUSED_ __attribute__ ((__unused__)) -#else -#define _UNUSED_ -#endif - -#include /* size_t */ -#include /* memset, etc */ -#include /* exit */ - -#ifndef oom -#define oom() exit(-1) -#endif - -typedef void (ctor_f)(void *dst, const void *src); -typedef void (dtor_f)(void *elt); -typedef void (init_f)(void *elt); -typedef struct { - size_t sz; - init_f *init; - ctor_f *copy; - dtor_f *dtor; -} UT_icd; - -typedef struct { - unsigned i,n;/* i: index of next available slot, n: num slots */ - UT_icd icd; /* initializer, copy and destructor functions */ - char *d; /* n slots of size icd->sz*/ -} UT_array; - -#define utarray_init(a,_icd) do { \ - memset(a,0,sizeof(UT_array)); \ - (a)->icd=*_icd; \ -} while(0) - -#define utarray_done(a) do { \ - if ((a)->n) { \ - if ((a)->icd.dtor) { \ - size_t _ut_i; \ - for(_ut_i=0; _ut_i < (a)->i; _ut_i++) { \ - (a)->icd.dtor(utarray_eltptr(a,_ut_i)); \ - } \ - } \ - free((a)->d); \ - } \ - (a)->n=0; \ -} while(0) - -#define utarray_new(a,_icd) do { \ - a=(UT_array*)malloc(sizeof(UT_array)); \ - utarray_init(a,_icd); \ -} while(0) - -#define utarray_free(a) do { \ - utarray_done(a); \ - free(a); \ -} while(0) - -#define utarray_reserve(a,by) do { \ - if (((a)->i+(by)) > ((a)->n)) { \ - char *utarray_tmp; \ - while(((a)->i+(by)) > ((a)->n)) { (a)->n = ((a)->n ? (2*(a)->n) : 8); } \ - utarray_tmp=(char*)realloc((a)->d, (a)->n*(a)->icd.sz); \ - if (utarray_tmp == NULL) oom(); \ - (a)->d=utarray_tmp; \ - } \ -} while(0) - -#define utarray_push_back(a,p) do { \ - utarray_reserve(a,1); \ - if ((a)->icd.copy) { (a)->icd.copy( _utarray_eltptr(a,(a)->i++), p); } \ - else { memcpy(_utarray_eltptr(a,(a)->i++), p, (a)->icd.sz); }; \ -} while(0) - -#define utarray_pop_back(a) do { \ - if ((a)->icd.dtor) { (a)->icd.dtor( _utarray_eltptr(a,--((a)->i))); } \ - else { (a)->i--; } \ -} while(0) - -#define utarray_extend_back(a) do { \ - utarray_reserve(a,1); \ - if ((a)->icd.init) { (a)->icd.init(_utarray_eltptr(a,(a)->i)); } \ - else { memset(_utarray_eltptr(a,(a)->i),0,(a)->icd.sz); } \ - (a)->i++; \ -} while(0) - -#define utarray_len(a) ((a)->i) - -#define utarray_eltptr(a,j) (((j) < (a)->i) ? _utarray_eltptr(a,j) : NULL) -#define _utarray_eltptr(a,j) ((char*)((a)->d + ((a)->icd.sz*(j) ))) - -#define utarray_insert(a,p,j) do { \ - if (j > (a)->i) utarray_resize(a,j); \ - utarray_reserve(a,1); \ - if ((j) < (a)->i) { \ - memmove( _utarray_eltptr(a,(j)+1), _utarray_eltptr(a,j), \ - ((a)->i - (j))*((a)->icd.sz)); \ - } \ - if ((a)->icd.copy) { (a)->icd.copy( _utarray_eltptr(a,j), p); } \ - else { memcpy(_utarray_eltptr(a,j), p, (a)->icd.sz); }; \ - (a)->i++; \ -} while(0) - -#define utarray_inserta(a,w,j) do { \ - if (utarray_len(w) == 0) break; \ - if (j > (a)->i) utarray_resize(a,j); \ - utarray_reserve(a,utarray_len(w)); \ - if ((j) < (a)->i) { \ - memmove(_utarray_eltptr(a,(j)+utarray_len(w)), \ - _utarray_eltptr(a,j), \ - ((a)->i - (j))*((a)->icd.sz)); \ - } \ - if ((a)->icd.copy) { \ - size_t _ut_i; \ - for(_ut_i=0;_ut_i<(w)->i;_ut_i++) { \ - (a)->icd.copy(_utarray_eltptr(a,j+_ut_i), _utarray_eltptr(w,_ut_i)); \ - } \ - } else { \ - memcpy(_utarray_eltptr(a,j), _utarray_eltptr(w,0), \ - utarray_len(w)*((a)->icd.sz)); \ - } \ - (a)->i += utarray_len(w); \ -} while(0) - -#define utarray_resize(dst,num) do { \ - size_t _ut_i; \ - if (dst->i > (size_t)(num)) { \ - if ((dst)->icd.dtor) { \ - for(_ut_i=num; _ut_i < dst->i; _ut_i++) { \ - (dst)->icd.dtor(utarray_eltptr(dst,_ut_i)); \ - } \ - } \ - } else if (dst->i < (size_t)(num)) { \ - utarray_reserve(dst,num-dst->i); \ - if ((dst)->icd.init) { \ - for(_ut_i=dst->i; _ut_i < num; _ut_i++) { \ - (dst)->icd.init(utarray_eltptr(dst,_ut_i)); \ - } \ - } else { \ - memset(_utarray_eltptr(dst,dst->i),0,(dst)->icd.sz*(num-dst->i)); \ - } \ - } \ - dst->i = num; \ -} while(0) - -#define utarray_concat(dst,src) do { \ - utarray_inserta((dst),(src),utarray_len(dst)); \ -} while(0) - -#define utarray_erase(a,pos,len) do { \ - if ((a)->icd.dtor) { \ - size_t _ut_i; \ - for(_ut_i=0; _ut_i < len; _ut_i++) { \ - (a)->icd.dtor(utarray_eltptr((a),pos+_ut_i)); \ - } \ - } \ - if ((a)->i > (pos+len)) { \ - memmove( _utarray_eltptr((a),pos), _utarray_eltptr((a),pos+len), \ - (((a)->i)-(pos+len))*((a)->icd.sz)); \ - } \ - (a)->i -= (len); \ -} while(0) - -#define utarray_renew(a,u) do { \ - if (a) utarray_clear(a); \ - else utarray_new((a),(u)); \ -} while(0) - -#define utarray_clear(a) do { \ - if ((a)->i > 0) { \ - if ((a)->icd.dtor) { \ - size_t _ut_i; \ - for(_ut_i=0; _ut_i < (a)->i; _ut_i++) { \ - (a)->icd.dtor(utarray_eltptr(a,_ut_i)); \ - } \ - } \ - (a)->i = 0; \ - } \ -} while(0) - -#define utarray_sort(a,cmp) do { \ - qsort((a)->d, (a)->i, (a)->icd.sz, cmp); \ -} while(0) - -#define utarray_find(a,v,cmp) bsearch((v),(a)->d,(a)->i,(a)->icd.sz,cmp) - -#define utarray_front(a) (((a)->i) ? (_utarray_eltptr(a,0)) : NULL) -#define utarray_next(a,e) (((e)==NULL) ? utarray_front(a) : ((((a)->i) > (utarray_eltidx(a,e)+1)) ? _utarray_eltptr(a,utarray_eltidx(a,e)+1) : NULL)) -#define utarray_prev(a,e) (((e)==NULL) ? utarray_back(a) : ((utarray_eltidx(a,e) > 0) ? _utarray_eltptr(a,utarray_eltidx(a,e)-1) : NULL)) -#define utarray_back(a) (((a)->i) ? (_utarray_eltptr(a,(a)->i-1)) : NULL) -#define utarray_eltidx(a,e) (((char*)(e) >= (char*)((a)->d)) ? (((char*)(e) - (char*)((a)->d))/(size_t)(a)->icd.sz) : (unsigned int)-1) - -/* last we pre-define a few icd for common utarrays of ints and strings */ -static void utarray_str_cpy(void *dst, const void *src) { - char **_src = (char**)src, **_dst = (char**)dst; - *_dst = (*_src == NULL) ? NULL : strdup(*_src); -} -static void utarray_str_dtor(void *elt) { - char **eltc = (char**)elt; - if (*eltc) free(*eltc); -} -static const UT_icd ut_str_icd _UNUSED_ = {sizeof(char*),NULL,utarray_str_cpy,utarray_str_dtor}; -static const UT_icd ut_int_icd _UNUSED_ = {sizeof(int),NULL,NULL,NULL}; -static const UT_icd ut_ptr_icd _UNUSED_ = {sizeof(void*),NULL,NULL,NULL}; - - -#endif /* UTARRAY_H */ diff -Nru hwloc-2.9.2/include/netloc/uthash.h hwloc-2.10.0/include/netloc/uthash.h --- hwloc-2.9.2/include/netloc/uthash.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/netloc/uthash.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,966 +0,0 @@ -/* -Copyright (c) 2003-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef UTHASH_H -#define UTHASH_H - -#include /* memcmp,strlen */ -#include /* ptrdiff_t */ -#include /* exit() */ - -/* These macros use decltype or the earlier __typeof GNU extension. - As decltype is only available in newer compilers (VS2010 or gcc 4.3+ - when compiling c++ source) this code uses whatever method is needed - or, for VS2008 where neither is available, uses casting workarounds. */ -#if defined(_MSC_VER) /* MS compiler */ -#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ -#define DECLTYPE(x) (decltype(x)) -#else /* VS2008 or older (or VS2010 in C mode) */ -#define NO_DECLTYPE -#define DECLTYPE(x) -#endif -#elif defined(__BORLANDC__) || defined(__LCC__) || defined(__WATCOMC__) -#define NO_DECLTYPE -#define DECLTYPE(x) -#else /* GNU, Sun and other compilers */ -#define DECLTYPE(x) (__typeof(x)) -#endif - -#ifdef NO_DECLTYPE -#define DECLTYPE_ASSIGN(dst,src) \ -do { \ - char **_da_dst = (char**)(&(dst)); \ - *_da_dst = (char*)(src); \ -} while(0) -#else -#define DECLTYPE_ASSIGN(dst,src) \ -do { \ - (dst) = DECLTYPE(dst)(src); \ -} while(0) -#endif - -/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */ -#if defined(_WIN32) -#if defined(_MSC_VER) && _MSC_VER >= 1600 -#include -#elif defined(__WATCOMC__) || defined(__MINGW32__) || defined(__CYGWIN__) -#include -#else -typedef unsigned int uint32_t; -typedef unsigned char uint8_t; -#endif -#elif defined(__GNUC__) && !defined(__VXWORKS__) -#include -#else -typedef unsigned int uint32_t; -typedef unsigned char uint8_t; -#endif - -#define UTHASH_VERSION 1.9.9 - -#ifndef uthash_fatal -#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ -#endif -#ifndef uthash_malloc -#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ -#endif -#ifndef uthash_free -#define uthash_free(ptr,sz) free(ptr) /* free fcn */ -#endif - -#ifndef uthash_noexpand_fyi -#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ -#endif -#ifndef uthash_expand_fyi -#define uthash_expand_fyi(tbl) /* can be defined to log expands */ -#endif - -/* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */ -#define HASH_BKT_CAPACITY_THRESH 10U /* expand when bucket count reaches */ - -/* calculate the element whose hash handle address is hhe */ -#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) - -#define HASH_FIND(hh,head,keyptr,keylen,out) \ -do { \ - out=NULL; \ - if (head != NULL) { \ - unsigned _hf_bkt,_hf_hashv; \ - HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ - if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv) != 0) { \ - HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ - keyptr,keylen,out); \ - } \ - } \ -} while (0) - -#ifdef HASH_BLOOM -#define HASH_BLOOM_BITLEN (1UL << HASH_BLOOM) -#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8UL) + (((HASH_BLOOM_BITLEN%8UL)!=0UL) ? 1UL : 0UL) -#define HASH_BLOOM_MAKE(tbl) \ -do { \ - (tbl)->bloom_nbits = HASH_BLOOM; \ - (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ - if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ - memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ - (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ -} while (0) - -#define HASH_BLOOM_FREE(tbl) \ -do { \ - uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ -} while (0) - -#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8U] |= (1U << ((idx)%8U))) -#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8U] & (1U << ((idx)%8U))) - -#define HASH_BLOOM_ADD(tbl,hashv) \ - HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1U))) - -#define HASH_BLOOM_TEST(tbl,hashv) \ - HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1U))) - -#else -#define HASH_BLOOM_MAKE(tbl) -#define HASH_BLOOM_FREE(tbl) -#define HASH_BLOOM_ADD(tbl,hashv) -#define HASH_BLOOM_TEST(tbl,hashv) (1) -#define HASH_BLOOM_BYTELEN 0U -#endif - -#define HASH_MAKE_TABLE(hh,head) \ -do { \ - (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ - sizeof(UT_hash_table)); \ - if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ - (head)->hh.tbl->tail = &((head)->hh); \ - (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ - (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ - (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ - (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl->buckets, 0, \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - HASH_BLOOM_MAKE((head)->hh.tbl); \ - (head)->hh.tbl->signature = HASH_SIGNATURE; \ -} while(0) - -#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ - HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add) - -#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ -do { \ - replaced=NULL; \ - HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced); \ - if (replaced!=NULL) { \ - HASH_DELETE(hh,head,replaced); \ - } \ - HASH_ADD(hh,head,fieldname,keylen_in,add); \ -} while(0) - -#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ -do { \ - unsigned _ha_bkt; \ - (add)->hh.next = NULL; \ - (add)->hh.key = (char*)(keyptr); \ - (add)->hh.keylen = (unsigned)(keylen_in); \ - if (!(head)) { \ - head = (add); \ - (head)->hh.prev = NULL; \ - HASH_MAKE_TABLE(hh,head); \ - } else { \ - (head)->hh.tbl->tail->next = (add); \ - (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ - (head)->hh.tbl->tail = &((add)->hh); \ - } \ - (head)->hh.tbl->num_items++; \ - (add)->hh.tbl = (head)->hh.tbl; \ - HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ - (add)->hh.hashv, _ha_bkt); \ - HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ - HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ - HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ - HASH_FSCK(hh,head); \ -} while(0) - -#define HASH_TO_BKT( hashv, num_bkts, bkt ) \ -do { \ - bkt = ((hashv) & ((num_bkts) - 1U)); \ -} while(0) - -/* delete "delptr" from the hash table. - * "the usual" patch-up process for the app-order doubly-linked-list. - * The use of _hd_hh_del below deserves special explanation. - * These used to be expressed using (delptr) but that led to a bug - * if someone used the same symbol for the head and deletee, like - * HASH_DELETE(hh,users,users); - * We want that to work, but by changing the head (users) below - * we were forfeiting our ability to further refer to the deletee (users) - * in the patch-up process. Solution: use scratch space to - * copy the deletee pointer, then the latter references are via that - * scratch pointer rather than through the repointed (users) symbol. - */ -#define HASH_DELETE(hh,head,delptr) \ -do { \ - struct UT_hash_handle *_hd_hh_del; \ - if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ - uthash_free((head)->hh.tbl->buckets, \ - (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ - HASH_BLOOM_FREE((head)->hh.tbl); \ - uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ - head = NULL; \ - } else { \ - unsigned _hd_bkt; \ - _hd_hh_del = &((delptr)->hh); \ - if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ - (head)->hh.tbl->tail = \ - (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho); \ - } \ - if ((delptr)->hh.prev != NULL) { \ - ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ - } else { \ - DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ - } \ - if (_hd_hh_del->next != NULL) { \ - ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ - (head)->hh.tbl->hho))->prev = \ - _hd_hh_del->prev; \ - } \ - HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ - HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ - (head)->hh.tbl->num_items--; \ - } \ - HASH_FSCK(hh,head); \ -} while (0) - - -/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ -#define HASH_FIND_STR(head,findstr,out) \ - HASH_FIND(hh,head,findstr,(unsigned)strlen(findstr),out) -#define HASH_ADD_STR(head,strfield,add) \ - HASH_ADD(hh,head,strfield[0],(unsigned int)strlen(add->strfield),add) -#define HASH_REPLACE_STR(head,strfield,add,replaced) \ - HASH_REPLACE(hh,head,strfield[0],(unsigned)strlen(add->strfield),add,replaced) -#define HASH_FIND_INT(head,findint,out) \ - HASH_FIND(hh,head,findint,sizeof(int),out) -#define HASH_ADD_INT(head,intfield,add) \ - HASH_ADD(hh,head,intfield,sizeof(int),add) -#define HASH_REPLACE_INT(head,intfield,add,replaced) \ - HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) -#define HASH_FIND_PTR(head,findptr,out) \ - HASH_FIND(hh,head,findptr,sizeof(void *),out) -#define HASH_ADD_PTR(head,ptrfield,add) \ - HASH_ADD(hh,head,ptrfield,sizeof(void *),add) -#define HASH_REPLACE_PTR(head,ptrfield,add,replaced) \ - HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) -#define HASH_DEL(head,delptr) \ - HASH_DELETE(hh,head,delptr) - -/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. - * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. - */ -#ifdef HASH_DEBUG -#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) -#define HASH_FSCK(hh,head) \ -do { \ - struct UT_hash_handle *_thh; \ - if (head) { \ - unsigned _bkt_i; \ - unsigned _count; \ - char *_prev; \ - _count = 0; \ - for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ - unsigned _bkt_count = 0; \ - _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ - _prev = NULL; \ - while (_thh) { \ - if (_prev != (char*)(_thh->hh_prev)) { \ - HASH_OOPS("invalid hh_prev %p, actual %p\n", \ - _thh->hh_prev, _prev ); \ - } \ - _bkt_count++; \ - _prev = (char*)(_thh); \ - _thh = _thh->hh_next; \ - } \ - _count += _bkt_count; \ - if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ - HASH_OOPS("invalid bucket count %u, actual %u\n", \ - (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ - } \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid hh item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ - } \ - /* traverse hh in app order; check next/prev integrity, count */ \ - _count = 0; \ - _prev = NULL; \ - _thh = &(head)->hh; \ - while (_thh) { \ - _count++; \ - if (_prev !=(char*)(_thh->prev)) { \ - HASH_OOPS("invalid prev %p, actual %p\n", \ - _thh->prev, _prev ); \ - } \ - _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ - _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ - (head)->hh.tbl->hho) : NULL ); \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid app item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ - } \ - } \ -} while (0) -#else -#define HASH_FSCK(hh,head) -#endif - -/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to - * the descriptor to which this macro is defined for tuning the hash function. - * The app can #include to get the prototype for write(2). */ -#ifdef HASH_EMIT_KEYS -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ -do { \ - unsigned _klen = fieldlen; \ - write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ - write(HASH_EMIT_KEYS, keyptr, (unsigned long)fieldlen); \ -} while (0) -#else -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) -#endif - -/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ -#ifdef HASH_FUNCTION -#define HASH_FCN HASH_FUNCTION -#else -#define HASH_FCN HASH_JEN -#endif - -/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */ -#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _hb_keylen=(unsigned)keylen; \ - const unsigned char *_hb_key=(const unsigned char*)(key); \ - (hashv) = 0; \ - while (_hb_keylen-- != 0U) { \ - (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; \ - } \ - bkt = (hashv) & (num_bkts-1U); \ -} while (0) - - -/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at - * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ -#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _sx_i; \ - const unsigned char *_hs_key=(const unsigned char*)(key); \ - hashv = 0; \ - for(_sx_i=0; _sx_i < keylen; _sx_i++) { \ - hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ - } \ - bkt = hashv & (num_bkts-1U); \ -} while (0) -/* FNV-1a variation */ -#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _fn_i; \ - const unsigned char *_hf_key=(const unsigned char*)(key); \ - hashv = 2166136261U; \ - for(_fn_i=0; _fn_i < keylen; _fn_i++) { \ - hashv = hashv ^ _hf_key[_fn_i]; \ - hashv = hashv * 16777619U; \ - } \ - bkt = hashv & (num_bkts-1U); \ -} while(0) - -#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _ho_i; \ - const unsigned char *_ho_key=(const unsigned char*)(key); \ - hashv = 0; \ - for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ - hashv += _ho_key[_ho_i]; \ - hashv += (hashv << 10); \ - hashv ^= (hashv >> 6); \ - } \ - hashv += (hashv << 3); \ - hashv ^= (hashv >> 11); \ - hashv += (hashv << 15); \ - bkt = hashv & (num_bkts-1U); \ -} while(0) - -#define HASH_JEN_MIX(a,b,c) \ -do { \ - a -= b; a -= c; a ^= ( c >> 13 ); \ - b -= c; b -= a; b ^= ( a << 8 ); \ - c -= a; c -= b; c ^= ( b >> 13 ); \ - a -= b; a -= c; a ^= ( c >> 12 ); \ - b -= c; b -= a; b ^= ( a << 16 ); \ - c -= a; c -= b; c ^= ( b >> 5 ); \ - a -= b; a -= c; a ^= ( c >> 3 ); \ - b -= c; b -= a; b ^= ( a << 10 ); \ - c -= a; c -= b; c ^= ( b >> 15 ); \ -} while (0) - -#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned _hj_i,_hj_j,_hj_k; \ - unsigned const char *_hj_key=(unsigned const char*)(key); \ - hashv = 0xfeedbeefu; \ - _hj_i = _hj_j = 0x9e3779b9u; \ - _hj_k = (unsigned)(keylen); \ - while (_hj_k >= 12U) { \ - _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ - + ( (unsigned)_hj_key[2] << 16 ) \ - + ( (unsigned)_hj_key[3] << 24 ) ); \ - _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ - + ( (unsigned)_hj_key[6] << 16 ) \ - + ( (unsigned)_hj_key[7] << 24 ) ); \ - hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ - + ( (unsigned)_hj_key[10] << 16 ) \ - + ( (unsigned)_hj_key[11] << 24 ) ); \ - \ - HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ - \ - _hj_key += 12; \ - _hj_k -= 12U; \ - } \ - hashv += (unsigned)(keylen); \ - switch ( _hj_k ) { \ - case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */ \ - case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */ \ - case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); /* FALLTHROUGH */ \ - case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */ \ - case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */ \ - case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); /* FALLTHROUGH */ \ - case 5: _hj_j += _hj_key[4]; /* FALLTHROUGH */ \ - case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */ \ - case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */ \ - case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); /* FALLTHROUGH */ \ - case 1: _hj_i += _hj_key[0]; \ - } \ - HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ - bkt = hashv & (num_bkts-1U); \ -} while(0) - -/* The Paul Hsieh hash function */ -#undef get16bits -#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ - || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) -#define get16bits(d) (*((const uint16_t *) (d))) -#endif - -#if !defined (get16bits) -#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ - +(uint32_t)(((const uint8_t *)(d))[0]) ) -#endif -#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ -do { \ - unsigned const char *_sfh_key=(unsigned const char*)(key); \ - uint32_t _sfh_tmp, _sfh_len = (uint32_t)keylen; \ - \ - unsigned _sfh_rem = _sfh_len & 3U; \ - _sfh_len >>= 2; \ - hashv = 0xcafebabeu; \ - \ - /* Main loop */ \ - for (;_sfh_len > 0U; _sfh_len--) { \ - hashv += get16bits (_sfh_key); \ - _sfh_tmp = ((uint32_t)(get16bits (_sfh_key+2)) << 11) ^ hashv; \ - hashv = (hashv << 16) ^ _sfh_tmp; \ - _sfh_key += 2U*sizeof (uint16_t); \ - hashv += hashv >> 11; \ - } \ - \ - /* Handle end cases */ \ - switch (_sfh_rem) { \ - case 3: hashv += get16bits (_sfh_key); \ - hashv ^= hashv << 16; \ - hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)]) << 18; \ - hashv += hashv >> 11; \ - break; \ - case 2: hashv += get16bits (_sfh_key); \ - hashv ^= hashv << 11; \ - hashv += hashv >> 17; \ - break; \ - case 1: hashv += *_sfh_key; \ - hashv ^= hashv << 10; \ - hashv += hashv >> 1; \ - } \ - \ - /* Force "avalanching" of final 127 bits */ \ - hashv ^= hashv << 3; \ - hashv += hashv >> 5; \ - hashv ^= hashv << 4; \ - hashv += hashv >> 17; \ - hashv ^= hashv << 25; \ - hashv += hashv >> 6; \ - bkt = hashv & (num_bkts-1U); \ -} while(0) - -#ifdef HASH_USING_NO_STRICT_ALIASING -/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. - * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. - * MurmurHash uses the faster approach only on CPU's where we know it's safe. - * - * Note the preprocessor built-in defines can be emitted using: - * - * gcc -m64 -dM -E - < /dev/null (on gcc) - * cc -## a.c (where a.c is a simple test file) (Sun Studio) - */ -#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) -#define MUR_GETBLOCK(p,i) p[i] -#else /* non intel */ -#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 3UL) == 0UL) -#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 3UL) == 1UL) -#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 3UL) == 2UL) -#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 3UL) == 3UL) -#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) -#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) -#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) -#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) -#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) -#else /* assume little endian non-intel */ -#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) -#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) -#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) -#endif -#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ - (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ - (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ - MUR_ONE_THREE(p)))) -#endif -#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) -#define MUR_FMIX(_h) \ -do { \ - _h ^= _h >> 16; \ - _h *= 0x85ebca6bu; \ - _h ^= _h >> 13; \ - _h *= 0xc2b2ae35u; \ - _h ^= _h >> 16; \ -} while(0) - -#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ -do { \ - const uint8_t *_mur_data = (const uint8_t*)(key); \ - const int _mur_nblocks = (int)(keylen) / 4; \ - uint32_t _mur_h1 = 0xf88D5353u; \ - uint32_t _mur_c1 = 0xcc9e2d51u; \ - uint32_t _mur_c2 = 0x1b873593u; \ - uint32_t _mur_k1 = 0; \ - const uint8_t *_mur_tail; \ - const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+(_mur_nblocks*4)); \ - int _mur_i; \ - for(_mur_i = -_mur_nblocks; _mur_i!=0; _mur_i++) { \ - _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ - _mur_k1 *= _mur_c1; \ - _mur_k1 = MUR_ROTL32(_mur_k1,15); \ - _mur_k1 *= _mur_c2; \ - \ - _mur_h1 ^= _mur_k1; \ - _mur_h1 = MUR_ROTL32(_mur_h1,13); \ - _mur_h1 = (_mur_h1*5U) + 0xe6546b64u; \ - } \ - _mur_tail = (const uint8_t*)(_mur_data + (_mur_nblocks*4)); \ - _mur_k1=0; \ - switch((keylen) & 3U) { \ - case 3: _mur_k1 ^= (uint32_t)_mur_tail[2] << 16; /* FALLTHROUGH */ \ - case 2: _mur_k1 ^= (uint32_t)_mur_tail[1] << 8; /* FALLTHROUGH */ \ - case 1: _mur_k1 ^= (uint32_t)_mur_tail[0]; \ - _mur_k1 *= _mur_c1; \ - _mur_k1 = MUR_ROTL32(_mur_k1,15); \ - _mur_k1 *= _mur_c2; \ - _mur_h1 ^= _mur_k1; \ - } \ - _mur_h1 ^= (uint32_t)(keylen); \ - MUR_FMIX(_mur_h1); \ - hashv = _mur_h1; \ - bkt = hashv & (num_bkts-1U); \ -} while(0) -#endif /* HASH_USING_NO_STRICT_ALIASING */ - -/* key comparison function; return 0 if keys equal */ -#define HASH_KEYCMP(a,b,len) memcmp(a,b,(unsigned long)(len)) - -/* iterate over items in a known bucket to find desired item */ -#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ -do { \ - if (head.hh_head != NULL) { DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); } \ - else { out=NULL; } \ - while (out != NULL) { \ - if ((out)->hh.keylen == (keylen_in)) { \ - if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) { break; } \ - } \ - if ((out)->hh.hh_next != NULL) { DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); } \ - else { out = NULL; } \ - } \ -} while(0) - -/* add an item to a bucket */ -#define HASH_ADD_TO_BKT(head,addhh) \ -do { \ - head.count++; \ - (addhh)->hh_next = head.hh_head; \ - (addhh)->hh_prev = NULL; \ - if (head.hh_head != NULL) { (head).hh_head->hh_prev = (addhh); } \ - (head).hh_head=addhh; \ - if ((head.count >= ((head.expand_mult+1U) * HASH_BKT_CAPACITY_THRESH)) \ - && ((addhh)->tbl->noexpand != 1U)) { \ - HASH_EXPAND_BUCKETS((addhh)->tbl); \ - } \ -} while(0) - -/* remove an item from a given bucket */ -#define HASH_DEL_IN_BKT(hh,head,hh_del) \ - (head).count--; \ - if ((head).hh_head == hh_del) { \ - (head).hh_head = hh_del->hh_next; \ - } \ - if (hh_del->hh_prev) { \ - hh_del->hh_prev->hh_next = hh_del->hh_next; \ - } \ - if (hh_del->hh_next) { \ - hh_del->hh_next->hh_prev = hh_del->hh_prev; \ - } - -/* Bucket expansion has the effect of doubling the number of buckets - * and redistributing the items into the new buckets. Ideally the - * items will distribute more or less evenly into the new buckets - * (the extent to which this is true is a measure of the quality of - * the hash function as it applies to the key domain). - * - * With the items distributed into more buckets, the chain length - * (item count) in each bucket is reduced. Thus by expanding buckets - * the hash keeps a bound on the chain length. This bounded chain - * length is the essence of how a hash provides constant time lookup. - * - * The calculation of tbl->ideal_chain_maxlen below deserves some - * explanation. First, keep in mind that we're calculating the ideal - * maximum chain length based on the *new* (doubled) bucket count. - * In fractions this is just n/b (n=number of items,b=new num buckets). - * Since the ideal chain length is an integer, we want to calculate - * ceil(n/b). We don't depend on floating point arithmetic in this - * hash, so to calculate ceil(n/b) with integers we could write - * - * ceil(n/b) = (n/b) + ((n%b)?1:0) - * - * and in fact a previous version of this hash did just that. - * But now we have improved things a bit by recognizing that b is - * always a power of two. We keep its base 2 log handy (call it lb), - * so now we can write this with a bit shift and logical AND: - * - * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) - * - */ -#define HASH_EXPAND_BUCKETS(tbl) \ -do { \ - unsigned _he_bkt; \ - unsigned _he_bkt_i; \ - struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ - UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ - _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ - 2UL * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ - if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \ - memset(_he_new_buckets, 0, \ - 2UL * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ - tbl->ideal_chain_maxlen = \ - (tbl->num_items >> (tbl->log2_num_buckets+1U)) + \ - (((tbl->num_items & ((tbl->num_buckets*2U)-1U)) != 0U) ? 1U : 0U); \ - tbl->nonideal_items = 0; \ - for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \ - { \ - _he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \ - while (_he_thh != NULL) { \ - _he_hh_nxt = _he_thh->hh_next; \ - HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2U, _he_bkt); \ - _he_newbkt = &(_he_new_buckets[ _he_bkt ]); \ - if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \ - tbl->nonideal_items++; \ - _he_newbkt->expand_mult = _he_newbkt->count / \ - tbl->ideal_chain_maxlen; \ - } \ - _he_thh->hh_prev = NULL; \ - _he_thh->hh_next = _he_newbkt->hh_head; \ - if (_he_newbkt->hh_head != NULL) { _he_newbkt->hh_head->hh_prev = \ - _he_thh; } \ - _he_newbkt->hh_head = _he_thh; \ - _he_thh = _he_hh_nxt; \ - } \ - } \ - uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ - tbl->num_buckets *= 2U; \ - tbl->log2_num_buckets++; \ - tbl->buckets = _he_new_buckets; \ - tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \ - (tbl->ineff_expands+1U) : 0U; \ - if (tbl->ineff_expands > 1U) { \ - tbl->noexpand=1; \ - uthash_noexpand_fyi(tbl); \ - } \ - uthash_expand_fyi(tbl); \ -} while(0) - - -/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ -/* Note that HASH_SORT assumes the hash handle name to be hh. - * HASH_SRT was added to allow the hash handle name to be passed in. */ -#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) -#define HASH_SRT(hh,head,cmpfcn) \ -do { \ - unsigned _hs_i; \ - unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ - struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ - if (head != NULL) { \ - _hs_insize = 1; \ - _hs_looping = 1; \ - _hs_list = &((head)->hh); \ - while (_hs_looping != 0U) { \ - _hs_p = _hs_list; \ - _hs_list = NULL; \ - _hs_tail = NULL; \ - _hs_nmerges = 0; \ - while (_hs_p != NULL) { \ - _hs_nmerges++; \ - _hs_q = _hs_p; \ - _hs_psize = 0; \ - for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \ - _hs_psize++; \ - _hs_q = (UT_hash_handle*)((_hs_q->next != NULL) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - if (! (_hs_q) ) { break; } \ - } \ - _hs_qsize = _hs_insize; \ - while ((_hs_psize > 0U) || ((_hs_qsize > 0U) && (_hs_q != NULL))) {\ - if (_hs_psize == 0U) { \ - _hs_e = _hs_q; \ - _hs_q = (UT_hash_handle*)((_hs_q->next != NULL) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - _hs_qsize--; \ - } else if ( (_hs_qsize == 0U) || (_hs_q == NULL) ) { \ - _hs_e = _hs_p; \ - if (_hs_p != NULL){ \ - _hs_p = (UT_hash_handle*)((_hs_p->next != NULL) ? \ - ((void*)((char*)(_hs_p->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - } \ - _hs_psize--; \ - } else if (( \ - cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \ - DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \ - ) <= 0) { \ - _hs_e = _hs_p; \ - if (_hs_p != NULL){ \ - _hs_p = (UT_hash_handle*)((_hs_p->next != NULL) ? \ - ((void*)((char*)(_hs_p->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - } \ - _hs_psize--; \ - } else { \ - _hs_e = _hs_q; \ - _hs_q = (UT_hash_handle*)((_hs_q->next != NULL) ? \ - ((void*)((char*)(_hs_q->next) + \ - (head)->hh.tbl->hho)) : NULL); \ - _hs_qsize--; \ - } \ - if ( _hs_tail != NULL ) { \ - _hs_tail->next = ((_hs_e != NULL) ? \ - ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \ - } else { \ - _hs_list = _hs_e; \ - } \ - if (_hs_e != NULL) { \ - _hs_e->prev = ((_hs_tail != NULL) ? \ - ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \ - } \ - _hs_tail = _hs_e; \ - } \ - _hs_p = _hs_q; \ - } \ - if (_hs_tail != NULL){ \ - _hs_tail->next = NULL; \ - } \ - if ( _hs_nmerges <= 1U ) { \ - _hs_looping=0; \ - (head)->hh.tbl->tail = _hs_tail; \ - DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ - } \ - _hs_insize *= 2U; \ - } \ - HASH_FSCK(hh,head); \ - } \ -} while (0) - -/* This function selects items from one hash into another hash. - * The end result is that the selected items have dual presence - * in both hashes. There is no copy of the items made; rather - * they are added into the new hash through a secondary hash - * hash handle that must be present in the structure. */ -#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ -do { \ - unsigned _src_bkt, _dst_bkt; \ - void *_last_elt=NULL, *_elt; \ - UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ - ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ - if (src != NULL) { \ - for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ - for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ - _src_hh != NULL; \ - _src_hh = _src_hh->hh_next) { \ - _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ - if (cond(_elt)) { \ - _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \ - _dst_hh->key = _src_hh->key; \ - _dst_hh->keylen = _src_hh->keylen; \ - _dst_hh->hashv = _src_hh->hashv; \ - _dst_hh->prev = _last_elt; \ - _dst_hh->next = NULL; \ - if (_last_elt_hh != NULL) { _last_elt_hh->next = _elt; } \ - if (dst == NULL) { \ - DECLTYPE_ASSIGN(dst,_elt); \ - HASH_MAKE_TABLE(hh_dst,dst); \ - } else { \ - _dst_hh->tbl = (dst)->hh_dst.tbl; \ - } \ - HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ - HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \ - (dst)->hh_dst.tbl->num_items++; \ - _last_elt = _elt; \ - _last_elt_hh = _dst_hh; \ - } \ - } \ - } \ - } \ - HASH_FSCK(hh_dst,dst); \ -} while (0) - -#define HASH_CLEAR(hh,head) \ -do { \ - if (head != NULL) { \ - uthash_free((head)->hh.tbl->buckets, \ - (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ - HASH_BLOOM_FREE((head)->hh.tbl); \ - uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ - (head)=NULL; \ - } \ -} while(0) - -#define HASH_OVERHEAD(hh,head) \ - ((head != NULL) ? ( \ - (size_t)(((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \ - ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \ - sizeof(UT_hash_table) + \ - (HASH_BLOOM_BYTELEN))) : 0U) - -#ifdef NO_DECLTYPE -#define HASH_ITER(hh,head,el,tmp) \ -for(((el)=(head)), ((*(char**)(&(tmp)))=(char*)((head!=NULL)?(head)->hh.next:NULL)); \ - (el) != NULL; ((el)=(tmp)), ((*(char**)(&(tmp)))=(char*)((tmp!=NULL)?(tmp)->hh.next:NULL))) -#else -#define HASH_ITER(hh,head,el,tmp) \ -for(((el)=(head)), ((tmp)=DECLTYPE(el)((head!=NULL)?(head)->hh.next:NULL)); \ - (el) != NULL; ((el)=(tmp)), ((tmp)=DECLTYPE(el)((tmp!=NULL)?(tmp)->hh.next:NULL))) -#endif - -/* obtain a count of items in the hash */ -#define HASH_COUNT(head) HASH_CNT(hh,head) -#define HASH_CNT(hh,head) ((head != NULL)?((head)->hh.tbl->num_items):0U) - -typedef struct UT_hash_bucket { - struct UT_hash_handle *hh_head; - unsigned count; - - /* expand_mult is normally set to 0. In this situation, the max chain length - * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If - * the bucket's chain exceeds this length, bucket expansion is triggered). - * However, setting expand_mult to a non-zero value delays bucket expansion - * (that would be triggered by additions to this particular bucket) - * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. - * (The multiplier is simply expand_mult+1). The whole idea of this - * multiplier is to reduce bucket expansions, since they are expensive, in - * situations where we know that a particular bucket tends to be overused. - * It is better to let its chain length grow to a longer yet-still-bounded - * value, than to do an O(n) bucket expansion too often. - */ - unsigned expand_mult; - -} UT_hash_bucket; - -/* random signature used only to find hash tables in external analysis */ -#define HASH_SIGNATURE 0xa0111fe1u -#define HASH_BLOOM_SIGNATURE 0xb12220f2u - -typedef struct UT_hash_table { - UT_hash_bucket *buckets; - unsigned num_buckets, log2_num_buckets; - unsigned num_items; - struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ - ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ - - /* in an ideal situation (all buckets used equally), no bucket would have - * more than ceil(#items/#buckets) items. that's the ideal chain length. */ - unsigned ideal_chain_maxlen; - - /* nonideal_items is the number of items in the hash whose chain position - * exceeds the ideal chain maxlen. these items pay the penalty for an uneven - * hash distribution; reaching them in a chain traversal takes >ideal steps */ - unsigned nonideal_items; - - /* ineffective expands occur when a bucket doubling was performed, but - * afterward, more than half the items in the hash had nonideal chain - * positions. If this happens on two consecutive expansions we inhibit any - * further expansion, as it's not helping; this happens when the hash - * function isn't a good fit for the key domain. When expansion is inhibited - * the hash will still work, albeit no longer in constant time. */ - unsigned ineff_expands, noexpand; - - uint32_t signature; /* used only to find hash tables in external analysis */ -#ifdef HASH_BLOOM - uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ - uint8_t *bloom_bv; - uint8_t bloom_nbits; -#endif - -} UT_hash_table; - -typedef struct UT_hash_handle { - struct UT_hash_table *tbl; - void *prev; /* prev element in app order */ - void *next; /* next element in app order */ - struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ - struct UT_hash_handle *hh_next; /* next hh in bucket order */ - void *key; /* ptr to enclosing struct's key */ - unsigned keylen; /* enclosing struct's key len */ - unsigned hashv; /* result of hash-fcn(key) */ -} UT_hash_handle; - -#endif /* UTHASH_H */ diff -Nru hwloc-2.9.2/include/netloc.h hwloc-2.10.0/include/netloc.h --- hwloc-2.9.2/include/netloc.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/netloc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - * Copyright © 2013-2014 Cisco Systems, Inc. All rights reserved. - * Copyright © 2013-2014 University of Wisconsin-La Crosse. - * All rights reserved. - * Copyright © 2015-2016 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#ifndef _NETLOC_H_ -#define _NETLOC_H_ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE // for asprintf -#endif - -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup netloc_api Netloc API - * @{ - */ -/** - * Return codes - */ -enum { - NETLOC_SUCCESS = 0, /**< Success */ - NETLOC_ERROR = -1, /**< Error: General condition */ - NETLOC_ERROR_NOTDIR = -2, /**< Error: URI is not a directory */ - NETLOC_ERROR_NOENT = -3, /**< Error: URI is invalid, no such entry */ - NETLOC_ERROR_EMPTY = -4, /**< Error: No networks found */ - NETLOC_ERROR_MULTIPLE = -5, /**< Error: Multiple matching networks found */ - NETLOC_ERROR_NOT_IMPL = -6, /**< Error: Interface not implemented */ - NETLOC_ERROR_EXISTS = -7, /**< Error: If the entry already exists when trying to add to a lookup table */ - NETLOC_ERROR_NOT_FOUND = -8, /**< Error: No path found */ - NETLOC_ERROR_MAX = -9 /**< Error: Enum upper bound marker. No errors less than this number Will not be returned externally. */ -}; - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** @} */ - -#endif // _NETLOC_H_ diff -Nru hwloc-2.9.2/include/netlocscotch.h hwloc-2.10.0/include/netlocscotch.h --- hwloc-2.9.2/include/netlocscotch.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/netlocscotch.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -/* - * Copyright © 2016 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#ifndef _NETLOCSCOTCH_H_ -#define _NETLOCSCOTCH_H_ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE // for asprintf -#endif - -#include -#include - -/* Includes for Scotch */ -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * A structure to represent process mapping - */ -typedef struct { - int rank; /**< Rank of the process */ - char *nodename; /**< Name of the node */ - int core; /**< Physical slot number of the core */ -} netlocscotch_core_t; - -/** - * \brief Build the Scotch architecture representing the all machine - * - * \param arch Pointer to the Scotch arch that will be built. - * - * \returns 0 on success - * \returns NETLOC_ERROR on error - */ -int netlocscotch_build_global_arch(SCOTCH_Arch *arch); - -/** - * \brief Build the Scotch architecture representing the available resources - * - * This function reads the file about available resources, found by reading the - * environment variable NETLOC_CURRENTSLOTS. The file must be generated before - * calling the program running this functions with: mpirun -np - * netloc_mpi_find_hosts - * The complete architecture is needed since the sub architecture use data from it. - * - * \param arch Pointer to the Scotch arch that will be built. - * \param subarch Pointer to the Scotch sub arch that will be built. - * - * \returns 0 on success - * \returns NETLOC_ERROR on error - */ -int netlocscotch_build_current_arch(SCOTCH_Arch *arch, SCOTCH_Arch *subarch); - -/** - * \brief Give a good mapping with Scotch from a file containing a - * communication matrix - * - * This function reads the file about available resources, found by reading the - * environment variable NETLOC_CURRENTSLOTS. The file must be generated before - * calling the program running this functions with: mpirun -np - * netloc_mpi_find_hosts - * - * An application graph is built from the communication matrix and is mapped to - * the architecture graph built from the resource file. - * - * \param[in] filename Filename of the matrix file, where the matrix is stored line - * by line with spaces between values. - * - * \param[out] pnum_processes Pointer to the integer where th number of processes - * will be written. - * - * \param[out] pcores Array of pnum_processes elements. - * - * \returns 0 on succes - * \returns NETLOC_ERROR on error - */ -int netlocscotch_get_mapping_from_comm_file(char *filename, int *pnum_processes, - netlocscotch_core_t **pcores); - -/** - * \brief Give a good mapping with Scotch from a communication matrix - * - * This function reads the file about available resources, found by reading the - * environment variable NETLOC_CURRENTSLOTS. The file must be generated before - * calling the program running this functions with: mpirun -np - * netloc_mpi_find_hosts - * - * An application graph is built from the communication matrix and is mapped to - * the architecture graph built from the resource file. - * - * \param[in] comm pointer to the lines of the matrix of communications. - * - * \param[in] num_vertices number of processes, that corresponds to the size of - * the matrix. - * - * \param[out] pcores Array of num_vertices elements. - * - * \returns 0 on success - * \returns NETLOC_ERROR on error - */ -int netlocscotch_get_mapping_from_comm_matrix(double **comm, int num_vertices, - netlocscotch_core_t **pcores); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** @} */ - -#endif // _NETLOC_H_ diff -Nru hwloc-2.9.2/include/private/autogen/config.h.in hwloc-2.10.0/include/private/autogen/config.h.in --- hwloc-2.9.2/include/private/autogen/config.h.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/private/autogen/config.h.in 2023-12-05 12:32:19.000000000 +0000 @@ -282,9 +282,6 @@ /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP -/* Define to 1 if you have the header file. */ -#undef HAVE_MPI_H - /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO @@ -461,9 +458,6 @@ /* 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 @@ -690,6 +684,9 @@ /* Define to 1 if zeDevicePciGetPropertiesExt is available */ #undef HWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT +/* Define to 1 if zesInit is available */ +#undef HWLOC_HAVE_ZESINIT + /* Define to 1 on HP-UX */ #undef HWLOC_HPUX_SYS @@ -775,9 +772,6 @@ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR -/* Define to 1 if scotch is netlocscotch is enabled */ -#undef NETLOC_SCOTCH - /* Name of package */ #undef PACKAGE diff -Nru hwloc-2.9.2/include/private/netloc.h hwloc-2.10.0/include/private/netloc.h --- hwloc-2.9.2/include/private/netloc.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/private/netloc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,578 +0,0 @@ -/* - * Copyright © 2014 Cisco Systems, Inc. All rights reserved. - * Copyright © 2013-2014 University of Wisconsin-La Crosse. - * All rights reserved. - * Copyright © 2015-2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#ifndef _NETLOC_PRIVATE_H_ -#define _NETLOC_PRIVATE_H_ - -#include -#include -#include -#include -#include - -#define NETLOCFILE_VERSION 1 - -#ifdef NETLOC_SCOTCH -#include -#include -#define NETLOC_int SCOTCH_Num -#else -#define NETLOC_int int -#endif - -/* - * "Import" a few things from hwloc - */ -#define __netloc_attribute_unused __hwloc_attribute_unused -#define __netloc_attribute_malloc __hwloc_attribute_malloc -#define __netloc_attribute_const __hwloc_attribute_const -#define __netloc_attribute_pure __hwloc_attribute_pure -#define __netloc_attribute_deprecated __hwloc_attribute_deprecated -#define __netloc_attribute_may_alias __hwloc_attribute_may_alias -#define NETLOC_DECLSPEC HWLOC_DECLSPEC - - -/********************************************************************** - * Types - **********************************************************************/ - -/** - * Definitions for Comparators - * \sa These are the return values from the following functions: - * netloc_network_compare, netloc_dt_edge_t_compare, netloc_dt_node_t_compare - */ -typedef enum { - NETLOC_CMP_SAME = 0, /**< Compared as the Same */ - NETLOC_CMP_SIMILAR = -1, /**< Compared as Similar, but not the Same */ - NETLOC_CMP_DIFF = -2 /**< Compared as Different */ -} netloc_compare_type_t; - -/** - * Enumerated type for the various types of supported networks - */ -typedef enum { - NETLOC_NETWORK_TYPE_ETHERNET = 1, /**< Ethernet network */ - NETLOC_NETWORK_TYPE_INFINIBAND = 2, /**< InfiniBand network */ - NETLOC_NETWORK_TYPE_INVALID = 3 /**< Invalid network */ -} netloc_network_type_t; - -/** - * Enumerated type for the various types of supported topologies - */ -typedef enum { - NETLOC_TOPOLOGY_TYPE_INVALID = -1, /**< Invalid */ - NETLOC_TOPOLOGY_TYPE_TREE = 1, /**< Tree */ -} netloc_topology_type_t; - -/** - * Enumerated type for the various types of nodes - */ -typedef enum { - NETLOC_NODE_TYPE_HOST = 0, /**< Host (a.k.a., network addressable endpoint - e.g., MAC Address) node */ - NETLOC_NODE_TYPE_SWITCH = 1, /**< Switch node */ - NETLOC_NODE_TYPE_INVALID = 2 /**< Invalid node */ -} netloc_node_type_t; - -typedef enum { - NETLOC_ARCH_TREE = 0, /* Fat tree */ -} netloc_arch_type_t; - - -/* Pre declarations to avoid inter dependency problems */ -/** \cond IGNORE */ -struct netloc_topology_t; -typedef struct netloc_topology_t netloc_topology_t; -struct netloc_node_t; -typedef struct netloc_node_t netloc_node_t; -struct netloc_edge_t; -typedef struct netloc_edge_t netloc_edge_t; -struct netloc_physical_link_t; -typedef struct netloc_physical_link_t netloc_physical_link_t; -struct netloc_path_t; -typedef struct netloc_path_t netloc_path_t; - -struct netloc_arch_tree_t; -typedef struct netloc_arch_tree_t netloc_arch_tree_t; -struct netloc_arch_node_t; -typedef struct netloc_arch_node_t netloc_arch_node_t; -struct netloc_arch_node_slot_t; -typedef struct netloc_arch_node_slot_t netloc_arch_node_slot_t; -struct netloc_arch_t; -typedef struct netloc_arch_t netloc_arch_t; -/** \endcond */ - -/** - * \struct netloc_topology_t - * \brief Netloc Topology Context - * - * An opaque data structure used to reference a network topology. - * - * \note Must be initialized with \ref netloc_topology_construct() - */ -struct netloc_topology_t { - /** Topology path */ - char *topopath; - /** Subnet ID */ - char *subnet_id; - - /** Node List */ - netloc_node_t *nodes; /* Hash table of nodes by physical_id */ - netloc_node_t *nodesByHostname; /* Hash table of nodes by hostname */ - - netloc_physical_link_t *physical_links; /* Hash table with physcial links */ - - /** Partition List */ - UT_array *partitions; - - /** Hwloc topology List */ - char *hwlocpath; - UT_array *topos; - hwloc_topology_t *hwloc_topos; - - /** Type of the graph */ - netloc_topology_type_t type; -}; - -/** - * \brief Netloc Node Type - * - * Represents the concept of a node (a.k.a., vertex, endpoint) within a network - * graph. This could be a server or a network switch. The \ref node_type parameter - * will distinguish the exact type of node this represents in the graph. - */ -struct netloc_node_t { - UT_hash_handle hh; /* makes this structure hashable with physical_id */ - UT_hash_handle hh2; /* makes this structure hashable with hostname */ - - /** Physical ID of the node */ - char physical_id[20]; - - /** Logical ID of the node (if any) */ - int logical_id; - - /** Type of the node */ - netloc_node_type_t type; - - /* Pointer to physical_links */ - UT_array *physical_links; - - /** Description information from discovery (if any) */ - char *description; - - /** - * Application-given private data pointer. - * Initialized to NULL, and not used by the netloc library. - */ - void * userdata; - - /** Outgoing edges from this node */ - netloc_edge_t *edges; - - UT_array *subnodes; /* the group of nodes for the virtual nodes */ - - netloc_path_t *paths; - - char *hostname; - - UT_array *partitions; /* index in the list from the topology */ - - hwloc_topology_t hwlocTopo; - int hwlocTopoIdx; -}; - -/** - * \brief Netloc Edge Type - * - * Represents the concept of a directed edge within a network graph. - * - * \note We do not point to the netloc_node_t structure directly to - * simplify the representation, and allow the information to more easily - * be entered into the data store without circular references. - * \todo JJH Is the note above still true? - */ -struct netloc_edge_t { - UT_hash_handle hh; /* makes this structure hashable */ - - netloc_node_t *dest; - - int id; - - /** Pointers to the parent node */ - netloc_node_t *node; - - /* Pointer to physical_links */ - UT_array *physical_links; - - /** total gbits of the links */ - float total_gbits; - - UT_array *partitions; /* index in the list from the topology */ - - UT_array *subnode_edges; /* for edges going to virtual nodes */ - - struct netloc_edge_t *other_way; - - /** - * Application-given private data pointer. - * Initialized to NULL, and not used by the netloc library. - */ - void * userdata; -}; - - -struct netloc_physical_link_t { - UT_hash_handle hh; /* makes this structure hashable */ - - int id; // TODO long long - netloc_node_t *src; - netloc_node_t *dest; - int ports[2]; - char *width; - char *speed; - - netloc_edge_t *edge; - - int other_way_id; - struct netloc_physical_link_t *other_way; - - UT_array *partitions; /* index in the list from the topology */ - - /** gbits of the link from speed and width */ - float gbits; - - /** Description information from discovery (if any) */ - char *description; -}; - -struct netloc_path_t { - UT_hash_handle hh; /* makes this structure hashable */ - char dest_id[20]; - UT_array *links; -}; - - -/********************************************************************** - * Architecture structures - **********************************************************************/ -struct netloc_arch_tree_t { - NETLOC_int num_levels; - NETLOC_int *degrees; - NETLOC_int *cost; -}; - -struct netloc_arch_node_t { - UT_hash_handle hh; /* makes this structure hashable */ - char *name; /* Hash key */ - netloc_node_t *node; /* Corresponding node */ - int idx_in_topo; /* idx with ghost hosts to have complete topo */ - int num_slots; /* it is not the real number of slots but the maximum slot idx */ - int *slot_idx; /* corresponding idx in slot_tree */ - int *slot_os_idx; /* corresponding os index for each leaf in tree */ - netloc_arch_tree_t *slot_tree; /* Tree built from hwloc */ - int num_current_slots; /* Number of PUs */ - NETLOC_int *current_slots; /* indices in the complete tree */ - int *slot_ranks; /* corresponding MPI rank for each leaf in tree */ -}; - -struct netloc_arch_node_slot_t { - netloc_arch_node_t *node; - int slot; -}; - -struct netloc_arch_t { - netloc_topology_t *topology; - int has_slots; /* if slots are included in the architecture */ - netloc_arch_type_t type; - union { - netloc_arch_tree_t *node_tree; - netloc_arch_tree_t *global_tree; - } arch; - netloc_arch_node_t *nodes_by_name; - netloc_arch_node_slot_t *node_slot_by_idx; /* node_slot by index in complete topo */ - NETLOC_int num_current_hosts; /* if has_slots, host is a slot, else host is a node */ - NETLOC_int *current_hosts; /* indices in the complete topology */ -}; - -/********************************************************************** - * Topology Functions - **********************************************************************/ -/** - * Allocate a topology handle. - * - * User is responsible for calling \ref netloc_detach on the topology handle. - * The network parameter information is deep copied into the topology handle, so the - * user may destruct the network handle after calling this function and/or reuse - * the network handle. - * - * \returns NETLOC_SUCCESS on success - * \returns NETLOC_ERROR upon an error. - */ -netloc_topology_t *netloc_topology_construct(char *path); - -/** - * Destruct a topology handle - * - * \param topology A valid pointer to a \ref netloc_topology_t handle created - * from a prior call to \ref netloc_topology_construct. - * - * \returns NETLOC_SUCCESS on success - * \returns NETLOC_ERROR upon an error. - */ -int netloc_topology_destruct(netloc_topology_t *topology); - -int netloc_topology_find_partition_idx(netloc_topology_t *topology, char *partition_name); - -int netloc_topology_read_hwloc(netloc_topology_t *topology, int num_nodes, - netloc_node_t **node_list); - -#define netloc_topology_iter_partitions(topology,partition) \ - for ((partition) = (char **)utarray_front(topology->partitions); \ - (partition) != NULL; \ - (partition) = (char **)utarray_next(topology->partitions, partition)) - -#define netloc_topology_iter_hwloctopos(topology,hwloctopo) \ - for ((hwloctopo) = (char **)utarray_front(topology->topos); \ - (hwloctopo) != NULL; \ - (hwloctopo) = (char **)utarray_next(topology->topos, hwloctopo)) - -#define netloc_topology_find_node(topology,node_id,node) \ - HASH_FIND_STR(topology->nodes, node_id, node) - -#define netloc_topology_iter_nodes(topology,node,_tmp) \ - HASH_ITER(hh, topology->nodes, node, _tmp) - -#define netloc_topology_num_nodes(topology) \ - HASH_COUNT(topology->nodes) - -/*************************************************/ - - -/** - * Constructor for netloc_node_t - * - * User is responsible for calling the destructor on the handle. - * - * Returns - * A newly allocated pointer to the network information. - */ -netloc_node_t *netloc_node_construct(void); - -/** - * Destructor for netloc_node_t - * - * \param node A valid node handle - * - * Returns - * NETLOC_SUCCESS on success - * NETLOC_ERROR on error - */ -int netloc_node_destruct(netloc_node_t *node); - -char *netloc_node_pretty_print(netloc_node_t* node); - -#define netloc_node_get_num_subnodes(node) \ - utarray_len((node)->subnodes) - -#define netloc_node_get_subnode(node,i) \ - (*(netloc_node_t **)utarray_eltptr((node)->subnodes, (i))) - -#define netloc_node_get_num_edges(node) \ - utarray_len((node)->edges) - -#define netloc_node_get_edge(node,i) \ - (*(netloc_edge_t **)utarray_eltptr((node)->edges, (i))) - -#define netloc_node_iter_edges(node,edge,_tmp) \ - HASH_ITER(hh, node->edges, edge, _tmp) - -#define netloc_node_iter_paths(node,path,_tmp) \ - HASH_ITER(hh, node->paths, path, _tmp) - -#define netloc_node_is_host(node) \ - (node->type == NETLOC_NODE_TYPE_HOST) - -#define netloc_node_is_switch(node) \ - (node->type == NETLOC_NODE_TYPE_SWITCH) - -#define netloc_node_iter_paths(node, path,_tmp) \ - HASH_ITER(hh, node->paths, path, _tmp) - -int netloc_node_is_in_partition(netloc_node_t *node, int partition); - -/*************************************************/ - - -/** - * Constructor for netloc_edge_t - * - * User is responsible for calling the destructor on the handle. - * - * Returns - * A newly allocated pointer to the edge information. - */ -netloc_edge_t *netloc_edge_construct(void); - -/** - * Destructor for netloc_edge_t - * - * \param edge A valid edge handle - * - * Returns - * NETLOC_SUCCESS on success - * NETLOC_ERROR on error - */ -int netloc_edge_destruct(netloc_edge_t *edge); - -char * netloc_edge_pretty_print(netloc_edge_t* edge); - -void netloc_edge_reset_uid(void); - -int netloc_edge_is_in_partition(netloc_edge_t *edge, int partition); - -#define netloc_edge_get_num_links(edge) \ - utarray_len((edge)->physical_links) - -#define netloc_edge_get_link(edge,i) \ - (*(netloc_physical_link_t **)utarray_eltptr((edge)->physical_links, (i))) - -#define netloc_edge_get_num_subedges(edge) \ - utarray_len((edge)->subnode_edges) - -#define netloc_edge_get_subedge(edge,i) \ - (*(netloc_edge_t **)utarray_eltptr((edge)->subnode_edges, (i))) - -/*************************************************/ - - -/** - * Constructor for netloc_physical_link_t - * - * User is responsible for calling the destructor on the handle. - * - * Returns - * A newly allocated pointer to the physical link information. - */ -netloc_physical_link_t * netloc_physical_link_construct(void); - -/** - * Destructor for netloc_physical_link_t - * - * Returns - * NETLOC_SUCCESS on success - * NETLOC_ERROR on error - */ -int netloc_physical_link_destruct(netloc_physical_link_t *link); - -char * netloc_link_pretty_print(netloc_physical_link_t* link); - -/*************************************************/ - - -netloc_path_t *netloc_path_construct(void); -int netloc_path_destruct(netloc_path_t *path); - - -/********************************************************************** - * Architecture functions - **********************************************************************/ - -netloc_arch_t * netloc_arch_construct(void); - -int netloc_arch_destruct(netloc_arch_t *arch); - -int netloc_arch_build(netloc_arch_t *arch, int add_slots); - -int netloc_arch_set_current_resources(netloc_arch_t *arch); - -int netloc_arch_set_global_resources(netloc_arch_t *arch); - -int netloc_arch_node_get_hwloc_info(netloc_arch_node_t *arch); - -void netloc_arch_tree_complete(netloc_arch_tree_t *tree, UT_array **down_degrees_by_level, - int num_hosts, int **parch_idx); - -NETLOC_int netloc_arch_tree_num_leaves(netloc_arch_tree_t *tree); - - -/********************************************************************** - * Access functions of various elements of the topology - **********************************************************************/ - -#define netloc_get_num_partitions(object) \ - utarray_len((object)->partitions) - -#define netloc_get_partition(object,i) \ - (*(int *)utarray_eltptr((object)->partitions, (i))) - - -#define netloc_path_iter_links(path,link) \ - for ((link) = (netloc_physical_link_t **)utarray_front(path->links); \ - (link) != NULL; \ - (link) = (netloc_physical_link_t **)utarray_next(path->links, link)) - -/********************************************************************** - * Misc functions - **********************************************************************/ - -/** - * Decode the network type - * - * \param net_type A valid member of the \ref netloc_network_type_t type - * - * \returns NULL if the type is invalid - * \returns A string for that \ref netloc_network_type_t type - */ -static inline const char * netloc_network_type_decode(netloc_network_type_t net_type) { - if( NETLOC_NETWORK_TYPE_ETHERNET == net_type ) { - return "ETH"; - } - else if( NETLOC_NETWORK_TYPE_INFINIBAND == net_type ) { - return "IB"; - } - else { - return NULL; - } -} - -/** - * Decode the node type - * - * \param node_type A valid member of the \ref netloc_node_type_t type - * - * \returns NULL if the type is invalid - * \returns A string for that \ref netloc_node_type_t type - */ -static inline const char * netloc_node_type_decode(netloc_node_type_t node_type) { - if( NETLOC_NODE_TYPE_SWITCH == node_type ) { - return "SW"; - } - else if( NETLOC_NODE_TYPE_HOST == node_type ) { - return "CA"; - } - else { - return NULL; - } -} - -ssize_t netloc_line_get(char **lineptr, size_t *n, FILE *stream); - -char *netloc_line_get_next_token(char **string, char c); - -int netloc_build_comm_mat(char *filename, int *pn, double ***pmat); - -#define STRDUP_IF_NOT_NULL(str) (NULL == str ? NULL : strdup(str)) -#define STR_EMPTY_IF_NULL(str) (NULL == str ? "" : str) - - -#endif // _NETLOC_PRIVATE_H_ diff -Nru hwloc-2.9.2/include/private/private.h hwloc-2.10.0/include/private/private.h --- hwloc-2.9.2/include/private/private.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/private/private.h 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2022 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2012, 2020 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * @@ -245,6 +245,12 @@ * temporary variables during discovery */ + /* set to 1 at the beginning of load() if the filter of any cpu cache type (L1 to L3i) is not NONE, + * may be checked by backends before querying caches + * (when they don't know the level of caches they are querying). + */ + int want_some_cpu_caches; + /* machine-wide memory. * temporarily stored there by OSes that only provide this without NUMA information, * and actually used later by the core. @@ -420,7 +426,7 @@ extern void hwloc_internal_memattrs_refresh(hwloc_topology_t topology); extern int hwloc_internal_memattrs_dup(hwloc_topology_t new, hwloc_topology_t old); extern int hwloc_internal_memattr_set_value(hwloc_topology_t topology, hwloc_memattr_id_t id, hwloc_obj_type_t target_type, hwloc_uint64_t target_gp_index, unsigned target_os_index, struct hwloc_internal_location_s *initiator, hwloc_uint64_t value); -extern int hwloc_internal_memattrs_guess_memory_tiers(hwloc_topology_t topology); +extern int hwloc_internal_memattrs_guess_memory_tiers(hwloc_topology_t topology, int force_subtype); extern void hwloc_internal_cpukinds_init(hwloc_topology_t topology); extern int hwloc_internal_cpukinds_rank(hwloc_topology_t topology); @@ -477,6 +483,7 @@ #define HWLOC_GROUP_KIND_INTEL_DIE 104 /* no subkind */ #define HWLOC_GROUP_KIND_S390_BOOK 110 /* subkind 0 is book, subkind 1 is drawer (group of books) */ #define HWLOC_GROUP_KIND_AMD_COMPUTE_UNIT 120 /* no subkind */ +#define HWLOC_GROUP_KIND_AMD_COMPLEX 121 /* no subkind */ /* then, OS-specific groups */ #define HWLOC_GROUP_KIND_SOLARIS_PG_HW_PERF 200 /* subkind is group width */ #define HWLOC_GROUP_KIND_AIX_SDL_UNKNOWN 210 /* subkind is SDL level */ diff -Nru hwloc-2.9.2/include/private/xml.h hwloc-2.10.0/include/private/xml.h --- hwloc-2.9.2/include/private/xml.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/include/private/xml.h 2023-12-05 12:32:19.000000000 +0000 @@ -19,13 +19,14 @@ typedef struct hwloc__xml_import_state_s { struct hwloc__xml_import_state_s *parent; - /* globals shared because the entire stack of states during import */ + /* globals shared between the entire stack of states during import */ struct hwloc_xml_backend_data_s *global; /* opaque data used to store backend-specific data. * statically allocated to allow stack-allocation by the common code without knowing actual backend needs. + * libxml is 3 ptrs. nolibxml is 3 ptr + one int. */ - char data[32]; + char data[4 * SIZEOF_VOID_P]; } * hwloc__xml_import_state_t; struct hwloc__xml_imported_v1distances_s { @@ -74,8 +75,9 @@ /* opaque data used to store backend-specific data. * statically allocated to allow stack-allocation by the common code without knowing actual backend needs. + * libxml is 1 ptr. nolibxml is 1 ptr + 2 size_t + 3 ints. */ - char data[40]; + char data[6 * SIZEOF_VOID_P]; } * hwloc__xml_export_state_t; HWLOC_DECLSPEC void hwloc__xml_export_topology(hwloc__xml_export_state_t parentstate, hwloc_topology_t topology, unsigned long flags); diff -Nru hwloc-2.9.2/netloc/Makefile.am hwloc-2.10.0/netloc/Makefile.am --- hwloc-2.9.2/netloc/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -# Copyright © 2014 Cisco Systems, Inc. All rights reserved. -# Copyright © 2014 University of Wisconsin-La Crosse. -# All rights reserved. -# -# Copyright © 2016-2018 Inria. All rights reserved. -# See COPYING in top-level directory. -# -# $HEADER$ -# - -AM_CPPFLAGS = \ - $(NETLOC_CPPFLAGS) \ - $(HWLOC_CPPFLAGS) - -# If we're in standalone mode, build the installable library. -# Otherwise, build the embedded library. - -if HWLOC_BUILD_STANDALONE -lib_LTLIBRARIES = libnetloc.la -else -noinst_LTLIBRARIES = libnetloc_embedded.la -endif - -sources = \ - support.c \ - topology.c \ - edge.c \ - node.c \ - physical_link.c \ - path.c \ - architecture.c \ - hwloc.c \ - mpicomm.c - - -# Installable library - -libnetloc_la_SOURCES = $(sources) -libnetloc_la_LDFLAGS = $(ldflags) -version-info $(libnetloc_so_version) -libnetloc_la_LIBADD = \ - $(top_builddir)/hwloc/libhwloc.la - -# Embedded library (note the lack of a .so version number -- that -# intentionally only appears in the installable library). Also note -# the lack of _LDFLAGS -- all libs are added by the upper layer (via -# HWLOC_EMBEDDED_LIBS). - -libnetloc_embedded_la_SOURCES = $(sources) -libnetloc_embedded_la_LDFLAGS = $(ldflags) -libnetloc_embedded_la_LIBADD = \ - $(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la - -scotchsources = \ - scotch.c - -if BUILD_NETLOCSCOTCH -# If we're in standalone mode, build the installable library. -# Otherwise, build the embedded library. - -if HWLOC_BUILD_STANDALONE -lib_LTLIBRARIES += libnetlocscotch.la -else -noinst_LTLIBRARIES += libnetlocscotch_embedded.la -endif - -# Installable library - -libnetlocscotch_la_SOURCES = $(scotchsources) -libnetlocscotch_la_LDFLAGS = -version-info $(libnetloc_so_version) -libnetlocscotch_la_LIBADD = \ - $(top_builddir)/hwloc/libhwloc.la \ - libnetloc.la - -# Embedded library (note the lack of a .so version number -- that -# intentionally only appears in the installable library). Also note -# the lack of _LDFLAGS -- all libs are added by the upper layer (via -# HWLOC_EMBEDDED_LIBS). - -libnetlocscotch_embedded_la_SOURCES = $(scotchsources) -libnetlocscotch_embedded_la_LDFLAGS = -libnetlocscotch_embedded_la_LIBADD = \ - $(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la \ - $(HWLOC_top_builddir)/hwloc/libnetloc_embedded.la - -else !BUILD_NETLOCSCOTCH -EXTRA_DIST = $(scotchsources) -endif !BUILD_NETLOCSCOTCH diff -Nru hwloc-2.9.2/netloc/Makefile.in hwloc-2.10.0/netloc/Makefile.in --- hwloc-2.9.2/netloc/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,953 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright © 2014 Cisco Systems, Inc. All rights reserved. -# Copyright © 2014 University of Wisconsin-La Crosse. -# All rights reserved. -# -# Copyright © 2016-2018 Inria. All rights reserved. -# See COPYING in top-level directory. -# -# $HEADER$ -# - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ - -# If we're in standalone mode, build the installable library. -# Otherwise, build the embedded library. -@BUILD_NETLOCSCOTCH_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@am__append_1 = libnetlocscotch.la -@BUILD_NETLOCSCOTCH_TRUE@@HWLOC_BUILD_STANDALONE_FALSE@am__append_2 = libnetlocscotch_embedded.la -subdir = netloc -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ - $(top_srcdir)/config/hwloc_check_attributes.m4 \ - $(top_srcdir)/config/hwloc_check_vendor.m4 \ - $(top_srcdir)/config/hwloc_check_visibility.m4 \ - $(top_srcdir)/config/hwloc_components.m4 \ - $(top_srcdir)/config/hwloc_internal.m4 \ - $(top_srcdir)/config/hwloc_pkg.m4 \ - $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ - $(top_builddir)/include/hwloc/autogen/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) -libnetloc_la_DEPENDENCIES = $(top_builddir)/hwloc/libhwloc.la -am__objects_1 = support.lo topology.lo edge.lo node.lo \ - physical_link.lo path.lo architecture.lo hwloc.lo mpicomm.lo -am_libnetloc_la_OBJECTS = $(am__objects_1) -libnetloc_la_OBJECTS = $(am_libnetloc_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libnetloc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libnetloc_la_LDFLAGS) $(LDFLAGS) -o $@ -@HWLOC_BUILD_STANDALONE_TRUE@am_libnetloc_la_rpath = -rpath $(libdir) -libnetloc_embedded_la_DEPENDENCIES = \ - $(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la -am_libnetloc_embedded_la_OBJECTS = $(am__objects_1) -libnetloc_embedded_la_OBJECTS = $(am_libnetloc_embedded_la_OBJECTS) -libnetloc_embedded_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(libnetloc_embedded_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -@HWLOC_BUILD_STANDALONE_FALSE@am_libnetloc_embedded_la_rpath = -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_la_DEPENDENCIES = \ -@BUILD_NETLOCSCOTCH_TRUE@ $(top_builddir)/hwloc/libhwloc.la \ -@BUILD_NETLOCSCOTCH_TRUE@ libnetloc.la -am__libnetlocscotch_la_SOURCES_DIST = scotch.c -am__objects_2 = scotch.lo -@BUILD_NETLOCSCOTCH_TRUE@am_libnetlocscotch_la_OBJECTS = \ -@BUILD_NETLOCSCOTCH_TRUE@ $(am__objects_2) -libnetlocscotch_la_OBJECTS = $(am_libnetlocscotch_la_OBJECTS) -libnetlocscotch_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(libnetlocscotch_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -@BUILD_NETLOCSCOTCH_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@am_libnetlocscotch_la_rpath = \ -@BUILD_NETLOCSCOTCH_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@ -rpath \ -@BUILD_NETLOCSCOTCH_TRUE@@HWLOC_BUILD_STANDALONE_TRUE@ $(libdir) -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_embedded_la_DEPENDENCIES = $(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la \ -@BUILD_NETLOCSCOTCH_TRUE@ $(HWLOC_top_builddir)/hwloc/libnetloc_embedded.la -am__libnetlocscotch_embedded_la_SOURCES_DIST = scotch.c -@BUILD_NETLOCSCOTCH_TRUE@am_libnetlocscotch_embedded_la_OBJECTS = \ -@BUILD_NETLOCSCOTCH_TRUE@ $(am__objects_2) -libnetlocscotch_embedded_la_OBJECTS = \ - $(am_libnetlocscotch_embedded_la_OBJECTS) -libnetlocscotch_embedded_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(libnetlocscotch_embedded_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -@BUILD_NETLOCSCOTCH_TRUE@@HWLOC_BUILD_STANDALONE_FALSE@am_libnetlocscotch_embedded_la_rpath = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/private/autogen -I$(top_builddir)/include/hwloc/autogen -depcomp = $(SHELL) $(top_srcdir)/./config/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/architecture.Plo \ - ./$(DEPDIR)/edge.Plo ./$(DEPDIR)/hwloc.Plo \ - ./$(DEPDIR)/mpicomm.Plo ./$(DEPDIR)/node.Plo \ - ./$(DEPDIR)/path.Plo ./$(DEPDIR)/physical_link.Plo \ - ./$(DEPDIR)/scotch.Plo ./$(DEPDIR)/support.Plo \ - ./$(DEPDIR)/topology.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libnetloc_la_SOURCES) $(libnetloc_embedded_la_SOURCES) \ - $(libnetlocscotch_la_SOURCES) \ - $(libnetlocscotch_embedded_la_SOURCES) -DIST_SOURCES = $(libnetloc_la_SOURCES) \ - $(libnetloc_embedded_la_SOURCES) \ - $(am__libnetlocscotch_la_SOURCES_DIST) \ - $(am__libnetlocscotch_embedded_la_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/./config/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BUNZIPP = @BUNZIPP@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CONFIGURE_DEPENDENCIES = @CONFIGURE_DEPENDENCIES@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CUDA_VERSION = @CUDA_VERSION@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIFF = @DIFF@ -DLLTOOL = @DLLTOOL@ -DOXYGEN = @DOXYGEN@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EPSTOPDF = @EPSTOPDF@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FIG2DEV = @FIG2DEV@ -FILECMD = @FILECMD@ -GREP = @GREP@ -GS = @GS@ -HWLOC_CAIRO_CFLAGS = @HWLOC_CAIRO_CFLAGS@ -HWLOC_CAIRO_LIBS = @HWLOC_CAIRO_LIBS@ -HWLOC_CFLAGS = @HWLOC_CFLAGS@ -HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ -HWLOC_CUDART_CFLAGS = @HWLOC_CUDART_CFLAGS@ -HWLOC_CUDART_CPPFLAGS = @HWLOC_CUDART_CPPFLAGS@ -HWLOC_CUDART_LDFLAGS = @HWLOC_CUDART_LDFLAGS@ -HWLOC_CUDART_LIBS = @HWLOC_CUDART_LIBS@ -HWLOC_CUDA_CFLAGS = @HWLOC_CUDA_CFLAGS@ -HWLOC_CUDA_CPPFLAGS = @HWLOC_CUDA_CPPFLAGS@ -HWLOC_CUDA_LDFLAGS = @HWLOC_CUDA_LDFLAGS@ -HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ -HWLOC_DARWIN_LDFLAGS = @HWLOC_DARWIN_LDFLAGS@ -HWLOC_DIFF_U = @HWLOC_DIFF_U@ -HWLOC_DIFF_W = @HWLOC_DIFF_W@ -HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ -HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ -HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ -HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ -HWLOC_EMBEDDED_LDFLAGS = @HWLOC_EMBEDDED_LDFLAGS@ -HWLOC_EMBEDDED_LIBS = @HWLOC_EMBEDDED_LIBS@ -HWLOC_GL_LIBS = @HWLOC_GL_LIBS@ -HWLOC_HAVE_LEVELZERO = @HWLOC_HAVE_LEVELZERO@ -HWLOC_HAVE_LIBXML2 = @HWLOC_HAVE_LIBXML2@ -HWLOC_HAVE_LINUX = @HWLOC_HAVE_LINUX@ -HWLOC_HAVE_NVML = @HWLOC_HAVE_NVML@ -HWLOC_HAVE_OPENCL = @HWLOC_HAVE_OPENCL@ -HWLOC_HAVE_RSMI = @HWLOC_HAVE_RSMI@ -HWLOC_HAVE_X86_CPUID = @HWLOC_HAVE_X86_CPUID@ -HWLOC_IBVERBS_LIBS = @HWLOC_IBVERBS_LIBS@ -HWLOC_LDFLAGS = @HWLOC_LDFLAGS@ -HWLOC_LEVELZERO_CFLAGS = @HWLOC_LEVELZERO_CFLAGS@ -HWLOC_LEVELZERO_LIBS = @HWLOC_LEVELZERO_LIBS@ -HWLOC_LIBS = @HWLOC_LIBS@ -HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ -HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ -HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ -HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ -HWLOC_MS_LIB = @HWLOC_MS_LIB@ -HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ -HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ -HWLOC_NUMA_LIBS = @HWLOC_NUMA_LIBS@ -HWLOC_NVML_CPPFLAGS = @HWLOC_NVML_CPPFLAGS@ -HWLOC_NVML_LDFLAGS = @HWLOC_NVML_LDFLAGS@ -HWLOC_NVML_LIBS = @HWLOC_NVML_LIBS@ -HWLOC_OPENCL_CPPFLAGS = @HWLOC_OPENCL_CPPFLAGS@ -HWLOC_OPENCL_LDFLAGS = @HWLOC_OPENCL_LDFLAGS@ -HWLOC_OPENCL_LIBS = @HWLOC_OPENCL_LIBS@ -HWLOC_PCIACCESS_CFLAGS = @HWLOC_PCIACCESS_CFLAGS@ -HWLOC_PCIACCESS_LIBS = @HWLOC_PCIACCESS_LIBS@ -HWLOC_PLUGINS_DIR = @HWLOC_PLUGINS_DIR@ -HWLOC_PLUGINS_PATH = @HWLOC_PLUGINS_PATH@ -HWLOC_PS_LIBS = @HWLOC_PS_LIBS@ -HWLOC_RELEASE_DATE = @HWLOC_RELEASE_DATE@ -HWLOC_REQUIRES = @HWLOC_REQUIRES@ -HWLOC_RSMI_CPPFLAGS = @HWLOC_RSMI_CPPFLAGS@ -HWLOC_RSMI_LDFLAGS = @HWLOC_RSMI_LDFLAGS@ -HWLOC_RSMI_LIBS = @HWLOC_RSMI_LIBS@ -HWLOC_TERMCAP_LIBS = @HWLOC_TERMCAP_LIBS@ -HWLOC_VERSION = @HWLOC_VERSION@ -HWLOC_W3_GENERATOR = @HWLOC_W3_GENERATOR@ -HWLOC_X11_CPPFLAGS = @HWLOC_X11_CPPFLAGS@ -HWLOC_X11_LIBS = @HWLOC_X11_LIBS@ -HWLOC_XML_LOCALIZED = @HWLOC_XML_LOCALIZED@ -HWLOC_runstatedir = @HWLOC_runstatedir@ -HWLOC_top_builddir = @HWLOC_top_builddir@ -HWLOC_top_srcdir = @HWLOC_top_srcdir@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LYNX = @LYNX@ -MAKEINDEX = @MAKEINDEX@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -ROCM_VERSION = @ROCM_VERSION@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -W3M = @W3M@ -XMKMF = @XMKMF@ -XMLLINT = @XMLLINT@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libhwloc_so_name = @libhwloc_so_name@ -libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xz = @xz@ -AM_CPPFLAGS = \ - $(NETLOC_CPPFLAGS) \ - $(HWLOC_CPPFLAGS) - - -# If we're in standalone mode, build the installable library. -# Otherwise, build the embedded library. -@HWLOC_BUILD_STANDALONE_TRUE@lib_LTLIBRARIES = libnetloc.la \ -@HWLOC_BUILD_STANDALONE_TRUE@ $(am__append_1) -@HWLOC_BUILD_STANDALONE_FALSE@noinst_LTLIBRARIES = \ -@HWLOC_BUILD_STANDALONE_FALSE@ libnetloc_embedded.la \ -@HWLOC_BUILD_STANDALONE_FALSE@ $(am__append_2) -sources = \ - support.c \ - topology.c \ - edge.c \ - node.c \ - physical_link.c \ - path.c \ - architecture.c \ - hwloc.c \ - mpicomm.c - - -# Installable library -libnetloc_la_SOURCES = $(sources) -libnetloc_la_LDFLAGS = $(ldflags) -version-info $(libnetloc_so_version) -libnetloc_la_LIBADD = \ - $(top_builddir)/hwloc/libhwloc.la - - -# Embedded library (note the lack of a .so version number -- that -# intentionally only appears in the installable library). Also note -# the lack of _LDFLAGS -- all libs are added by the upper layer (via -# HWLOC_EMBEDDED_LIBS). -libnetloc_embedded_la_SOURCES = $(sources) -libnetloc_embedded_la_LDFLAGS = $(ldflags) -libnetloc_embedded_la_LIBADD = \ - $(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la - -scotchsources = \ - scotch.c - - -# Installable library -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_la_SOURCES = $(scotchsources) -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_la_LDFLAGS = -version-info $(libnetloc_so_version) -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_la_LIBADD = \ -@BUILD_NETLOCSCOTCH_TRUE@ $(top_builddir)/hwloc/libhwloc.la \ -@BUILD_NETLOCSCOTCH_TRUE@ libnetloc.la - - -# Embedded library (note the lack of a .so version number -- that -# intentionally only appears in the installable library). Also note -# the lack of _LDFLAGS -- all libs are added by the upper layer (via -# HWLOC_EMBEDDED_LIBS). -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_embedded_la_SOURCES = $(scotchsources) -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_embedded_la_LDFLAGS = -@BUILD_NETLOCSCOTCH_TRUE@libnetlocscotch_embedded_la_LIBADD = \ -@BUILD_NETLOCSCOTCH_TRUE@ $(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la \ -@BUILD_NETLOCSCOTCH_TRUE@ $(HWLOC_top_builddir)/hwloc/libnetloc_embedded.la - -@BUILD_NETLOCSCOTCH_FALSE@EXTRA_DIST = $(scotchsources) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign netloc/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign netloc/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libnetloc.la: $(libnetloc_la_OBJECTS) $(libnetloc_la_DEPENDENCIES) $(EXTRA_libnetloc_la_DEPENDENCIES) - $(AM_V_CCLD)$(libnetloc_la_LINK) $(am_libnetloc_la_rpath) $(libnetloc_la_OBJECTS) $(libnetloc_la_LIBADD) $(LIBS) - -libnetloc_embedded.la: $(libnetloc_embedded_la_OBJECTS) $(libnetloc_embedded_la_DEPENDENCIES) $(EXTRA_libnetloc_embedded_la_DEPENDENCIES) - $(AM_V_CCLD)$(libnetloc_embedded_la_LINK) $(am_libnetloc_embedded_la_rpath) $(libnetloc_embedded_la_OBJECTS) $(libnetloc_embedded_la_LIBADD) $(LIBS) - -libnetlocscotch.la: $(libnetlocscotch_la_OBJECTS) $(libnetlocscotch_la_DEPENDENCIES) $(EXTRA_libnetlocscotch_la_DEPENDENCIES) - $(AM_V_CCLD)$(libnetlocscotch_la_LINK) $(am_libnetlocscotch_la_rpath) $(libnetlocscotch_la_OBJECTS) $(libnetlocscotch_la_LIBADD) $(LIBS) - -libnetlocscotch_embedded.la: $(libnetlocscotch_embedded_la_OBJECTS) $(libnetlocscotch_embedded_la_DEPENDENCIES) $(EXTRA_libnetlocscotch_embedded_la_DEPENDENCIES) - $(AM_V_CCLD)$(libnetlocscotch_embedded_la_LINK) $(am_libnetlocscotch_embedded_la_rpath) $(libnetlocscotch_embedded_la_OBJECTS) $(libnetlocscotch_embedded_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/architecture.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwloc.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpicomm.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physical_link.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scotch.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/topology.Plo@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/architecture.Plo - -rm -f ./$(DEPDIR)/edge.Plo - -rm -f ./$(DEPDIR)/hwloc.Plo - -rm -f ./$(DEPDIR)/mpicomm.Plo - -rm -f ./$(DEPDIR)/node.Plo - -rm -f ./$(DEPDIR)/path.Plo - -rm -f ./$(DEPDIR)/physical_link.Plo - -rm -f ./$(DEPDIR)/scotch.Plo - -rm -f ./$(DEPDIR)/support.Plo - -rm -f ./$(DEPDIR)/topology.Plo - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/architecture.Plo - -rm -f ./$(DEPDIR)/edge.Plo - -rm -f ./$(DEPDIR)/hwloc.Plo - -rm -f ./$(DEPDIR)/mpicomm.Plo - -rm -f ./$(DEPDIR)/node.Plo - -rm -f ./$(DEPDIR)/path.Plo - -rm -f ./$(DEPDIR)/physical_link.Plo - -rm -f ./$(DEPDIR)/scotch.Plo - -rm -f ./$(DEPDIR)/support.Plo - -rm -f ./$(DEPDIR)/topology.Plo - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-libLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru hwloc-2.9.2/netloc/architecture.c hwloc-2.10.0/netloc/architecture.c --- hwloc-2.9.2/netloc/architecture.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/architecture.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,853 +0,0 @@ -/* - * Copyright © 2016-2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -#include - -typedef struct netloc_analysis_data_t { - int level; - void *userdata; -} netloc_analysis_data; - - -static int partition_topology_to_tleaf(netloc_topology_t *topology, - int partition, int num_cores, netloc_arch_t *arch); -static netloc_arch_tree_t *tree_merge(netloc_arch_tree_t *main, - netloc_arch_tree_t *sub); -static int netloc_arch_tree_destruct(netloc_arch_tree_t *tree); -static int netloc_arch_node_destruct(netloc_arch_node_t *arch_node); -static netloc_arch_node_t *netloc_arch_node_construct(void); - -#define checked_fscanf(f, w, str, failed) \ - if (fscanf(f, " %1023s", w) != 1) { \ - fprintf(stderr, "Cannot read %s\n", str); \ - perror("fscanf"); \ - goto ERROR; \ - } - - -/* Complete the topology to have a complete balanced tree */ -void netloc_arch_tree_complete(netloc_arch_tree_t *tree, UT_array **down_degrees_by_level, - int num_hosts, int **parch_idx) -{ - int num_levels = tree->num_levels; - NETLOC_int *max_degrees = tree->degrees; - - /* Complete the tree by inserting nodes */ - for (int l = 0; l < num_levels-1; l++) { // from the root to the leaves - int num_degrees = utarray_len(down_degrees_by_level[l]); - int *degrees = (int *)down_degrees_by_level[l]->d; - NETLOC_int max_degree = max_degrees[l]; - - unsigned int down_level_idx = 0; - UT_array *down_level_degrees = down_degrees_by_level[l+1]; - NETLOC_int down_level_max_degree = max_degrees[l+1]; - for (int d = 0; d < num_degrees; d++) { - int degree = degrees[d]; - if (degree > 0) { - down_level_idx += degree; - if (degree < max_degree) { - int missing_degree = (degree-max_degree)*down_level_max_degree; - utarray_insert(down_level_degrees, &missing_degree, down_level_idx); - down_level_idx++; - } - } else { - int missing_degree = degree*down_level_max_degree; - utarray_insert(down_level_degrees, &missing_degree, down_level_idx); - down_level_idx++; - } - } - } - - /* Indices for the list of hosts, in the complete architecture */ - int num_degrees = utarray_len(down_degrees_by_level[num_levels-1]); - int *degrees = (int *)down_degrees_by_level[num_levels-1]->d; - NETLOC_int max_degree = max_degrees[num_levels-1]; - int ghost_idx = 0; - int idx = 0; - int *arch_idx = (int *)malloc(sizeof(int[num_hosts])); - for (int d = 0; d < num_degrees; d++) { - int degree = degrees[d]; - int diff; - - if (degree > 0) { - diff = max_degree-degree; - } else { - diff = -degree; - } - - for (int i = 0; i < degree; i++) { - arch_idx[idx++] = ghost_idx++; - } - ghost_idx += diff; - } - *parch_idx = arch_idx; -} - -NETLOC_int netloc_arch_tree_num_leaves(netloc_arch_tree_t *tree) -{ - NETLOC_int num_leaves = 1; - for (int l = 0; l < tree->num_levels; l++) { - num_leaves *= tree->degrees[l]; - } - return num_leaves; -} - -static int get_current_resources(int *pnum_nodes, char ***pnodes, int **pslot_idx, - int **pslot_list, int **prank_list) -{ - char *filename = getenv("NETLOC_CURRENTSLOTS"); - char word[1024]; - char *end_word; - int *slot_list = NULL; - int *rank_list = NULL; - int *slot_idx = NULL; - char **nodes = NULL; - - if (!filename) { - fprintf(stderr, "You need to set NETLOC_CURRENTSLOTS\n"); - return NETLOC_ERROR; - } - - FILE *file = fopen(filename, "r"); - if (!file) { - perror("fopen"); - return NETLOC_ERROR; - } - - checked_fscanf(file, word, "num_nodes", failed); - - int num_nodes; - num_nodes = strtol(word, &end_word, 10); - if (*word == '\0' || *end_word != '\0' || num_nodes <= 0) { - fprintf(stderr, "Oups: incorrect number of nodes (%d) in \"%s\"\n", - num_nodes, word); - goto ERROR; - } - - nodes = (char **)malloc(sizeof(char *[num_nodes])); - for (int n = 0; n < num_nodes; n++) { - checked_fscanf(file, word, "node", failed); - nodes[n] = strdup(word); - } - - slot_idx = (int *)malloc(sizeof(int[num_nodes+1])); - slot_idx[0] = 0; - for (int n = 0; n < num_nodes; n++) { - checked_fscanf(file, word, "slot index", failed); - - int slot_index = strtol(word, &end_word, 10); - if (*word == '\0' || *end_word != '\0' || num_nodes <= 0) { - fprintf(stderr, "Oups: incorrect slot index (%d) in \"%s\"\n", - slot_index, word); - goto ERROR; - } - slot_idx[n+1] = slot_idx[n]+slot_index; - } - - slot_list = (int *)malloc(sizeof(int[slot_idx[num_nodes]])); - rank_list = (int *)malloc(sizeof(int[slot_idx[num_nodes]])); - for (int s = 0; s < slot_idx[num_nodes]; s++) { - checked_fscanf(file, word, "slot number", failed); - slot_list[s] = strtol(word, &end_word, 10); - if (*word == '\0' || *end_word != '\0' || num_nodes <= 0) { - fprintf(stderr, "Oups: incorrect slot number (%d) in \"%s\"\n", - slot_list[s], word); - goto ERROR; - } - - checked_fscanf(file, word, "rank number", failed); - rank_list[s] = strtol(word, &end_word, 10); - if (*word == '\0' || *end_word != '\0' || num_nodes <= 0) { - fprintf(stderr, "Oups: incorrect rank number (%d) in \"%s\"\n", - rank_list[s], word); - goto ERROR; - } - } - - *pnum_nodes = num_nodes; - *pnodes = nodes; - *pslot_idx = slot_idx; - *pslot_list = slot_list; - *prank_list = rank_list; - - fclose(file); - - return NETLOC_SUCCESS; - -ERROR: - fclose(file); - free(nodes); - free(slot_idx); - free(slot_list); - free(rank_list); - return NETLOC_ERROR; -} - -int netloc_arch_set_current_resources(netloc_arch_t *arch) -{ - int ret; - int num_nodes; - char **nodenames; - int *slot_idx; - int *slot_list; - int *rank_list; - - ret = get_current_resources(&num_nodes, &nodenames, &slot_idx, &slot_list, - &rank_list); - - if (ret != NETLOC_SUCCESS || num_nodes <= 0) - assert(0); // XXX - - NETLOC_int *current_nodes = NULL; - - if (!arch->has_slots) { - current_nodes = (NETLOC_int *) malloc(sizeof(NETLOC_int[num_nodes])); - } - - netloc_arch_node_t **arch_node_list = (netloc_arch_node_t **) - malloc(sizeof(netloc_arch_node_t *[num_nodes])); - netloc_node_t **node_list = (netloc_node_t **) - malloc(sizeof(netloc_node_t *[num_nodes])); - for (int n = 0; n < num_nodes; n++) { - netloc_arch_node_t *arch_node; - HASH_FIND_STR(arch->nodes_by_name, nodenames[n], arch_node); - if (!arch_node) { - ret = NETLOC_ERROR; - goto ERROR; - } - arch_node_list[n] = arch_node; - node_list[n] = arch_node->node; - } - - ret = netloc_topology_read_hwloc(arch->topology, num_nodes, node_list); - if( NETLOC_SUCCESS != ret ) { - goto ERROR; - } - - int constant_num_slots = 0; - for (int n = 0; n < num_nodes; n++) { - netloc_arch_node_t *node = arch_node_list[n]; - - ret = netloc_arch_node_get_hwloc_info(node); - if (ret != NETLOC_SUCCESS) - goto ERROR; - - - if (!arch->has_slots) { - current_nodes[n] = node->idx_in_topo; - } - - int num_slots = slot_idx[n+1]-slot_idx[n]; - node->num_current_slots = num_slots; - - /* Nodes with different number of slots are not handled yet, because we - * build the scotch architecture without taking account of the - * available cores inside nodes, and Scotch is not able to weight the - * nodes */ - if (!arch->has_slots) { - if (constant_num_slots) { - if (constant_num_slots != num_slots) { - fprintf(stderr, "Oups: the same number of cores by node is needed!\n"); - assert(constant_num_slots == num_slots); - } - } else { - constant_num_slots = num_slots; - } - } - - node->current_slots = (NETLOC_int *) - malloc(sizeof(NETLOC_int[num_slots])); - NETLOC_int num_leaves = netloc_arch_tree_num_leaves(node->slot_tree); - node->slot_ranks = (int *) - malloc(sizeof(int[num_leaves])); - - for (int s = slot_idx[n]; s < slot_idx[n+1]; s++) { - int slot = slot_list[s]; - node->current_slots[s-slot_idx[n]] = node->slot_idx[slot]; - node->slot_ranks[node->slot_idx[slot]] = rank_list[s]; - } - } - - if (!arch->has_slots) { - arch->num_current_hosts = num_nodes; - arch->current_hosts = current_nodes; - arch->arch.global_tree = arch->arch.node_tree; - - /* Build nodes_by_idx */ - NETLOC_int tree_size = netloc_arch_tree_num_leaves(arch->arch.node_tree); - netloc_arch_node_slot_t *nodes_by_idx = (netloc_arch_node_slot_t *) - malloc(sizeof(netloc_arch_node_slot_t[tree_size])); - for (int n = 0; n < num_nodes; n++) { - netloc_arch_node_t *node = arch_node_list[n]; - nodes_by_idx[node->idx_in_topo].node = node; - nodes_by_idx[node->idx_in_topo].slot = -1; - } - arch->node_slot_by_idx = nodes_by_idx; - - - } else { - int num_hosts = slot_idx[num_nodes]; - NETLOC_int *current_hosts = (NETLOC_int *) - malloc(sizeof(NETLOC_int[num_hosts])); - /* Add the slot trees to the node tree */ - - /* Check that each slot tree has the same size */ - int slot_tree_size = 0; - for (int n = 0; n < num_nodes; n++) { - netloc_arch_node_t *node = arch_node_list[n]; - int current_size = netloc_arch_tree_num_leaves(node->slot_tree); - if (!slot_tree_size) { - slot_tree_size = current_size; - } else { - if (slot_tree_size != current_size) { - assert(0); - } - } - } - - int current_host_idx = 0; - int node_tree_size = netloc_arch_tree_num_leaves(arch->arch.node_tree); - int global_tree_size = node_tree_size*slot_tree_size; - netloc_arch_node_slot_t *nodes_by_idx = (netloc_arch_node_slot_t *) - malloc(sizeof(netloc_arch_node_slot_t[global_tree_size])); - for (int n = 0; n < num_nodes; n++) { - netloc_arch_node_t *node = arch_node_list[n]; - for (int s = slot_idx[n]; s < slot_idx[n+1]; s++) { - int slot_rank = s-slot_idx[n]; - int topo_idx = node->idx_in_topo*slot_tree_size + - node->slot_idx[slot_rank]; - nodes_by_idx[topo_idx].node = node; - nodes_by_idx[topo_idx].slot = slot_rank; - current_hosts[current_host_idx++] = topo_idx; - } - } - arch->num_current_hosts = current_host_idx; - arch->current_hosts = current_hosts; - arch->node_slot_by_idx = nodes_by_idx; - - netloc_arch_tree_t *new_tree = - tree_merge(arch->arch.node_tree, arch_node_list[0]->slot_tree); - netloc_arch_tree_destruct(arch->arch.node_tree); - arch->arch.global_tree = new_tree; - } - -ERROR: - for (int n = 0; n < num_nodes; n++) { - free(nodenames[n]); - } - free(nodenames); - free(slot_idx); - free(slot_list); - free(rank_list); - free(arch_node_list); - free(node_list); - - if (ret == NETLOC_SUCCESS) - return ret; - - free(current_nodes); - return ret; -} - -int netloc_arch_set_global_resources(netloc_arch_t *arch) -{ - int ret; - NETLOC_int *current_nodes = NULL; - int *slot_idx = NULL; - - int num_nodes = HASH_COUNT(arch->nodes_by_name); - if (!arch->has_slots) { - current_nodes = (NETLOC_int *) malloc(sizeof(NETLOC_int[num_nodes])); - } - - ret = netloc_topology_read_hwloc(arch->topology, 0, NULL); - if( NETLOC_SUCCESS != ret ) { - goto ERROR; - } - - int constant_num_slots = 0; - slot_idx = (int *)malloc(sizeof(int[num_nodes+1])); - slot_idx[0] = 0; - int current_idx = 0; - netloc_arch_node_t *node, *node_tmp; - HASH_ITER(hh, arch->nodes_by_name, node, node_tmp) { - ret = netloc_arch_node_get_hwloc_info(node); - if (ret != NETLOC_SUCCESS) - goto ERROR; - - if (!arch->has_slots) { - current_nodes[current_idx] = node->idx_in_topo; - } - current_idx++; - - int num_slots = node->num_slots; - node->num_current_slots = num_slots; - - slot_idx[current_idx] = slot_idx[current_idx-1]+num_slots; - - /* Nodes with different number of slots are not handled yet, because we - * build the scotch architecture without taking account of the - * available cores inside nodes, and Scotch is not able to weight the - * nodes */ - if (!arch->has_slots) { - if (constant_num_slots) { - if (constant_num_slots != num_slots) { - fprintf(stderr, "Oups: the same number of cores by node is needed!\n"); - assert(constant_num_slots == num_slots); - } - } else { - constant_num_slots = num_slots; - } - } - } - - if (!arch->has_slots) { - arch->num_current_hosts = num_nodes; - arch->current_hosts = current_nodes; - arch->arch.global_tree = arch->arch.node_tree; - - /* Build nodes_by_idx */ - int tree_size = netloc_arch_tree_num_leaves(arch->arch.node_tree); - netloc_arch_node_slot_t *nodes_by_idx = (netloc_arch_node_slot_t *) - malloc(sizeof(netloc_arch_node_slot_t[tree_size])); - netloc_arch_node_t *node, *node_tmp; - HASH_ITER(hh, arch->nodes_by_name, node, node_tmp) { - nodes_by_idx[node->idx_in_topo].node = node; - nodes_by_idx[node->idx_in_topo].slot = -1; - } - arch->node_slot_by_idx = nodes_by_idx; - - - } else { - int num_hosts = slot_idx[num_nodes]; - NETLOC_int *current_hosts = (NETLOC_int *) - malloc(sizeof(NETLOC_int[num_hosts])); - netloc_arch_node_t *node, *node_tmp; - /* Add the slot trees to the node tree */ - - /* Check that each slot tree has the same size */ - int slot_tree_size = 0; - HASH_ITER(hh, arch->nodes_by_name, node, node_tmp) { - int current_size = netloc_arch_tree_num_leaves(node->slot_tree); - if (!slot_tree_size) { - slot_tree_size = current_size; - } else { - if (slot_tree_size != current_size) { - assert(0); - } - } - } - - int current_host_idx = 0; - int node_tree_size = netloc_arch_tree_num_leaves(arch->arch.node_tree); - int global_tree_size = node_tree_size*slot_tree_size; - netloc_arch_node_slot_t *nodes_by_idx = (netloc_arch_node_slot_t *) - malloc(sizeof(netloc_arch_node_slot_t[global_tree_size])); - int n = 0; - HASH_ITER(hh, arch->nodes_by_name, node, node_tmp) { - for (int s = slot_idx[n]; s < slot_idx[n+1]; s++) { - int slot_rank = s-slot_idx[n]; - int topo_idx = node->idx_in_topo*slot_tree_size + - node->slot_idx[slot_rank]; - nodes_by_idx[topo_idx].node = node; - nodes_by_idx[topo_idx].slot = slot_rank; - current_hosts[current_host_idx++] = topo_idx; - } - n++; - } - arch->num_current_hosts = current_host_idx; - arch->current_hosts = current_hosts; - arch->node_slot_by_idx = nodes_by_idx; - - netloc_arch_tree_t *new_tree = - tree_merge(arch->arch.node_tree, arch->nodes_by_name->slot_tree); - netloc_arch_tree_destruct(arch->arch.node_tree); - arch->arch.global_tree = new_tree; - } - -ERROR: - free(slot_idx); - - if (ret == NETLOC_SUCCESS) - return ret; - - free(current_nodes); - return ret; -} - -netloc_arch_tree_t *tree_merge(netloc_arch_tree_t *main, netloc_arch_tree_t *sub) -{ - netloc_arch_tree_t *new_tree = (netloc_arch_tree_t *) - malloc(sizeof(netloc_arch_tree_t)); - - int num_levels = main->num_levels+sub->num_levels; - new_tree->num_levels = num_levels; - new_tree->degrees = (NETLOC_int *)malloc(sizeof(NETLOC_int[num_levels])); - new_tree->cost = (NETLOC_int *)malloc(sizeof(NETLOC_int[num_levels])); - - memcpy(new_tree->degrees, main->degrees, - main->num_levels*sizeof(*new_tree->degrees)); - memcpy(new_tree->degrees+main->num_levels, sub->degrees, - sub->num_levels*sizeof(*new_tree->degrees)); - - int out_coeff = 10; - for (int l = 0; l < main->num_levels; l++) { - new_tree->cost[l] = main->cost[l]*sub->cost[0]*out_coeff; - } - memcpy(new_tree->cost+main->num_levels, sub->cost, - sub->num_levels*sizeof(*new_tree->cost)); - - return new_tree; -} - -static int netloc_arch_tree_destruct(netloc_arch_tree_t *tree) -{ - free(tree->cost); - free(tree->degrees); - free(tree); - - return NETLOC_SUCCESS; -} - - -int partition_topology_to_tleaf(netloc_topology_t *topology, - int partition, int num_cores, netloc_arch_t *arch) -{ - int ret = 0; - UT_array *nodes; - utarray_new(nodes, &ut_ptr_icd); - - netloc_arch_tree_t *tree = (netloc_arch_tree_t *) - malloc(sizeof(netloc_arch_tree_t)); - arch->arch.node_tree = tree; - arch->type = NETLOC_ARCH_TREE; - - /* we build nodes from host list in the given partition - * and we init all the analysis data */ - netloc_node_t *node, *node_tmp; - netloc_topology_iter_nodes(topology, node, node_tmp) { - if (!netloc_node_is_in_partition(node, partition)) - continue; - void *userdata = node->userdata; - node->userdata = (void *)malloc(sizeof(netloc_analysis_data)); - netloc_analysis_data *analysis_data = (netloc_analysis_data *)node->userdata; - analysis_data->level = -1; - analysis_data->userdata = userdata; - - netloc_edge_t *edge, *edge_tmp; - netloc_node_iter_edges(node, edge, edge_tmp) { - void *userdata = edge->userdata; - edge->userdata = (void *)malloc(sizeof(netloc_analysis_data)); - netloc_analysis_data *analysis_data = (netloc_analysis_data *)edge->userdata; - analysis_data->level = -1; - analysis_data->userdata = userdata; - } - - if (netloc_node_is_host(node)) { - utarray_push_back(nodes, &node); - } - } - - /* We set the levels in the analysis data */ - /* Upward edges will have the level of the source node and downward edges - * will have -1 as level */ - int num_levels = 0; - netloc_node_t *current_node = /* pointer to one host node */ - *(void **)utarray_eltptr(nodes, 0); - while (utarray_len(nodes)) { - UT_array *new_nodes; - utarray_new(new_nodes, &ut_ptr_icd); - - for (unsigned int n = 0; n < utarray_len(nodes); n++) { - netloc_node_t *node = *(void **)utarray_eltptr(nodes, n); - netloc_analysis_data *node_data = (netloc_analysis_data *)node->userdata; - /* There is a problem, this is not a tree */ - if (node_data->level != -1 && node_data->level != num_levels) { - utarray_free(new_nodes); - ret = -1; - goto end; - } - else { - node_data->level = num_levels; - netloc_edge_t *edge, *edge_tmp; - netloc_node_iter_edges(node, edge, edge_tmp) { - if (!netloc_edge_is_in_partition(edge, partition)) - continue; - netloc_analysis_data *edge_data = (netloc_analysis_data *)edge->userdata; - - netloc_node_t *dest = edge->dest; - netloc_analysis_data *dest_data = (netloc_analysis_data *)dest->userdata; - /* If we are going back */ - if (dest_data->level != -1 && dest_data->level < num_levels) { - continue; - } - else { - if (dest_data->level != num_levels) { - edge_data->level = num_levels; - utarray_push_back(new_nodes, &dest); - } - } - } - } - } - num_levels++; - utarray_free(nodes); - nodes = new_nodes; - } - - /* We go though the tree to order the leaves and find the tree - * structure */ - UT_array *ordered_name_array = NULL; - UT_array **down_degrees_by_level = NULL; - NETLOC_int *max_down_degrees_by_level; - - utarray_new(ordered_name_array, &ut_ptr_icd); - - down_degrees_by_level = (UT_array **)malloc(num_levels*sizeof(UT_array *)); - for (int l = 0; l < num_levels; l++) { - utarray_new(down_degrees_by_level[l], &ut_int_icd); - } - max_down_degrees_by_level = (NETLOC_int *) - calloc(num_levels-1, sizeof(NETLOC_int)); - - UT_array *down_edges = NULL; - utarray_new(down_edges, &ut_ptr_icd); - netloc_edge_t *up_edge = current_node->edges; - utarray_push_back(ordered_name_array, ¤t_node); - while (1) { - if (utarray_len(down_edges)) { - netloc_edge_t *down_edge = *(void **)utarray_back(down_edges); - utarray_pop_back(down_edges); - netloc_node_t *dest_node = down_edge->dest; - if (netloc_node_is_host(dest_node)) { - utarray_push_back(ordered_name_array, &dest_node); - } - else { - netloc_edge_t *edge, *edge_tmp; - int num_edges = 0; - netloc_node_iter_edges(dest_node, edge, edge_tmp) { - if (!netloc_edge_is_in_partition(edge, partition)) - continue; - netloc_analysis_data *edge_data = (netloc_analysis_data *)edge->userdata; - int edge_level = edge_data->level; - if (edge_level == -1) { - utarray_push_back(down_edges, &edge); - num_edges++; - } - } - int level = ((netloc_analysis_data *)dest_node->userdata)->level; - utarray_push_back(down_degrees_by_level[num_levels-1-level], &num_edges); - max_down_degrees_by_level[num_levels-1-level] = - max_down_degrees_by_level[num_levels-1-level] > num_edges ? - max_down_degrees_by_level[num_levels-1-level]: num_edges; - } - } - else { - netloc_edge_t *new_up_edge = NULL; - if (!up_edge) - break; - - netloc_node_t *up_node = up_edge->dest; - netloc_edge_t *edge, *edge_tmp; - int num_edges = 0; - netloc_node_iter_edges(up_node, edge, edge_tmp) { - if (!netloc_edge_is_in_partition(edge, partition)) - continue; - netloc_analysis_data *edge_data = (netloc_analysis_data *)edge->userdata; - int edge_level = edge_data->level; - - netloc_node_t *dest_node = edge->dest; - - /* If the is the node where we are from */ - if (dest_node == up_edge->node) { - num_edges++; - continue; - } - - /* Downward edge */ - if (edge_level == -1) { - utarray_push_back(down_edges, &edge); - num_edges++; - } - /* Upward edge */ - else { - new_up_edge = edge; - } - - } - int level = ((netloc_analysis_data *)up_node->userdata)->level; - utarray_push_back(down_degrees_by_level[num_levels-1-level], &num_edges); - max_down_degrees_by_level[num_levels-1-level] = - max_down_degrees_by_level[num_levels-1-level] > num_edges ? - max_down_degrees_by_level[num_levels-1-level]: num_edges; - up_edge = new_up_edge; - } - } - - tree->num_levels = num_levels-1; - tree->degrees = max_down_degrees_by_level; - - int network_coeff = 2; - tree->cost = (NETLOC_int *)malloc(sizeof(NETLOC_int[tree->num_levels])); - tree->cost[tree->num_levels-1] = 1; - for (int i = tree->num_levels-2; i >= 0 ; i--) { - tree->cost[i] = tree->cost[i+1]*network_coeff; - } - - /* Now we have the degree of each node, so we can complete the topology to - * have a complete balanced tree as requested by the tleaf structure */ - int *arch_idx; - int num_nodes = utarray_len(ordered_name_array); - netloc_arch_tree_complete(tree, down_degrees_by_level, num_nodes, &arch_idx); - - netloc_node_t **ordered_nodes = (netloc_node_t **)ordered_name_array->d; - netloc_arch_node_t *named_nodes = NULL; - for (int i = 0; i < num_nodes; i++) { - netloc_arch_node_t *node = netloc_arch_node_construct(); - node->node = ordered_nodes[i]; - node->name = ordered_nodes[i]->hostname; - node->idx_in_topo = arch_idx[i]; - HASH_ADD_KEYPTR(hh, named_nodes, node->name, strlen(node->name), node); - } - free(arch_idx); - - arch->nodes_by_name = named_nodes; - -end: - if (nodes) - utarray_free(nodes); - - if (ordered_name_array) - utarray_free(ordered_name_array); - - if (down_degrees_by_level) { - for (int l = 0; l < num_levels; l++) { - utarray_free(down_degrees_by_level[l]); - } - free(down_degrees_by_level); - } - - if (down_edges) - utarray_free(down_edges); - - /* We copy back all userdata */ - netloc_topology_iter_nodes(topology, node, node_tmp) { - if (!netloc_node_is_in_partition(node, partition)) - continue; - netloc_analysis_data *analysis_data = (netloc_analysis_data *)node->userdata; - if (analysis_data->level == -1 && ret != -1) { - ret = -1; - printf("The node %s was not browsed\n", node->description); - } - free(analysis_data); - - netloc_edge_t *edge, *edge_tmp; - netloc_node_iter_edges(node, edge, edge_tmp) { - netloc_analysis_data *analysis_data = (netloc_analysis_data *)edge->userdata; - node->userdata = analysis_data->userdata; - free(analysis_data); - } - } - - return ret; -} - -int netloc_arch_build(netloc_arch_t *arch, int add_slots) -{ - char *partition_name = getenv("NETLOC_PARTITION"); - char *topopath = getenv("NETLOC_TOPOFILE"); - - if (!topopath) { - fprintf(stderr, "Error: you need to set NETLOC_TOPOFILE in your environment.\n"); - return NETLOC_ERROR; - } - topopath = strdup(topopath); - - netloc_topology_t *topology = netloc_topology_construct(topopath); - if (topology == NULL) { - fprintf(stderr, "Error: netloc_topology_construct failed\n"); - free(topopath); - return NETLOC_ERROR; - } - - arch->topology = topology; - arch->has_slots = add_slots; - - if (!partition_name) { - fprintf(stderr, "Error: you need to set NETLOC_PARTITION in your environment.\n"); - fprintf(stderr, "\tIt can be: "); - unsigned int num_partitions = utarray_len(topology->partitions); - for (unsigned int p = 0; p < num_partitions; p++) { - char *partition = *(char **)utarray_eltptr(topology->partitions, p); - fprintf(stderr, "%s%s", partition, p != num_partitions-1 ? ", ": "\n"); - } - return NETLOC_ERROR; - } - - int partition = - netloc_topology_find_partition_idx(topology, partition_name); - - partition_topology_to_tleaf(topology, partition, 1, arch); - - return NETLOC_SUCCESS; -} - -netloc_arch_t * netloc_arch_construct(void) -{ - netloc_arch_t *arch = (netloc_arch_t *)calloc(1, sizeof(netloc_arch_t)); - - return arch; -} - -int netloc_arch_destruct(netloc_arch_t *arch) -{ - netloc_topology_destruct(arch->topology); - - netloc_arch_node_t *node, *node_tmp; - HASH_ITER(hh, arch->nodes_by_name, node, node_tmp) { - HASH_DEL(arch->nodes_by_name, node); - netloc_arch_node_destruct(node); - } - - free(arch->arch.node_tree->degrees); - free(arch->arch.node_tree->cost); - free(arch->arch.node_tree); - free(arch->current_hosts); - free(arch->node_slot_by_idx); - - free(arch); - - return NETLOC_SUCCESS; -} - -static netloc_arch_node_t *netloc_arch_node_construct(void) -{ - netloc_arch_node_t *arch_node = (netloc_arch_node_t *) - calloc(1, sizeof(netloc_arch_node_t)); - arch_node->num_slots = -1; - - return arch_node; -} - -static int netloc_arch_node_destruct(netloc_arch_node_t *arch_node) -{ - free(arch_node->slot_idx); - free(arch_node->slot_os_idx); - if (arch_node->slot_tree) - netloc_arch_tree_destruct(arch_node->slot_tree); - free(arch_node->current_slots); - free(arch_node->slot_ranks); - free(arch_node); - - return NETLOC_SUCCESS; -} diff -Nru hwloc-2.9.2/netloc/edge.c hwloc-2.10.0/netloc/edge.c --- hwloc-2.9.2/netloc/edge.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/edge.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright © 2013-2014 University of Wisconsin-La Crosse. - * All rights reserved. - * Copyright © 2013 Cisco Systems, Inc. All rights reserved. - * Copyright © 2015-2016 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include - -#include -#include - -static int cur_uid = 0; - -netloc_edge_t * netloc_edge_construct(void) -{ - - netloc_edge_t *edge = NULL; - - edge = (netloc_edge_t*)malloc(sizeof(netloc_edge_t)); - if( NULL == edge ) { - return NULL; - } - - edge->id = cur_uid; - cur_uid++; - - edge->dest = NULL; - edge->node = NULL; - - utarray_new(edge->physical_links, &ut_ptr_icd); - - edge->total_gbits = 0; - - utarray_new(edge->partitions, &ut_int_icd); - - utarray_new(edge->subnode_edges, &ut_ptr_icd); - - edge->userdata = NULL; - - return edge; -} - -char * netloc_edge_pretty_print(netloc_edge_t* edge) -{ - // TODO - return "TODO"; -} - -int netloc_edge_destruct(netloc_edge_t * edge) -{ - utarray_free(edge->physical_links); - utarray_free(edge->partitions); - - for (unsigned int e = 0; e < netloc_edge_get_num_subedges(edge); e++) { - netloc_edge_t *subedge; - subedge = netloc_edge_get_subedge(edge, e); - netloc_edge_destruct(subedge); - } - utarray_free(edge->subnode_edges); - free(edge); - return NETLOC_SUCCESS; -} - -void netloc_edge_reset_uid(void) -{ - cur_uid = 0; -} - -int netloc_edge_is_in_partition(netloc_edge_t *edge, int partition) -{ - for (unsigned int i = 0; i < netloc_get_num_partitions(edge); i++) { - if (netloc_get_partition(edge, i) == partition) - return 1; - } - return NETLOC_SUCCESS; -} - - diff -Nru hwloc-2.9.2/netloc/hwloc.c hwloc-2.10.0/netloc/hwloc.c --- hwloc-2.9.2/netloc/hwloc.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/hwloc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,288 +0,0 @@ -/* - * Copyright © 2016-2018 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ - -#include -#include -#include - -#include -#include -#include - -static UT_icd topos_icd = {sizeof(hwloc_topology_t), NULL, NULL, NULL}; - -int netloc_topology_read_hwloc(netloc_topology_t *topology, int num_nodes, - netloc_node_t **node_list) -{ - int ret = 0; - int all = 0; - - char *hwloc_path; - - if (!topology->hwlocpath) { - printf("No hwloc directory recorded in the topology\n"); - return NETLOC_ERROR; - } - - if (topology->hwlocpath[0] != '/') { - char *path_tmp = strdup(topology->topopath); - asprintf(&hwloc_path, "%s/%s", dirname(path_tmp), topology->hwlocpath); - free(path_tmp); - } else { - hwloc_path = strdup(topology->hwlocpath); - } - - DIR* dir = opendir(hwloc_path); - /* Directory does not exist */ - if (!dir) { - printf("Directory (%s) to hwloc does not exist\n", hwloc_path); - free(hwloc_path); - return NETLOC_ERROR; - } - else { - closedir(dir); - } - - UT_array *hwloc_topo_names = topology->topos; - UT_array *hwloc_topos; - utarray_new(hwloc_topos, &topos_icd); - - int num_diffs = 0; - - if (!num_nodes) { - netloc_node_t *node, *node_tmp; - num_nodes = HASH_COUNT(topology->nodes); - node_list = (netloc_node_t **)malloc(sizeof(netloc_node_t *[num_nodes])); - int n = 0; - netloc_topology_iter_nodes(topology, node, node_tmp) { - node_list[n++] = node; - } - all = 1; - } - - for (int n = 0; n < num_nodes; n++) { - netloc_node_t *node = node_list[n]; - char *hwloc_file; - char *refname; - - if (netloc_node_is_switch(node)) - continue; - - /* We try to find a diff file */ - asprintf(&hwloc_file, "%s/%s.diff.xml", hwloc_path, node->hostname); - hwloc_topology_diff_t diff; - int err; - if ((err = hwloc_topology_diff_load_xml(hwloc_file, &diff, &refname)) >= 0) { - refname[strlen(refname)-4] = '\0'; - hwloc_topology_diff_destroy(diff); - num_diffs++; - } - else { - free(hwloc_file); - /* We try to find a regular file */ - asprintf(&hwloc_file, "%s/%s.xml", hwloc_path, node->hostname); - FILE *fxml; - if (!(fxml = fopen(hwloc_file, "r"))) { - printf("Missing hwloc file: %s\n", hwloc_file); - } - else - fclose(fxml); - asprintf(&refname, "%s", node->hostname); - } - - /* Add the hwloc topology */ - unsigned int t = 0; - while (t < utarray_len(hwloc_topo_names) && - strcmp(*(char **)utarray_eltptr(hwloc_topo_names, t), refname)) { - t++; - } - /* Topology not found */ - if (t == utarray_len(hwloc_topo_names)) { - utarray_push_back(hwloc_topo_names, &refname); - - /* Read the hwloc topology */ - hwloc_topology_t topology; - hwloc_topology_init(&topology); - hwloc_topology_set_flags(topology, HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED); - - char *hwloc_ref_path; - asprintf(&hwloc_ref_path, "%s/%s.xml", hwloc_path, refname); - ret = hwloc_topology_set_xml(topology, hwloc_ref_path); - free(hwloc_ref_path); - if (ret == -1) { - void *null = NULL; - utarray_push_back(hwloc_topos, &null); - fprintf(stdout, "Warning: no topology for %s\n", refname); - hwloc_topology_destroy(topology); - free(refname); free(hwloc_file); - continue; - } - - ret = hwloc_topology_set_all_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_STRUCTURE); - if (ret == -1) { - fprintf(stderr, "hwloc_topology_set_all_types_filter failed\n"); - free(refname); free(hwloc_file); - goto ERROR; - } - - ret = hwloc_topology_set_io_types_filter(topology, HWLOC_TYPE_FILTER_KEEP_NONE); - if (ret == -1) { - fprintf(stderr, "hwloc_topology_set_all_types_filter failed\n"); - free(refname); free(hwloc_file); - goto ERROR; - } - - ret = hwloc_topology_load(topology); - if (ret == -1) { - fprintf(stderr, "hwloc_topology_load failed\n"); - free(refname); free(hwloc_file); - goto ERROR; - } - utarray_push_back(hwloc_topos, &topology); - } - free(refname); - free(hwloc_file); - node->hwlocTopo = *(hwloc_topology_t *)utarray_eltptr(hwloc_topos, t); - node->hwlocTopoIdx = t; - } - - if (!num_diffs) { - printf("Warning: no hwloc diff file found!\n"); - } - - topology->topos = hwloc_topo_names; - topology->hwloc_topos = (hwloc_topology_t *)hwloc_topos->d; - - printf("%d hwloc topologies found:\n", utarray_len(topology->topos)); - for (unsigned int p = 0; p < utarray_len(topology->topos); p++) { - printf("\t'%s'\n", *(char **)utarray_eltptr(topology->topos, p)); - } - - ret = NETLOC_SUCCESS; - -ERROR: - if (all) { - free(node_list); - } - free(hwloc_path); - if (ret == NETLOC_SUCCESS) - free(hwloc_topos); - else - utarray_free(hwloc_topos); - return ret; -} - -/* Set the info from hwloc of the node in the correspondig arch */ -int netloc_arch_node_get_hwloc_info(netloc_arch_node_t *arch_node) -{ - hwloc_topology_t topology = arch_node->node->hwlocTopo; - - hwloc_obj_t root = hwloc_get_root_obj(topology); - - int depth = hwloc_topology_get_depth(topology); - hwloc_obj_t first_object = root->first_child; - - UT_array **down_degrees_by_level; - NETLOC_int *max_down_degrees_by_level; - - down_degrees_by_level = (UT_array **)malloc(depth*sizeof(UT_array *)); - for (int l = 0; l < depth; l++) { - utarray_new(down_degrees_by_level[l], &ut_int_icd); - } - max_down_degrees_by_level = (NETLOC_int *) - calloc(depth-1, sizeof(NETLOC_int)); - - int level = depth-1; - hwloc_obj_t current_object = first_object; - while (level >= 1) { - int degree = 1; - /* we go through the siblings */ - while (current_object->next_sibling) { - current_object = current_object->next_sibling; - degree++; - } - /* Add the degree to the list of degrees */ - utarray_push_back(down_degrees_by_level[depth-1-level], °ree); - max_down_degrees_by_level[depth-1-level] = - max_down_degrees_by_level[depth-1-level] > degree ? - max_down_degrees_by_level[depth-1-level] : degree; - - current_object = current_object->next_cousin; - - if (!current_object) { - level--; - if (!first_object->first_child) - break; - first_object = first_object->first_child; - current_object = first_object; - } - } - - /* List of PUs */ - unsigned int max_os_index = 0; - UT_array *ordered_host_array; - int *ordered_hosts; - utarray_new(ordered_host_array, &ut_int_icd); - current_object = first_object; - while (current_object) { - max_os_index = (max_os_index >= current_object->os_index)? - max_os_index: current_object->os_index; - utarray_push_back(ordered_host_array, ¤t_object->os_index); - current_object = current_object->next_cousin; - } - ordered_hosts = (int *)ordered_host_array->d;; - - /* Weight for the edges in the tree */ - NETLOC_int *cost = (NETLOC_int *)malloc((depth-1)*sizeof(NETLOC_int)); - int level_coeff = 3; - cost[depth-2] = 1; - for (int l = depth-3; l >= 0; l--) { - cost[l] = cost[l+1]*level_coeff; - } - - netloc_arch_tree_t *tree = (netloc_arch_tree_t *) - malloc(sizeof(netloc_arch_tree_t)); - tree->num_levels = depth-1; - tree->degrees = max_down_degrees_by_level; - tree->cost = cost; - - int *arch_idx; - int num_cores = utarray_len(ordered_host_array); - netloc_arch_tree_complete(tree, down_degrees_by_level, num_cores, &arch_idx); - - int *slot_idx = (int *)malloc(sizeof(int[max_os_index+1])); - for (int i = 0; i < num_cores; i++) { - slot_idx[ordered_hosts[i]] = arch_idx[i]; - } - - int num_leaves = netloc_arch_tree_num_leaves(tree); - int *slot_os_idx = (int *)malloc(sizeof(int[num_leaves])); - for (int i = 0; i < num_cores; i++) { - slot_os_idx[arch_idx[i]] = ordered_hosts[i]; - } - free(arch_idx); - - arch_node->slot_tree = tree; - arch_node->slot_idx = slot_idx; - arch_node->slot_os_idx = slot_os_idx; - arch_node->num_slots = max_os_index+1; - - for (int l = 0; l < depth; l++) { - utarray_free(down_degrees_by_level[l]); - } - free(down_degrees_by_level); - - utarray_free(ordered_host_array); - - return NETLOC_SUCCESS; -} diff -Nru hwloc-2.9.2/netloc/mpicomm.c hwloc-2.10.0/netloc/mpicomm.c --- hwloc-2.9.2/netloc/mpicomm.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/mpicomm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -/* - * Copyright © 2016-2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -#include - -#include -#include - -int netloc_build_comm_mat(char *filename, int *pn, double ***pmat) -{ - FILE *input = fopen(filename, "r"); - - if (!input ) { - perror("fopen"); - return NETLOC_ERROR; - } - char *line = NULL; - size_t linesize = 0; - - char *ptr= NULL; - int i,j; - - j = -1; - i = 0; - - /* Get the number of elements in a line to find the size of the matrix */ - netloc_line_get(&line, &linesize, input); - int n = 0; - char *remain_line = line; - while ((ptr = netloc_line_get_next_token(&remain_line, ' '))) { - if (!strlen(ptr)) - break; - n++; - } - rewind(input); - - if (!n) { - goto error; - } - - double *mat_values = (double *)malloc(sizeof(double[n*n])); - double **mat = (double **)malloc(sizeof(double *[n])); - for (int i = 0; i < n; i++) { - mat[i] = &mat_values[i*n]; - } - - while (netloc_line_get(&line, &linesize, input) != -1) { - char *remain_line = line; - j = 0; - while ((ptr = netloc_line_get_next_token(&remain_line, ' '))){ - if (!strlen(ptr)) - break; - mat[i][j] = atof(ptr); - if (mat[i][j] < 0) { - fprintf(stderr, "Warning: negative value in comm matrix " - "(mat[%d][%d] = %f)\n", i, j, mat[i][j]); - } - j++; - } - if (j != n) { - fprintf(stderr, "Error at %d %d (%d!=%d). " - "Too many columns for %s\n", i, j, j, n, filename); - goto error; - } - i++; - } - - if (i != n) { - fprintf(stderr,"Error at %d %d. Too many rows for %s\n", - i, j, filename); - goto error; - } - - fclose (input); - - *pn = n; - *pmat = mat; - - free(line); - return NETLOC_SUCCESS; - -error: - free(line); - free(mat_values); - free(mat); - *pmat = NULL; - *pn = 0; - fclose (input); - return NETLOC_ERROR; -} diff -Nru hwloc-2.9.2/netloc/node.c hwloc-2.10.0/netloc/node.c --- hwloc-2.9.2/netloc/node.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/node.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/* - * Copyright © 2013-2014 University of Wisconsin-La Crosse. - * All rights reserved. - * Copyright © 2013 Cisco Systems, Inc. All rights reserved. - * Copyright © 2015-2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include - -#include -#include -#include - -static UT_icd node_physical_links_icd = { - sizeof(netloc_physical_link_t *), NULL, NULL, NULL -}; - -static UT_icd node_physical_nodes_icd = { - sizeof(netloc_node_t *), NULL, NULL, NULL -}; - -static UT_icd node_partitions_icd = { sizeof(int), NULL, NULL, NULL }; - -static int node_or_subnode_destruct(netloc_node_t * node, int is_node); - -netloc_node_t * netloc_node_construct(void) -{ - netloc_node_t *node = NULL; - - node = (netloc_node_t*)malloc(sizeof(netloc_node_t)); - if (NULL == node) { - return NULL; - } - - node->physical_id[0] = '\0'; - node->logical_id = -1; - node->type = NETLOC_NODE_TYPE_INVALID; - utarray_new(node->physical_links, &node_physical_links_icd); - node->description = NULL; - node->userdata = NULL; - node->edges = NULL; - utarray_new(node->subnodes, &node_physical_nodes_icd); - node->paths = NULL; - node->hostname = NULL; - utarray_new(node->partitions, &node_partitions_icd); - node->hwlocTopo = NULL; - node->hwlocTopoIdx = -1; - - return node; -} - -int netloc_node_destruct(netloc_node_t * node) -{ - return node_or_subnode_destruct(node, 1); -} - -static int node_or_subnode_destruct(netloc_node_t * node, int is_node) -{ - utarray_free(node->physical_links); - - /* Description */ - free(node->description); - - /* Edges */ - netloc_edge_t *edge, *edge_tmp; - HASH_ITER(hh, node->edges, edge, edge_tmp) { - HASH_DEL(node->edges, edge); /* delete; edge advances to next */ - netloc_edge_destruct(edge); - } - - /* Subnodes */ - for (unsigned int n = 0; n < utarray_len(node->subnodes); n++) { - netloc_node_t *subnode = *(netloc_node_t **) - utarray_eltptr(node->subnodes, n); - node_or_subnode_destruct(subnode, 0); - } - utarray_free(node->subnodes); - - /* Paths */ - netloc_path_t *path, *path_tmp; - HASH_ITER(hh, node->paths, path, path_tmp) { - HASH_DEL(node->paths, path); /* delete; path advances to next */ - netloc_path_destruct(path); - } - - /* Hostname */ - free(node->hostname); - - /* Partitions */ - utarray_free(node->partitions); - - /* hwlocTopo: nothing to do beacause the pointer is stored also in the topology */ - - free(node); - - return NETLOC_SUCCESS; -} - -char *netloc_node_pretty_print(netloc_node_t* node) -{ - char * str = NULL; - - asprintf(&str, " [%23s]/[%d] -- %s (%d links)", - node->physical_id, - node->logical_id, - node->description, - utarray_len(node->physical_links)); - - return str; -} - -int netloc_node_is_in_partition(netloc_node_t *node, int partition) -{ - for (unsigned int i = 0; i < netloc_get_num_partitions(node); i++) { - if (netloc_get_partition(node, i) == partition) - return 1; - } - return NETLOC_SUCCESS; -} - - diff -Nru hwloc-2.9.2/netloc/path.c hwloc-2.10.0/netloc/path.c --- hwloc-2.9.2/netloc/path.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/path.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright © 2016 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include - -#include - -netloc_path_t *netloc_path_construct(void) -{ - netloc_path_t *path = (netloc_path_t *) - malloc(sizeof(netloc_path_t )); - utarray_new(path->links, &ut_ptr_icd); - - return path; -} - -int netloc_path_destruct(netloc_path_t *path) -{ - utarray_free(path->links); - free(path); - return NETLOC_SUCCESS; -} diff -Nru hwloc-2.9.2/netloc/physical_link.c hwloc-2.10.0/netloc/physical_link.c --- hwloc-2.9.2/netloc/physical_link.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/physical_link.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright © 2016 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include - -#include -#include - -netloc_physical_link_t * netloc_physical_link_construct(void) -{ - static int cur_uid = 0; - - netloc_physical_link_t *physical_link = NULL; - - physical_link = (netloc_physical_link_t*) - malloc(sizeof(netloc_physical_link_t)); - if( NULL == physical_link ) { - return NULL; - } - - physical_link->id = cur_uid; - cur_uid++; - - physical_link->src = NULL; - physical_link->dest = NULL; - - physical_link->ports[0] = -1; - physical_link->ports[1] = -1; - - physical_link->width = NULL; - physical_link->speed = NULL; - - physical_link->edge = NULL; - physical_link->other_way = NULL; - - utarray_new(physical_link->partitions, &ut_int_icd); - - physical_link->gbits = -1; - - physical_link->description = NULL; - - return physical_link; -} - -int netloc_physical_link_destruct(netloc_physical_link_t *link) -{ - free(link->width); - free(link->description); - free(link->speed); - utarray_free(link->partitions); - free(link); - return NETLOC_SUCCESS; -} - -char * netloc_link_pretty_print(netloc_physical_link_t* link) -{ - char * str = NULL; - const char * tmp_src_str = NULL; - const char * tmp_dest_str = NULL; - - tmp_src_str = netloc_node_type_decode(link->src->type); - tmp_dest_str = netloc_node_type_decode(link->dest->type); - - asprintf(&str, "%3d (%s) [%23s] %d [<- %s / %s (%f) ->] (%s) [%23s] %d", - link->id, - tmp_src_str, - link->src->physical_id, - link->ports[0], - link->speed, - link->width, - link->gbits, - tmp_dest_str, - link->dest->physical_id, - link->ports[1]); - - return str; -} - - diff -Nru hwloc-2.9.2/netloc/scotch.c hwloc-2.10.0/netloc/scotch.c --- hwloc-2.9.2/netloc/scotch.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/scotch.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,469 +0,0 @@ -/* - * Copyright © 2016-2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -static int arch_tree_to_scotch_arch(netloc_arch_tree_t *tree, SCOTCH_Arch *scotch); -static int comm_matrix_to_scotch_graph(double **matrix, int n, SCOTCH_Graph *graph); -static int netlocscotch_get_mapping_from_graph(SCOTCH_Graph *graph, - netlocscotch_core_t **pcores); - -static int compareint(void const *a, void const *b) -{ - const int *int_a = (const int *)a; - const int *int_b = (const int *)b; - return *int_a-*int_b; -} - -static int build_subarch(SCOTCH_Arch *scotch, NETLOC_int num_nodes, NETLOC_int *node_list, - SCOTCH_Arch *subarch) -{ - int ret; - - /* Hack to avoid problem with unsorted node list in the subarch and scotch - * FIXME TODO */ - qsort(node_list, num_nodes, sizeof(*node_list), compareint); - - ret = SCOTCH_archSub(subarch, scotch, num_nodes, node_list); - if (ret != 0) { - fprintf(stderr, "Error: SCOTCH_archSub failed\n"); - } - - return ret; -} - -/* Convert a netloc tree to a scotch tleaf architecture */ -int arch_tree_to_scotch_arch(netloc_arch_tree_t *tree, SCOTCH_Arch *scotch) -{ - int ret; - - ret = SCOTCH_archTleaf(scotch, tree->num_levels, tree->degrees, tree->cost); - if (ret != 0) { - fprintf(stderr, "Error: SCOTCH_archTleaf failed\n"); - return NETLOC_ERROR; - } - - return NETLOC_SUCCESS; -} - -static int build_subgraph(SCOTCH_Graph *graph, int *vertices, int num_vertices, - SCOTCH_Graph *nodegraph) -{ - int ret; - - SCOTCH_Num base; /* Base value */ - SCOTCH_Num vert; /* Number of vertices */ - SCOTCH_Num *verttab; /* Vertex array [vertnbr+1] */ - SCOTCH_Num *vendtab; /* Vertex array [vertnbr] */ - SCOTCH_Num *velotab; /* Vertex load array */ - SCOTCH_Num *vlbltab; /* Vertex label array */ - SCOTCH_Num edge; /* Number of edges (arcs) */ - SCOTCH_Num *edgetab; /* Edge array [edgenbr] */ - SCOTCH_Num *edlotab; /* Edge load array */ - - SCOTCH_graphData(graph, &base, &vert, &verttab, &vendtab, &velotab, - &vlbltab, &edge, &edgetab, &edlotab); - - int *vertex_is_present = (int *)malloc(vert*sizeof(int)); - for (int v = 0; v < vert; v++) { - vertex_is_present[v] = -1; - } - for (int v = 0; v < num_vertices; v++) { - vertex_is_present[vertices[v]] = v; - } - - // TODO handle other cases - if (vendtab) { - for (int i = 0; i < vert; i++) { - assert(vendtab[i] == verttab[i+1]); - } - } - - SCOTCH_Num *new_verttab; /* Vertex array [vertnbr+1] */ - SCOTCH_Num *new_vendtab; /* Vertex array [vertnbr] */ - SCOTCH_Num *new_velotab; /* Vertex load array */ - SCOTCH_Num *new_vlbltab; /* Vertex label array */ - SCOTCH_Num new_edge; /* Number of edges (arcs) */ - SCOTCH_Num *new_edgetab; /* Edge array [edgenbr] */ - SCOTCH_Num *new_edlotab; /* Edge load array */ - - new_verttab = (SCOTCH_Num *)malloc((num_vertices+1)*sizeof(SCOTCH_Num)); - new_vendtab = NULL; - if (velotab) - new_velotab = (SCOTCH_Num *)malloc(num_vertices*sizeof(SCOTCH_Num)); - else - new_velotab = NULL; - if (vlbltab) - new_vlbltab = (SCOTCH_Num *)malloc(num_vertices*sizeof(SCOTCH_Num)); - else - new_vlbltab = NULL; - - new_edgetab = (SCOTCH_Num *)malloc(edge*sizeof(SCOTCH_Num)); - new_edlotab = (SCOTCH_Num *)malloc(edge*sizeof(SCOTCH_Num)); - - int edge_idx = 0; - new_verttab[0] = 0; - for (int v = 0; v < num_vertices; v++) { - if (velotab) - new_velotab[v] = velotab[vertices[v]]; - if (vlbltab) - new_vlbltab[v] = vlbltab[vertices[v]]; - - for (int e = verttab[vertices[v]]; e < verttab[vertices[v]+1]; e++) { - int dest_vertex = edgetab[e]; - int new_dest = vertex_is_present[dest_vertex]; - if (new_dest != -1) { - new_edgetab[edge_idx] = new_dest; - new_edlotab[edge_idx] = edlotab[e]; - edge_idx++; - } - } - new_verttab[v+1] = edge_idx; - } - - new_edge = edge_idx; - - SCOTCH_Num *old_edgetab = new_edgetab; - new_edgetab = (SCOTCH_Num *) - realloc(new_edgetab, new_edge*sizeof(SCOTCH_Num)); - if (!new_edgetab) { - new_edgetab = old_edgetab; - } - - SCOTCH_Num *old_edlotab = new_edlotab; - new_edlotab = (SCOTCH_Num *) - realloc(new_edlotab, new_edge*sizeof(SCOTCH_Num)); - if (!new_edlotab) { - new_edlotab = old_edlotab; - } - - ret = SCOTCH_graphBuild (nodegraph, base, num_vertices, - new_verttab, new_vendtab, new_velotab, new_vlbltab, - new_edge, new_edgetab, new_edlotab); - - free(vertex_is_present); - - return ret; -} - -static int build_current_arch(SCOTCH_Arch *scotch_arch, - SCOTCH_Arch *scotch_subarch, netloc_arch_t *arch) -{ - int ret; - /* First we need to get the topology of the whole machine */ - ret = netloc_arch_build(arch, 1); - if( NETLOC_SUCCESS != ret ) { - return ret; - } - - if (scotch_subarch) { - /* Set the current nodes and slots in the arch */ - ret = netloc_arch_set_current_resources(arch); - } else { - ret = netloc_arch_set_global_resources(arch); - } - - if( NETLOC_SUCCESS != ret ) { - return ret; - } - - SCOTCH_archInit(scotch_arch); - ret = arch_tree_to_scotch_arch(arch->arch.global_tree, scotch_arch); - if (NETLOC_SUCCESS != ret) { - return ret; - } - - if (scotch_subarch) { - /* Now we can build the sub architecture */ - SCOTCH_archInit(scotch_subarch); - ret = build_subarch(scotch_arch, arch->num_current_hosts, - arch->current_hosts, scotch_subarch); - } - - return ret; -} - -int netlocscotch_build_global_arch(SCOTCH_Arch *arch) -{ - int ret; - netloc_arch_t *netloc_arch = netloc_arch_construct(); - ret = build_current_arch(arch, NULL, netloc_arch); - - netloc_arch_destruct(netloc_arch); - return ret; -} - -int netlocscotch_build_current_arch(SCOTCH_Arch *arch, SCOTCH_Arch *subarch) -{ - int ret; - netloc_arch_t *netloc_arch = netloc_arch_construct(); - ret = build_current_arch(arch, subarch, netloc_arch); - - if (ret == NETLOC_SUCCESS) - netloc_arch_destruct(netloc_arch); - - return ret; -} - -int netlocscotch_get_mapping_from_graph(SCOTCH_Graph *graph, - netlocscotch_core_t **pcores) -{ - int ret; - - SCOTCH_Arch scotch_arch; - SCOTCH_Arch scotch_subarch; - netlocscotch_core_t *cores = NULL; - netloc_arch_t *arch = netloc_arch_construct(); - ret = build_current_arch(&scotch_arch, &scotch_subarch, arch); - if (NETLOC_SUCCESS != ret) { - netloc_arch_destruct(arch); - return ret; - } - - NETLOC_int graph_size; - SCOTCH_graphSize(graph, &graph_size, NULL); - - int num_hosts = arch->num_current_hosts; - - SCOTCH_Strat strategy; - SCOTCH_stratInit(&strategy); - /* We force Scotch to use all the processes - * barat is 0.01 as in SCOTCH_STRATDEFAULT */ - SCOTCH_stratGraphMapBuild(&strategy, SCOTCH_STRATQUALITY, graph_size, 0.01); - - /* The ranks are the indices of the nodes in the complete graph */ - NETLOC_int *ranks = (NETLOC_int *)malloc(graph_size*sizeof(NETLOC_int)); - ret = SCOTCH_graphMap(graph, &scotch_subarch, &strategy, ranks); - - SCOTCH_stratExit(&strategy); - - SCOTCH_archExit(&scotch_subarch); - SCOTCH_archExit(&scotch_arch); - - if (ret != 0) { - fprintf(stderr, "Error: SCOTCH_graphMap failed\n"); - goto ERROR; - } - - cores = (netlocscotch_core_t *) - malloc(graph_size*sizeof(netlocscotch_core_t)); - if (!arch->has_slots) { - /* We have the mapping but only for the nodes, not inside the nodes */ - - UT_array *process_by_node[num_hosts]; - for (int n = 0; n < num_hosts; n++) { - utarray_new(process_by_node[n], &ut_int_icd); - } - - /* Find the processes mapped to the nodes */ - for (int p = 0; p < graph_size; p++) { - int rank = ranks[p]; - if (rank >= num_hosts || rank < 0) { - ret = NETLOC_ERROR; - goto ERROR; - } - utarray_push_back(process_by_node[rank], &p); - } - - /* Use the intranode topology */ - for (int n = 0; n < num_hosts; n++) { - int *process_list = (int *)process_by_node[n]->d; - int num_processes = utarray_len(process_by_node[n]); - netloc_arch_node_t *node = - arch->node_slot_by_idx[arch->current_hosts[n]].node; - NETLOC_int node_ranks[num_processes]; - - /* We need to extract the subgraph with only the vertices mapped to the - * current node */ - SCOTCH_Graph nodegraph; /* graph with only elements for node n */ - build_subgraph(graph, process_list, num_processes, &nodegraph); - - /* Build the scotch arch of the all node */ - SCOTCH_Arch scotch_nodearch; - ret = arch_tree_to_scotch_arch(node->slot_tree, &scotch_nodearch); - if (NETLOC_SUCCESS != ret) { - goto ERROR; - } - - /* Restrict the scotch arch to the available cores */ - SCOTCH_Arch scotch_nodesubarch; - ret = build_subarch(&scotch_nodearch, node->num_current_slots, - node->current_slots, &scotch_nodesubarch); - if (NETLOC_SUCCESS != ret) { - goto ERROR; - } - - /* Find the mapping to the cores */ - ret = SCOTCH_graphMap(&nodegraph, &scotch_nodesubarch, &strategy, node_ranks); - if (ret != 0) { - fprintf(stderr, "Error: SCOTCH_graphMap failed\n"); - goto ERROR; - } - - /* Report the node ranks in the global rank array */ - for (int p = 0; p < num_processes; p++) { - int process = process_list[p]; - int arch_idx = node->current_slots[node_ranks[p]]; - cores[process].core = node->slot_os_idx[arch_idx]; - cores[process].nodename = strdup(node->node->hostname); - cores[process].rank = node->slot_ranks[node_ranks[p]]; - } - } - for (int n = 0; n < num_hosts; n++) { - utarray_free(process_by_node[n]); - } - } else { - for (int p = 0; p < graph_size; p++) { - int host_idx = arch->current_hosts[ranks[p]]; - netloc_arch_node_t *node = arch->node_slot_by_idx[host_idx].node; - int slot_rank = arch->node_slot_by_idx[host_idx].slot; - cores[p].nodename = strdup(node->node->hostname); - cores[p].core = node->slot_os_idx[node->slot_idx[slot_rank]]; - cores[p].rank = node->slot_ranks[node->slot_idx[slot_rank]]; - } - } - - *pcores = cores; - -ERROR: - free(ranks); - netloc_arch_destruct(arch); - if (ret == NETLOC_SUCCESS) - return ret; - free(cores); - return ret; -} - -int netlocscotch_get_mapping_from_comm_matrix(double **comm, int num_vertices, - netlocscotch_core_t **pcores) -{ - int ret; - - SCOTCH_Graph graph; - ret = comm_matrix_to_scotch_graph(comm, num_vertices, &graph); - if (NETLOC_SUCCESS != ret) { - return ret; - } - - ret = netlocscotch_get_mapping_from_graph(&graph, pcores); - - /* Free arrays */ - { - SCOTCH_Num base; /* Base value */ - SCOTCH_Num vert; /* Number of vertices */ - SCOTCH_Num *verttab; /* Vertex array [vertnbr+1] */ - SCOTCH_Num *vendtab; /* Vertex array [vertnbr] */ - SCOTCH_Num *velotab; /* Vertex load array */ - SCOTCH_Num *vlbltab; /* Vertex label array */ - SCOTCH_Num edge; /* Number of edges (arcs) */ - SCOTCH_Num *edgetab; /* Edge array [edgenbr] */ - SCOTCH_Num *edlotab; /* Edge load array */ - - SCOTCH_graphData(&graph, &base, &vert, &verttab, &vendtab, &velotab, - &vlbltab, &edge, &edgetab, &edlotab); - free(edlotab); - free(edgetab); - free(verttab); - SCOTCH_graphExit(&graph); - } - - return ret; -} - -int netlocscotch_get_mapping_from_comm_file(char *filename, int *pnum_processes, - netlocscotch_core_t **pcores) -{ - int ret; - int n; - double **mat; - - ret = netloc_build_comm_mat(filename, &n, &mat); - - if (ret != NETLOC_SUCCESS) { - return ret; - } - - *pnum_processes = n; - - ret = netlocscotch_get_mapping_from_comm_matrix(mat, n, pcores); - - free(mat[0]); - free(mat); - - return ret; -} - -static int comm_matrix_to_scotch_graph(double **matrix, int n, SCOTCH_Graph *graph) -{ - int ret; - - SCOTCH_Num base; /* Base value */ - SCOTCH_Num vert; /* Number of vertices */ - SCOTCH_Num *verttab; /* Vertex array [vertnbr+1] */ - SCOTCH_Num *vendtab; /* Vertex array [vertnbr] */ - SCOTCH_Num *velotab; /* Vertex load array */ - SCOTCH_Num *vlbltab; /* Vertex label array */ - SCOTCH_Num edge; /* Number of edges (arcs) */ - SCOTCH_Num *edgetab; /* Edge array [edgenbr] */ - SCOTCH_Num *edlotab; /* Edge load array */ - - base = 0; - vert = n; - - verttab = (SCOTCH_Num *)malloc((vert+1)*sizeof(SCOTCH_Num)); - for (int v = 0; v < vert+1; v++) { - verttab[v] = v*(n-1); - } - - vendtab = NULL; - velotab = NULL; - vlbltab = NULL; - - edge = n*(n-1); - - /* Compute the lowest load to reduce of the values of the load to avoid overflow */ - double min_load = -1; - for (int v1 = 0; v1 < vert; v1++) { - for (int v2 = 0; v2 < vert; v2++) { - double load = matrix[v1][v2]; - if (load >= 0.01 && (load < min_load || min_load < 0)) /* TODO set an epsilon */ - min_load = load; - } - } - - edgetab = (SCOTCH_Num *)malloc(n*(n-1)*sizeof(SCOTCH_Num)); - edlotab = (SCOTCH_Num *)malloc(n*(n-1)*sizeof(SCOTCH_Num)); - for (int v1 = 0; v1 < vert; v1++) { - for (int v2 = 0; v2 < vert; v2++) { - if (v2 == v1) - continue; - int idx = v1*(n-1)+((v2 < v1) ? v2: v2-1); - edgetab[idx] = v2; - edlotab[idx] = (int)(matrix[v1][v2]/min_load); - } - } - - ret = SCOTCH_graphBuild(graph, base, vert, - verttab, vendtab, velotab, vlbltab, edge, edgetab, edlotab); - - return ret; -} - diff -Nru hwloc-2.9.2/netloc/support.c hwloc-2.10.0/netloc/support.c --- hwloc-2.9.2/netloc/support.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/support.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright © 2013-2014 University of Wisconsin-La Crosse. - * All rights reserved. - * Copyright © 2016-2018 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#include -#include - -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif - -char *netloc_line_get_next_token(char **string, char c) -{ - char *field; - char *string_end; - - if (!*string) - return NULL; - - string_end = strchr(*string, c); - - if (string_end) { - string_end[0] = '\0'; - field = *string; - *string = string_end+1; - } else { - field = *string; - *string = NULL; - } - - return field; -} - -ssize_t netloc_line_get(char **lineptr, size_t *n, FILE *stream) -{ - ssize_t read = getline(lineptr, n, stream); - if (read == -1) - return -1; - - /* Remove last \n character */ - char *line = *lineptr; - size_t lastpos = strlen(line)-1; - if (line[lastpos] == '\n') { - line[lastpos] = '\0'; - read--; - } - return read; -} - diff -Nru hwloc-2.9.2/netloc/topology.c hwloc-2.10.0/netloc/topology.c --- hwloc-2.9.2/netloc/topology.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc/topology.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,598 +0,0 @@ -/* - * Copyright © 2013-2014 University of Wisconsin-La Crosse. - * All rights reserved. - * Copyright © 2016-2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -#include -#include -#include - -#include - -static char *line_get_next_field(char **string); -static void read_partition_list(char *list, UT_array *array); -static int edges_sort_by_dest(netloc_edge_t *a, netloc_edge_t *b); -static int find_reverse_edges(netloc_topology_t *topology); -static int find_similar_nodes(netloc_topology_t *topology); -static int netloc_node_get_virtual_id(char *id); -static int edge_merge_into(netloc_edge_t *dest, netloc_edge_t *src, int keep); - -netloc_topology_t *netloc_topology_construct(char *path) -{ - int ret; - char *line = NULL; - size_t linesize = 0; - - netloc_topology_t *topology = NULL; - - FILE *input = fopen(path, "r"); - - if (!input ) { - fprintf(stderr, "Cannot open topology file %s\n", path); - perror("fopen"); - exit(-1); - } - - int version; - if (fscanf(input , "%d\n,", &version) != 1) { - fprintf(stderr, "Cannot read the version number in %s\n", path); - perror("fscanf"); - fclose(input); - return NULL; - } else if (version != NETLOCFILE_VERSION) { - fprintf(stderr, "Incorrect version number, " - "please generate your input file again\n"); - fclose(input); - return NULL; - } - - char *subnet; - if (netloc_line_get(&line, &linesize, input) == -1) { - fprintf(stderr, "Cannot read the subnet in %s\n", path); - perror("fscanf"); - free(line); - fclose(input); - return NULL; - } else { - subnet = strdup(line); - } - - char *hwlocpath; - if (netloc_line_get(&line, &linesize, input) == -1) { - fprintf(stderr, "Cannot read hwloc path in %s\n", path); - perror("fscanf"); - free(subnet); - fclose(input); - return NULL; - } else if (!strlen(line)) { - hwlocpath = NULL; - } else { - hwlocpath = strdup(line); - } - - if (hwlocpath) { - DIR *hwlocdir; - char *realhwlocpath; - if (hwlocpath[0] != '/') { - char *path_tmp = strdup(path); - asprintf(&realhwlocpath, "%s/%s", dirname(path_tmp), hwlocpath); - free(path_tmp); - } else { - realhwlocpath = strdup(hwlocpath); - } - if (!(hwlocdir = opendir(realhwlocpath))) { - fprintf(stderr, "Couldn't open hwloc directory: \"%s\"\n", realhwlocpath); - perror("opendir"); - free(subnet); - free(realhwlocpath); - fclose(input); - return NULL; - } else { - closedir(hwlocdir); - free(realhwlocpath); - } - } - - int num_nodes; - if (fscanf(input , "%d\n", &num_nodes) != 1) { - fprintf(stderr, "Cannot read the number of nodes in %s\n", path); - perror("fscanf"); - free(subnet); - fclose(input); - return NULL; - } - - if (num_nodes <= 0) { - fprintf(stderr, "Oups: incorrect number of nodes (%d) in %s\n", - num_nodes, path); - free(subnet); - fclose(input); - return NULL; - } - - /* - * Allocate Memory - */ - topology = (netloc_topology_t *)malloc(sizeof(netloc_topology_t) * 1); - if( NULL == topology ) { - free(subnet); - fclose(input); - return NULL; - } - - /* - * Initialize the structure - */ - topology->topopath = path; - topology->hwlocpath = hwlocpath; - topology->subnet_id = subnet; - topology->nodes = NULL; - topology->physical_links = NULL; - topology->type = NETLOC_TOPOLOGY_TYPE_INVALID ; - topology->nodesByHostname = NULL; - topology->hwloc_topos = NULL; - utarray_new(topology->partitions, &ut_str_icd); - utarray_new(topology->topos, &ut_str_icd); - - /* Read nodes from file */ - for (int n = 0; n < num_nodes; n++) { - netloc_node_t *node = netloc_node_construct(); - netloc_line_get(&line, &linesize, input); - char *remain_line = line; - - strncpy(node->physical_id, line_get_next_field(&remain_line), 20); - /* Should be shorter than 20 */ - node->physical_id[19] = '\0'; /* If a problem occurs */ - node->logical_id = atoi(line_get_next_field(&remain_line)); - node->type = atoi(line_get_next_field(&remain_line)); - read_partition_list(line_get_next_field(&remain_line), node->partitions); - node->description = strdup(line_get_next_field(&remain_line)); - node->hostname = strdup(line_get_next_field(&remain_line)); - - HASH_ADD_STR(topology->nodes, physical_id, node); - if (strlen(node->hostname) > 0) { - HASH_ADD_KEYPTR(hh2, topology->nodesByHostname, node->hostname, - strlen(node->hostname), node); - } - } - - /* Read edges from file */ - for (int n = 0; n < num_nodes; n++) { - char *field; - netloc_node_t *node; - - netloc_line_get(&line, &linesize, input); - char *remain_line = line; - - field = line_get_next_field(&remain_line); - if (strlen(field) > 19) - field[19] = '\0'; - HASH_FIND_STR(topology->nodes, field, node); - - if (!node) { - fprintf(stderr, "Node not found: %s\n", field); - utarray_free(topology->partitions); - utarray_free(topology->topos); - return NULL; - } - - while ((field = line_get_next_field(&remain_line))) { - /* There is an edge */ - netloc_edge_t *edge = netloc_edge_construct(); - - HASH_FIND_STR(topology->nodes, field, edge->dest); - edge->total_gbits = strtof(line_get_next_field(&remain_line), NULL); - read_partition_list(line_get_next_field(&remain_line), edge->partitions); - - edge->node = node; - HASH_ADD_PTR(node->edges, dest, edge); - - /* Read links */ - int num_links = atoi(line_get_next_field(&remain_line)); - assert(num_links >= 0); - utarray_reserve(edge->physical_links, (unsigned int)num_links); - utarray_reserve(node->physical_links, (unsigned int)num_links); - for (int i = 0; i < num_links; i++) { - netloc_physical_link_t *link; - link = netloc_physical_link_construct(); - - link->id = atoi(line_get_next_field(&remain_line)); - - link->src = node; - link->dest = edge->dest; - - link->ports[0] = atoi(line_get_next_field(&remain_line)); - link->ports[1] = atoi(line_get_next_field(&remain_line)); - - link->width = strdup(line_get_next_field(&remain_line)); - link->speed = strdup(line_get_next_field(&remain_line)); - link->gbits = strtof(line_get_next_field(&remain_line), NULL); - link->description = strdup(line_get_next_field(&remain_line)); - link->other_way_id = atoi(line_get_next_field(&remain_line)); - - read_partition_list(line_get_next_field(&remain_line), - link->partitions); - - HASH_ADD_INT(topology->physical_links, id, link); - - utarray_push_back(node->physical_links, &link); - utarray_push_back(edge->physical_links, &link); - } - - } - HASH_SRT(hh, node->edges, edges_sort_by_dest); - } - - /* Read partitions from file */ - { - netloc_line_get(&line, &linesize, input); - char *remain_line = line; - char *field; - - while ((field = line_get_next_field(&remain_line))) { - utarray_push_back(topology->partitions, &field); - } - } - - /* Read paths */ - while (netloc_line_get(&line, &linesize, input) != -1) { - netloc_node_t *node; - netloc_path_t *path; - char *field; - - char *remain_line = line; - char *src_id = line_get_next_field(&remain_line); - char *dest_id = line_get_next_field(&remain_line); - - HASH_FIND_STR(topology->nodes, src_id, node); - - path = netloc_path_construct(); - strncpy(path->dest_id, dest_id, 20); /* Should be shorter than 20 */ - path->dest_id[19] = '\0'; /* If a problem occurs */ - - while ((field = line_get_next_field(&remain_line))) { - int link_id = atoi(field); - netloc_physical_link_t *link; - - HASH_FIND_INT(topology->physical_links, &link_id, link); - utarray_push_back(path->links, &link); - } - - HASH_ADD_STR(node->paths, dest_id, path); - } - - fclose(input); - free(line); - - if (find_reverse_edges(topology) != NETLOC_SUCCESS) { - netloc_topology_destruct(topology); - return NULL; - } - - ret = find_similar_nodes(topology); - if (ret != NETLOC_SUCCESS) { - netloc_topology_destruct(topology); - return NULL; - } - - return topology; -} - -int netloc_topology_destruct(netloc_topology_t *topology) -{ - /* - * Sanity Check - */ - if( NULL == topology ) { - fprintf(stderr, "Error: Detaching from a NULL pointer\n"); - return NETLOC_ERROR; - } - - free(topology->topopath); - free(topology->hwlocpath); - free(topology->subnet_id); - - /* Nodes */ - netloc_node_t *node, *node_tmp; - HASH_ITER(hh, topology->nodes, node, node_tmp) { - HASH_DELETE(hh, topology->nodes, node); - } - - netloc_topology_iter_nodes(topology, node, node_tmp) { - HASH_DELETE(hh, topology->nodes, node); - netloc_node_destruct(node); - } - - /** Partition List */ - utarray_free(topology->partitions); - - /** Physical links */ - netloc_physical_link_t *link, *link_tmp; - HASH_ITER(hh, topology->physical_links, link, link_tmp) { - HASH_DEL(topology->physical_links, link); - netloc_physical_link_destruct(link); - } - - /** Hwloc topology List */ - for (unsigned int t = 0; t < utarray_len(topology->topos); t++) { - if (topology->hwloc_topos[t]) - hwloc_topology_destroy(topology->hwloc_topos[t]); - } - free(topology->hwloc_topos); - - /** Hwloc topology name List */ - utarray_free(topology->topos); - - free(topology); - - return NETLOC_SUCCESS; -} - -int netloc_topology_find_partition_idx(netloc_topology_t *topology, char *partition_name) -{ - if (!partition_name) - return -1; - - /* Find the selected partition in the topology */ - unsigned int p = 0; - int found = 0; - while (p < utarray_len(topology->partitions)) { - char *current_name = *(char **)utarray_eltptr(topology->partitions, p); - - if (!strcmp(current_name, partition_name)) { - found = 1; - break; - } - p++; - } - - if (!found) - return -2; - - assert(p <= INT_MAX); - - return (int)p; -} - -static char *line_get_next_field(char **string) -{ - return netloc_line_get_next_token(string, ','); -} - -static void read_partition_list(char *list, UT_array *array) -{ - char *partition; - if (!strlen(list)) - return; - while ((partition = netloc_line_get_next_token(&list, ':'))) { - int partition_num = atoi(partition); - utarray_push_back(array, &partition_num); - } -} - -static int edges_sort_by_dest(netloc_edge_t *a, netloc_edge_t *b) -{ - return strcmp(a->dest->physical_id, b->dest->physical_id); -} - -static int find_reverse_edges(netloc_topology_t *topology) -{ - netloc_node_t *node, *node_tmp; - HASH_ITER(hh, topology->nodes, node, node_tmp) { - netloc_edge_t *edge, *edge_tmp; - netloc_node_iter_edges(node, edge, edge_tmp) { - netloc_node_t *dest = edge->dest; - if (dest > node) { - netloc_edge_t *reverse_edge; - HASH_FIND_PTR(dest->edges, &node, reverse_edge); - if (reverse_edge == NULL) { - return NETLOC_ERROR; - } - edge->other_way = reverse_edge; - reverse_edge->other_way = edge; - } - } - } - return NETLOC_SUCCESS; -} - -static int find_similar_nodes(netloc_topology_t * topology) -{ - int ret; - - /* Build edge lists by node */ - int num_nodes = HASH_COUNT(topology->nodes); - netloc_node_t **nodes = (netloc_node_t **)malloc(num_nodes*sizeof(netloc_node_t *)); - netloc_node_t ***edgedest_by_node = (netloc_node_t ***)malloc(num_nodes*sizeof(netloc_node_t **)); - int *num_edges_by_node = (int *)malloc(num_nodes*sizeof(int)); - netloc_node_t *node, *node_tmp; - int idx = -1; - netloc_topology_iter_nodes(topology, node, node_tmp) { - idx++; - if (netloc_node_is_host(node)) { - nodes[idx] = NULL; - edgedest_by_node[idx] = NULL; - continue; - } - int num_edges = HASH_COUNT(node->edges); - nodes[idx] = node; - num_edges_by_node[idx] = num_edges; - edgedest_by_node[idx] = (netloc_node_t **)malloc(num_edges*sizeof(netloc_node_t *)); - - netloc_edge_t *edge, *edge_tmp; - int edge_idx = 0; - netloc_node_iter_edges(node, edge, edge_tmp) { - edgedest_by_node[idx][edge_idx] = edge->dest; - edge_idx++; - } - } - - /* We compare the edge lists to find similar nodes */ - UT_array *similar_nodes; - utarray_new(similar_nodes, &ut_ptr_icd); - for (int idx1 = 0; idx1 < num_nodes; idx1++) { - netloc_node_t *node1 = nodes[idx1]; - netloc_node_t *virtual_node = NULL; - netloc_edge_t *first_virtual_edge = NULL; - if (!node1) - continue; - for (int idx2 = idx1+1; idx2 < num_nodes; idx2++) { - netloc_node_t *node2 = nodes[idx2]; - if (!node2) - continue; - if (num_edges_by_node[idx2] != num_edges_by_node[idx1]) - continue; - if (idx2 == idx1) - continue; - - int equal = 1; - for (int i = 0; i < num_edges_by_node[idx1]; i++) { - if (edgedest_by_node[idx2][i] != edgedest_by_node[idx1][i]) { - equal = 0; - break; - } - } - - /* If we have similar nodes */ - if (equal) { - /* We create a new virtual node to contain all of them */ - if (!virtual_node) { - virtual_node = netloc_node_construct(); - netloc_node_get_virtual_id(virtual_node->physical_id); - - virtual_node->type = node1->type; - utarray_concat(virtual_node->physical_links, node1->physical_links); - virtual_node->description = strdup(virtual_node->physical_id); - - utarray_push_back(virtual_node->subnodes, &node1); - utarray_concat(virtual_node->partitions, node1->partitions); - - // TODO paths - - /* Set edges */ - netloc_edge_t *edge1, *edge_tmp1; - netloc_node_iter_edges(node1, edge1, edge_tmp1) { - netloc_edge_t *virtual_edge = netloc_edge_construct(); - if (!first_virtual_edge) - first_virtual_edge = virtual_edge; - virtual_edge->node = virtual_node; - virtual_edge->dest = edge1->dest; - ret = edge_merge_into(virtual_edge, edge1, 0); - if (ret != NETLOC_SUCCESS) { - netloc_edge_destruct(virtual_edge); - goto ERROR; - } - HASH_ADD_PTR(virtual_node->edges, dest, virtual_edge); - - /* Change the reverse edge of the neighbours (reverse nodes) */ - netloc_node_t *reverse_node = edge1->dest; - netloc_edge_t *reverse_edge = edge1->other_way; - - netloc_edge_t *reverse_virtual_edge = - netloc_edge_construct(); - reverse_virtual_edge->dest = virtual_node; - reverse_virtual_edge->node = reverse_node; - reverse_virtual_edge->other_way = virtual_edge; - virtual_edge->other_way = reverse_virtual_edge; - HASH_ADD_PTR(reverse_node->edges, dest, reverse_virtual_edge); - ret = edge_merge_into(reverse_virtual_edge, reverse_edge, 1); - if (ret != NETLOC_SUCCESS) { - goto ERROR; - } - HASH_DEL(reverse_node->edges, reverse_edge); - } - - /* We remove the node from the list of nodes */ - HASH_DEL(topology->nodes, node1); - HASH_ADD_STR(topology->nodes, physical_id, virtual_node); - printf("First node found: %s (%s)\n", node1->description, node1->physical_id); - } - - utarray_concat(virtual_node->physical_links, node2->physical_links); - utarray_push_back(virtual_node->subnodes, &node2); - utarray_concat(virtual_node->partitions, node2->partitions); - - /* Set edges */ - netloc_edge_t *edge2, *edge_tmp2; - netloc_edge_t *virtual_edge = first_virtual_edge; - netloc_node_iter_edges(node2, edge2, edge_tmp2) { - /* Merge the edges from the physical node into the virtual node */ - ret = edge_merge_into(virtual_edge, edge2, 0); - if (ret != NETLOC_SUCCESS) { - goto ERROR; - } - - /* Change the reverse edge of the neighbours (reverse nodes) */ - netloc_node_t *reverse_node = edge2->dest; - netloc_edge_t *reverse_edge = edge2->other_way; - - netloc_edge_t *reverse_virtual_edge; - HASH_FIND_PTR(reverse_node->edges, &virtual_node, - reverse_virtual_edge); - ret = edge_merge_into(reverse_virtual_edge, reverse_edge, 1); - if (ret != NETLOC_SUCCESS) { - goto ERROR; - } - HASH_DEL(reverse_node->edges, reverse_edge); - - /* Get the next edge */ - virtual_edge = virtual_edge->hh.next; - } - - /* We remove the node from the list of nodes */ - HASH_DEL(topology->nodes, node2); - printf("\t node found: %s (%s)\n", node2->description, node2->physical_id); - - nodes[idx2] = NULL; - } - } - utarray_clear(similar_nodes); - } - - ret = NETLOC_SUCCESS; -ERROR: - free(nodes); - - for (int idx = 0; idx < num_nodes; idx++) { - if (edgedest_by_node[idx]) - free(edgedest_by_node[idx]); - } - free(edgedest_by_node); - free(num_edges_by_node); - free(similar_nodes); - return ret; -} - -static int netloc_node_get_virtual_id(char *id) -{ - static int virtual_id = 0; - sprintf(id, "virtual%d", virtual_id++); - return 0; -} - -static int edge_merge_into(netloc_edge_t *dest, netloc_edge_t *src, int keep) -{ - if (!dest || !src) { - return NETLOC_ERROR; - } - - utarray_concat(dest->physical_links, src->physical_links); - dest->total_gbits += src->total_gbits; - utarray_concat(dest->partitions, src->partitions); - /* it will keep the duplicated edges */ - if (keep) - utarray_push_back(dest->subnode_edges, &src); - - return NETLOC_SUCCESS; -} - diff -Nru hwloc-2.9.2/netloc.pc.in hwloc-2.10.0/netloc.pc.in --- hwloc-2.9.2/netloc.pc.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netloc.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: netloc -Description: Network locality detection and management library -Version: @HWLOC_VERSION@ -Cflags: -I${includedir} -Libs: -L${libdir} -lnetloc -lhwloc -Libs.private: @LIBS@ diff -Nru hwloc-2.9.2/netlocscotch.pc.in hwloc-2.10.0/netlocscotch.pc.in --- hwloc-2.9.2/netlocscotch.pc.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/netlocscotch.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: netlocscotch -Description: Network locality to scotch architecture -Version: @HWLOC_VERSION@ -Cflags: -I${includedir} -Libs: -L${libdir} -lnetlocscotch -lnetloc -lhwloc -Libs.private: @LIBS@ diff -Nru hwloc-2.9.2/tests/Makefile.am hwloc-2.10.0/tests/Makefile.am --- hwloc-2.9.2/tests/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -4,6 +4,3 @@ # See COPYING in top-level directory. SUBDIRS = hwloc -if BUILD_NETLOC -SUBDIRS += netloc -endif diff -Nru hwloc-2.9.2/tests/Makefile.in hwloc-2.10.0/tests/Makefile.in --- hwloc-2.9.2/tests/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -93,7 +93,6 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@BUILD_NETLOC_TRUE@am__append_1 = netloc subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ @@ -107,8 +106,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -169,7 +167,7 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -DIST_SUBDIRS = hwloc netloc +DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ @@ -201,7 +199,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -328,17 +325,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -407,7 +393,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -430,8 +415,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ -SUBDIRS = hwloc $(am__append_1) +SUBDIRS = hwloc all: all-recursive .SUFFIXES: diff -Nru hwloc-2.9.2/tests/hwloc/CMakeLists.txt hwloc-2.10.0/tests/hwloc/CMakeLists.txt --- hwloc-2.9.2/tests/hwloc/CMakeLists.txt 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -foreach(t api_version backends bind - bitmap bitmap_compare_inclusion bitmap_first_last_weight bitmap_singlify bitmap_string - distances get_area_memlocation get_cache_covering_cpuset get_closest_objs get_largest_objs_inside_cpuset - get_last_cpu_location get_next_obj_covering_cpuset get_obj_below_array_by_type get_obj_covering_cpuset - get_obj_inside_cpuset get_obj_with_same_locality get_shared_cache_covering_obj - groups insert_misc iodevs is_thissystem list_components obj_infos object_userdata pci_backend synthetic - topology_abi topology_allow topology_diff topology_dup topology_restrict type_depth type_sscanf -) - add_executable(hwloc_${t} hwloc_${t}.c) - target_link_libraries(hwloc_${t} PRIVATE hwloc) - - add_test(NAME ${t} COMMAND hwloc_${t} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) - set_tests_properties(${t} PROPERTIES TIMEOUT 10) -endforeach() - -foreach(t cpuset_nodeset memattrs cpukinds gl windows_processor_groups) - add_executable(${t} ${t}.c) - target_link_libraries(${t} PRIVATE hwloc) - - add_test(NAME ${t} COMMAND ${t} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) - set_tests_properties(${t} PROPERTIES TIMEOUT 10) -endforeach() - -add_executable(xmlbuffer xmlbuffer.c) -target_link_libraries(xmlbuffer PRIVATE hwloc) -add_test(NAME xmlbuffer00 COMMAND xmlbuffer 0 0 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) -add_test(NAME xmlbuffer01 COMMAND xmlbuffer 0 1 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) -add_test(NAME xmlbuffer10 COMMAND xmlbuffer 1 0 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) -add_test(NAME xmlbuffer11 COMMAND xmlbuffer 1 1 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) -set_tests_properties(xmlbuffer00 xmlbuffer01 xmlbuffer10 xmlbuffer11 PROPERTIES TIMEOUT 10) - -target_compile_definitions(hwloc_type_sscanf PRIVATE XMLTESTDIR=\"${CMAKE_CURRENT_SOURCE_DIR}/xml/\") - -set_tests_properties(get_obj_with_same_locality PROPERTIES ENVIRONMENT HWLOC_TOP_SRCDIR=${TOPDIR}) - -add_test(NAME lstopo-no-graphics:verbose COMMAND lstopo-no-graphics -v) -add_test(NAME lstopo-no-graphics:groups COMMAND lstopo-no-graphics --windows-processor-groups) -set_tests_properties(lstopo-no-graphics:verbose lstopo-no-graphics:groups PROPERTIES -DISABLED ${HWLOC_SKIP_LSTOPO} -LABELS exe -TIMEOUT 10 -) - -add_test(NAME hwloc-info:support COMMAND hwloc-info --support) -set_tests_properties(hwloc-info:support PROPERTIES -DISABLED ${HWLOC_SKIP_TOOLS} -LABELS exe -TIMEOUT 10 -) - - -# --- optional tests - -if(HWLOC_HAVE_OPENCL) - add_executable(test_opencl opencl.c) - target_link_libraries(test_opencl PRIVATE hwloc OpenCL::OpenCL) - - add_test(NAME OpenCL COMMAND test_opencl) - set_tests_properties(OpenCL PROPERTIES TIMEOUT 10) -endif() - -if(HAVE_CUDA) - add_executable(test_cuda cuda.c) - target_link_libraries(test_cuda PRIVATE hwloc CUDA::cudart CUDA::cuda_driver) - - add_test(NAME CUDA COMMAND test_cuda) - set_tests_properties(CUDA PROPERTIES TIMEOUT 10) -endif() diff -Nru hwloc-2.9.2/tests/hwloc/Makefile.am hwloc-2.10.0/tests/hwloc/Makefile.am --- hwloc-2.9.2/tests/hwloc/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -168,5 +168,4 @@ embedded/main.c \ embedded/run-embedded-tests.sh \ embedded/README.txt \ - embedded/config/README.txt \ - CMakeLists.txt + embedded/config/README.txt diff -Nru hwloc-2.9.2/tests/hwloc/Makefile.in hwloc-2.10.0/tests/hwloc/Makefile.in --- hwloc-2.9.2/tests/hwloc/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -152,8 +152,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -868,7 +867,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -995,17 +993,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -1074,7 +1061,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -1097,7 +1083,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) -DXMLTESTDIR=\"$(abs_top_srcdir)/tests/hwloc/xml/\" AM_LDFLAGS = $(HWLOC_LDFLAGS) @@ -1138,8 +1123,7 @@ embedded/main.c \ embedded/run-embedded-tests.sh \ embedded/README.txt \ - embedded/config/README.txt \ - CMakeLists.txt + embedded/config/README.txt all: all-recursive diff -Nru hwloc-2.9.2/tests/hwloc/hwloc_groups.c hwloc-2.10.0/tests/hwloc/hwloc_groups.c --- hwloc-2.9.2/tests/hwloc/hwloc_groups.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/hwloc_groups.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2011-2021 Inria. All rights reserved. + * Copyright © 2011-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -31,6 +31,17 @@ hwloc_topology_load(topology); root = hwloc_get_root_obj(topology); assert(hwloc_topology_get_depth(topology) == 3); + /* free instead of inserting */ + group = hwloc_topology_alloc_group_object(topology); + assert(group); + group->cpuset = hwloc_bitmap_dup(root->cpuset); + err = hwloc_topology_free_group_object(topology, group); + assert(err == 0); + /* insert without sets, fails */ + group = hwloc_topology_alloc_group_object(topology); + assert(group); + res = hwloc_topology_insert_group_object(topology, group); + assert(res == NULL); /* insert a group identical to root, will be merged */ group = hwloc_topology_alloc_group_object(topology); assert(group); diff -Nru hwloc-2.9.2/tests/hwloc/hwloc_topology_abi.c hwloc-2.10.0/tests/hwloc/hwloc_topology_abi.c --- hwloc-2.9.2/tests/hwloc/hwloc_topology_abi.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/hwloc_topology_abi.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2017-2020 Inria. All rights reserved. + * Copyright © 2017-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -141,6 +141,22 @@ size = sizeof(struct hwloc_info_s); assert(size == 16); +#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN + size = sizeof(struct hwloc_pcidev_attr_s); + assert(size == 24); + offset = offsetof(struct hwloc_pcidev_attr_s, class_id); + assert(offset == 6); + offset = offsetof(struct hwloc_pcidev_attr_s, revision); + assert(offset == 16); +#else + size = sizeof(struct hwloc_pcidev_attr_s); + assert(size == 24); + offset = offsetof(struct hwloc_pcidev_attr_s, class_id); + assert(offset == 8); + offset = offsetof(struct hwloc_pcidev_attr_s, revision); + assert(offset == 18); +#endif + size = sizeof(struct hwloc_topology_support); assert(size == 32); size = sizeof(struct hwloc_topology_discovery_support); diff -Nru hwloc-2.9.2/tests/hwloc/levelzero.c hwloc-2.10.0/tests/hwloc/levelzero.c --- hwloc-2.9.2/tests/hwloc/levelzero.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/levelzero.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2021 Inria. All rights reserved. + * Copyright © 2021-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -9,6 +9,7 @@ #include #include +#include "private/autogen/config.h" /* for HWLOC_HAVE_ZESINIT */ #include "hwloc.h" #include "hwloc/levelzero.h" @@ -22,6 +23,14 @@ ze_result_t res; int err = 0; +#ifdef HWLOC_HAVE_ZESINIT + res = zesInit(0); + if (res != ZE_RESULT_SUCCESS) { + fprintf(stderr, "Failed to initialize LevelZero Sysman in zesInit(): %d\n", (int)res); + /* continuing, assuming ZES_ENABLE_SYSMAN=1 will be enough */ + } +#endif + putenv((char *) "ZES_ENABLE_SYSMAN=1"); res = zeInit(0); diff -Nru hwloc-2.9.2/tests/hwloc/linux/20em64t-hybrid-1p6c2t+2ca4co1t.output hwloc-2.10.0/tests/hwloc/linux/20em64t-hybrid-1p6c2t+2ca4co1t.output --- hwloc-2.9.2/tests/hwloc/linux/20em64t-hybrid-1p6c2t+2ca4co1t.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/20em64t-hybrid-1p6c2t+2ca4co1t.output 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,90 @@ +Machine (P#0 total=32489480KB DMIProductName="HP EliteBook 840 14 inch G10 Notebook PC" DMIProductVersion= DMIBoardVendor=HP DMIBoardName=8B41 DMIBoardVersion="KBC Version 51.32.00" DMIBoardAssetTag= DMIChassisVendor=HP DMIChassisType=10 DMIChassisVersion= DMIChassisAssetTag= DMIBIOSVendor=HP DMIBIOSVersion="V70 Ver. 01.02.03" DMIBIOSDate=09/13/2023 DMISysVendor=HP Backend=Linux OSName=Linux OSRelease=6.1.0-13-amd64 OSVersion="#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29)" HostName=vesubie Architecture=x86_64) + Package L#0 (P#0 total=32489480KB CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=186 CPUModel="13th Gen Intel(R) Core(TM) i7-1370P" CPUStepping=2) + NUMANode L#0 (P#0 local=32489480KB total=32489480KB) + L3Cache L#0 (P#0 size=24576KB linesize=64 ways=12) + L2Cache L#0 (P#0 size=1280KB linesize=64 ways=10) + L1dCache L#0 (P#0 size=48KB linesize=64 ways=12) + L1iCache L#0 (P#0 size=32KB linesize=64 ways=8) + Core L#0 (P#0) + PU L#0 (P#0) + PU L#1 (P#1) + L2Cache L#1 (P#1 size=1280KB linesize=64 ways=10) + L1dCache L#1 (P#4 size=48KB linesize=64 ways=12) + L1iCache L#1 (P#4 size=32KB linesize=64 ways=8) + Core L#1 (P#4) + PU L#2 (P#2) + PU L#3 (P#3) + L2Cache L#2 (P#2 size=1280KB linesize=64 ways=10) + L1dCache L#2 (P#8 size=48KB linesize=64 ways=12) + L1iCache L#2 (P#8 size=32KB linesize=64 ways=8) + Core L#2 (P#8) + PU L#4 (P#4) + PU L#5 (P#5) + L2Cache L#3 (P#3 size=1280KB linesize=64 ways=10) + L1dCache L#3 (P#12 size=48KB linesize=64 ways=12) + L1iCache L#3 (P#12 size=32KB linesize=64 ways=8) + Core L#3 (P#12) + PU L#6 (P#6) + PU L#7 (P#7) + L2Cache L#4 (P#4 size=1280KB linesize=64 ways=10) + L1dCache L#4 (P#16 size=48KB linesize=64 ways=12) + L1iCache L#4 (P#16 size=32KB linesize=64 ways=8) + Core L#4 (P#16) + PU L#8 (P#8) + PU L#9 (P#9) + L2Cache L#5 (P#5 size=1280KB linesize=64 ways=10) + L1dCache L#5 (P#20 size=48KB linesize=64 ways=12) + L1iCache L#5 (P#20 size=32KB linesize=64 ways=8) + Core L#5 (P#20) + PU L#10 (P#10) + PU L#11 (P#11) + L2Cache L#6 (P#6 size=2048KB linesize=64 ways=16) + L1dCache L#6 (P#24 size=32KB linesize=64 ways=8) + L1iCache L#6 (P#24 size=64KB linesize=64 ways=8) + Core L#6 (P#24) + PU L#12 (P#12) + L1dCache L#7 (P#25 size=32KB linesize=64 ways=8) + L1iCache L#7 (P#25 size=64KB linesize=64 ways=8) + Core L#7 (P#25) + PU L#13 (P#13) + L1dCache L#8 (P#26 size=32KB linesize=64 ways=8) + L1iCache L#8 (P#26 size=64KB linesize=64 ways=8) + Core L#8 (P#26) + PU L#14 (P#14) + L1dCache L#9 (P#27 size=32KB linesize=64 ways=8) + L1iCache L#9 (P#27 size=64KB linesize=64 ways=8) + Core L#9 (P#27) + PU L#15 (P#15) + L2Cache L#7 (P#7 size=2048KB linesize=64 ways=16) + L1dCache L#10 (P#28 size=32KB linesize=64 ways=8) + L1iCache L#10 (P#28 size=64KB linesize=64 ways=8) + Core L#10 (P#28) + PU L#16 (P#16) + L1dCache L#11 (P#29 size=32KB linesize=64 ways=8) + L1iCache L#11 (P#29 size=64KB linesize=64 ways=8) + Core L#11 (P#29) + PU L#17 (P#17) + L1dCache L#12 (P#30 size=32KB linesize=64 ways=8) + L1iCache L#12 (P#30 size=64KB linesize=64 ways=8) + Core L#12 (P#30) + PU L#18 (P#18) + L1dCache L#13 (P#31 size=32KB linesize=64 ways=8) + L1iCache L#13 (P#31 size=64KB linesize=64 ways=8) + Core L#13 (P#31) + PU L#19 (P#19) +depth 0: 1 Machine (type #0) + depth 1: 1 Package (type #1) + depth 2: 1 L3Cache (type #6) + depth 3: 8 L2Cache (type #5) + depth 4: 14 L1dCache (type #4) + depth 5: 14 L1iCache (type #9) + depth 6: 14 Core (type #2) + depth 7: 20 PU (type #3) +Special depth -3: 1 NUMANode (type #13) +CPU kind #0 efficiency 0 cpuset 0x000ff000 + FrequencyMaxMHz = 3900 + FrequencyBaseMHz = 1400 +CPU kind #1 efficiency 1 cpuset 0x00000fff + FrequencyMaxMHz = 5000 + FrequencyBaseMHz = 1900 +Topology not from this system Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/hwloc/linux/20em64t-hybrid-1p6c2t+2ca4co1t.tar.bz2 and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/hwloc/linux/20em64t-hybrid-1p6c2t+2ca4co1t.tar.bz2 differ diff -Nru hwloc-2.9.2/tests/hwloc/linux/32em64t-2n8c+1mic.output hwloc-2.10.0/tests/hwloc/linux/32em64t-2n8c+1mic.output --- hwloc-2.9.2/tests/hwloc/linux/32em64t-2n8c+1mic.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/32em64t-2n8c+1mic.output 2023-12-05 12:32:19.000000000 +0000 @@ -447,6 +447,10 @@ + + + + @@ -454,6 +458,10 @@ + + + + @@ -461,6 +469,10 @@ + + + + @@ -468,6 +480,10 @@ + + + + @@ -475,6 +491,10 @@ + + + + @@ -482,6 +502,10 @@ + + + + @@ -489,6 +513,10 @@ + + + + @@ -496,6 +524,10 @@ + + + + diff -Nru hwloc-2.9.2/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid-msc.output hwloc-2.10.0/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid-msc.output --- hwloc-2.9.2/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid-msc.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid-msc.output 2023-12-05 12:32:19.000000000 +0000 @@ -2,8 +2,8 @@ Package L#0 (P#0 total=12582912KB CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=87 CPUModel=06/57 CPUStepping=0) Group0(Cluster) L#0 (total=3145728KB) MemCache L#0 (total=1048576KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#0 (P#0 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#1 (P#7 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#0 (P#0 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#1 (P#7 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#0 (size=4096KB linesize=64) L1dCache L#0 (size=32KB linesize=64) L1iCache L#0 (size=32KB linesize=64) @@ -36,8 +36,8 @@ PU L#15 (P#51) Group0(Cluster) L#1 (total=3145728KB) MemCache L#1 (total=1048576KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#2 (P#1 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#3 (P#4 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#2 (P#1 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#3 (P#4 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#2 (size=4096KB linesize=64) L1dCache L#4 (size=32KB linesize=64) L1iCache L#4 (size=32KB linesize=64) @@ -70,8 +70,8 @@ PU L#31 (P#55) Group0(Cluster) L#2 (total=3145728KB) MemCache L#2 (total=1048576KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#4 (P#2 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#5 (P#5 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#4 (P#2 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#5 (P#5 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#4 (size=4096KB linesize=64) L1dCache L#8 (size=32KB linesize=64) L1iCache L#8 (size=32KB linesize=64) @@ -104,8 +104,8 @@ PU L#47 (P#59) Group0(Cluster) L#3 (total=3145728KB) MemCache L#3 (total=1048576KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#6 (P#3 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#7 (P#6 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#6 (P#3 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#7 (P#6 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#6 (size=4096KB linesize=64) L1dCache L#12 (size=32KB linesize=64) L1iCache L#12 (size=32KB linesize=64) diff -Nru hwloc-2.9.2/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid.output hwloc-2.10.0/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid.output --- hwloc-2.9.2/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/64intel64-fakeKNL-SNC4-hybrid.output 2023-12-05 12:32:19.000000000 +0000 @@ -1,8 +1,8 @@ Machine (P#0 total=12582912KB ClusterMode=SNC4 MemoryMode=Hybrid50 Backend=Linux OSName=Linux OSRelease=3.10.0-327.el7.x86_64 OSVersion="#1 SMP Thu Oct 29 17:29:29 EDT 2015" HostName=localhost.localdomain Architecture=x86_64) Package L#0 (P#0 total=12582912KB CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=87 CPUModel=06/57 CPUStepping=0) L3Cache(MemorySideCache) L#0 (total=3145728KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#0 (P#0 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#1 (P#7 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#0 (P#0 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#1 (P#7 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#0 (size=4096KB linesize=64) L1dCache L#0 (size=32KB linesize=64) L1iCache L#0 (size=32KB linesize=64) @@ -34,8 +34,8 @@ PU L#14 (P#35) PU L#15 (P#51) L3Cache(MemorySideCache) L#1 (total=3145728KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#2 (P#1 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#3 (P#4 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#2 (P#1 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#3 (P#4 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#2 (size=4096KB linesize=64) L1dCache L#4 (size=32KB linesize=64) L1iCache L#4 (size=32KB linesize=64) @@ -67,8 +67,8 @@ PU L#30 (P#39) PU L#31 (P#55) L3Cache(MemorySideCache) L#2 (total=3145728KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#4 (P#2 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#5 (P#5 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#4 (P#2 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#5 (P#5 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#4 (size=4096KB linesize=64) L1dCache L#8 (size=32KB linesize=64) L1iCache L#8 (size=32KB linesize=64) @@ -100,8 +100,8 @@ PU L#46 (P#43) PU L#47 (P#59) L3Cache(MemorySideCache) L#3 (total=3145728KB size=2097152KB linesize=64 ways=1 Inclusive=1) - NUMANode L#6 (P#3 local=1048576KB total=1048576KB) - NUMANode(MCDRAM) L#7 (P#6 local=2097152KB total=2097152KB) + NUMANode(DRAM) L#6 (P#3 local=1048576KB total=1048576KB MemoryTier=1) + NUMANode(MCDRAM) L#7 (P#6 local=2097152KB total=2097152KB MemoryTier=0) L2Cache L#6 (size=4096KB linesize=64) L1dCache L#12 (size=32KB linesize=64) L1iCache L#12 (size=32KB linesize=64) diff -Nru hwloc-2.9.2/tests/hwloc/linux/Makefile.am hwloc-2.10.0/tests/hwloc/linux/Makefile.am --- hwloc-2.9.2/tests/hwloc/linux/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2022 Inria. All rights reserved. +# Copyright © 2009-2023 Inria. All rights reserved. # Copyright © 2009-2011 Université Bordeaux # Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -57,6 +57,7 @@ 128arm-2pa2n8cluster4co.output \ 256ia64-64n2s2c.output \ 2s390-2c.output \ + 20em64t-hybrid-1p6c2t+2ca4co1t.output \ 20s390-2g6s4c.output \ 2arm-2c.output \ nvidiagpunumanodes.output \ @@ -65,6 +66,7 @@ fakecpuid1f-64intel64-2p4d2n2c2t.output \ fakeheterocpunuma.output \ fakeheteromemtiers.output \ + memorysidecaches.output \ offline-cpu0-node0.output if HWLOC_HAVE_32BITS_PCI_DOMAIN @@ -127,6 +129,7 @@ 128arm-2pa2n8cluster4co.tar.bz2 \ 256ia64-64n2s2c.tar.bz2 \ 2s390-2c.tar.bz2 \ + 20em64t-hybrid-1p6c2t+2ca4co1t.tar.bz2 \ 20s390-2g6s4c.tar.bz2 \ 2arm-2c.tar.bz2 \ 2pa-pcidomain32bits.tar.bz2 \ @@ -137,6 +140,7 @@ fakecpuid1f-64intel64-2p4d2n2c2t.tar.bz2 \ fakeheterocpunuma.tar.bz2 \ fakeheteromemtiers.tar.bz2 \ + memorysidecaches.tar.bz2 \ offline-cpu0-node0.tar.bz2 # Each output `xyz.output' may have a corresponding exclude `xyz.exclude' diff -Nru hwloc-2.9.2/tests/hwloc/linux/Makefile.in hwloc-2.10.0/tests/hwloc/linux/Makefile.in --- hwloc-2.9.2/tests/hwloc/linux/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2022 Inria. All rights reserved. +# Copyright © 2009-2023 Inria. All rights reserved. # Copyright © 2009-2011 Université Bordeaux # Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -108,8 +108,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -407,7 +406,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -534,17 +532,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -613,7 +600,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -636,7 +622,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) @@ -671,12 +656,14 @@ 64intel64-fakeKNL-SNC4-hybrid-msc.output \ 96em64t-4n4d3ca2co.output 128ia64-17n4s2c.output \ 128arm-2pa2n8cluster4co.output 256ia64-64n2s2c.output \ - 2s390-2c.output 20s390-2g6s4c.output 2arm-2c.output \ - nvidiagpunumanodes.output nvidiagpunumanodes.kept.output \ + 2s390-2c.output 20em64t-hybrid-1p6c2t+2ca4co1t.output \ + 20s390-2g6s4c.output 2arm-2c.output nvidiagpunumanodes.output \ + nvidiagpunumanodes.kept.output \ fakememinitiators-1np2c+1npp+gi.output \ fakecpuid1f-64intel64-2p4d2n2c2t.output \ fakeheterocpunuma.output fakeheteromemtiers.output \ - offline-cpu0-node0.output $(am__append_1) $(am__append_2) + memorysidecaches.output offline-cpu0-node0.output \ + $(am__append_1) $(am__append_2) @HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@EXTRA_DIST = 2pa-pcidomain32bits.output \ @HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@ $(sysfs_outputs) \ @HWLOC_HAVE_32BITS_PCI_DOMAIN_FALSE@ $(sysfs_tarballs) \ @@ -742,6 +729,7 @@ 128arm-2pa2n8cluster4co.tar.bz2 \ 256ia64-64n2s2c.tar.bz2 \ 2s390-2c.tar.bz2 \ + 20em64t-hybrid-1p6c2t+2ca4co1t.tar.bz2 \ 20s390-2g6s4c.tar.bz2 \ 2arm-2c.tar.bz2 \ 2pa-pcidomain32bits.tar.bz2 \ @@ -752,6 +740,7 @@ fakecpuid1f-64intel64-2p4d2n2c2t.tar.bz2 \ fakeheterocpunuma.tar.bz2 \ fakeheteromemtiers.tar.bz2 \ + memorysidecaches.tar.bz2 \ offline-cpu0-node0.tar.bz2 @@ -1401,6 +1390,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +20em64t-hybrid-1p6c2t+2ca4co1t.output.log: 20em64t-hybrid-1p6c2t+2ca4co1t.output + @p='20em64t-hybrid-1p6c2t+2ca4co1t.output'; \ + b='20em64t-hybrid-1p6c2t+2ca4co1t.output'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) 20s390-2g6s4c.output.log: 20s390-2g6s4c.output @p='20s390-2g6s4c.output'; \ b='20s390-2g6s4c.output'; \ @@ -1456,6 +1452,13 @@ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +memorysidecaches.output.log: memorysidecaches.output + @p='memorysidecaches.output'; \ + b='memorysidecaches.output'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) offline-cpu0-node0.output.log: offline-cpu0-node0.output @p='offline-cpu0-node0.output'; \ diff -Nru hwloc-2.9.2/tests/hwloc/linux/allowed/Makefile.in hwloc-2.10.0/tests/hwloc/linux/allowed/Makefile.in --- hwloc-2.9.2/tests/hwloc/linux/allowed/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/allowed/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -104,8 +104,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -346,7 +345,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -473,17 +471,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -552,7 +539,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -575,7 +561,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) diff -Nru hwloc-2.9.2/tests/hwloc/linux/fakeheteromemtiers.output hwloc-2.10.0/tests/hwloc/linux/fakeheteromemtiers.output --- hwloc-2.9.2/tests/hwloc/linux/fakeheteromemtiers.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/fakeheteromemtiers.output 2023-12-05 12:32:19.000000000 +0000 @@ -2,8 +2,8 @@ Package L#0 (P#0 total=6236076KB CPUVendor=GenuineIntel CPUFamilyNumber=15 CPUModelNumber=107 CPUModel="QEMU Virtual CPU version 2.5+" CPUStepping=1) L3Cache L#0 (P#0 total=6236076KB size=16384KB linesize=64 ways=16) Group0 L#0 (total=3398608KB) - NUMANode(DRAM) L#0 (P#0 local=3005392KB total=3005392KB) - NUMANode(NVM) L#1 (P#8 local=393216KB total=393216KB DAXDevice=dax7.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region7/dax7.1) + NUMANode(DRAM) L#0 (P#0 local=3005392KB total=3005392KB MemoryTier=1) + NUMANode(NVM) L#1 (P#8 local=393216KB total=393216KB DAXDevice=dax7.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region7/dax7.1 MemoryTier=2) L2Cache L#0 (P#0 size=4096KB linesize=64 ways=16) L1dCache L#0 (P#0 size=32KB linesize=64 ways=8) L1iCache L#0 (P#0 size=32KB linesize=64 ways=8) @@ -16,9 +16,9 @@ PU L#1 (P#1) Block(SPM) L#0 (DAXType=SPM DAXParent=hmem.0 Size=524288 LinuxDeviceID=253:0) "dax0.0" Group0 L#1 (total=1919964KB) - NUMANode(DRAM) L#2 (P#1 local=1002460KB total=1002460KB) - NUMANode(HBM) L#3 (P#4 local=524288KB total=524288KB DAXDevice=dax1.0 DAXType=SPM DAXParent=hmem.1) - NUMANode(NVM) L#4 (P#6 local=393216KB total=393216KB DAXDevice=dax5.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region5/dax5.1) + NUMANode(DRAM) L#2 (P#1 local=1002460KB total=1002460KB MemoryTier=1) + NUMANode(HBM) L#3 (P#4 local=524288KB total=524288KB DAXDevice=dax1.0 DAXType=SPM DAXParent=hmem.1 MemoryTier=0) + NUMANode(NVM) L#4 (P#6 local=393216KB total=393216KB DAXDevice=dax5.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region5/dax5.1 MemoryTier=2) L2Cache L#2 (P#2 size=4096KB linesize=64 ways=16) L1dCache L#2 (P#2 size=32KB linesize=64 ways=8) L1iCache L#2 (P#2 size=32KB linesize=64 ways=8) @@ -31,8 +31,8 @@ PU L#3 (P#3) Block(SPM) L#1 (DAXType=SPM DAXParent=hmem.2 Size=524288 LinuxDeviceID=253:2) "dax2.0" Group0 L#2 (total=917504KB) - NUMANode(HBM) L#5 (P#2 local=524288KB total=524288KB DAXDevice=dax3.0 DAXType=SPM DAXParent=hmem.3) - NUMANode(NVM) L#6 (P#9 local=393216KB total=393216KB DAXDevice=dax8.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region8/dax8.1) + NUMANode(HBM) L#5 (P#2 local=524288KB total=524288KB DAXDevice=dax3.0 DAXType=SPM DAXParent=hmem.3 MemoryTier=0) + NUMANode(NVM) L#6 (P#9 local=393216KB total=393216KB DAXDevice=dax8.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region8/dax8.1 MemoryTier=2) L2Cache L#4 (P#4 size=4096KB linesize=64 ways=16) L1dCache L#4 (P#4 size=32KB linesize=64 ways=8) L1iCache L#4 (P#4 size=32KB linesize=64 ways=8) diff -Nru hwloc-2.9.2/tests/hwloc/linux/fakememinitiators-1np2c+1npp+gi.output hwloc-2.10.0/tests/hwloc/linux/fakememinitiators-1np2c+1npp+gi.output --- hwloc-2.9.2/tests/hwloc/linux/fakememinitiators-1np2c+1npp+gi.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/fakememinitiators-1np2c+1npp+gi.output 2023-12-05 12:32:19.000000000 +0000 @@ -1,28 +1,28 @@ Machine (P#0 total=1951314696KB Backend=Linux LinuxCgroup=/) Package L#0 (P#0 total=974581080KB CPUModel="Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz") - NUMANode(NVM) L#2 (P#7 local=778043392KB total=778043392KB DAXDevice=dax0.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region0/dax0.1) + NUMANode(NVM) L#2 (P#7 local=778043392KB total=778043392KB DAXDevice=dax0.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region0/dax0.1 MemoryTier=1) Group0 L#0 (total=97447340KB) - NUMANode L#0 (P#5 local=97447340KB total=97447340KB) + NUMANode L#0 (P#5 local=97447340KB total=97447340KB MemoryTier=0) Core L#0 (P#0) PU L#0 (P#0) Core L#1 (P#0) PU L#1 (P#1) Group0 L#1 (total=99090348KB) - NUMANode L#1 (P#6 local=99090348KB total=99090348KB) + NUMANode L#1 (P#6 local=99090348KB total=99090348KB MemoryTier=0) Core L#2 (P#0) PU L#2 (P#4) Core L#3 (P#0) PU L#3 (P#5) Package L#1 (P#1 total=976733616KB CPUModel="Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz") - NUMANode(NVM) L#5 (P#10 local=780140544KB total=780140544KB DAXDevice=dax1.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region1/dax1.1) + NUMANode(NVM) L#5 (P#10 local=780140544KB total=780140544KB DAXDevice=dax1.0 DAXType=NVM DAXParent=LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region1/dax1.1 MemoryTier=1) Group0 L#2 (total=97542052KB) - NUMANode L#3 (P#8 local=97542052KB total=97542052KB) + NUMANode L#3 (P#8 local=97542052KB total=97542052KB MemoryTier=0) Core L#4 (P#1) PU L#4 (P#2) Core L#5 (P#1) PU L#5 (P#3) Group0 L#3 (total=99051020KB) - NUMANode L#4 (P#9 local=99051020KB total=99051020KB) + NUMANode L#4 (P#9 local=99051020KB total=99051020KB MemoryTier=0) Core L#6 (P#1) PU L#6 (P#6) Core L#7 (P#1) diff -Nru hwloc-2.9.2/tests/hwloc/linux/gather/Makefile.am hwloc-2.10.0/tests/hwloc/linux/gather/Makefile.am --- hwloc-2.9.2/tests/hwloc/linux/gather/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/gather/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -2,6 +2,7 @@ # Copyright © 2010 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. +if !HWLOC_CROSS_COMPILING if HWLOC_HAVE_LINUX if HWLOC_HAVE_OPENAT if HWLOC_HAVE_BUNZIPP @@ -9,3 +10,4 @@ endif HWLOC_HAVE_BUNZIPP endif HWLOC_HAVE_OPENAT endif HWLOC_HAVE_LINUX +endif !HWLOC_CROSS_COMPILING diff -Nru hwloc-2.9.2/tests/hwloc/linux/gather/Makefile.in hwloc-2.10.0/tests/hwloc/linux/gather/Makefile.in --- hwloc-2.9.2/tests/hwloc/linux/gather/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/gather/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -105,8 +105,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -348,7 +347,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -475,17 +473,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -554,7 +541,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -577,8 +563,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ -@HWLOC_HAVE_BUNZIPP_TRUE@@HWLOC_HAVE_LINUX_TRUE@@HWLOC_HAVE_OPENAT_TRUE@TESTS = test-gather-topology.sh +@HWLOC_CROSS_COMPILING_FALSE@@HWLOC_HAVE_BUNZIPP_TRUE@@HWLOC_HAVE_LINUX_TRUE@@HWLOC_HAVE_OPENAT_TRUE@TESTS = test-gather-topology.sh all: all-am .SUFFIXES: diff -Nru hwloc-2.9.2/tests/hwloc/linux/memorysidecaches.output hwloc-2.10.0/tests/hwloc/linux/memorysidecaches.output --- hwloc-2.9.2/tests/hwloc/linux/memorysidecaches.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/memorysidecaches.output 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,275 @@ +Machine (P#0 total=1558982816KB DMIProductName="PowerEdge R740" DMIProductVersion= DMIBoardVendor="Dell Inc." DMIBoardName=01YM03 DMIBoardVersion=A02 DMIChassisVendor="Dell Inc." DMIChassisType=23 DMIChassisVersion= DMIChassisAssetTag= DMIBIOSVendor="Dell Inc." DMIBIOSVersion=2.2.11 DMIBIOSDate=06/13/2019 DMISysVendor="Dell Inc." Backend=Linux LinuxCgroup=/ OSName=Linux OSRelease=5.3.0-rc7 OSVersion="#4 SMP Wed Sep 4 19:32:09 CEST 2019" HostName=leonide Architecture=x86_64) + Package L#0 (P#0 total=778656156KB CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=85 CPUModel="Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz" CPUStepping=7) + L3Cache L#0 (P#0 total=778656156KB size=28160KB linesize=64 ways=11) + Group0 L#0 (total=388492316KB) + MemCache L#0 (total=388492316KB size=100663296KB linesize=64 ways=1) + NUMANode L#0 (P#0 local=388492316KB total=388492316KB) + L2Cache L#0 (P#0 size=1024KB linesize=64 ways=16) + L1dCache L#0 (P#0 size=32KB linesize=64 ways=8) + L1iCache L#0 (P#0 size=32KB linesize=64 ways=8) + Core L#0 (P#0) + PU L#0 (P#0) + PU L#1 (P#40) + L2Cache L#1 (P#1 size=1024KB linesize=64 ways=16) + L1dCache L#1 (P#1 size=32KB linesize=64 ways=8) + L1iCache L#1 (P#1 size=32KB linesize=64 ways=8) + Core L#1 (P#1) + PU L#2 (P#4) + PU L#3 (P#44) + L2Cache L#2 (P#2 size=1024KB linesize=64 ways=16) + L1dCache L#2 (P#2 size=32KB linesize=64 ways=8) + L1iCache L#2 (P#2 size=32KB linesize=64 ways=8) + Core L#2 (P#2) + PU L#4 (P#8) + PU L#5 (P#48) + L2Cache L#3 (P#8 size=1024KB linesize=64 ways=16) + L1dCache L#3 (P#8 size=32KB linesize=64 ways=8) + L1iCache L#3 (P#8 size=32KB linesize=64 ways=8) + Core L#3 (P#8) + PU L#6 (P#12) + PU L#7 (P#52) + L2Cache L#4 (P#9 size=1024KB linesize=64 ways=16) + L1dCache L#4 (P#9 size=32KB linesize=64 ways=8) + L1iCache L#4 (P#9 size=32KB linesize=64 ways=8) + Core L#4 (P#9) + PU L#8 (P#16) + PU L#9 (P#56) + L2Cache L#5 (P#16 size=1024KB linesize=64 ways=16) + L1dCache L#5 (P#16 size=32KB linesize=64 ways=8) + L1iCache L#5 (P#16 size=32KB linesize=64 ways=8) + Core L#5 (P#16) + PU L#10 (P#20) + PU L#11 (P#60) + L2Cache L#6 (P#17 size=1024KB linesize=64 ways=16) + L1dCache L#6 (P#17 size=32KB linesize=64 ways=8) + L1iCache L#6 (P#17 size=32KB linesize=64 ways=8) + Core L#6 (P#17) + PU L#12 (P#24) + PU L#13 (P#64) + L2Cache L#7 (P#18 size=1024KB linesize=64 ways=16) + L1dCache L#7 (P#18 size=32KB linesize=64 ways=8) + L1iCache L#7 (P#18 size=32KB linesize=64 ways=8) + Core L#7 (P#18) + PU L#14 (P#28) + PU L#15 (P#68) + L2Cache L#8 (P#24 size=1024KB linesize=64 ways=16) + L1dCache L#8 (P#24 size=32KB linesize=64 ways=8) + L1iCache L#8 (P#24 size=32KB linesize=64 ways=8) + Core L#8 (P#24) + PU L#16 (P#32) + PU L#17 (P#72) + L2Cache L#9 (P#25 size=1024KB linesize=64 ways=16) + L1dCache L#9 (P#25 size=32KB linesize=64 ways=8) + L1iCache L#9 (P#25 size=32KB linesize=64 ways=8) + Core L#9 (P#25) + PU L#18 (P#36) + PU L#19 (P#76) + Group0 L#1 (total=390163840KB) + MemCache L#1 (total=390163840KB size=100663296KB linesize=64 ways=1) + NUMANode L#1 (P#2 local=390163840KB total=390163840KB) + L2Cache L#10 (P#4 size=1024KB linesize=64 ways=16) + L1dCache L#10 (P#4 size=32KB linesize=64 ways=8) + L1iCache L#10 (P#4 size=32KB linesize=64 ways=8) + Core L#10 (P#4) + PU L#20 (P#2) + PU L#21 (P#42) + L2Cache L#11 (P#3 size=1024KB linesize=64 ways=16) + L1dCache L#11 (P#3 size=32KB linesize=64 ways=8) + L1iCache L#11 (P#3 size=32KB linesize=64 ways=8) + Core L#11 (P#3) + PU L#22 (P#6) + PU L#23 (P#46) + L2Cache L#12 (P#12 size=1024KB linesize=64 ways=16) + L1dCache L#12 (P#12 size=32KB linesize=64 ways=8) + L1iCache L#12 (P#12 size=32KB linesize=64 ways=8) + Core L#12 (P#12) + PU L#24 (P#10) + PU L#25 (P#50) + L2Cache L#13 (P#11 size=1024KB linesize=64 ways=16) + L1dCache L#13 (P#11 size=32KB linesize=64 ways=8) + L1iCache L#13 (P#11 size=32KB linesize=64 ways=8) + Core L#13 (P#11) + PU L#26 (P#14) + PU L#27 (P#54) + L2Cache L#14 (P#10 size=1024KB linesize=64 ways=16) + L1dCache L#14 (P#10 size=32KB linesize=64 ways=8) + L1iCache L#14 (P#10 size=32KB linesize=64 ways=8) + Core L#14 (P#10) + PU L#28 (P#18) + PU L#29 (P#58) + L2Cache L#15 (P#20 size=1024KB linesize=64 ways=16) + L1dCache L#15 (P#20 size=32KB linesize=64 ways=8) + L1iCache L#15 (P#20 size=32KB linesize=64 ways=8) + Core L#15 (P#20) + PU L#30 (P#22) + PU L#31 (P#62) + L2Cache L#16 (P#19 size=1024KB linesize=64 ways=16) + L1dCache L#16 (P#19 size=32KB linesize=64 ways=8) + L1iCache L#16 (P#19 size=32KB linesize=64 ways=8) + Core L#16 (P#19) + PU L#32 (P#26) + PU L#33 (P#66) + L2Cache L#17 (P#28 size=1024KB linesize=64 ways=16) + L1dCache L#17 (P#28 size=32KB linesize=64 ways=8) + L1iCache L#17 (P#28 size=32KB linesize=64 ways=8) + Core L#17 (P#28) + PU L#34 (P#30) + PU L#35 (P#70) + L2Cache L#18 (P#27 size=1024KB linesize=64 ways=16) + L1dCache L#18 (P#27 size=32KB linesize=64 ways=8) + L1iCache L#18 (P#27 size=32KB linesize=64 ways=8) + Core L#18 (P#27) + PU L#36 (P#34) + PU L#37 (P#74) + L2Cache L#19 (P#26 size=1024KB linesize=64 ways=16) + L1dCache L#19 (P#26 size=32KB linesize=64 ways=8) + L1iCache L#19 (P#26 size=32KB linesize=64 ways=8) + Core L#19 (P#26) + PU L#38 (P#38) + PU L#39 (P#78) + Package L#1 (P#1 total=780326660KB CPUVendor=GenuineIntel CPUFamilyNumber=6 CPUModelNumber=85 CPUModel="Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz" CPUStepping=7) + L3Cache L#1 (P#1 total=780326660KB size=28160KB linesize=64 ways=11) + Group0 L#2 (total=390163848KB) + MemCache L#2 (total=390163848KB size=100663296KB linesize=64 ways=1) + NUMANode L#2 (P#1 local=390163848KB total=390163848KB) + L2Cache L#20 (P#32 size=1024KB linesize=64 ways=16) + L1dCache L#20 (P#32 size=32KB linesize=64 ways=8) + L1iCache L#20 (P#32 size=32KB linesize=64 ways=8) + Core L#20 (P#0) + PU L#40 (P#1) + PU L#41 (P#41) + L2Cache L#21 (P#33 size=1024KB linesize=64 ways=16) + L1dCache L#21 (P#33 size=32KB linesize=64 ways=8) + L1iCache L#21 (P#33 size=32KB linesize=64 ways=8) + Core L#21 (P#1) + PU L#42 (P#5) + PU L#43 (P#45) + L2Cache L#22 (P#34 size=1024KB linesize=64 ways=16) + L1dCache L#22 (P#34 size=32KB linesize=64 ways=8) + L1iCache L#22 (P#34 size=32KB linesize=64 ways=8) + Core L#22 (P#2) + PU L#44 (P#9) + PU L#45 (P#49) + L2Cache L#23 (P#40 size=1024KB linesize=64 ways=16) + L1dCache L#23 (P#40 size=32KB linesize=64 ways=8) + L1iCache L#23 (P#40 size=32KB linesize=64 ways=8) + Core L#23 (P#8) + PU L#46 (P#13) + PU L#47 (P#53) + L2Cache L#24 (P#41 size=1024KB linesize=64 ways=16) + L1dCache L#24 (P#41 size=32KB linesize=64 ways=8) + L1iCache L#24 (P#41 size=32KB linesize=64 ways=8) + Core L#24 (P#9) + PU L#48 (P#17) + PU L#49 (P#57) + L2Cache L#25 (P#48 size=1024KB linesize=64 ways=16) + L1dCache L#25 (P#48 size=32KB linesize=64 ways=8) + L1iCache L#25 (P#48 size=32KB linesize=64 ways=8) + Core L#25 (P#16) + PU L#50 (P#21) + PU L#51 (P#61) + L2Cache L#26 (P#49 size=1024KB linesize=64 ways=16) + L1dCache L#26 (P#49 size=32KB linesize=64 ways=8) + L1iCache L#26 (P#49 size=32KB linesize=64 ways=8) + Core L#26 (P#17) + PU L#52 (P#25) + PU L#53 (P#65) + L2Cache L#27 (P#50 size=1024KB linesize=64 ways=16) + L1dCache L#27 (P#50 size=32KB linesize=64 ways=8) + L1iCache L#27 (P#50 size=32KB linesize=64 ways=8) + Core L#27 (P#18) + PU L#54 (P#29) + PU L#55 (P#69) + L2Cache L#28 (P#56 size=1024KB linesize=64 ways=16) + L1dCache L#28 (P#56 size=32KB linesize=64 ways=8) + L1iCache L#28 (P#56 size=32KB linesize=64 ways=8) + Core L#28 (P#24) + PU L#56 (P#33) + PU L#57 (P#73) + L2Cache L#29 (P#57 size=1024KB linesize=64 ways=16) + L1dCache L#29 (P#57 size=32KB linesize=64 ways=8) + L1iCache L#29 (P#57 size=32KB linesize=64 ways=8) + Core L#29 (P#25) + PU L#58 (P#37) + PU L#59 (P#77) + Group0 L#3 (total=390162812KB) + MemCache L#3 (total=390162812KB size=100663296KB linesize=64 ways=1) + NUMANode L#3 (P#3 local=390162812KB total=390162812KB) + L2Cache L#30 (P#36 size=1024KB linesize=64 ways=16) + L1dCache L#30 (P#36 size=32KB linesize=64 ways=8) + L1iCache L#30 (P#36 size=32KB linesize=64 ways=8) + Core L#30 (P#4) + PU L#60 (P#3) + PU L#61 (P#43) + L2Cache L#31 (P#35 size=1024KB linesize=64 ways=16) + L1dCache L#31 (P#35 size=32KB linesize=64 ways=8) + L1iCache L#31 (P#35 size=32KB linesize=64 ways=8) + Core L#31 (P#3) + PU L#62 (P#7) + PU L#63 (P#47) + L2Cache L#32 (P#44 size=1024KB linesize=64 ways=16) + L1dCache L#32 (P#44 size=32KB linesize=64 ways=8) + L1iCache L#32 (P#44 size=32KB linesize=64 ways=8) + Core L#32 (P#12) + PU L#64 (P#11) + PU L#65 (P#51) + L2Cache L#33 (P#43 size=1024KB linesize=64 ways=16) + L1dCache L#33 (P#43 size=32KB linesize=64 ways=8) + L1iCache L#33 (P#43 size=32KB linesize=64 ways=8) + Core L#33 (P#11) + PU L#66 (P#15) + PU L#67 (P#55) + L2Cache L#34 (P#42 size=1024KB linesize=64 ways=16) + L1dCache L#34 (P#42 size=32KB linesize=64 ways=8) + L1iCache L#34 (P#42 size=32KB linesize=64 ways=8) + Core L#34 (P#10) + PU L#68 (P#19) + PU L#69 (P#59) + L2Cache L#35 (P#52 size=1024KB linesize=64 ways=16) + L1dCache L#35 (P#52 size=32KB linesize=64 ways=8) + L1iCache L#35 (P#52 size=32KB linesize=64 ways=8) + Core L#35 (P#20) + PU L#70 (P#23) + PU L#71 (P#63) + L2Cache L#36 (P#51 size=1024KB linesize=64 ways=16) + L1dCache L#36 (P#51 size=32KB linesize=64 ways=8) + L1iCache L#36 (P#51 size=32KB linesize=64 ways=8) + Core L#36 (P#19) + PU L#72 (P#27) + PU L#73 (P#67) + L2Cache L#37 (P#60 size=1024KB linesize=64 ways=16) + L1dCache L#37 (P#60 size=32KB linesize=64 ways=8) + L1iCache L#37 (P#60 size=32KB linesize=64 ways=8) + Core L#37 (P#28) + PU L#74 (P#31) + PU L#75 (P#71) + L2Cache L#38 (P#59 size=1024KB linesize=64 ways=16) + L1dCache L#38 (P#59 size=32KB linesize=64 ways=8) + L1iCache L#38 (P#59 size=32KB linesize=64 ways=8) + Core L#38 (P#27) + PU L#76 (P#35) + PU L#77 (P#75) + L2Cache L#39 (P#58 size=1024KB linesize=64 ways=16) + L1dCache L#39 (P#58 size=32KB linesize=64 ways=8) + L1iCache L#39 (P#58 size=32KB linesize=64 ways=8) + Core L#39 (P#26) + PU L#78 (P#39) + PU L#79 (P#79) +depth 0: 1 Machine (type #0) + depth 1: 2 Package (type #1) + depth 2: 2 L3Cache (type #6) + depth 3: 4 Group0 (type #12) + depth 4: 40 L2Cache (type #5) + depth 5: 40 L1dCache (type #4) + depth 6: 40 L1iCache (type #9) + depth 7: 40 Core (type #2) + depth 8: 80 PU (type #3) +Special depth -3: 4 NUMANode (type #13) +Special depth -8: 4 MemCache (type #18) +Relative latency matrix (name NUMALatency kind 5) between 4 NUMANodes (depth -3) by logical indexes: + index 0 2 1 3 + 0 10 21 11 21 + 2 21 10 21 11 + 1 11 21 10 21 + 3 21 11 21 10 +Topology not from this system Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/hwloc/linux/memorysidecaches.tar.bz2 and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/hwloc/linux/memorysidecaches.tar.bz2 differ diff -Nru hwloc-2.9.2/tests/hwloc/linux/nvidiagpunumanodes.kept.output hwloc-2.10.0/tests/hwloc/linux/nvidiagpunumanodes.kept.output --- hwloc-2.9.2/tests/hwloc/linux/nvidiagpunumanodes.kept.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/linux/nvidiagpunumanodes.kept.output 2023-12-05 12:32:19.000000000 +0000 @@ -1,9 +1,9 @@ Machine (P#0 total=358162944KB PlatformName=PowerNV PlatformModel="PowerNV 8335-GTW" Backend=Linux LinuxCgroup=/jjh OSName=Linux OSRelease=4.14.0-49.el7a.bz1553205.page_fault_hang.ppc64le OSVersion="#1 SMP Fri Mar 30 12:06:11 CDT 2018" HostName=c685f8n02 Architecture=ppc64le) Package L#0 (P#0 total=177025024KB CPUModel="POWER9, altivec supported" CPURevision="2.1 (pvr 004e 1201)") - NUMANode L#0 (P#0 local=129839104KB total=129839104KB) - NUMANode(GPUMemory) L#1 (P#253 local=15728640KB total=15728640KB PCIBusID=0006:00:00.0) - NUMANode(GPUMemory) L#2 (P#254 local=15728640KB total=15728640KB PCIBusID=0004:06:00.0) - NUMANode(GPUMemory) L#3 (P#255 local=15728640KB total=15728640KB PCIBusID=0004:05:00.0) + NUMANode L#0 (P#0 local=129839104KB total=129839104KB MemoryTier=0) + NUMANode(GPUMemory) L#1 (P#253 local=15728640KB total=15728640KB PCIBusID=0006:00:00.0 MemoryTier=1) + NUMANode(GPUMemory) L#2 (P#254 local=15728640KB total=15728640KB PCIBusID=0004:06:00.0 MemoryTier=1) + NUMANode(GPUMemory) L#3 (P#255 local=15728640KB total=15728640KB PCIBusID=0004:05:00.0 MemoryTier=1) L3Cache L#0 (size=10240KB linesize=0) L2Cache L#0 (size=512KB linesize=0) L1dCache L#0 (size=32KB linesize=128 ways=32) @@ -43,10 +43,10 @@ HostBridge L#2 (buses=0006:[00-00]) PCI L#2 (busid=0006:00:00.0 id=0000:0000 class=0300(VGA)) Package L#1 (P#8 total=181137920KB CPUModel="POWER9, altivec supported" CPURevision="2.1 (pvr 004e 1201)") - NUMANode L#4 (P#8 local=133952000KB total=133952000KB) - NUMANode(GPUMemory) L#5 (P#250 local=15728640KB total=15728640KB PCIBusID=0035:05:00.0) - NUMANode(GPUMemory) L#6 (P#251 local=15728640KB total=15728640KB PCIBusID=0035:04:00.0) - NUMANode(GPUMemory) L#7 (P#252 local=15728640KB total=15728640KB PCIBusID=0007:00:00.0) + NUMANode L#4 (P#8 local=133952000KB total=133952000KB MemoryTier=0) + NUMANode(GPUMemory) L#5 (P#250 local=15728640KB total=15728640KB PCIBusID=0035:05:00.0 MemoryTier=1) + NUMANode(GPUMemory) L#6 (P#251 local=15728640KB total=15728640KB PCIBusID=0035:04:00.0 MemoryTier=1) + NUMANode(GPUMemory) L#7 (P#252 local=15728640KB total=15728640KB PCIBusID=0007:00:00.0 MemoryTier=1) L3Cache L#2 (size=10240KB linesize=0) L2Cache L#2 (size=512KB linesize=0) L1dCache L#4 (size=32KB linesize=128 ways=32) diff -Nru hwloc-2.9.2/tests/hwloc/memtiers.c hwloc-2.10.0/tests/hwloc/memtiers.c --- hwloc-2.9.2/tests/hwloc/memtiers.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/memtiers.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2020-2022 Inria. All rights reserved. + * Copyright © 2020-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -24,13 +24,23 @@ hwloc_obj_add_info(node, "DAXType", daxtype); } +static int +get_tier(hwloc_obj_t obj) +{ + const char *value = hwloc_obj_get_info_by_name(obj, "MemoryTier"); + if (value) + return atoi(value); + else + return -1; +} + static void check_subtypes(hwloc_topology_t topo, - const char *rootnsubtype, - const char *pack1n1subtype, - const char *pack1n2subtype, - const char *pack2n1subtype, - const char *pack2n2subtype) + const char *rootnsubtype, int rootntier, + const char *pack1n1subtype, int pack1n1tier, + const char *pack1n2subtype, int pack1n2tier, + const char *pack2n1subtype, int pack2n1tier, + const char *pack2n2subtype, int pack2n2tier) { hwloc_obj_t root, rootn, pack1n1, pack1n2, pack2n1, pack2n2; root = hwloc_get_root_obj(topo); @@ -40,36 +50,58 @@ pack2n1 = root->last_child->memory_first_child; pack2n2 = root->last_child->memory_first_child->next_sibling; + printf(" Expected %s(%d) %s(%d) %s(%d) %s(%d) %s(%d)\n", + rootnsubtype, rootntier, + pack1n1subtype, pack1n1tier, + pack1n2subtype, pack1n2tier, + pack2n1subtype, pack2n1tier, + pack2n2subtype, pack2n2tier); + printf(" Found %s(%d) %s(%d) %s(%d) %s(%d) %s(%d)\n", + rootn->subtype, get_tier(rootn), + pack1n1->subtype, get_tier(pack1n1), + pack1n2->subtype, get_tier(pack1n2), + pack2n1->subtype, get_tier(pack2n1), + pack2n2->subtype, get_tier(pack2n2)); + if (rootnsubtype) { assert(rootn->subtype); assert(!strcmp(rootnsubtype, rootn->subtype)); } else { assert(!rootn->subtype); } + assert(rootntier == get_tier(rootn)); + if (pack1n1subtype) { assert(pack1n1->subtype); assert(!strcmp(pack1n1subtype, pack1n1->subtype)); } else { assert(!pack1n1->subtype); } + assert(pack1n1tier == get_tier(pack1n1)); + if (pack1n2subtype) { assert(pack1n2->subtype); assert(!strcmp(pack1n2subtype, pack1n2->subtype)); } else { assert(!pack1n2->subtype); } + assert(pack1n2tier == get_tier(pack1n2)); + if (pack2n1subtype) { assert(pack2n1->subtype); assert(!strcmp(pack2n1subtype, pack2n1->subtype)); } else { assert(!pack2n1->subtype); } + assert(pack2n1tier == get_tier(pack2n1)); + if (pack2n2subtype) { assert(pack2n2->subtype); assert(!strcmp(pack2n2subtype, pack2n2->subtype)); } else { assert(!pack2n2->subtype); } + assert(pack2n2tier == get_tier(pack2n2)); } int @@ -81,7 +113,7 @@ int buflen; int err; - printf("creatin topology...\n"); + printf("creating topology...\n"); err = hwloc_topology_init(&topology); assert(!err); err = hwloc_topology_set_synthetic(topology, "[numa] pack:2 [numa] [numa] pu:2"); @@ -100,22 +132,25 @@ add_daxtype(topology, pack1n2, "SPM"); add_daxtype(topology, pack2n2, "SPM"); - printf("checking subtypes aren't set\n"); - check_subtypes(topology, NULL, NULL, NULL, NULL, NULL); + printf("checking subtypes and tiers aren't set\n"); + check_subtypes(topology, NULL, -1, NULL, -1, NULL, -1, NULL, -1, NULL, -1); hwloc_topology_export_xmlbuffer(topology, &xmlbuffer, &buflen, 0); + putenv((char*)"HWLOC_MEMTIERS_REFRESH=1"); + printf("checking NVM and SPM subtypes are set on XML reload\n"); + printf("UNKNOWN should be before SPM and NVM in tiers since we have no BW\n"); err = hwloc_topology_init(&new); assert(!err); err = hwloc_topology_set_xmlbuffer(new, xmlbuffer, buflen); assert(!err); err = hwloc_topology_load(new); assert(!err); - check_subtypes(new, "NVM", NULL, "SPM", NULL, "SPM"); + check_subtypes(new, "NVM", 2, NULL, 0, "SPM", 1, NULL, 0, "SPM", 1); hwloc_topology_destroy(new); - printf("checking DRAM and HBM subtypes are set on XML reload if HWLOC_MEMTIERS_GUESS=spm_is_hbm\n"); + printf("checking HBM subtypes are set on XML reload if HWLOC_MEMTIERS_GUESS=spm_is_hbm\n"); putenv((char*)"HWLOC_MEMTIERS_GUESS=spm_is_hbm"); err = hwloc_topology_init(&new); assert(!err); @@ -123,7 +158,20 @@ assert(!err); err = hwloc_topology_load(new); assert(!err); - check_subtypes(new, "NVM", "DRAM", "HBM", "DRAM", "HBM"); + check_subtypes(new, "NVM", 2, NULL, 0, "HBM", 1, NULL, 0, "HBM", 1); + printf("UNKNOWN should be before HBM and NVM in tiers since we have no BW\n"); + hwloc_topology_destroy(new); + + printf("checking HBM subtypes are set on XML reload if HWLOC_MEMTIERS_GUESS=node0_is_dram,spm_is_hbm\n"); + putenv((char*)"HWLOC_MEMTIERS_GUESS=node0_is_dram,spm_is_hbm"); + err = hwloc_topology_init(&new); + assert(!err); + err = hwloc_topology_set_xmlbuffer(new, xmlbuffer, buflen); + assert(!err); + err = hwloc_topology_load(new); + assert(!err); + check_subtypes(new, "NVM", 2, "DRAM", 1, "HBM", 0, "DRAM", 1, "HBM", 0); + printf("DRAM should be before SPM and NVM in tiers since we have no BW\n"); hwloc_topology_destroy(new); free(xmlbuffer); @@ -145,7 +193,8 @@ assert(!err); err = hwloc_topology_load(new); assert(!err); - check_subtypes(new, "NVM", "DRAM", "HBM", "DRAM", "HBM"); + check_subtypes(new, "NVM", 2, "DRAM", 1, "HBM", 0, "DRAM", 1, "HBM", 0); + printf("HBM should be before DRAM and NVM in tiers since we have BW\n"); hwloc_topology_destroy(new); printf("checking DRAM and HBM subtypes aren't set anymore on XML reload if HWLOC_MEMTIERS_GUESS=none\n"); @@ -156,10 +205,22 @@ assert(!err); err = hwloc_topology_load(new); assert(!err); - check_subtypes(new, NULL, NULL, NULL, NULL, NULL); + check_subtypes(new, "NVM", 2, NULL, 1, "SPM", 0, NULL, 1, "SPM", 0); + printf("SPM should be before UNKNOWN and NVM in tiers since we have BW\n"); hwloc_topology_destroy(new); - free(xmlbuffer); + printf("checking that no subtypes and tiers are back on XML reload if disabling memory attributes (which disables tiers too)\n"); + putenv((char*)"HWLOC_MEMTIERS_GUESS=spm_is_hbm"); + err = hwloc_topology_init(&new); + assert(!err); + err = hwloc_topology_set_flags(new, HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS); + assert(!err); + err = hwloc_topology_set_xmlbuffer(new, xmlbuffer, buflen); + assert(!err); + err = hwloc_topology_load(new); + assert(!err); + check_subtypes(new, NULL, -1, NULL, -1, NULL, -1, NULL, -1, NULL, -1); + hwloc_topology_destroy(new); printf("breaking BW values\n"); add_local_bw(topology, rootn, 100); @@ -169,6 +230,7 @@ hwloc_topology_export_xmlbuffer(topology, &xmlbuffer, &buflen, 0); printf("checking DRAM and HBM subtypes aren't set anymore on XML reload\n"); + printf("one tier per node since kinds and BW are mixed\n"); putenv((char*)"HWLOC_MEMTIERS_GUESS=default"); err = hwloc_topology_init(&new); assert(!err); @@ -176,10 +238,11 @@ assert(!err); err = hwloc_topology_load(new); assert(!err); - check_subtypes(new, "NVM", NULL, "SPM", NULL, "SPM"); + check_subtypes(new, "NVM", 4, NULL, 2, "SPM", 1, NULL, 0, "SPM", 3); hwloc_topology_destroy(new); printf("checking broken BW can be ignored if HWLOC_MEMTIERS_GUESS=spm_is_hbm\n"); + printf("one tier per node since kinds and BW are mixed\n"); putenv((char*)"HWLOC_MEMTIERS_GUESS=spm_is_hbm"); err = hwloc_topology_init(&new); assert(!err); @@ -187,10 +250,11 @@ assert(!err); err = hwloc_topology_load(new); assert(!err); - check_subtypes(new, "NVM", "DRAM", "HBM", "DRAM", "HBM"); + check_subtypes(new, "NVM", 4, NULL, 2, "HBM", 1, NULL, 0, "HBM", 3); hwloc_topology_destroy(new); - printf("checking everything can be disabled if HWLOC_MEMTIERS_GUESS=none\n"); + printf("checking guessing can be disabled if HWLOC_MEMTIERS_GUESS=none\n"); + printf("one tier per node since kinds and BW are mixed\n"); putenv((char*)"HWLOC_MEMTIERS_GUESS=none"); err = hwloc_topology_init(&new); assert(!err); @@ -198,7 +262,40 @@ assert(!err); err = hwloc_topology_load(new); assert(!err); - check_subtypes(new, NULL, NULL, NULL, NULL, NULL); + check_subtypes(new, "NVM", 4, NULL, 2, "SPM", 1, NULL, 0, "SPM", 3); + hwloc_topology_destroy(new); + + printf("checking all tier stuff can be disabled if HWLOC_MEMTIERS=none\n"); + putenv((char*)"HWLOC_MEMTIERS=none"); + err = hwloc_topology_init(&new); + assert(!err); + err = hwloc_topology_set_xmlbuffer(new, xmlbuffer, buflen); + assert(!err); + err = hwloc_topology_load(new); + assert(!err); + check_subtypes(new, NULL, -1, NULL, -1, NULL, -1, NULL, -1, NULL, -1); + hwloc_topology_destroy(new); + + printf("checking everything can be overwritten with HWLOC_MEMTIERS\n"); + putenv((char*)"HWLOC_MEMTIERS=0x5=HBM;0x12=SPM;0x8=DRAM"); + err = hwloc_topology_init(&new); + assert(!err); + err = hwloc_topology_set_xmlbuffer(new, xmlbuffer, buflen); + assert(!err); + err = hwloc_topology_load(new); + assert(!err); + check_subtypes(new, "SPM", 1, "HBM", 0, "SPM", 1, "HBM", 0, "DRAM", 2); + hwloc_topology_destroy(new); + + printf("checking everything can be overwritten with HWLOC_MEMTIERS with invalid types\n"); + putenv((char*)"HWLOC_MEMTIERS=0x14=foo;0xb=HBM"); + err = hwloc_topology_init(&new); + assert(!err); + err = hwloc_topology_set_xmlbuffer(new, xmlbuffer, buflen); + assert(!err); + err = hwloc_topology_load(new); + assert(!err); + check_subtypes(new, NULL, 0, "HBM", 1, "HBM", 1, NULL, 0, "HBM", 1); hwloc_topology_destroy(new); free(xmlbuffer); diff -Nru hwloc-2.9.2/tests/hwloc/ports/Makefile.am hwloc-2.10.0/tests/hwloc/ports/Makefile.am --- hwloc-2.9.2/tests/hwloc/ports/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/ports/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -187,7 +187,8 @@ include/levelzero/level_zero/zes_api.h libhwloc_port_levelzero_la_CPPFLAGS = $(common_CPPFLAGS) \ -I$(HWLOC_top_srcdir)/tests/hwloc/ports/include/levelzero \ - -DHWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT=1 + -DHWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT=1 \ + -DHWLOC_HAVE_ZESINIT=1 nodist_libhwloc_port_gl_la_SOURCES = topology-gl.c libhwloc_port_gl_la_SOURCES = \ diff -Nru hwloc-2.9.2/tests/hwloc/ports/Makefile.in hwloc-2.10.0/tests/hwloc/ports/Makefile.in --- hwloc-2.9.2/tests/hwloc/ports/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/ports/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -106,8 +106,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -376,7 +375,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -503,17 +501,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -582,7 +569,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -605,7 +591,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) @@ -801,7 +786,8 @@ libhwloc_port_levelzero_la_CPPFLAGS = $(common_CPPFLAGS) \ -I$(HWLOC_top_srcdir)/tests/hwloc/ports/include/levelzero \ - -DHWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT=1 + -DHWLOC_HAVE_ZEDEVICEPCIGETPROPERTIESEXT=1 \ + -DHWLOC_HAVE_ZESINIT=1 nodist_libhwloc_port_gl_la_SOURCES = topology-gl.c libhwloc_port_gl_la_SOURCES = \ diff -Nru hwloc-2.9.2/tests/hwloc/ports/include/darwin/IOKit/IOKitLib.h hwloc-2.10.0/tests/hwloc/ports/include/darwin/IOKit/IOKitLib.h --- hwloc-2.9.2/tests/hwloc/ports/include/darwin/IOKit/IOKitLib.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/ports/include/darwin/IOKit/IOKitLib.h 2023-12-05 12:32:19.000000000 +0000 @@ -6,8 +6,8 @@ typedef int io_registry_entry_t; typedef int io_iterator_t; typedef int io_object_t; -typedef const char io_name_t[10]; -typedef const char * io_string_t; +typedef const char io_name_t[128]; +typedef const char io_string_t[512]; typedef int kern_return_t; #define KERN_SUCCESS 0 diff -Nru hwloc-2.9.2/tests/hwloc/ports/include/levelzero/level_zero/zes_api.h hwloc-2.10.0/tests/hwloc/ports/include/levelzero/level_zero/zes_api.h --- hwloc-2.9.2/tests/hwloc/ports/include/levelzero/level_zero/zes_api.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/ports/include/levelzero/level_zero/zes_api.h 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2020-2022 Inria. All rights reserved. + * Copyright © 2020-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -8,6 +8,8 @@ #include "ze_api.h" +extern ze_result_t zesInit(int); + typedef void * zes_device_handle_t; typedef struct { diff -Nru hwloc-2.9.2/tests/hwloc/rename/Makefile.in hwloc-2.10.0/tests/hwloc/rename/Makefile.in --- hwloc-2.9.2/tests/hwloc/rename/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/rename/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -111,8 +111,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -147,7 +146,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -274,17 +272,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -353,7 +340,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -376,7 +362,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ TEST_CPPFLAGS = $(am__append_1) $(am__append_2) $(am__append_3) \ $(am__append_4) $(am__append_5) $(am__append_6) \ $(am__append_7) $(am__append_8) $(am__append_9) \ diff -Nru hwloc-2.9.2/tests/hwloc/x86/AMD-19h-Zen4-2xEpyc-9654.output hwloc-2.10.0/tests/hwloc/x86/AMD-19h-Zen4-2xEpyc-9654.output --- hwloc-2.9.2/tests/hwloc/x86/AMD-19h-Zen4-2xEpyc-9654.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/x86/AMD-19h-Zen4-2xEpyc-9654.output 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,2639 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/hwloc/x86/AMD-19h-Zen4-2xEpyc-9654.tar.bz2 and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/hwloc/x86/AMD-19h-Zen4-2xEpyc-9654.tar.bz2 differ diff -Nru hwloc-2.9.2/tests/hwloc/x86/Intel-RaptorLake-Corei7-1370P.output hwloc-2.10.0/tests/hwloc/x86/Intel-RaptorLake-Corei7-1370P.output --- hwloc-2.9.2/tests/hwloc/x86/Intel-RaptorLake-Corei7-1370P.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/x86/Intel-RaptorLake-Corei7-1370P.output 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/hwloc/x86/Intel-RaptorLake-Corei7-1370P.tar.bz2 and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/hwloc/x86/Intel-RaptorLake-Corei7-1370P.tar.bz2 differ diff -Nru hwloc-2.9.2/tests/hwloc/x86/Intel-SapphireRapids-2xXeonMax9460.output hwloc-2.10.0/tests/hwloc/x86/Intel-SapphireRapids-2xXeonMax9460.output --- hwloc-2.9.2/tests/hwloc/x86/Intel-SapphireRapids-2xXeonMax9460.output 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/x86/Intel-SapphireRapids-2xXeonMax9460.output 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,1068 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/hwloc/x86/Intel-SapphireRapids-2xXeonMax9460.tar.bz2 and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/hwloc/x86/Intel-SapphireRapids-2xXeonMax9460.tar.bz2 differ diff -Nru hwloc-2.9.2/tests/hwloc/x86/Makefile.am hwloc-2.10.0/tests/hwloc/x86/Makefile.am --- hwloc-2.9.2/tests/hwloc/x86/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/x86/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -11,6 +11,8 @@ # XML outputs shouldn't have gp_index attributes to avoid spurious errors. # Remove them with: sed -r -e 's/ gp_index=\"[0-9]+\"//' -i foo.outpu cpuid_outputs = \ + Intel-RaptorLake-Corei7-1370P.output \ + Intel-SapphireRapids-2xXeonMax9460.output \ Intel-CPUID.1A-1p2co2t.output \ Intel-CPUID.1F-Qemu-2p3d3c2t.output \ Intel-CascadeLake-2xXeon6230.output \ @@ -25,6 +27,7 @@ Intel-Core-2xXeon-E5345.output \ Intel-KnightsLanding-XeonPhi-7210.output \ Intel-KnightsCorner-XeonPhi-SE10P.output \ + AMD-19h-Zen4-2xEpyc-9654.output \ AMD-19h-Zen3-2xEpyc-7763.output \ AMD-17h-Zen-2xEpyc-7451.output \ AMD-15h-Piledriver-4xOpteron-6348.output \ @@ -42,6 +45,8 @@ # Each output `xyz.output' must have a corresponding tarball `xyz.tar.bz2' # specifying which tarball to use cpuid_tarballs = \ + Intel-RaptorLake-Corei7-1370P.tar.bz2 \ + Intel-SapphireRapids-2xXeonMax9460.tar.bz2 \ Intel-CPUID.1A-1p2co2t.tar.bz2 \ Intel-CPUID.1F-Qemu-2p3d3c2t.tar.bz2 \ Intel-CascadeLake-2xXeon6230.tar.bz2 \ @@ -56,6 +61,7 @@ Intel-Core-2xXeon-E5345.tar.bz2 \ Intel-KnightsLanding-XeonPhi-7210.tar.bz2 \ Intel-KnightsCorner-XeonPhi-SE10P.tar.bz2 \ + AMD-19h-Zen4-2xEpyc-9654.tar.bz2 \ AMD-19h-Zen3-2xEpyc-7763.tar.bz2 \ AMD-17h-Zen-2xEpyc-7451.tar.bz2 \ AMD-15h-Piledriver-4xOpteron-6348.tar.bz2 \ diff -Nru hwloc-2.9.2/tests/hwloc/x86/Makefile.in hwloc-2.10.0/tests/hwloc/x86/Makefile.in --- hwloc-2.9.2/tests/hwloc/x86/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/x86/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -104,8 +104,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -346,7 +345,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -473,17 +471,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -552,7 +539,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -575,7 +561,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) @@ -586,6 +571,8 @@ # XML outputs shouldn't have gp_index attributes to avoid spurious errors. # Remove them with: sed -r -e 's/ gp_index=\"[0-9]+\"//' -i foo.outpu cpuid_outputs = \ + Intel-RaptorLake-Corei7-1370P.output \ + Intel-SapphireRapids-2xXeonMax9460.output \ Intel-CPUID.1A-1p2co2t.output \ Intel-CPUID.1F-Qemu-2p3d3c2t.output \ Intel-CascadeLake-2xXeon6230.output \ @@ -600,6 +587,7 @@ Intel-Core-2xXeon-E5345.output \ Intel-KnightsLanding-XeonPhi-7210.output \ Intel-KnightsCorner-XeonPhi-SE10P.output \ + AMD-19h-Zen4-2xEpyc-9654.output \ AMD-19h-Zen3-2xEpyc-7763.output \ AMD-17h-Zen-2xEpyc-7451.output \ AMD-15h-Piledriver-4xOpteron-6348.output \ @@ -618,6 +606,8 @@ # Each output `xyz.output' must have a corresponding tarball `xyz.tar.bz2' # specifying which tarball to use cpuid_tarballs = \ + Intel-RaptorLake-Corei7-1370P.tar.bz2 \ + Intel-SapphireRapids-2xXeonMax9460.tar.bz2 \ Intel-CPUID.1A-1p2co2t.tar.bz2 \ Intel-CPUID.1F-Qemu-2p3d3c2t.tar.bz2 \ Intel-CascadeLake-2xXeon6230.tar.bz2 \ @@ -632,6 +622,7 @@ Intel-Core-2xXeon-E5345.tar.bz2 \ Intel-KnightsLanding-XeonPhi-7210.tar.bz2 \ Intel-KnightsCorner-XeonPhi-SE10P.tar.bz2 \ + AMD-19h-Zen4-2xEpyc-9654.tar.bz2 \ AMD-19h-Zen3-2xEpyc-7763.tar.bz2 \ AMD-17h-Zen-2xEpyc-7451.tar.bz2 \ AMD-15h-Piledriver-4xOpteron-6348.tar.bz2 \ @@ -844,6 +835,20 @@ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? +Intel-RaptorLake-Corei7-1370P.output.log: Intel-RaptorLake-Corei7-1370P.output + @p='Intel-RaptorLake-Corei7-1370P.output'; \ + b='Intel-RaptorLake-Corei7-1370P.output'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +Intel-SapphireRapids-2xXeonMax9460.output.log: Intel-SapphireRapids-2xXeonMax9460.output + @p='Intel-SapphireRapids-2xXeonMax9460.output'; \ + b='Intel-SapphireRapids-2xXeonMax9460.output'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) Intel-CPUID.1A-1p2co2t.output.log: Intel-CPUID.1A-1p2co2t.output @p='Intel-CPUID.1A-1p2co2t.output'; \ b='Intel-CPUID.1A-1p2co2t.output'; \ @@ -941,6 +946,13 @@ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +AMD-19h-Zen4-2xEpyc-9654.output.log: AMD-19h-Zen4-2xEpyc-9654.output + @p='AMD-19h-Zen4-2xEpyc-9654.output'; \ + b='AMD-19h-Zen4-2xEpyc-9654.output'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) AMD-19h-Zen3-2xEpyc-7763.output.log: AMD-19h-Zen3-2xEpyc-7763.output @p='AMD-19h-Zen3-2xEpyc-7763.output'; \ diff -Nru hwloc-2.9.2/tests/hwloc/x86+linux/Makefile.in hwloc-2.10.0/tests/hwloc/x86+linux/Makefile.in --- hwloc-2.9.2/tests/hwloc/x86+linux/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/x86+linux/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -104,8 +104,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -346,7 +345,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -473,17 +471,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -552,7 +539,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -575,7 +561,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) diff -Nru hwloc-2.9.2/tests/hwloc/xml/16amd64-4distances.console.env hwloc-2.10.0/tests/hwloc/xml/16amd64-4distances.console.env --- hwloc-2.9.2/tests/hwloc/xml/16amd64-4distances.console.env 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/16amd64-4distances.console.env 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# make sure we use default numeric formats (only XML outputs are dis-localized when supported) -# we really want to check the distance matrix here (in case it gets truncated or so) -LANG=C -LC_ALL=C -export LANG LC_ALL diff -Nru hwloc-2.9.2/tests/hwloc/xml/64intel64-3g2n+2n-irregulargroups+pci.console.env hwloc-2.10.0/tests/hwloc/xml/64intel64-3g2n+2n-irregulargroups+pci.console.env --- hwloc-2.9.2/tests/hwloc/xml/64intel64-3g2n+2n-irregulargroups+pci.console.env 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/64intel64-3g2n+2n-irregulargroups+pci.console.env 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# make sure we use default numeric formats (only XML outputs are dis-localized when supported) -# we really want to check the distance matrix here (in case it gets truncated or so) -LANG=C -LC_ALL=C -export LANG LC_ALL diff -Nru hwloc-2.9.2/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v1tov2.xml hwloc-2.10.0/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v1tov2.xml --- hwloc-2.9.2/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v1tov2.xml 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v1tov2.xml 2023-12-05 12:32:19.000000000 +0000 @@ -18,199 +18,231 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + diff -Nru hwloc-2.9.2/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml hwloc-2.10.0/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml --- hwloc-2.9.2/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml 2023-12-05 12:32:19.000000000 +0000 @@ -20,6 +20,8 @@ + + @@ -70,11 +72,14 @@ + + + @@ -125,11 +130,14 @@ + + + @@ -180,11 +188,14 @@ + + + @@ -235,6 +246,7 @@ + diff -Nru hwloc-2.9.2/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.xml hwloc-2.10.0/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.xml --- hwloc-2.9.2/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.xml 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/64intel64-fakeKNL-SNC4-hybrid.xml 2023-12-05 12:32:19.000000000 +0000 @@ -20,8 +20,12 @@ - - + + + + + + @@ -69,8 +73,12 @@ - - + + + + + + @@ -118,8 +126,12 @@ - - + + + + + + @@ -167,8 +179,12 @@ - - + + + + + + diff -Nru hwloc-2.9.2/tests/hwloc/xml/8intel64-4n2t-memattrs.xml hwloc-2.10.0/tests/hwloc/xml/8intel64-4n2t-memattrs.xml --- hwloc-2.9.2/tests/hwloc/xml/8intel64-4n2t-memattrs.xml 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/8intel64-4n2t-memattrs.xml 2023-12-05 12:32:19.000000000 +0000 @@ -9,6 +9,7 @@ + @@ -16,6 +17,7 @@ + @@ -23,6 +25,7 @@ + @@ -30,6 +33,7 @@ + diff -Nru hwloc-2.9.2/tests/hwloc/xml/Makefile.am hwloc-2.10.0/tests/hwloc/xml/Makefile.am --- hwloc-2.9.2/tests/hwloc/xml/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright © 2009-2021 Inria. All rights reserved. +# Copyright © 2009-2023 Inria. All rights reserved. # Copyright © 2009-2010 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -35,6 +35,7 @@ power8gpudistances.xml \ fakeheterodistances.xml \ fakecpukinds.xml \ + memorysidecaches.xml \ 8em64t-2p2ca2co-nonodesets.v1tov2.xml \ 8ia64-2n2s2c+1n.v1tov2.xml \ 16amd64-4distances.v1tov2.xml \ @@ -45,7 +46,8 @@ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v1tov2.xml \ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v2tov1.xml \ 64intel64-fakeKNL-SNC4-hybrid.v1tov2.xml \ - 64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml + 64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml \ + cxlmem+dax.v2.xml # Each output `xyz.xml' may have a corresponding `xyz.source' file specifying # its source file. @@ -75,7 +77,9 @@ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v1tov2.source \ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v2tov1.source \ 64intel64-fakeKNL-SNC4-hybrid.v1tov2.source \ - 64intel64-fakeKNL-SNC4-hybrid.v2tov1.source + 64intel64-fakeKNL-SNC4-hybrid.v2tov1.source \ + cxlmem+dax.v2.source \ + cxlmem+dax.v3.xml # Each output `xyz.xml' or `xyz.output' may have a corresponding `xyz.options' # file modifying the behavior of lstopo @@ -96,9 +100,7 @@ # Each output `xyz.xml' or `xyz.output' may have a corresponding `xyz.env' # modifying the environment of lstopo -xml_envs = \ - 16amd64-4distances.console.env \ - 64intel64-3g2n+2n-irregulargroups+pci.console.env +xml_envs = # Only run the tests if we're building standalone, because the tests # call hwloc executables. diff -Nru hwloc-2.9.2/tests/hwloc/xml/Makefile.in hwloc-2.10.0/tests/hwloc/xml/Makefile.in --- hwloc-2.9.2/tests/hwloc/xml/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright © 2009-2021 Inria. All rights reserved. +# Copyright © 2009-2023 Inria. All rights reserved. # Copyright © 2009-2010 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -106,8 +106,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -348,7 +347,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -475,17 +473,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -554,7 +541,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -577,7 +563,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) @@ -610,6 +595,7 @@ power8gpudistances.xml \ fakeheterodistances.xml \ fakecpukinds.xml \ + memorysidecaches.xml \ 8em64t-2p2ca2co-nonodesets.v1tov2.xml \ 8ia64-2n2s2c+1n.v1tov2.xml \ 16amd64-4distances.v1tov2.xml \ @@ -620,7 +606,8 @@ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v1tov2.xml \ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v2tov1.xml \ 64intel64-fakeKNL-SNC4-hybrid.v1tov2.xml \ - 64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml + 64intel64-fakeKNL-SNC4-hybrid.v2tov1.xml \ + cxlmem+dax.v2.xml # Each output `xyz.xml' may have a corresponding `xyz.source' file specifying @@ -651,7 +638,9 @@ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v1tov2.source \ 8intel64-fakeKNL-A2A-hybrid.rootattachednumas.v2tov1.source \ 64intel64-fakeKNL-SNC4-hybrid.v1tov2.source \ - 64intel64-fakeKNL-SNC4-hybrid.v2tov1.source + 64intel64-fakeKNL-SNC4-hybrid.v2tov1.source \ + cxlmem+dax.v2.source \ + cxlmem+dax.v3.xml # Each output `xyz.xml' or `xyz.output' may have a corresponding `xyz.options' @@ -674,10 +663,7 @@ # Each output `xyz.xml' or `xyz.output' may have a corresponding `xyz.env' # modifying the environment of lstopo -xml_envs = \ - 16amd64-4distances.console.env \ - 64intel64-3g2n+2n-irregulargroups+pci.console.env - +xml_envs = # Only run the tests if we're building standalone, because the tests # call hwloc executables. @@ -1055,6 +1041,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +memorysidecaches.xml.log: memorysidecaches.xml + @p='memorysidecaches.xml'; \ + b='memorysidecaches.xml'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) 8em64t-2p2ca2co-nonodesets.v1tov2.xml.log: 8em64t-2p2ca2co-nonodesets.v1tov2.xml @p='8em64t-2p2ca2co-nonodesets.v1tov2.xml'; \ b='8em64t-2p2ca2co-nonodesets.v1tov2.xml'; \ @@ -1131,6 +1124,13 @@ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +cxlmem+dax.v2.xml.log: cxlmem+dax.v2.xml + @p='cxlmem+dax.v2.xml'; \ + b='cxlmem+dax.v2.xml'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ diff -Nru hwloc-2.9.2/tests/hwloc/xml/cxlmem+dax.v2.source hwloc-2.10.0/tests/hwloc/xml/cxlmem+dax.v2.source --- hwloc-2.9.2/tests/hwloc/xml/cxlmem+dax.v2.source 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/cxlmem+dax.v2.source 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1 @@ +cxlmem+dax.v3.xml diff -Nru hwloc-2.9.2/tests/hwloc/xml/cxlmem+dax.v2.xml hwloc-2.10.0/tests/hwloc/xml/cxlmem+dax.v2.xml --- hwloc-2.9.2/tests/hwloc/xml/cxlmem+dax.v2.xml 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/cxlmem+dax.v2.xml 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru hwloc-2.9.2/tests/hwloc/xml/cxlmem+dax.v3.xml hwloc-2.10.0/tests/hwloc/xml/cxlmem+dax.v3.xml --- hwloc-2.9.2/tests/hwloc/xml/cxlmem+dax.v3.xml 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/cxlmem+dax.v3.xml 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru hwloc-2.9.2/tests/hwloc/xml/memorysidecaches.xml hwloc-2.10.0/tests/hwloc/xml/memorysidecaches.xml --- hwloc-2.9.2/tests/hwloc/xml/memorysidecaches.xml 1970-01-01 00:00:00.000000000 +0000 +++ hwloc-2.10.0/tests/hwloc/xml/memorysidecaches.xml 2023-12-05 12:32:19.000000000 +0000 @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 + 10 21 11 21 21 10 21 11 11 21 + 10 21 21 11 21 10 + + + + + + + + diff -Nru hwloc-2.9.2/tests/netloc/Makefile.am hwloc-2.10.0/tests/netloc/Makefile.am --- hwloc-2.9.2/tests/netloc/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/netloc/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -# Copyright © 2016-2017 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - -AM_CFLAGS = $(NETLOC_CFLAGS) -AM_CPPFLAGS = $(NETLOC_CPPFLAGS) -AM_LDFLAGS = $(NETLOC_LDFLAGS) -lpthread - -LDADD = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/netloc/libnetlocscotch.la \ - -lscotch -lscotcherr -lm -lpthread - -EXTRA_DIST = \ - data/tests_extract.txt \ - data/tests_draw.txt \ - data/avakas.txz \ - data/plafrim.txz \ - data/plafrim2.txz \ - data/scotch.txz \ - data/tests_scotch.txt \ - data/tests_mpiscotch.txt - -if FOUND_XZ -TESTS = \ - data/tests_extract.txt \ - data/tests_draw.txt - -if BUILD_NETLOCSCOTCH -TESTS += data/tests_scotch.txt -if BUILD_MPITOOLS -TESTS += data/tests_mpiscotch.txt -endif -endif -endif - -TEST_EXTENSIONS = .txt -TXT_LOG_COMPILER = ./tests.sh diff -Nru hwloc-2.9.2/tests/netloc/Makefile.in hwloc-2.10.0/tests/netloc/Makefile.in --- hwloc-2.9.2/tests/netloc/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/netloc/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,963 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright © 2016-2017 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@BUILD_NETLOCSCOTCH_TRUE@@FOUND_XZ_TRUE@am__append_1 = data/tests_scotch.txt -@BUILD_MPITOOLS_TRUE@@BUILD_NETLOCSCOTCH_TRUE@@FOUND_XZ_TRUE@am__append_2 = data/tests_mpiscotch.txt -subdir = tests/netloc -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ - $(top_srcdir)/config/hwloc_check_attributes.m4 \ - $(top_srcdir)/config/hwloc_check_vendor.m4 \ - $(top_srcdir)/config/hwloc_check_visibility.m4 \ - $(top_srcdir)/config/hwloc_components.m4 \ - $(top_srcdir)/config/hwloc_internal.m4 \ - $(top_srcdir)/config/hwloc_pkg.m4 \ - $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ - $(top_builddir)/include/hwloc/autogen/config.h -CONFIG_CLEAN_FILES = tests.sh -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__tty_colors_dummy = \ - mgn= red= grn= lgn= blu= brg= std=; \ - am__color_tests=no -am__tty_colors = { \ - $(am__tty_colors_dummy); \ - if test "X$(AM_COLOR_TESTS)" = Xno; then \ - am__color_tests=no; \ - elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ - am__color_tests=yes; \ - elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ - am__color_tests=yes; \ - fi; \ - if test $$am__color_tests = yes; then \ - red=''; \ - grn=''; \ - lgn=''; \ - blu=''; \ - mgn=''; \ - brg=''; \ - std=''; \ - fi; \ -} -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__recheck_rx = ^[ ]*:recheck:[ ]* -am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* -am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* -# A command that, given a newline-separated list of test names on the -# standard input, print the name of the tests that are to be re-run -# upon "make recheck". -am__list_recheck_tests = $(AWK) '{ \ - recheck = 1; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - { \ - if ((getline line2 < ($$0 ".log")) < 0) \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ - { \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ - { \ - break; \ - } \ - }; \ - if (recheck) \ - print $$0; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# A command that, given a newline-separated list of test names on the -# standard input, create the global log from their .trs and .log files. -am__create_global_log = $(AWK) ' \ -function fatal(msg) \ -{ \ - print "fatal: making $@: " msg | "cat >&2"; \ - exit 1; \ -} \ -function rst_section(header) \ -{ \ - print header; \ - len = length(header); \ - for (i = 1; i <= len; i = i + 1) \ - printf "="; \ - printf "\n\n"; \ -} \ -{ \ - copy_in_global_log = 1; \ - global_test_result = "RUN"; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".trs"); \ - if (line ~ /$(am__global_test_result_rx)/) \ - { \ - sub("$(am__global_test_result_rx)", "", line); \ - sub("[ ]*$$", "", line); \ - global_test_result = line; \ - } \ - else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ - copy_in_global_log = 0; \ - }; \ - if (copy_in_global_log) \ - { \ - rst_section(global_test_result ": " $$0); \ - while ((rc = (getline line < ($$0 ".log"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".log"); \ - print line; \ - }; \ - printf "\n"; \ - }; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# Restructured Text title. -am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } -# Solaris 10 'make', and several other traditional 'make' implementations, -# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it -# by disabling -e (using the XSI extension "set +e") if it's set. -am__sh_e_setup = case $$- in *e*) set +e;; esac -# Default flags passed to test drivers. -am__common_driver_flags = \ - --color-tests "$$am__color_tests" \ - --enable-hard-errors "$$am__enable_hard_errors" \ - --expect-failure "$$am__expect_failure" -# To be inserted before the command running the test. Creates the -# directory for the log if needed. Stores in $dir the directory -# containing $f, in $tst the test, in $log the log. Executes the -# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and -# passes TESTS_ENVIRONMENT. Set up options for the wrapper that -# will run the test scripts (or their associated LOG_COMPILER, if -# thy have one). -am__check_pre = \ -$(am__sh_e_setup); \ -$(am__vpath_adj_setup) $(am__vpath_adj) \ -$(am__tty_colors); \ -srcdir=$(srcdir); export srcdir; \ -case "$@" in \ - */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ - *) am__odir=.;; \ -esac; \ -test "x$$am__odir" = x"." || test -d "$$am__odir" \ - || $(MKDIR_P) "$$am__odir" || exit $$?; \ -if test -f "./$$f"; then dir=./; \ -elif test -f "$$f"; then dir=; \ -else dir="$(srcdir)/"; fi; \ -tst=$$dir$$f; log='$@'; \ -if test -n '$(DISABLE_HARD_ERRORS)'; then \ - am__enable_hard_errors=no; \ -else \ - am__enable_hard_errors=yes; \ -fi; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - am__expect_failure=yes;; \ - *) \ - am__expect_failure=no;; \ -esac; \ -$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) -# A shell command to get the names of the tests scripts with any registered -# extension removed (i.e., equivalently, the names of the test logs, with -# the '.log' extension removed). The result is saved in the shell variable -# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, -# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", -# since that might cause problem with VPATH rewrites for suffix-less tests. -# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. -am__set_TESTS_bases = \ - bases='$(TEST_LOGS)'; \ - bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ - bases=`echo $$bases` -AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' -RECHECK_LOGS = $(TEST_LOGS) -AM_RECURSIVE_TARGETS = check recheck -TEST_SUITE_LOG = test-suite.log -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) -TEST_LOGS = $(am__test_logs2:.txt.log=.log) -TXT_LOG_DRIVER = $(SHELL) $(top_srcdir)/./config/test-driver -TXT_LOG_COMPILE = $(TXT_LOG_COMPILER) $(AM_TXT_LOG_FLAGS) \ - $(TXT_LOG_FLAGS) -am__set_b = \ - case '$@' in \ - */*) \ - case '$*' in \ - */*) b='$*';; \ - *) b=`echo '$@' | sed 's/\.log$$//'`; \ - esac;; \ - *) \ - b='$*';; \ - esac -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/tests.sh.in \ - $(top_srcdir)/./config/test-driver -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BUNZIPP = @BUNZIPP@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CONFIGURE_DEPENDENCIES = @CONFIGURE_DEPENDENCIES@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CUDA_VERSION = @CUDA_VERSION@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIFF = @DIFF@ -DLLTOOL = @DLLTOOL@ -DOXYGEN = @DOXYGEN@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EPSTOPDF = @EPSTOPDF@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FIG2DEV = @FIG2DEV@ -FILECMD = @FILECMD@ -GREP = @GREP@ -GS = @GS@ -HWLOC_CAIRO_CFLAGS = @HWLOC_CAIRO_CFLAGS@ -HWLOC_CAIRO_LIBS = @HWLOC_CAIRO_LIBS@ -HWLOC_CFLAGS = @HWLOC_CFLAGS@ -HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ -HWLOC_CUDART_CFLAGS = @HWLOC_CUDART_CFLAGS@ -HWLOC_CUDART_CPPFLAGS = @HWLOC_CUDART_CPPFLAGS@ -HWLOC_CUDART_LDFLAGS = @HWLOC_CUDART_LDFLAGS@ -HWLOC_CUDART_LIBS = @HWLOC_CUDART_LIBS@ -HWLOC_CUDA_CFLAGS = @HWLOC_CUDA_CFLAGS@ -HWLOC_CUDA_CPPFLAGS = @HWLOC_CUDA_CPPFLAGS@ -HWLOC_CUDA_LDFLAGS = @HWLOC_CUDA_LDFLAGS@ -HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ -HWLOC_DARWIN_LDFLAGS = @HWLOC_DARWIN_LDFLAGS@ -HWLOC_DIFF_U = @HWLOC_DIFF_U@ -HWLOC_DIFF_W = @HWLOC_DIFF_W@ -HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ -HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ -HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ -HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ -HWLOC_EMBEDDED_LDFLAGS = @HWLOC_EMBEDDED_LDFLAGS@ -HWLOC_EMBEDDED_LIBS = @HWLOC_EMBEDDED_LIBS@ -HWLOC_GL_LIBS = @HWLOC_GL_LIBS@ -HWLOC_HAVE_LEVELZERO = @HWLOC_HAVE_LEVELZERO@ -HWLOC_HAVE_LIBXML2 = @HWLOC_HAVE_LIBXML2@ -HWLOC_HAVE_LINUX = @HWLOC_HAVE_LINUX@ -HWLOC_HAVE_NVML = @HWLOC_HAVE_NVML@ -HWLOC_HAVE_OPENCL = @HWLOC_HAVE_OPENCL@ -HWLOC_HAVE_RSMI = @HWLOC_HAVE_RSMI@ -HWLOC_HAVE_X86_CPUID = @HWLOC_HAVE_X86_CPUID@ -HWLOC_IBVERBS_LIBS = @HWLOC_IBVERBS_LIBS@ -HWLOC_LDFLAGS = @HWLOC_LDFLAGS@ -HWLOC_LEVELZERO_CFLAGS = @HWLOC_LEVELZERO_CFLAGS@ -HWLOC_LEVELZERO_LIBS = @HWLOC_LEVELZERO_LIBS@ -HWLOC_LIBS = @HWLOC_LIBS@ -HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ -HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ -HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ -HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ -HWLOC_MS_LIB = @HWLOC_MS_LIB@ -HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ -HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ -HWLOC_NUMA_LIBS = @HWLOC_NUMA_LIBS@ -HWLOC_NVML_CPPFLAGS = @HWLOC_NVML_CPPFLAGS@ -HWLOC_NVML_LDFLAGS = @HWLOC_NVML_LDFLAGS@ -HWLOC_NVML_LIBS = @HWLOC_NVML_LIBS@ -HWLOC_OPENCL_CPPFLAGS = @HWLOC_OPENCL_CPPFLAGS@ -HWLOC_OPENCL_LDFLAGS = @HWLOC_OPENCL_LDFLAGS@ -HWLOC_OPENCL_LIBS = @HWLOC_OPENCL_LIBS@ -HWLOC_PCIACCESS_CFLAGS = @HWLOC_PCIACCESS_CFLAGS@ -HWLOC_PCIACCESS_LIBS = @HWLOC_PCIACCESS_LIBS@ -HWLOC_PLUGINS_DIR = @HWLOC_PLUGINS_DIR@ -HWLOC_PLUGINS_PATH = @HWLOC_PLUGINS_PATH@ -HWLOC_PS_LIBS = @HWLOC_PS_LIBS@ -HWLOC_RELEASE_DATE = @HWLOC_RELEASE_DATE@ -HWLOC_REQUIRES = @HWLOC_REQUIRES@ -HWLOC_RSMI_CPPFLAGS = @HWLOC_RSMI_CPPFLAGS@ -HWLOC_RSMI_LDFLAGS = @HWLOC_RSMI_LDFLAGS@ -HWLOC_RSMI_LIBS = @HWLOC_RSMI_LIBS@ -HWLOC_TERMCAP_LIBS = @HWLOC_TERMCAP_LIBS@ -HWLOC_VERSION = @HWLOC_VERSION@ -HWLOC_W3_GENERATOR = @HWLOC_W3_GENERATOR@ -HWLOC_X11_CPPFLAGS = @HWLOC_X11_CPPFLAGS@ -HWLOC_X11_LIBS = @HWLOC_X11_LIBS@ -HWLOC_XML_LOCALIZED = @HWLOC_XML_LOCALIZED@ -HWLOC_runstatedir = @HWLOC_runstatedir@ -HWLOC_top_builddir = @HWLOC_top_builddir@ -HWLOC_top_srcdir = @HWLOC_top_srcdir@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LYNX = @LYNX@ -MAKEINDEX = @MAKEINDEX@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -ROCM_VERSION = @ROCM_VERSION@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -W3M = @W3M@ -XMKMF = @XMKMF@ -XMLLINT = @XMLLINT@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libhwloc_so_name = @libhwloc_so_name@ -libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xz = @xz@ -AM_CFLAGS = $(NETLOC_CFLAGS) -AM_CPPFLAGS = $(NETLOC_CPPFLAGS) -AM_LDFLAGS = $(NETLOC_LDFLAGS) -lpthread -LDADD = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/netloc/libnetlocscotch.la \ - -lscotch -lscotcherr -lm -lpthread - -EXTRA_DIST = \ - data/tests_extract.txt \ - data/tests_draw.txt \ - data/avakas.txz \ - data/plafrim.txz \ - data/plafrim2.txz \ - data/scotch.txz \ - data/tests_scotch.txt \ - data/tests_mpiscotch.txt - -@FOUND_XZ_TRUE@TESTS = data/tests_extract.txt data/tests_draw.txt \ -@FOUND_XZ_TRUE@ $(am__append_1) $(am__append_2) -TEST_EXTENSIONS = .txt -TXT_LOG_COMPILER = ./tests.sh -all: all-am - -.SUFFIXES: -.SUFFIXES: .log .trs .txt .txt$(EXEEXT) -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/netloc/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign tests/netloc/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -tests.sh: $(top_builddir)/config.status $(srcdir)/tests.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -# Recover from deleted '.trs' file; this should ensure that -# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create -# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells -# to avoid problems with "make -n". -.log.trs: - rm -f $< $@ - $(MAKE) $(AM_MAKEFLAGS) $< - -# Leading 'am--fnord' is there to ensure the list of targets does not -# expand to empty, as could happen e.g. with make check TESTS=''. -am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) -am--force-recheck: - @: - -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - if test -n "$$redo_bases"; then \ - redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ - redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ - if $(am__make_dryrun); then :; else \ - rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ - fi; \ - fi; \ - if test -n "$$am__remaking_logs"; then \ - echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ - "recursion detected" >&2; \ - elif test -n "$$redo_logs"; then \ - am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ - fi; \ - if $(am__make_dryrun); then :; else \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; \ - fi - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done \ - | $(am__create_global_log); \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ - fi; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 - -check-TESTS: - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -recheck: all - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - bases=`for i in $$bases; do echo $$i; done \ - | $(am__list_recheck_tests)` || exit 1; \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ - am__force_recheck=am--force-recheck \ - TEST_LOGS="$$log_list"; \ - exit $$? -.txt.log: - @p='$<'; \ - $(am__set_b); \ - $(am__check_pre) $(TXT_LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TXT_LOG_DRIVER_FLAGS) $(TXT_LOG_DRIVER_FLAGS) -- $(TXT_LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -@am__EXEEXT_TRUE@.txt$(EXEEXT).log: -@am__EXEEXT_TRUE@ @p='$<'; \ -@am__EXEEXT_TRUE@ $(am__set_b); \ -@am__EXEEXT_TRUE@ $(am__check_pre) $(TXT_LOG_DRIVER) --test-name "$$f" \ -@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ -@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TXT_LOG_DRIVER_FLAGS) $(TXT_LOG_DRIVER_FLAGS) -- $(TXT_LOG_COMPILE) \ -@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: check-am install-am install-strip - -.PHONY: all all-am check check-TESTS check-am clean clean-generic \ - clean-libtool cscopelist-am ctags-am distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \ - uninstall uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/netloc/data/avakas.txz and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/netloc/data/avakas.txz differ Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/netloc/data/plafrim.txz and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/netloc/data/plafrim.txz differ Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/netloc/data/plafrim2.txz and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/netloc/data/plafrim2.txz differ Binary files /tmp/tmpqz6q8m8n/hR9169EefO/hwloc-2.9.2/tests/netloc/data/scotch.txz and /tmp/tmpqz6q8m8n/L0DSasYnhW/hwloc-2.10.0/tests/netloc/data/scotch.txz differ diff -Nru hwloc-2.9.2/tests/netloc/data/tests_draw.txt hwloc-2.10.0/tests/netloc/data/tests_draw.txt --- hwloc-2.9.2/tests/netloc/data/tests_draw.txt 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/netloc/data/tests_draw.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -draw: - testset: avakas plafrim plafrim2 - copy: %=txz - needed: %/netloc %/hwloc - excluded: $NETLOC_TEST/netloc/*json - command: $NETLOC_UTIL_PATH/draw/netloc_draw_to_json %/netloc - checkfiles: $NETLOC_TEST/netloc/*json - diff -Nru hwloc-2.9.2/tests/netloc/data/tests_extract.txt hwloc-2.10.0/tests/netloc/data/tests_extract.txt --- hwloc-2.9.2/tests/netloc/data/tests_extract.txt 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/netloc/data/tests_extract.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -extract: - testset: avakas plafrim plafrim2 - copy: %=txz - needed: %/ib-raw - command: mkdir %/netloc; mkdir %/hwloc; $NETLOC_UTIL_PATH/infiniband/netloc_ib_extract_dats %/ib-raw %/netloc --hwloc-dir ../hwloc - checkfiles: %/netloc/*txt - diff -Nru hwloc-2.9.2/tests/netloc/data/tests_mpiscotch.txt hwloc-2.10.0/tests/netloc/data/tests_mpiscotch.txt --- hwloc-2.9.2/tests/netloc/data/tests_mpiscotch.txt 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/netloc/data/tests_mpiscotch.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -rank_file: - testset: scotch - copy: scotch=txz plafrim2=txz - needed: % plafrim2/netloc/*txt plafrim2/hwloc - command: ./%/test_mpi_rank_file.sh - checkcommand: test -f test.rank && ! grep -vlP "^rank \d+=[^\s]+ slot=\d+$" test.rank diff -Nru hwloc-2.9.2/tests/netloc/data/tests_scotch.txt hwloc-2.10.0/tests/netloc/data/tests_scotch.txt --- hwloc-2.9.2/tests/netloc/data/tests_scotch.txt 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/netloc/data/tests_scotch.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -scotch_arch: - testset: scotch - copy: scotch=txz plafrim2=txz - needed: % plafrim2/netloc/*txt plafrim2/hwloc - command: ./%/test_scotch_get_arch.sh - checkfiles: ./%/subarch.scotch ./%/arch.scotch - diff -Nru hwloc-2.9.2/tests/netloc/tests.sh.in hwloc-2.10.0/tests/netloc/tests.sh.in --- hwloc-2.9.2/tests/netloc/tests.sh.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/tests/netloc/tests.sh.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright © 2016-2017 Inria. All rights reserved. -# See COPYING in top-level directory. -# - -# This script needs a test file as argument -# The syntax of this file is the following -# test1: -# testset: machine1 machine2 # subfolders where tests be run -# command: ./test1 param1 # command to test -# needed: dir1/file*txt dir2 # files needed -# excluded: dir1/file0.txt dir2/file1 # file to exclude -# checkfiles: dir2/file1 # files used to check validity -# checkscript: ./check.sh # script to check validity -# test2: -# ... - -export NETLOC_TESTS_PATH="@HWLOC_top_srcdir@/tests/netloc" -export NETLOC_BUILD_PATH="@HWLOC_top_builddir@/tests/netloc" -export NETLOC_UTIL_PATH="@HWLOC_top_builddir@/utils/netloc" - -origpwd="$(pwd)" - -red="\e[31m" -green="\e[32m" -default="\e[0m" - -function write_output -{ - color=$1 - shift - echo -e $color$@$default -} - -function quit -{ - write_output $red "Test failed" - rm -fr $TEMPDIR -} - -function getvalues -{ - for i in $@; do - echo "$params" | $SED -n "s/^[[:space:]]*$i:[[:space:]]*\(.*\)\$/\1/p" - done | tr '\n' ' ' -} - -function getCopies -{ - local t=$1 - local copies=$(getvalues copy copy_${t}) - for f in $copies; do - local name=$(echo $f | $SED 's/\([^=]*\)\(=.*\)\{0,1\}/\1/') - local ext=$(echo $f | $SED 's/\([^=]*\)\(=.*\)\{0,1\}/\2/') - if [ -z "$ext" ]; then - cp -r "$NETLOC_TESTS_PATH/data/$name" "$REFDIR" - chmod -R u+w $REFDIR - cp -r "$NETLOC_BUILD_PATH/data/$name" "$REFDIR" - chmod -R u+w $REFDIR - elif [ "$ext" = "=txz" ]; then - # TODO prevent from extracting it again - $COMPRESS -d --stdout "$NETLOC_TESTS_PATH/data/$name.txz" > "$REFDIR/$name.tar" - tar -xf "$REFDIR/$name.tar" -C "$REFDIR" - rm "$REFDIR/$name.tar" - fi - done -} - - -trap 'quit' 0 -set -e - -compress=xz -hash $compress 2>/dev/null || \ - { echo >&2 "It requires $compress but it's not installed."; exit 1; } -COMPRESS=$(which $compress) -GREP=$(which grep) -SED=$(which sed) -AWK=$(which awk) - -# Folder structure like that -# TEMPDIR -# ├── ref <- copy of the data directory -# │   ├── machine1 -# │   │   └── file1 -# │   └── machine2 -# │   └── file1 -# └── test -# └── file1 -TEMPDIR=$(mktemp -d -t netloc_tests_XXXXX) -TESTDIR=$TEMPDIR/tests -REFDIR=$TEMPDIR/ref && mkdir $REFDIR -TESTFILE=$REFDIR/$(basename $1); cp $NETLOC_TESTS_PATH/data/$(basename $1) $REFDIR - -# Remove comments from the test file -$SED 's/#.*$//g; /^[[:space:]]*$/d' $TESTFILE > $TESTFILE.new -mv -f $TESTFILE.new $TESTFILE - -# Get tests -tests=$($SED -n 's/^\([^[:space:]]*\):[[:space:]]*$/\1/p' $TESTFILE) - -S=0 -F=0 - -for t in $tests; do - params_sv=$($AWK '/^'$t':\s*$/{flag=1;next}; /^\S*:\s*$/{flag=0}; {if (flag) print}' $TESTFILE) - params="$params_sv" - sets=$(getvalues testset) - - # For each set to test - for s in $sets; do - NETLOC_TEST=$s - params="$(echo "$params_sv" | $SED 's/%/'$NETLOC_TEST'/g')" - mkdir $TESTDIR - cd $TESTDIR - - # Copy or extract files if needed - getCopies $s - - # Copy needed files - cd "$REFDIR" - needed=$(getvalues needed) - if [ -z "needed" ]; then - cp -r $s $TESTDIR - else - files=$(eval "echo \"$needed\"") - for f in $files; do - mkdir -p "$TESTDIR/$(dirname "$f")" - cp -r "$f" "$TESTDIR/$(dirname "$f")" - done - fi - - # Remove excluded files - cd "$TESTDIR" - excluded=$(getvalues excluded) - if [ -n "$excluded" ]; then - files=$(eval "echo \"$excluded\"") - for f in $files; do - rm -f "$f" - done - fi - - while true; do - # Remove output files - cd $TESTDIR - for cf in $checkfiles; do - files=$(eval "echo \"$cf\"") - for f in $files; do - rm -f "$f" - done - done - - # Execute the command - cd $TESTDIR - cmd=$(getvalues command) - eval " $cmd" > /dev/null || \ - { - eval "echo \"Command $cmd failed\"" - write_output $red "Test $t on $NETLOC_TEST failed!" - failed=1 - break - } - - # Check files - cd "$REFDIR" - checkfiles=$(getvalues checkfiles) - for cf in $checkfiles; do - files=$(eval "echo \"$cf\"") - for f in $files; do - cmp "$f" "$TESTDIR/$f" || \ - { - echo "$f: wrong file" - eval "echo \"Command was: $cmd\"" - write_output $red "Test $t on $NETLOC_TEST failed!" - failed=1 - break - } - done - done - if [ "$failed" = 1 ]; then break; fi - - # Check program - cd $TESTDIR - checkcmd=$(getvalues checkcommand) - eval " $checkcmd" > /dev/null || \ - { - echo "Check command failed: $checkcmd" - eval "echo \"Command was: $cmd\"" - write_output $red "Test $t on $NETLOC_TEST failed!" - failed=1 - break - } - - break - done - - cd "$origpwd" - rm -fr $TESTDIR - if [ -n "$failed" ]; then - ((F+=1)) - else - ((S+=1)) - fi - failed= - done -done - -if [[ $F -ne O ]]; then - color=$red - returncode=1 -else - color=$green - returncode=0 -fi -echo "### Summary ###" -write_output $color "$F tests failed" -write_output $green "$S tests succeeded" -trap 0 -rm -fr $TEMPDIR -exit $returncode diff -Nru hwloc-2.9.2/utils/Makefile.am hwloc-2.10.0/utils/Makefile.am --- hwloc-2.9.2/utils/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -4,11 +4,3 @@ # See COPYING in top-level directory. SUBDIRS = hwloc lstopo - -if BUILD_NETLOC -SUBDIRS += \ - netloc/infiniband \ - netloc/draw \ - netloc/mpi \ - netloc/scotch -endif diff -Nru hwloc-2.9.2/utils/Makefile.in hwloc-2.10.0/utils/Makefile.in --- hwloc-2.9.2/utils/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -93,12 +93,6 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@BUILD_NETLOC_TRUE@am__append_1 = \ -@BUILD_NETLOC_TRUE@ netloc/infiniband \ -@BUILD_NETLOC_TRUE@ netloc/draw \ -@BUILD_NETLOC_TRUE@ netloc/mpi \ -@BUILD_NETLOC_TRUE@ netloc/scotch - subdir = utils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ @@ -112,8 +106,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -174,8 +167,7 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -DIST_SUBDIRS = hwloc lstopo netloc/infiniband netloc/draw netloc/mpi \ - netloc/scotch +DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ @@ -207,7 +199,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -334,17 +325,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -413,7 +393,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -436,8 +415,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ -SUBDIRS = hwloc lstopo $(am__append_1) +SUBDIRS = hwloc lstopo all: all-recursive .SUFFIXES: diff -Nru hwloc-2.9.2/utils/hwloc/Makefile.am hwloc-2.10.0/utils/hwloc/Makefile.am --- hwloc-2.9.2/utils/hwloc/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,7 @@ # Copyright © 2009-2021 Inria. All rights reserved. # Copyright © 2009-2012, 2014, 2016 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. +# Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. # # See COPYING in top-level directory. @@ -160,12 +161,16 @@ @ $(SEDMAN) \ > $@ < $< + +hwloc_compress_dir_name=`echo "hwloc-compress-dir" | $(SED) -e "$(transform)"` +hwloc_gather_topology_name=`echo "hwloc-gather-topology" | $(SED) -e "$(transform)"` + install-exec-hook: - $(SED) -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-compress-dir > $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp $(DESTDIR)$(bindir)/hwloc-compress-dir - chmod +x $(DESTDIR)$(bindir)/hwloc-compress-dir + $(SED) -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name) > $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name).tmp && mv -f $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name).tmp $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name) + chmod +x $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name) if HWLOC_HAVE_LINUX - $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-gather-topology > $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp $(DESTDIR)$(bindir)/hwloc-gather-topology - chmod +x $(DESTDIR)$(bindir)/hwloc-gather-topology + $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name) > $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name).tmp && mv -f $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name).tmp $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name) + chmod +x $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name) endif HWLOC_HAVE_LINUX distclean-local: diff -Nru hwloc-2.9.2/utils/hwloc/Makefile.in hwloc-2.10.0/utils/hwloc/Makefile.in --- hwloc-2.9.2/utils/hwloc/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -17,6 +17,7 @@ # Copyright © 2009-2021 Inria. All rights reserved. # Copyright © 2009-2012, 2014, 2016 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. +# Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. # # See COPYING in top-level directory. @@ -129,8 +130,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ @@ -548,7 +548,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -675,17 +674,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -754,7 +742,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -777,7 +764,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) @@ -851,6 +837,8 @@ # Same for dump-hwdata page on Linux/x86 hdh_page = hwloc-dump-hwdata.1 +hwloc_compress_dir_name = `echo "hwloc-compress-dir" | $(SED) -e "$(transform)"` +hwloc_gather_topology_name = `echo "hwloc-gather-topology" | $(SED) -e "$(transform)"` all: all-recursive .SUFFIXES: @@ -1826,10 +1814,10 @@ > $@ < $< install-exec-hook: - $(SED) -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-compress-dir > $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-compress-dir.tmp $(DESTDIR)$(bindir)/hwloc-compress-dir - chmod +x $(DESTDIR)$(bindir)/hwloc-compress-dir -@HWLOC_HAVE_LINUX_TRUE@ $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-gather-topology > $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp $(DESTDIR)$(bindir)/hwloc-gather-topology -@HWLOC_HAVE_LINUX_TRUE@ chmod +x $(DESTDIR)$(bindir)/hwloc-gather-topology + $(SED) -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name) > $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name).tmp && mv -f $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name).tmp $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name) + chmod +x $(DESTDIR)$(bindir)/$(hwloc_compress_dir_name) +@HWLOC_HAVE_LINUX_TRUE@ $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e 's/HWLOC_top_builddir\/utils\/hwloc/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name) > $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name).tmp && mv -f $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name).tmp $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name) +@HWLOC_HAVE_LINUX_TRUE@ chmod +x $(DESTDIR)$(bindir)/$(hwloc_gather_topology_name) distclean-local: rm -f $(nodist_man_MANS) diff -Nru hwloc-2.9.2/utils/hwloc/common-ps.c hwloc-2.10.0/utils/hwloc/common-ps.c --- hwloc-2.9.2/utils/hwloc/common-ps.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/common-ps.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2022 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -57,7 +57,7 @@ free(path); goto out; } - proc->name[n] = 0; + proc->name[n] = '\0'; if (flags & HWLOC_PS_FLAG_SHORTNAME) { /* try to get a small name from comm */ @@ -68,9 +68,9 @@ n = read(fd, comm, sizeof(comm) - 1); close(fd); if (n > 0) { - comm[n] = 0; + comm[n] = '\0'; if (n > 1 && comm[n-1] == '\n') - comm[n-1] = 0; + comm[n-1] = '\0'; } } else { @@ -85,12 +85,12 @@ n = read(fd, stats, sizeof(stats) - 1); close(fd); if (n > 0) { - stats[n] = 0; + stats[n] = '\0'; parenl = strchr(stats, '('); parenr = strchr(stats, ')'); if (!parenr) parenr = &stats[sizeof(stats)-1]; - *parenr = 0; + *parenr = '\0'; if (parenl) snprintf(comm, sizeof(comm), "%s", parenl+1); } @@ -115,12 +115,13 @@ if (fd >= 0) { char status[1024]; char *uid; - (void) read(fd, &status, sizeof(status)); - status[1023] = '\0'; - uid = strstr(status, "Uid:"); - if (uid) - proc->uid = strtoul(uid+4, NULL, 0); - close(fd); + if (read(fd, &status, sizeof(status)) > 0) { + status[1023] = '\0'; + uid = strstr(status, "Uid:"); + if (uid) + proc->uid = strtoul(uid+4, NULL, 0); + close(fd); + } } free(path); #endif @@ -390,5 +391,65 @@ return 0; #else /* HAVE_DIRENT_H */ return -1; +#endif /* HAVE_DIRENT_H */ +} + +int hwloc_ps_foreach_child(hwloc_topology_t topology, hwloc_const_bitmap_t topocpuset, + long pid, + void (*callback)(hwloc_topology_t topology, struct hwloc_ps_process *proc, void *cbdata), + void *cbdata, + unsigned long flags, const char *only_name, long uid) +{ +#ifdef HAVE_DIRENT_H + struct hwloc_ps_process proc; + DIR *taskdir; + char path[512]; + + proc.pid = pid; + proc.cpuset = NULL; + proc.nthreads = 0; + proc.nboundthreads = 0; + proc.threads = NULL; + if (hwloc_ps_read_process(topology, topocpuset, &proc, flags) < 0) + goto next; + if (only_name && !strstr(proc.name, only_name)) + goto next; + if (uid != HWLOC_PS_ALL_UIDS && proc.uid != HWLOC_PS_ALL_UIDS && proc.uid != uid) + goto next; + callback(topology, &proc, cbdata); + next: + hwloc_ps_free_process(&proc); + + snprintf(path, sizeof(path), "/proc/%ld/task", proc.pid); + taskdir = opendir(path); /* should be enough for the vast majority of cases */ + if (taskdir) { + struct dirent *taskdirent; + while ((taskdirent = readdir(taskdir))) { + char pidline[4096]; + FILE *file; + char *begin; + size_t len; + snprintf(path, sizeof(path), "/proc/%ld/task/%s/children", proc.pid, taskdirent->d_name); + file = fopen(path, "r"); + if (!file) + continue; + len = fread(pidline, 1, sizeof(pidline)-1, file); + fclose(file); + pidline[len] = '\0'; + begin = pidline; + while (1) { + char *end; + long childpid = strtoul(begin, &end, 10); + if (end == begin) + break; + hwloc_ps_foreach_child(topology, topocpuset, childpid, callback, cbdata, flags, only_name, uid); + begin = end; + } + } + closedir(taskdir); + } + return 0; +#else /* HAVE_DIRENT_H */ + return -1; #endif /* HAVE_DIRENT_H */ } diff -Nru hwloc-2.9.2/utils/hwloc/common-ps.h hwloc-2.10.0/utils/hwloc/common-ps.h --- hwloc-2.9.2/utils/hwloc/common-ps.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/common-ps.h 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -45,6 +45,12 @@ void *cbdata, unsigned long flags, const char *only_name, long only_uid); +int hwloc_ps_foreach_child(hwloc_topology_t topology, hwloc_const_bitmap_t topocpuset, + long pid, + void (*callback)(hwloc_topology_t topology, struct hwloc_ps_process *proc, void *cbdata), + void *cbdata, + unsigned long flags, const char *only_name, long only_uid); + void hwloc_ps_pidcmd(struct hwloc_ps_process *proc, const char *pidcmd); void hwloc_ps_free_process(struct hwloc_ps_process *proc); diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-annotate.c hwloc-2.10.0/utils/hwloc/hwloc-annotate.c --- hwloc-2.9.2/utils/hwloc/hwloc-annotate.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-annotate.c 2023-12-05 12:32:19.000000000 +0000 @@ -193,8 +193,8 @@ size_t typelen; int err; - typelen = strspn(str, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); - if (!typelen || (str[typelen] != ':' && str[typelen] != '=' && str[typelen] != '[')) + typelen = hwloc_calc_parse_level_size(str); + if (!typelen || (str[typelen] != ':' && str[typelen] != '=')) return NULL; lcontext.topology = topology; @@ -810,7 +810,7 @@ apply(topology, hwloc_get_root_obj(topology)); } else { size_t typelen; - typelen = strspn(location, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); + typelen = hwloc_calc_parse_level_size(location); if (typelen && (location[typelen] == ':' || location[typelen] == '=' || location[typelen] == '[')) { struct hwloc_calc_location_context_s lcontext; lcontext.topology = topology; diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-bind.1in hwloc-2.10.0/utils/hwloc/hwloc-bind.1in --- hwloc-2.9.2/utils/hwloc/hwloc-bind.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-bind.1in 2023-12-05 12:32:19.000000000 +0000 @@ -44,9 +44,18 @@ .TP \fB\-\-restrict\fR Restrict the topology to the given cpuset. +This removes some PUs and their now-child-less parents. + +Beware that restricting the PUs in a topology may change the +logical indexes of many objects, including NUMA nodes. .TP \fB\-\-restrict\fR nodeset= -Restrict the topology to the given nodeset, unless \fB\-\-restrict\-flags\fR specifies something different. +Restrict the topology to the given nodeset +(unless \fB\-\-restrict\-flags\fR specifies something different). +This removes some NUMA nodes and their now-child-less parents. + +Beware that restricting the NUMA nodes in a topology may change the +logical indexes of many objects, including PUs. .TP \fB\-\-restrict\-flags\fR Enforce flags when restricting the topology. @@ -74,15 +83,17 @@ .TP \fB\-\-hbm\fR -Only take high bandwidth memory nodes (Intel Xeon Phi MCDRAM) +Only take high bandwidth memory nodes +(marked with "HBM" subtype, or "MCDRAM" on Intel Xeon Phi) in account when looking for NUMA nodes in the input locations. This option must be combined with NUMA node locations, such as \fI--hbm numa:1\fR for binding on the second HBM node. -It may also be written as \fIhbm:1\fR. +It may also be written as \fInuma[hbm]:1\fR or \fInuma[mcdram]:1\fR. .TP \fB\-\-no\-hbm\fR -Ignore high bandwidth memory nodes (Intel Xeon Phi MCDRAM) +Ignore high bandwidth memory nodes +(marked with "HBM" subtype, or "MCDRAM" on Intel Xeon Phi MCDRAM) when looking for NUMA nodes in the input locations. . .SH OPTIONS @@ -100,13 +111,22 @@ .TP \fB\-\-mempolicy\fR Change the memory binding policy. -The available policies are default, firsttouch, bind, interleave -and nexttouch. + This option is only meaningful when an actual binding is also given with \fB\-\-membind\fR. If \fB\-\-membind\fR is given without \fB\-\-mempolicy\fR, the default policy is bind. +The available policies are \fBdefault\fR, \fBfirsttouch\fR, +\fBbind\fR, \fBinterleave\fR and \fBnexttouch\fR. +See hwloc.h for details about these policies. + +Note that hwloc's memory binding policies may be slightly different +from operating system policies. +For instance, the hwloc \fBbind\fR policy uses Linux \fIMPOL_PREFERRED_MANY\fR +(or \fIMPOL_PREFERRED\fR) by default, but it switches to Linux \fIMPOL_BIND\fR +if the hwloc strict option or flag is also given. + .TP \fB\-\-get\fR Report the current bindings. @@ -277,9 +297,14 @@ $ hwloc-bind --best-memattr capacity --cpubind pu:23 --membind pu:23 -- echo hello -To bind memory on the first high-bandwidth memory node on Intel Xeon Phi: +To bind memory on the first NUMA node marked with "HBM" subtype: + + $ hwloc-bind --membind numa[hbm]:0 -- echo hello + $ hwloc-bind --hbm --membind numa:0 -- echo hello + +To bind memory on the first high-bandwidth memory node (MCDRAM) on Intel Xeon Phi: - $ hwloc-bind --membind hbm:0 -- echo hello + $ hwloc-bind --membind numa[mcdram]:0 -- echo hello $ hwloc-bind --hbm --membind numa:0 -- echo hello Note that binding the "echo" command to multiple processors is diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-bind.c hwloc-2.10.0/utils/hwloc/hwloc-bind.c --- hwloc-2.9.2/utils/hwloc/hwloc-bind.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-bind.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2010, 2012 Université Bordeaux * Copyright © 2009-2018 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -337,8 +337,7 @@ scontext.output_set = working_on_cpubind ? cpubind_set : membind_set; ret = hwloc_calc_process_location_as_set(&lcontext, &scontext, location); if (ret < 0) { - if (verbose > 0) - fprintf(stderr, "assuming the command starts at %s\n", argv[0]); + fprintf(stderr, "argument `%s' unrecognized, assuming this is the executable.\n", argv[0]); break; } if (working_on_cpubind) @@ -376,6 +375,11 @@ return EXIT_FAILURE; } + if (!got_cpubind && !got_membind && !get_binding && !get_last_cpu_location) { + if (verbose >= 0) + fprintf(stderr, "got neither CPU nor memory binding locations.\n"); + } + if (get_binding || get_last_cpu_location) { char *s; const char *policystr = NULL; diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-calc.1in hwloc-2.10.0/utils/hwloc/hwloc-calc.1in --- hwloc-2.9.2/utils/hwloc/hwloc-calc.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-calc.1in 2023-12-05 12:32:19.000000000 +0000 @@ -44,7 +44,7 @@ \fB\-\-cpukind\fR , \fB\-\-cpukind\fR = Only keep PUs whose CPU kind match. Either a single CPU kind is specified as an index, -or the info name/value keypair will select matching kinds. +or the info attribute name-value will select matching kinds. When specified by index, it corresponds to hwloc ranking of CPU kinds which returns energy-efficient cores first, and high-performance @@ -62,11 +62,21 @@ .TP \fB\-\-restrict\fR Restrict the topology to the given cpuset. +This removes some PUs and their now-child-less parents. + This is useful when combining invocations to filter some objects before selecting among them. + +Beware that restricting the PUs in a topology may change the +logical indexes of many objects, including NUMA nodes. .TP \fB\-\-restrict\fR nodeset= -Restrict the topology to the given nodeset, unless \fB\-\-restrict\-flags\fR specifies something different. +Restrict the topology to the given nodeset +(unless \fB\-\-restrict\-flags\fR specifies something different). +This removes some NUMA nodes and their now-child-less parents. + +Beware that restricting the NUMA nodes in a topology may change the +logical indexes of many objects, including PUs. .TP \fB\-\-restrict\-flags\fR Enforce flags when restricting the topology. @@ -141,6 +151,10 @@ \fB\-\-ni\fR \fB\-\-nodeset\-input\fR Interpret input sets as nodesets instead of CPU sets. .TP +\fB\-\-oo\fR \fB\-\-object\-output\fR +When reporting object indexes (e.g. with \fB\-I\fR or \fB\-\-local\-memory\fR), +this option prefixes these indexes with types (e.g. \fICore:0\fR instead of \fI0\fR). +.TP \fB\-N \-\-number\-of \fR Report the number of objects of the given type or depth that intersect the CPU set. This is convenient for finding how many cores, NUMA nodes or PUs are available @@ -150,6 +164,10 @@ the nodeset is considered instead of the CPU set for finding matching objects. This is useful when reporting the output as a number or set of NUMA nodes. +\fI....\fR Find the list of objects of type that intersect the CPU set and @@ -191,7 +216,8 @@ Report (in a human readable format) the list of largest objects which exactly include all input objects (by looking at their CPU sets). None of these output objects intersect each other, and the sum of them is -exactly equivalent to the input. No largest object is included in the input +exactly equivalent to the input. No larger object is included in the input. + This is different from \-\-intersect where reported objects may not be strictly included in the input. .TP @@ -204,6 +230,9 @@ configured with \fB\-\-local\-memory\-flags\fR, while \fB\-I numa\fR just selects all nodes that are somehow local to any of the input objects. + +If combined with \fB\-\-object\-output\fR, object indexes are prefixed +with types (e.g. \fINUMANode:0\fR instead of \fI0\fR). .TP \fB\-\-local\-memory\-flags\fR Change the flags used to select local NUMA nodes. @@ -231,6 +260,8 @@ $ lstopo --memattrs +If combined with \fB\-\-object\-output\fR, the object index is prefixed +with its type (e.g. \fINUMANode:0\fR instead of \fI0\fR). .TP \fB\-\-sep \fR Change the field separator in the output. @@ -359,15 +390,31 @@ To display the list of NUMA nodes, by physical indexes, whose locality is exactly equal to a Package: - $ hwloc-calc --local-memory-flags 0 pack:1 + $ hwloc-calc --local-memory-flags 0 --physical-output pack:1 4,7 -To display the best-capacity NUMA node, by physical indexe, +To display the best-capacity NUMA node, by physical indexes, whose locality is exactly equal to a Package: - $ hwloc-calc --local-memory-flags 0 --best-memattr capacity pack:1 + $ hwloc-calc --local-memory-flags 0 --best-memattr capacity --physical-output pack:1 4 +To find the number of NUMA nodes with subtype "HBM": + + $ hwloc-calc -N "numa[hbm]" all + 4 + +To find the number of NUMA nodes in memory tier 1 +(DRAM nodes on a server with HBM and DRAM): + + $ hwloc-calc -N "numa[tier=1]" all + 4 + +To find the NUMA node of subtype MCDRAM (on KNL) near a PU: + + $ hwloc-calc -I "numa[mcdram]" pu:157 + 1 + Converting object logical indexes (default) from/to physical/OS indexes may be performed with \fB--intersect\fR combined with either \fB--physical-output\fR (logical to physical conversion) or \fB--physical-input\fR (physical to logical): diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-calc.c hwloc-2.10.0/utils/hwloc/hwloc-calc.c --- hwloc-2.9.2/utils/hwloc/hwloc-calc.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-calc.c 2023-12-05 12:32:19.000000000 +0000 @@ -3,6 +3,7 @@ * Copyright © 2009-2022 Inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux * Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. + * Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. * See COPYING in top-level directory. */ @@ -54,6 +55,7 @@ fprintf(where, " -n --nodeset Manipulate nodesets instead of cpusets\n"); fprintf(where, " --ni --nodeset-input Manipulate nodesets instead of cpusets for inputs\n"); fprintf(where, " --no --nodeset-output Manipulate nodesets instead of cpusets for outputs\n"); + fprintf(where, " --oo --object-output Report objects instead of object indexes\n"); fprintf(where, " --sep Use separator in the output\n"); fprintf(where, " --taskset Use taskset-specific format when displaying cpuset strings\n"); fprintf(where, " --single Singlify the output to a single CPU\n"); @@ -69,12 +71,11 @@ static int logicalo = 1; static int nodeseti = 0; static int nodeseto = 0; -static int numberofdepth = -1; -static union hwloc_obj_attr_u numberofattr; -static int intersectdepth = -1; -static union hwloc_obj_attr_u intersectattr; -static int hiernblevels = 0; -static int *hierdepth = NULL; +static int objecto = 0; +static struct hwloc_calc_level numberof; +static struct hwloc_calc_level intersect; +static int hiernblevels; +static struct hwloc_calc_level *hierlevels; static int local_numanodes = 0; static unsigned long local_numanode_flags = HWLOC_LOCAL_NUMANODE_FLAG_SMALLER_LOCALITY | HWLOC_LOCAL_NUMANODE_FLAG_LARGER_LOCALITY; static hwloc_memattr_id_t best_memattr_id = (hwloc_memattr_id_t) -1; @@ -116,12 +117,14 @@ hwloc_obj_t obj, prev = NULL; unsigned logi = 0; int first = 1; - while ((obj = hwloc_get_next_obj_covering_cpuset_by_depth(topology, root->cpuset, hierdepth[level], prev)) != NULL) { + while ((obj = hwloc_get_next_obj_covering_cpuset_by_depth(topology, root->cpuset, hierlevels[level].depth, prev)) != NULL) { char string[256]; char type[32]; unsigned idx = logicalo ? logi : obj->os_index; if (!hwloc_bitmap_intersects(set, obj->cpuset)) goto next; + if (hwloc_calc_check_object_filtered(obj, &hierlevels[level])) + goto next; hwloc_obj_type_snprintf(type, sizeof(type), obj, 1); if (idx == (unsigned)-1) snprintf(string, sizeof(string), "%s%s%s:-1", prefix, level ? "." : "", type); @@ -187,30 +190,31 @@ } printf("\n"); hwloc_bitmap_free(remaining); - } else if (numberofdepth != -1) { + } else if (numberof.depth != -1) { unsigned nb = 0; hwloc_obj_t obj = NULL; - while ((obj = hwloc_calc_get_next_obj_covering_set_by_depth(topology, set, nodeseto, numberofdepth, obj)) != NULL) { - if (numberofdepth == HWLOC_TYPE_DEPTH_OS_DEVICE - && numberofattr.osdev.type != (hwloc_obj_osdev_type_t) -1 - && numberofattr.osdev.type != obj->attr->osdev.type) + while ((obj = hwloc_calc_get_next_obj_covering_set_by_depth(topology, set, nodeseto, numberof.depth, obj)) != NULL) { + if (hwloc_calc_check_object_filtered(obj, &numberof)) continue; nb++; } printf("%u\n", nb); - } else if (intersectdepth != -1) { + } else if (intersect.depth != -1) { hwloc_obj_t obj = NULL; int first = 1; if (!sep) sep = ","; - while ((obj = hwloc_calc_get_next_obj_covering_set_by_depth(topology, set, nodeseto, intersectdepth, obj)) != NULL) { + while ((obj = hwloc_calc_get_next_obj_covering_set_by_depth(topology, set, nodeseto, intersect.depth, obj)) != NULL) { unsigned idx; - if (intersectdepth == HWLOC_TYPE_DEPTH_OS_DEVICE - && intersectattr.osdev.type != (hwloc_obj_osdev_type_t) -1 - && intersectattr.osdev.type != obj->attr->osdev.type) + if (hwloc_calc_check_object_filtered(obj, &intersect)) continue; if (!first) printf("%s", sep); + if (objecto) { + char types[64]; + hwloc_obj_type_snprintf(types, sizeof(types), obj, 0); + printf("%s:", types); + } idx = logicalo ? obj->logical_index : obj->os_index; if (idx == (unsigned)-1) printf("-1"); @@ -256,7 +260,14 @@ unsigned idx; hwloc_obj_type_snprintf(type, sizeof(type), nodes[i], 1); idx = logicalo ? nodes[i]->logical_index : nodes[i]->os_index; - printf("%s%u", i==0 ? (const char *) "" : sep, idx); + if (i>0) + printf("%s", sep); + if (objecto) { + char types[64]; + hwloc_obj_type_snprintf(types, sizeof(types), nodes[i], 0); + printf("%s:", types); + } + printf("%u", idx); } } free(nodes); @@ -275,71 +286,20 @@ return EXIT_SUCCESS; } -static int hwloc_calc_type_depth(hwloc_topology_t topology, const char *string, int *depthp, union hwloc_obj_attr_u *attrp, const char *caller) -{ - union hwloc_obj_attr_u attr; - hwloc_obj_type_t type; - int depth; - int err; - - /* similar to hwloc_type_sscanf_as_depth() but we want to get attr as well */ - - err = hwloc_type_sscanf(string, &type, &attr, sizeof(attr)); - if (err < 0) { - char *endptr; - depth = strtoul(string, &endptr, 0); - if (*endptr) { - fprintf(stderr, "unrecognized %s type or depth %s\n", caller, string); - return -1; - } - - *depthp = depth; - return 0; - } - - depth = hwloc_get_type_depth(topology, type); - if (type == HWLOC_OBJ_GROUP - && depth == HWLOC_TYPE_DEPTH_MULTIPLE - && attr.group.depth != (unsigned)-1) { - unsigned l; - depth = HWLOC_TYPE_DEPTH_UNKNOWN; - for(l=0; l<(unsigned) hwloc_topology_get_depth(topology); l++) { - hwloc_obj_t tmp = hwloc_get_obj_by_depth(topology, l, 0); - if (tmp->type == HWLOC_OBJ_GROUP && tmp->attr->group.depth == attr.group.depth) { - depth = (int)l; - break; - } - } - } - - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN) { - fprintf(stderr, "unavailable %s type %s\n", caller, hwloc_obj_type_string(type)); - return -1; - } else if (depth == HWLOC_TYPE_DEPTH_MULTIPLE) { - fprintf(stderr, "cannot use %s type %s with multiple depth, please use the relevant depth\n", caller, hwloc_obj_type_string(type)); - return -1; - } - - if (attrp) - memcpy(attrp, &attr, sizeof(attr)); - *depthp = depth; - return 0; -} - int main(int argc, char *argv[]) { hwloc_topology_t topology; unsigned long flags = HWLOC_TOPOLOGY_FLAG_IMPORT_SUPPORT; unsigned long restrict_flags = 0; char *input = NULL; - enum hwloc_utils_input_format input_format = HWLOC_UTILS_INPUT_DEFAULT; + struct hwloc_utils_input_format_s input_format = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; int depth = 0; hwloc_bitmap_t set; int cmdline_args = 0; - const char * numberoftype = NULL; - const char * intersecttype = NULL; + const char * numberof_string = NULL; + const char * intersect_string = NULL; char *restrictstring = NULL; - char * hiertype = NULL; + char * hier_string = NULL; char * best_memattr_str = NULL; char *callname; char *outsep = NULL; @@ -413,7 +373,7 @@ if (equal) { cpukind_infoname = argv[1]; cpukind_infovalue = equal+1; - *equal = 0; + *equal = '\0'; } else if (argv[1][0] >= '0' && argv[1][0] <= '9') { cpukind_index = atoi(argv[1]); } else { @@ -486,6 +446,9 @@ /* FALLTHRU */ } } + if (input) { + hwloc_utils_disable_input_format(&input_format); + } while (argc >= 1) { opt = 0; @@ -520,7 +483,7 @@ usage(callname, stderr); return EXIT_FAILURE; } - numberoftype = argv[1]; + numberof_string = argv[1]; opt = 1; goto next; } @@ -529,7 +492,7 @@ usage(callname, stderr); return EXIT_FAILURE; } - intersecttype = argv[1]; + intersect_string = argv[1]; opt = 1; goto next; } @@ -538,7 +501,7 @@ usage(callname, stderr); return EXIT_FAILURE; } - hiertype = argv[1]; + hier_string = argv[1]; opt = 1; goto next; } @@ -568,12 +531,12 @@ } if (!strcasecmp(argv[0], "--pulist") || !strcmp(argv[0], "--proclist")) { /* backward compat with 1.0 */ - intersecttype = "pu"; + intersect_string = "pu"; goto next; } if (!strcmp(argv[0], "--nodelist")) { /* backward compat with 1.0 */ - intersecttype = "numa"; + intersect_string = "numa"; goto next; } if (!strcmp(argv[0], "--largest") || !strcmp(argv[0], "--objects") /* backward compat with 1.0 */) { @@ -623,6 +586,10 @@ nodeseto = 1; goto next; } + if (!strcmp(argv[0], "--oo") || !strcmp(argv[0], "--object-output")) { + objecto = 1; + goto next; + } if (!strcmp(argv[0], "--sep")) { if (argc < 2) { usage (callname, stderr); @@ -669,16 +636,34 @@ argv += opt+1; } - if (numberoftype && hwloc_calc_type_depth(topology, numberoftype, &numberofdepth, &numberofattr, "--number-of") < 0) + numberof.depth = HWLOC_TYPE_DEPTH_UNKNOWN; /* disable this feature by default */ + if (numberof_string && hwloc_calc_parse_level(NULL, topology, numberof_string, strlen(numberof_string), &numberof) < 0) { + if (numberof.depth == HWLOC_TYPE_DEPTH_MULTIPLE) + fprintf(stderr, "cannot use --number-of type %s with multiple depth, please use the relevant depth\n", + numberof_string); + else if (numberof.depth == HWLOC_TYPE_DEPTH_UNKNOWN) + fprintf(stderr, "cannot use --number-of type %s, unavailable\n", + numberof_string); goto out; + } - if (intersecttype && hwloc_calc_type_depth(topology, intersecttype, &intersectdepth, &intersectattr, "--intersect") < 0) + intersect.depth = HWLOC_TYPE_DEPTH_UNKNOWN; /* disable this feature by default */ + if (intersect_string && hwloc_calc_parse_level(NULL, topology, intersect_string, strlen(intersect_string), &intersect) < 0) { + if (intersect.depth == HWLOC_TYPE_DEPTH_MULTIPLE) + fprintf(stderr, "cannot use --intersect type %s with multiple depth, please use the relevant depth\n", + intersect_string); + else if (intersect.depth == HWLOC_TYPE_DEPTH_UNKNOWN) + fprintf(stderr, "cannot use --intersect type %s, unavailable\n", + intersect_string); goto out; + } - if (hiertype) { + hiernblevels = 0; /* disable this feature by default */ + hierlevels = NULL; + if (hier_string) { char *tmp, *next; hiernblevels = 1; - tmp = hiertype; + tmp = hier_string; while (1) { tmp = strchr(tmp, '.'); if (!tmp) @@ -686,15 +671,22 @@ tmp++; hiernblevels++; } - hierdepth = malloc(hiernblevels * sizeof(int)); - tmp = hiertype; + hierlevels = malloc(hiernblevels * sizeof(struct hwloc_calc_level)); + tmp = hier_string; for(i=0; i #include +/* this is a global that doesn't change when walking hierarchy of locations, etc */ struct hwloc_calc_location_context_s { hwloc_topology_t topology; int topodepth; - int only_hbm; /* -1 for everything, 0 for only non-HBM, 1 for only HBM numa nodes */ + int only_hbm; /* -1 for everything, 0 for only non-HBM, 1 for only HBM numa nodes + * stored by caller, and passed to struct hwloc_calc_level for actual filtering + */ int logical; int verbose; }; +/* this a local that changes when going from one level to another in the hierarchy of locations, etc */ +struct hwloc_calc_level { + int depth; + hwloc_obj_type_t type; + union hwloc_obj_attr_u attr; + char subtype[32]; + int memory_tier; + int pci_vendor, pci_device; + int only_hbm; /* -1 for everything, 0 for only non-HBM, 1 for only HBM numa nodes */ +}; + typedef enum hwloc_calc_append_mode_e { HWLOC_CALC_APPEND_ADD, HWLOC_CALC_APPEND_CLR, @@ -76,29 +90,61 @@ return 0; } +/* return 1 if obj is filtered out */ +static __hwloc_inline int +hwloc_calc_check_object_filtered(hwloc_obj_t obj, struct hwloc_calc_level *level) +{ + if (level->subtype[0]) { + if (!obj->subtype || strcasecmp(level->subtype, obj->subtype)) + return 1; + } + + if (level->type == HWLOC_OBJ_NUMANODE) { + if (level->memory_tier >= 0) { + const char *tier = hwloc_obj_get_info_by_name(obj, "MemoryTier"); + if (!tier || atoi(tier) != level->memory_tier) + return 1; + } + + if (level->only_hbm >= 0) { + /* filter on hbm */ + int obj_is_hbm = obj->subtype && !strcmp(obj->subtype, "MCDRAM"); + if (level->only_hbm != obj_is_hbm) + return 1; + } + + } else if (level->type == HWLOC_OBJ_PCI_DEVICE) { + if (level->pci_vendor != -1 && (int) obj->attr->pcidev.vendor_id != level->pci_vendor) + return 1; + if (level->pci_device != -1 && (int) obj->attr->pcidev.device_id != level->pci_device) + return 1; + + } else if (level->type == HWLOC_OBJ_OS_DEVICE) { + if ((int) level->attr.osdev.type != -1 && obj->attr->osdev.type != level->attr.osdev.type) + return 1; + } + + return 0; +} + static __hwloc_inline unsigned hwloc_calc_get_nbobjs_inside_sets_by_depth(struct hwloc_calc_location_context_s *lcontext, hwloc_const_bitmap_t cpuset, hwloc_const_bitmap_t nodeset, - int depth) + struct hwloc_calc_level *level) { hwloc_topology_t topology = lcontext->topology; - int only_hbm = lcontext->only_hbm; hwloc_obj_t obj = NULL; unsigned n = 0; - while ((obj = hwloc_get_next_obj_by_depth(topology, depth, obj)) != NULL) { - if (!hwloc_bitmap_isincluded(obj->cpuset, cpuset)) + while ((obj = hwloc_get_next_obj_by_depth(topology, level->depth, obj)) != NULL) { + if (!hwloc_bitmap_iszero(obj->cpuset) && !hwloc_bitmap_intersects(obj->cpuset, cpuset)) continue; - if (!hwloc_bitmap_isincluded(obj->nodeset, nodeset)) + if (!hwloc_bitmap_iszero(obj->nodeset) && !hwloc_bitmap_intersects(obj->nodeset, nodeset)) continue; if (hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_iszero(obj->nodeset)) /* ignore objects with empty sets (both can be empty when outside of cgroup) */ continue; - if (only_hbm >= 0 && obj->type == HWLOC_OBJ_NUMANODE) { - /* filter on hbm */ - int obj_is_hbm = obj->subtype && !strcmp(obj->subtype, "MCDRAM"); - if (only_hbm != obj_is_hbm) - continue; - } + if (hwloc_calc_check_object_filtered(obj, level)) + continue; n++; } return n; @@ -107,27 +153,22 @@ static __hwloc_inline hwloc_obj_t hwloc_calc_get_obj_inside_sets_by_depth(struct hwloc_calc_location_context_s *lcontext, hwloc_const_bitmap_t cpuset, hwloc_const_bitmap_t nodeset, - int depth, unsigned ind) + struct hwloc_calc_level *level, unsigned ind) { hwloc_topology_t topology = lcontext->topology; - int only_hbm = lcontext->only_hbm; int logical = lcontext->logical; hwloc_obj_t obj = NULL; unsigned i = 0; - while ((obj = hwloc_get_next_obj_by_depth(topology, depth, obj)) != NULL) { - if (!hwloc_bitmap_isincluded(obj->cpuset, cpuset)) + while ((obj = hwloc_get_next_obj_by_depth(topology, level->depth, obj)) != NULL) { + if (!hwloc_bitmap_iszero(obj->cpuset) && !hwloc_bitmap_intersects(obj->cpuset, cpuset)) continue; - if (!hwloc_bitmap_isincluded(obj->nodeset, nodeset)) + if (!hwloc_bitmap_iszero(obj->nodeset) && !hwloc_bitmap_intersects(obj->nodeset, nodeset)) continue; if (hwloc_bitmap_iszero(obj->cpuset) && hwloc_bitmap_iszero(obj->nodeset)) /* ignore objects with empty sets (both can be empty when outside of cgroup) */ continue; - if (only_hbm >= 0 && obj->type == HWLOC_OBJ_NUMANODE) { - /* filter on hbm */ - int obj_is_hbm = obj->subtype && !strcmp(obj->subtype, "MCDRAM"); - if (only_hbm != obj_is_hbm) - continue; - } + if (hwloc_calc_check_object_filtered(obj, level)) + continue; if (logical) { if (i == ind) return obj; @@ -140,56 +181,170 @@ return NULL; } +/* return the length of the type/depth prefix (including filters if any) + * 0 if not found or invalid. + */ +static __hwloc_inline size_t +hwloc_calc_parse_level_size(const char *string) +{ + size_t len; + const char *filter_end; + + /* type/depth prefix ends with either '.' (for child), "=" (for name of osdev), + * ':' (for index), or '[' (for filters). + */ + len = strcspn(string, ":=.["); + if (string[len] != '[') + return len; + + /* we want to include filters */ + filter_end = strchr(string+len, ']'); + if (!filter_end) + return 0; + return filter_end + 1 - string; +} + +static __hwloc_inline int +hwloc_calc_parse_level_filter(hwloc_topology_t topology __hwloc_attribute_unused, + char *filter, + struct hwloc_calc_level *level) +{ + const char *current = filter; + const char *end; + unsigned subtypelen; + + if (!strncmp(current, "tier=", 5)) { + level->memory_tier = atoi(current+5); + return 0; + } + + if (!strncmp(current, "subtype=", 8)) { + current += 8; + goto subtype; + } + + if (level->type == HWLOC_OBJ_PCI_DEVICE) { + /* try to match by [vendor:device] */ + unsigned vendor, device; + if (sscanf(current, "%x:%x]", &vendor, &device) == 2) { + level->pci_vendor = (int) vendor; + level->pci_device = (int) device; + return 0; + } else if (sscanf(current, ":%x]", &device) == 1) { + level->pci_device = (int) device; + return 0; + } else if (sscanf(current, "%x:]", &vendor) == 1) { + level->pci_vendor = (int) vendor; + return 0; + } else if (!strncmp(current, ":]", 2)) { + /* nothing */ + return 0; + } else if (strchr(current, ':')) { + fprintf(stderr, "invalid PCI vendor:device filter specification %s\n", filter); + return -1; + } + + } else if (level->type == HWLOC_OBJ_OS_DEVICE) { + /* try to match by [osdevtype] */ + hwloc_obj_type_t type2; + union hwloc_obj_attr_u attr; + char *endp; + int err; + + endp = strchr(current, ']'); + if (!endp) { + fprintf(stderr, "invalid OS device type specification %s\n", filter); + return -1; + } + *endp = 0; + + err = hwloc_type_sscanf(current, &type2, &attr, sizeof(attr)); + *endp = ']'; + if (err < 0 || type2 != HWLOC_OBJ_OS_DEVICE) + goto subtype; + level->attr.osdev.type = attr.osdev.type; + return 0; + } + + subtype: + /* assume it's a subtype */ + end = strchr(current, ']'); + subtypelen = end - current; + if (subtypelen >= sizeof(level->subtype)) + subtypelen = sizeof(level->subtype) - 1; + snprintf(level->subtype, subtypelen+1, "%s", current); + return 0; +} + static __hwloc_inline int -hwloc_calc_parse_depth_prefix(struct hwloc_calc_location_context_s *lcontext, - const char *string, size_t typelen, - hwloc_obj_type_t *typep) +hwloc_calc_parse_level(struct hwloc_calc_location_context_s *lcontext, + hwloc_topology_t topology, + const char *_typestring, size_t typelen, + struct hwloc_calc_level *level) { - hwloc_topology_t topology = lcontext->topology; - int topodepth = lcontext->topodepth; - int verbose = lcontext->verbose; char typestring[20+1]; /* large enough to store all type names, even with a depth attribute */ - hwloc_obj_type_t type; - int depth; - char *end; + char *endptr; int err; - if (typelen >= sizeof(typestring)) { - if (verbose >= 0) - fprintf(stderr, "invalid type name %s\n", string); + level->subtype[0] = '\0'; + level->memory_tier = -1; + level->pci_device = level->pci_vendor = -1; + level->only_hbm = -1; + if (lcontext) + level->only_hbm = lcontext->only_hbm; + + level->depth = HWLOC_TYPE_DEPTH_UNKNOWN; + + if (typelen >= sizeof(typestring)) return -1; - } - strncpy(typestring, string, typelen); - typestring[typelen] = '\0'; + snprintf(typestring, typelen+1, "%s", _typestring); - /* try to match a type name */ - err = hwloc_type_sscanf_as_depth(typestring, &type, topology, &depth); + err = hwloc_type_sscanf(typestring, &level->type, &level->attr, sizeof(level->attr)); if (!err) { - *typep = type; - return depth; + char *bracket; + /* parsed a correct type */ + level->depth = hwloc_get_type_depth(topology, level->type); + if (level->type == HWLOC_OBJ_GROUP + && level->depth == HWLOC_TYPE_DEPTH_MULTIPLE + && level->attr.group.depth != (unsigned)-1) { + unsigned l; + level->depth = HWLOC_TYPE_DEPTH_UNKNOWN; + for(l=0; l<(unsigned) hwloc_topology_get_depth(topology); l++) { + hwloc_obj_t tmp = hwloc_get_obj_by_depth(topology, l, 0); + if (tmp->type == HWLOC_OBJ_GROUP && tmp->attr->group.depth == level->attr.group.depth) { + level->depth = (int)l; + break; + } + } + } + if (level->depth == HWLOC_TYPE_DEPTH_UNKNOWN + || level->depth == HWLOC_TYPE_DEPTH_MULTIPLE) + return -1; + + bracket = strchr(typestring, '['); + if (bracket) { + err = hwloc_calc_parse_level_filter(topology, bracket+1, level); + if (err < 0) + return -1; + } + return 0; } + if (!strcasecmp(typestring, "HBM") || !strcasecmp(typestring, "MCDRAM")) { - if (lcontext->only_hbm == -1) - lcontext->only_hbm = 1; - *typep = HWLOC_OBJ_NUMANODE; - depth = HWLOC_TYPE_DEPTH_NUMANODE; - return depth; + level->only_hbm = 1; + level->type = HWLOC_OBJ_NUMANODE; + level->depth = HWLOC_TYPE_DEPTH_NUMANODE; + return 0; } - /* try to match a numeric depth */ - depth = strtol(string, &end, 0); - if (end != &string[typelen]) { - if (verbose >= 0) - fprintf(stderr, "invalid type name %s\n", string); + /* couldn't parse the type, try a depth value */ + level->depth = strtoul(typestring, &endptr, 0); + if (typestring[0] == '-' || *endptr || level->depth >= hwloc_topology_get_depth(topology)) { + level->depth = HWLOC_TYPE_DEPTH_UNKNOWN; return -1; } - if (depth >= topodepth) { - if (verbose >= 0) - fprintf(stderr, "ignoring invalid depth %d\n", depth); - return -1; - } - *typep = HWLOC_OBJ_TYPE_NONE; - return depth; + level->type = HWLOC_OBJ_TYPE_NONE; + return 0; } static __hwloc_inline int @@ -292,15 +447,16 @@ static __hwloc_inline int hwloc_calc_append_object_range(struct hwloc_calc_location_context_s *lcontext, - hwloc_const_bitmap_t rootcpuset, hwloc_const_bitmap_t rootnodeset, int depth, + hwloc_const_bitmap_t rootcpuset, hwloc_const_bitmap_t rootnodeset, struct hwloc_calc_level *level, const char *string, /* starts with indexes following the colon */ void (*cbfunc)(struct hwloc_calc_location_context_s *, void *, hwloc_obj_t), void *cbdata) { int verbose = lcontext->verbose; + hwloc_topology_t topology = lcontext->topology; hwloc_obj_t obj; unsigned width; const char *dot, *nextsep = NULL; - int nextdepth = -1; + struct hwloc_calc_level nextlevel; int first, wrap, amount, step; unsigned i,j; int found = 0; @@ -320,9 +476,8 @@ if (dot) { /* parse the next string before calling ourself recursively */ size_t typelen; - hwloc_obj_type_t type; const char *nextstring = dot+1; - typelen = strspn(nextstring, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); + typelen = hwloc_calc_parse_level_size(nextstring); if (!typelen || nextstring[typelen] != ':') { if (verbose >= 0) fprintf(stderr, "hierarchical sublocation %s contains types not followed by colon and index range\n", nextstring); @@ -330,28 +485,29 @@ } nextsep = &nextstring[typelen]; - nextdepth = hwloc_calc_parse_depth_prefix(lcontext, - nextstring, typelen, - &type); - if (nextdepth == HWLOC_TYPE_DEPTH_UNKNOWN) { - if (verbose >= 0) - fprintf(stderr, "could not find level specified by location %s\n", nextstring); - return -1; - } - if (nextdepth == HWLOC_TYPE_DEPTH_MULTIPLE) { - if (verbose >= 0) - fprintf(stderr, "found multiple levels for location %s\n", nextstring); - return -1; + err = hwloc_calc_parse_level(lcontext, topology, nextstring, typelen, &nextlevel); + if (err < 0) { + if (nextlevel.depth == HWLOC_TYPE_DEPTH_UNKNOWN) { + if (verbose >= 0) + fprintf(stderr, "could not find level specified by location %s\n", nextstring); + return -1; + } + if (nextlevel.depth == HWLOC_TYPE_DEPTH_MULTIPLE) { + if (verbose >= 0) + fprintf(stderr, "found multiple levels for location %s\n", nextstring); + return -1; + } } + /* we need an object with a cpuset, that's depth>=0 or memory */ - if (nextdepth < 0 && nextdepth != HWLOC_TYPE_DEPTH_NUMANODE) { + if (nextlevel.depth < 0 && nextlevel.depth != HWLOC_TYPE_DEPTH_NUMANODE) { if (verbose >= 0) fprintf(stderr, "hierarchical location %s only supported with normal object types\n", string); return -1; } } - width = hwloc_calc_get_nbobjs_inside_sets_by_depth(lcontext, rootcpuset, rootnodeset, depth); + width = hwloc_calc_get_nbobjs_inside_sets_by_depth(lcontext, rootcpuset, rootnodeset, level); if (amount == -1) amount = (width-first+step-1)/step; @@ -359,24 +515,24 @@ if (wrap && i>=width) i = 0; - obj = hwloc_calc_get_obj_inside_sets_by_depth(lcontext, rootcpuset, rootnodeset, depth, i); + obj = hwloc_calc_get_obj_inside_sets_by_depth(lcontext, rootcpuset, rootnodeset, level, i); if (verbose > 0 || (!obj && verbose >= 0)) { char *sc, *sn; hwloc_bitmap_asprintf(&sc, rootcpuset); hwloc_bitmap_asprintf(&sn, rootnodeset); if (obj) printf("using object #%u depth %d below cpuset %s nodeset %s\n", - i, depth, sc, sn); + i, level->depth, sc, sn); else fprintf(stderr, "object #%u depth %d below cpuset %s nodeset %s does not exist\n", - i, depth, sc, sn); + i, level->depth, sc, sn); free(sc); free(sn); } if (obj) { found++; if (dot) { - hwloc_calc_append_object_range(lcontext, obj->cpuset, obj->nodeset, nextdepth, nextsep+1, cbfunc, cbdata); + hwloc_calc_append_object_range(lcontext, obj->cpuset, obj->nodeset, &nextlevel, nextsep+1, cbfunc, cbdata); } else { /* add to the temporary cpuset * and let the caller add/clear/and/xor for the actual final cpuset depending on cmdline options @@ -402,91 +558,17 @@ static __hwloc_inline int hwloc_calc_append_iodev_by_index(struct hwloc_calc_location_context_s *lcontext, - hwloc_obj_type_t type, int depth, const char *string, + struct hwloc_calc_level *level, const char *string, void (*cbfunc)(struct hwloc_calc_location_context_s *, void *, hwloc_obj_t), void *cbdata) { hwloc_topology_t topology = lcontext->topology; int verbose = lcontext->verbose; hwloc_obj_t obj, prev = NULL; - int pcivendor = -1, pcidevice = -1; - int osdevtype = -1; const char *current, *dot; - char *endp; int first = 0, step = 1, amount = 1, wrap = 0; /* assume the index suffix is `:0' by default */ int err, i, max; - if (*string == '[') { - /* matching */ - current = string+1; - - if (type == HWLOC_OBJ_PCI_DEVICE) { - /* try to match by [vendor:device] */ - pcivendor = strtoul(current, &endp, 16); - if (*endp != ':') { - if (verbose >= 0) - fprintf(stderr, "invalid PCI vendor:device matching specification %s\n", string); - return -1; - } - if (endp == current) - pcivendor = -1; - current = endp+1; - - pcidevice = strtoul(current, &endp, 16); - if (*endp != ']') { - if (verbose >= 0) - fprintf(stderr, "invalid PCI vendor:device matching specification %s\n", string); - return -1; - } - if (endp == current) - pcidevice = -1; - current = endp+1; - - if (*current != ':' && *current != '\0') { - if (verbose >= 0) - fprintf(stderr, "invalid PCI vendor:device matching specification %s\n", string); - return -1; - } - - } else if (type == HWLOC_OBJ_OS_DEVICE) { - /* try to match by [osdevtype] */ - hwloc_obj_type_t type2; - union hwloc_obj_attr_u attr; - - endp = strchr(current, ']'); - if (!endp) { - if (verbose >= 0) - fprintf(stderr, "invalid OS device subtype specification %s\n", string); - return -1; - } - *endp = 0; - - err = hwloc_type_sscanf(current, &type2, &attr, sizeof(attr)); - *endp = ']'; - if (err < 0 || type2 != HWLOC_OBJ_OS_DEVICE) { - if (verbose >= 0) - fprintf(stderr, "invalid OS device subtype specification %s\n", string); - return -1; - } - osdevtype = attr.osdev.type; - - current = endp+1; - if (*current != ':' && *current != '\0') { - if (verbose >= 0) - fprintf(stderr, "invalid OS device subtype specification %s\n", string); - return -1; - } - - } else { - /* no matching for non-PCI devices */ - if (verbose >= 0) - fprintf(stderr, "invalid matching specification %s\n", string); - return -1; - } - - } else { - /* no matching */ - current = string; - } + current = string; if (*current != '\0') { current++; @@ -505,7 +587,7 @@ } } - max = hwloc_get_nbobjs_by_depth(topology, depth); + max = hwloc_get_nbobjs_by_depth(topology, level->depth); for(i=0; i < max*(wrap+1); i++) { if (i == max && wrap) { @@ -513,31 +595,19 @@ wrap = 0; } - obj = hwloc_get_obj_by_depth(topology, depth, i); + obj = hwloc_get_obj_by_depth(topology, level->depth, i); assert(obj); if (obj == prev) /* already used that object, stop wrapping around */ break; - if (type == HWLOC_OBJ_PCI_DEVICE) { - if (pcivendor != -1 && (int) obj->attr->pcidev.vendor_id != pcivendor) - continue; - if (pcidevice != -1 && (int) obj->attr->pcidev.device_id != pcidevice) - continue; - } - - if (type == HWLOC_OBJ_OS_DEVICE) { - if (osdevtype != -1 && (int) obj->attr->osdev.type != osdevtype) - continue; - } + if (hwloc_calc_check_object_filtered(obj, level)) + continue; if (first--) continue; /* ok, got one object */ - if (verbose > 0) - printf("using matching PCI object #%d bus id %04x:%02x:%02x.%01x\n", i, - obj->attr->pcidev.domain, obj->attr->pcidev.bus, obj->attr->pcidev.dev, obj->attr->pcidev.func); hwloc_calc_append_iodev(lcontext, cbfunc, cbdata, obj); if (!prev) @@ -561,33 +631,33 @@ hwloc_topology_t topology = lcontext->topology; int verbose = lcontext->verbose; const char *sep = &arg[typelen]; - hwloc_obj_type_t type = HWLOC_OBJ_TYPE_NONE; - int depth; + struct hwloc_calc_level level; + int err; - depth = hwloc_calc_parse_depth_prefix(lcontext, - arg, typelen, - &type); - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN) { - if (verbose >= 0) - fprintf(stderr, "could not find level specified by location %s\n", arg); - return -1; - } - if (depth == HWLOC_TYPE_DEPTH_MULTIPLE) { - if (verbose >= 0) - fprintf(stderr, "found multiple levels for location %s\n", arg); - return -1; + err = hwloc_calc_parse_level(lcontext, topology, arg, typelen, &level); + if (err < 0) { + if (level.depth == HWLOC_TYPE_DEPTH_UNKNOWN) { + if (verbose >= 0) + fprintf(stderr, "could not find level specified by location %s\n", arg); + return -1; + } + if (level.depth == HWLOC_TYPE_DEPTH_MULTIPLE) { + if (verbose >= 0) + fprintf(stderr, "found multiple levels for location %s\n", arg); + return -1; + } } - if (depth < 0 && depth != HWLOC_TYPE_DEPTH_NUMANODE) { + if (level.depth < 0 && level.depth != HWLOC_TYPE_DEPTH_NUMANODE) { /* special object without cpusets */ /* if we didn't find a depth but found a type, handle special cases */ hwloc_obj_t obj = NULL; - if (*sep == ':' || *sep == '[') { - return hwloc_calc_append_iodev_by_index(lcontext, type, depth, sep, cbfunc, cbdata); + if (*sep == ':') { + return hwloc_calc_append_iodev_by_index(lcontext, &level, sep, cbfunc, cbdata); - } else if (*sep == '=' && type == HWLOC_OBJ_PCI_DEVICE) { + } else if (*sep == '=' && level.type == HWLOC_OBJ_PCI_DEVICE) { /* try to match a busid */ obj = hwloc_get_pcidev_by_busidstring(topology, sep+1); if (obj) @@ -596,7 +666,7 @@ fprintf(stderr, "invalid PCI device %s\n", sep+1); return -1; - } else if (*sep == '=' && type == HWLOC_OBJ_OS_DEVICE) { + } else if (*sep == '=' && level.type == HWLOC_OBJ_OS_DEVICE) { /* try to match a OS device name */ while ((obj = hwloc_get_next_osdev(topology, obj)) != NULL) { if (!strcmp(obj->name, sep+1)) @@ -606,7 +676,7 @@ fprintf(stderr, "invalid OS device %s\n", sep+1); return -1; - } else if (*sep == '=' && type == HWLOC_OBJ_MISC) { + } else if (*sep == '=' && level.type == HWLOC_OBJ_MISC) { /* try to match a Misc device name */ obj = hwloc_get_obj_by_type(topology, HWLOC_OBJ_MISC, 0); while (obj) { @@ -626,7 +696,7 @@ return hwloc_calc_append_object_range(lcontext, hwloc_topology_get_complete_cpuset(topology), hwloc_topology_get_complete_nodeset(topology), - depth, sep+1, cbfunc, cbdata); + &level, sep+1, cbfunc, cbdata); } struct hwloc_calc_set_context_s { @@ -689,8 +759,8 @@ mode, verbose); /* try to match a type/depth followed by a special character */ - typelen = strspn(arg, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); - if (typelen && (arg[typelen] == ':' || arg[typelen] == '=' || arg[typelen] == '[')) { + typelen = hwloc_calc_parse_level_size(arg); + if (typelen && (arg[typelen] == ':' || arg[typelen] == '=')) { /* process type/depth */ struct hwloc_calc_process_location_set_cbdata_s cbdata; cbdata.set = hwloc_bitmap_alloc(); diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-distrib.1in hwloc-2.10.0/utils/hwloc/hwloc-distrib.1in --- hwloc-2.9.2/utils/hwloc/hwloc-distrib.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-distrib.1in 2023-12-05 12:32:19.000000000 +0000 @@ -83,9 +83,18 @@ .TP \fB\-\-restrict\fR Restrict the topology to the given cpuset. +This removes some PUs and their now-child-less parents. + +Beware that restricting the PUs in a topology may change the +logical indexes of many objects, including NUMA nodes. .TP \fB\-\-restrict\fR nodeset= -Restrict the topology to the given nodeset, unless \fB\-\-restrict\-flags\fR specifies something different. +Restrict the topology to the given nodeset +(unless \fB\-\-restrict\-flags\fR specifies something different). +This removes some NUMA nodes and their now-child-less parents. + +Beware that restricting the NUMA nodes in a topology may change the +logical indexes of many objects, including PUs. .TP \fB\-\-restrict\-flags\fR Enforce flags when restricting the topology. diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-distrib.c hwloc-2.10.0/utils/hwloc/hwloc-distrib.c --- hwloc-2.9.2/utils/hwloc/hwloc-distrib.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-distrib.c 2023-12-05 12:32:19.000000000 +0000 @@ -3,6 +3,7 @@ * Copyright © 2009-2021 Inria. All rights reserved. * Copyright © 2009-2010 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. + * Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. * See COPYING in top-level directory. */ @@ -43,7 +44,7 @@ long n = -1; char *callname; char *input = NULL; - enum hwloc_utils_input_format input_format = HWLOC_UTILS_INPUT_DEFAULT; + struct hwloc_utils_input_format_s input_format = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; int taskset = 0; int singlify = 0; int verbose = 0; @@ -229,8 +230,12 @@ err = hwloc_topology_load(topology); if (err < 0) { free(cpuset); + if (input) hwloc_utils_disable_input_format(&input_format); return EXIT_FAILURE; } + if (input) { + hwloc_utils_disable_input_format(&input_format); + } if (restrictstring) { hwloc_bitmap_t restrictset = hwloc_bitmap_alloc(); diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-gather-cpuid.1in hwloc-2.10.0/utils/hwloc/hwloc-gather-cpuid.1in --- hwloc-2.9.2/utils/hwloc/hwloc-gather-cpuid.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-gather-cpuid.1in 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" Copyright © 2015-2021 Inria. All rights reserved. +.\" Copyright © 2015-2023 Inria. All rights reserved. .\" See COPYING in top-level directory. .TH HWLOC-GATHER-CPUID "1" "%HWLOC_DATE%" "%PACKAGE_VERSION%" "%PACKAGE_NAME%" .SH NAME @@ -23,7 +23,7 @@ Only gather cpuid values for logical processor whose OS/physical index is . .TP -\fB\-s\fR \fB\-\-silent\fR +\fB\-q\fR \fB\-\-quiet\fR \fB\-s\fR \fB\-\-silent\fR Do not show verbose messages. .TP \fB\-\-version\fR diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-gather-cpuid.c hwloc-2.10.0/utils/hwloc/hwloc-gather-cpuid.c --- hwloc-2.9.2/utils/hwloc/hwloc-gather-cpuid.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-gather-cpuid.c 2023-12-05 12:32:19.000000000 +0000 @@ -53,7 +53,7 @@ int has_intel_sgx = 0; int has_amd_topoext = 0; FILE *output; - int err; + int is_amd, err; err = hwloc_set_cpubind(topo, pu->cpuset, HWLOC_CPUBIND_PROCESS); if (err < 0) { @@ -91,6 +91,15 @@ regs[0] = 0x0; dump_one_cpuid(output, regs, 0x1); + /* AuthenticAMD */ +#define AMD_EBX ('A' | ('u'<<8) | ('t'<<16) | ('h'<<24)) +#define AMD_EDX ('e' | ('n'<<8) | ('t'<<16) | ('i'<<24)) +#define AMD_ECX ('c' | ('A'<<8) | ('M'<<16) | ('D'<<24)) + if (regs[1] == AMD_EBX && regs[2] == AMD_ECX && regs[3] == AMD_EDX) + is_amd = 1; + else + is_amd = 0; + /* 0x1 = Family, Model, Stepping, Topology, Features */ if (highest_cpuid >= 0x1) { regs[0] = 0x1; @@ -171,9 +180,15 @@ for(i=0; i<256; i++) { regs[0] = 0xb; regs[2] = i; dump_one_cpuid(output, regs, 0x5); - if (!(regs[2] & 0xff00)) - /* invalid, no more levels */ - break; + if (is_amd) { + /* AMD invalid (no more levels) = logprocatthislevel = ebx[0:15] == 0 */ + if (!(regs[1] & 0xffff)) + break; + } else { + /* Intel invalid (no more levels) = invalid level type = ecx[8:15] == 0 */ + if (!(regs[2] & 0xff00)) + break; + } } if (i == 256) fprintf(output, "# stopped at ecx=256\n"); @@ -517,6 +532,8 @@ fprintf(output, "# stopped at ecx=256\n"); } + /* AMD Genoa reports highest_ext_cpuid == 0x80000028 but these last 2 leaves aren't documented yet */ + if (highest_ext_cpuid > 0x80000026) { static int reported = 0; if (!reported) @@ -534,10 +551,10 @@ fprintf(where, "Usage : %s [ options ] ... [ outdir ]\n", callname); fprintf(where, " outdir is an optional output directory instead of cpuid/\n"); fprintf(where, "Options:\n"); - fprintf(where, " -c Only gather for logical processor with logical index \n"); - fprintf(where, " -s --silent Do not show verbose messages\n"); - fprintf(where, " --version Report version and exit\n"); - fprintf(where, " -h --help Show this usage\n"); + fprintf(where, " -c Only gather for logical processor with logical index \n"); + fprintf(where, " -q --quiet -s Do not show verbose messages\n"); + fprintf(where, " --version Report version and exit\n"); + fprintf(where, " -h --help Show this usage\n"); } int main(int argc, const char * const argv[]) @@ -573,7 +590,8 @@ idx = atoi(argv[1]); argc -= 2; argv += 2; - } else if (argc >= 1 && (!strcmp(argv[0], "-s") || !strcmp(argv[0], "--silent"))) { + } else if (argc >= 1 && (!strcmp(argv[0], "-q") || !strcmp(argv[0], "--quiet") + || !strcmp(argv[0], "-s") || !strcmp(argv[0], "--silent"))) { verbose--; argc--; argv++; diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-gather-topology.1in hwloc-2.10.0/utils/hwloc/hwloc-gather-topology.1in --- hwloc-2.9.2/utils/hwloc/hwloc-gather-topology.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-gather-topology.1in 2023-12-05 12:32:19.000000000 +0000 @@ -1,6 +1,6 @@ .\" -*- nroff -*- .\" Copyright © 2010 Jirka Hladky -.\" Copyright © 2010-2021 Inria. All rights reserved. +.\" Copyright © 2010-2023 Inria. All rights reserved. .\" See COPYING in top-level directory. .TH HWLOC-GATHER-TOPOLOGY "1" "%HWLOC_DATE%" "%PACKAGE_VERSION%" "%PACKAGE_NAME%" .SH NAME @@ -30,6 +30,11 @@ The gathering requires root access, and the dmi-sysfs kernel module should be loaded. . .TP +\fB\-\-dt\fR +Also gather Device-Tree CPU files. These files aren't needed for hwloc, +but they may be used for debugging what Linux exposes in /sys. +. +.TP \fB\-\-no\-cpuid\fR Do not gather x86 CPUID dump using \fIhwloc\-gather\-cpuid\fR. . diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-gather-topology.in hwloc-2.10.0/utils/hwloc/hwloc-gather-topology.in --- hwloc-2.9.2/utils/hwloc/hwloc-gather-topology.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-gather-topology.in 2023-12-05 12:32:19.000000000 +0000 @@ -3,7 +3,7 @@ # # Copyright © 2009 CNRS -# Copyright © 2009-2022 Inria. All rights reserved. +# Copyright © 2009-2023 Inria. All rights reserved. # Copyright © 2009-2012 Université Bordeaux # Copyright © 2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -26,11 +26,12 @@ export LANG LC_ALL # don't let ls append special chars after symlinks etc -unalias -a ls +unalias ls gathercpuid=1 gatherio=0 gatherdmi=0 +gatherdt=0 keep=0 if [ ! -x "$lstopo" ] @@ -52,6 +53,7 @@ echo "Options:" echo " --io Gather I/O files (takes much longer and generates much larger tarball)" echo " --dmi Gather SMBIOS files. Works only when run as root. Requires dmi-sysfs kernel module" + echo " --dt Gather Device-Tree CPU files under /proc/device-tree/cpus" echo " --no-cpuid Do not gather x86 CPUID using hwloc-gather-cpuid" echo " --keep Keep the temporary copy of dumped files" echo " --version Report version and exit" @@ -64,6 +66,7 @@ case $1 in --io) gatherio=1;; --dmi) gatherdmi=1;; + --dt) gatherdt=1;; --no-cpuid) gathercpuid=0;; --keep) keep=1;; --version) echo `basename $0`" $HWLOC_VERSION"; exit 0;; @@ -87,6 +90,9 @@ if [ x$gatherdmi = x0 ]; then echo "DMI files won't be saved (--dmi not given)." fi +if [ x$gatherdt = x0 ]; then + echo "Device-Tree CPU files won't be saved (--dt not given)." +fi echo echo "*** Note that this tool may be slow on large nodes or when I/O is enabled. ***" @@ -238,6 +244,9 @@ savedir "$destdir/$basename" /sys/bus/cpu/devices/ savedir "$destdir/$basename" /sys/devices/system/node/ savedir "$destdir/$basename" /sys/bus/node/devices/ +savefile "$destdir/$basename" /sys/devices/cpu_atom/cpus +savefile "$destdir/$basename" /sys/devices/cpu_core/cpus +savebusdir "$destdir/$basename" soc . # Gather DMI IDs # (no need for aveclassdir since we only want "id" and it usually points to /sys/devices/virtual/dmi/id/) @@ -247,6 +256,11 @@ # Gather hugepage information savedir "$destdir/$basename" /sys/kernel/mm/hugepages/ +if [ x$gatherdt = x1 ]; then + # Gather device-tree cpus + savedir "$destdir/$basename" /proc/device-tree/cpus/ +fi + # Gather the default /var/run/hwloc (in case it was created by a system-wide hwloc-dump-hwdata) if test -d /var/run/hwloc; then savedir "$destdir/$basename" /var/run/hwloc diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-info.1in hwloc-2.10.0/utils/hwloc/hwloc-info.1in --- hwloc-2.9.2/utils/hwloc/hwloc-info.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-info.1in 2023-12-05 12:32:19.000000000 +0000 @@ -73,22 +73,51 @@ \fB\-v\fR \fB\-\-verbose\fR Include additional detail. .TP -\fB\-s\fR \fB\-\-silent\fR +\fB\-q\fR \fB\-\-quiet\fR \fB\-s\fR \fB\-\-silent\fR Reduce the amount of details to show. A single summary line per object is displayed. .TP \fB\-\-ancestors\fR Display information about the object as well as about all its ancestors up to the root of the topology. +This is identical to \fB\-\-ancestor all\fR .TP \fB\-\-ancestor\fR Only display the object ancestors that match the given type. + +Some special values matching multiple types may also be given: +\fIkind=normal\fR (CPU objects, including caches), +\fIkind=cpu\fR (CPU objects, excluding caches), +\fIkind=cache\fR (all caches, including memory-side caches), +\fIkind=memory\fR (NUMA nodes or memory-side caches), +\fIkind=io\fR (IO objects), +\fIkind=all\fR (all objects). +See also \fIObject Kind\fR in Terms and Definitions in the documentation. +The prefix \fIkind=\fR may be omitted if there is no ambiguity. + +If multiple ancestors match, they are reported from the deepest +to the highest in the topology. +Adding \fB\-\-first\fR will only show the first one. .TP \fB\-\-children\fR Display information about the object children. .TP \fB\-\-descendants\fR Display information about the object descendants that match the given type. + +Some special values matching multiple types may also be given: +\fIkind=normal\fR (CPU objects, including caches), +\fIkind=cpu\fR (CPU objects, excluding caches), +\fIkind=cache\fR (all caches, including memory-side caches), +\fIkind=memory\fR (NUMA nodes or memory-side caches), +\fIkind=io\fR (IO objects), +\fIkind=all\fR (all objects). +See also \fIObject Kind\fR in Terms and Definitions in the documentation. +The prefix \fIkind=\fR may be omitted if there is no ambiguity. + +If multiple objects match, they are reported in a depth-first order +(first child, then its children, etc., then second child, etc.). +Adding \fB\-\-first\fR will only show the first one. .TP \fB\-\-local\-memory\fR Display information about the NUMA nodes that are local to the given object. @@ -112,6 +141,10 @@ If the memory attribute values depend on the initiator, the object given to hwloc-info is used as the initiator. .TP +\fB\-\-first\fR +For each input object, only report the first matching output object +(first ancestor, first child, etc.). +.TP \fB\-n\fR When outputting object information, prefix each line with the index of the considered object within the input. @@ -127,15 +160,27 @@ .TP \fB\-\-restrict\fR Restrict the topology to the given cpuset. +This removes some PUs and their now-child-less parents. + +Beware that restricting the PUs in a topology may change the +logical indexes of many objects, including NUMA nodes. .TP \fB\-\-restrict\fR nodeset= -Restrict the topology to the given nodeset, unless \fB\-\-restrict\-flags\fR specifies something different. +Restrict the topology to the given nodeset +(unless \fB\-\-restrict\-flags\fR specifies something different). +This removes some NUMA nodes and their now-child-less parents. + +Beware that restricting the NUMA nodes in a topology may change the +logical indexes of many objects, including PUs. .TP \fB\-\-restrict\fR binding Restrict the topology to the current process binding. This option requires the use of the actual current machine topology (or any other topology with \fB\-\-thissystem\fR or with HWLOC_THISSYSTEM set to 1 in the environment). + +Beware that restricting the topology may change the +logical indexes of many objects, including PUs and NUMA nodes. .TP \fB\-\-restrict\-flags\fR Enforce flags when restricting the topology. @@ -249,6 +294,12 @@ os index = 2 ... +To list the OS devices that are of subtype OpenCL: + + $ hwloc-info -s "os[OpenCL]:all" + CoProc:6 + CoProc:8 + To list the NUMA nodes that are local a PU: $ hwloc-info --local-memory pu:25 @@ -266,6 +317,11 @@ type = NUMANode ... +to find where a NUMA node is attached in the hierarchy of CPU cores: + + $ hwloc-info --ancestor kind=normal --first -s numa:1 + Package:0 + . .\" ************************** .\" See also section diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-info.c hwloc-2.10.0/utils/hwloc/hwloc-info.c --- hwloc-2.9.2/utils/hwloc/hwloc-info.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-info.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,8 +1,9 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. + * Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. * See COPYING in top-level directory. */ @@ -19,15 +20,66 @@ #include "misc.h" #include "hwloc-calc.h" +enum kind_e { + KIND_ALL, + KIND_NORMAL, + KIND_CACHE, + KIND_CPU, + KIND_MEMORY, + KIND_IO, + KIND_NONE +}; + +static enum kind_e parse_kind(const char *name) +{ + if (!strcmp(name, "all")) + return KIND_ALL; + if (!strcmp(name, "normal")) + return KIND_NORMAL; + if (!strcmp(name, "cache")) + return KIND_CACHE; + if (!strcmp(name, "cpu")) + return KIND_CPU; + if (!strcmp(name, "memory")) + return KIND_MEMORY; + if (!strcmp(name, "io")) + return KIND_IO; + return KIND_NONE; +} + +static int match_kind(hwloc_obj_t obj, enum kind_e kind) +{ + switch (kind) { + case KIND_ALL: + return 1; + case KIND_NORMAL: + return hwloc_obj_type_is_normal(obj->type); + case KIND_CACHE: + return hwloc_obj_type_is_cache(obj->type); + case KIND_CPU: + return hwloc_obj_type_is_normal(obj->type) && !hwloc_obj_type_is_cache(obj->type); + case KIND_MEMORY: + return hwloc_obj_type_is_memory(obj->type); + case KIND_IO: + return hwloc_obj_type_is_io(obj->type); + case KIND_NONE: + abort(); + } + return 0; +} + static int pid_number = -1; static hwloc_pid_t pid; static int verbose_mode = 0; static int logical = 1; static int show_ancestors = 0; static int show_ancestor_depth = HWLOC_TYPE_DEPTH_UNKNOWN; +static int show_ancestor_kind = KIND_NONE; static int show_children = 0; static int show_descendants_depth = HWLOC_TYPE_DEPTH_UNKNOWN; +static int show_descendants_kind = KIND_NONE; static int show_index_prefix = 0; +static int show_first_only = 0; static int show_local_memory = 0; static int show_local_memory_flags = HWLOC_LOCAL_NUMANODE_FLAG_SMALLER_LOCALITY | HWLOC_LOCAL_NUMANODE_FLAG_LARGER_LOCALITY; static hwloc_memattr_id_t best_memattr_id = (hwloc_memattr_id_t) -1; @@ -41,7 +93,7 @@ fprintf (where, " --topology Report information the topology\n"); fprintf (where, " --support Report information about supported features\n"); fprintf (where, " -v --verbose Include additional details\n"); - fprintf (where, " -s --silent Reduce the amount of details to show\n"); + fprintf (where, " -q --quiet -s Reduce the amount of details to show\n"); fprintf (where, " --ancestors Display the chain of ancestor objects up to the root\n"); fprintf (where, " --ancestor Only display the ancestor of the given type\n"); fprintf (where, " --children Display all children\n"); @@ -49,6 +101,7 @@ fprintf (where, " --local-memory Only display the local memory nodes\n"); fprintf (where, " --local-memory-flags Change flags for selecting local memory nodes\n"); fprintf (where, " --best-memattr Only display the best target among the local nodes\n"); + fprintf (where, " --first Only report the first matching object\n"); fprintf (where, " -n Prefix each line with the index of the considered object\n"); fprintf (where, "Object filtering options:\n"); fprintf (where, " --restrict [nodeset=]\n"); @@ -304,6 +357,115 @@ } static void +hwloc_info_show_ancestor(hwloc_topology_t topology, hwloc_obj_t ancestor, + hwloc_obj_t obj, const char *objs, + int level, const char *prefix, int verbose) +{ + char ancestors[128]; + hwloc_obj_type_snprintf(ancestors, sizeof(ancestors), ancestor, 1); + if (verbose < 0) + printf("%s%s:%u\n", prefix, ancestors, ancestor->logical_index); + else if (level > 0) + printf("%s%s L#%u = parent #%u of %s L#%u\n", + prefix, ancestors, ancestor->logical_index, level, objs, obj->logical_index); + else if (level == 0) /* the object itself, don't show it twice */ + printf("%s%s L#%u\n", + prefix, ancestors, ancestor->logical_index); + else /* single ancestor */ + printf("%s%s L#%u = parent of %s L#%u\n", + prefix, ancestors, ancestor->logical_index, objs, obj->logical_index); + hwloc_info_show_obj(topology, ancestor, ancestors, prefix, verbose); +} + +static void +hwloc_info_show_descendant(hwloc_topology_t topology, hwloc_obj_t descendant, + hwloc_obj_t obj, const char *objs, + int number, const char *prefix, int verbose) +{ + char descendants[128]; + hwloc_obj_type_snprintf(descendants, sizeof(descendants), descendant, 1); + if (verbose < 0) + printf("%s%s:%u\n", prefix, descendants, descendant->logical_index); + else + printf("%s%s L#%u = descendant #%u of %s L#%u\n", + prefix, descendants, descendant->logical_index, number, objs, obj->logical_index); + hwloc_info_show_obj(topology, descendant, descendants, prefix, verbose); +} + +static void +hwloc_info_show_child(hwloc_topology_t topology, hwloc_obj_t child, + hwloc_obj_t obj, const char *objs, + int number, const char *prefix, int verbose) +{ + char childs[128]; + hwloc_obj_type_snprintf(childs, sizeof(childs), child, 1); + if (verbose < 0) + printf("%s%s:%u\n", prefix, childs, child->logical_index); + else + printf("%s%s L#%u = child #%u of %s L#%u\n", + prefix, childs, child->logical_index, number, objs, obj->logical_index); + hwloc_info_show_obj(topology, child, childs, prefix, verbose); +} + +static void +hwloc_info_show_local_memory(hwloc_topology_t topology, hwloc_obj_t node, + hwloc_obj_t obj, const char *objs, + int number, const char *prefix, int verbose) +{ + char nodes[128]; + hwloc_obj_type_snprintf(nodes, sizeof(nodes), node, 1); + if (verbose < 0) + printf("%s%s:%u\n", prefix, nodes, node->logical_index); + else + printf("%s%s L#%u = local memory #%u of %s L#%u\n", + prefix, nodes, node->logical_index, number, objs, obj->logical_index); + hwloc_info_show_obj(topology, node, nodes, prefix, verbose); +} + +static void +hwloc_info_show_single_obj(hwloc_topology_t topology, + hwloc_obj_t obj, const char *objs, + const char *prefix, int verbose) +{ + if (verbose < 0) + printf("%s%s:%u\n", prefix, objs, obj->logical_index); + else + printf("%s%s L#%u\n", prefix, objs, obj->logical_index); + hwloc_info_show_obj(topology, obj, objs, prefix, verbose); +} + +static void +hwloc_info_recurse_descendants(hwloc_topology_t topology, + hwloc_obj_t obj, const char *objs, /* where we started */ + hwloc_obj_t root, /* current recursion root */ + int *number, + int verbose) +{ + /* process the current object before recursing, so that we traverse special objects + * as hwloc_list_special_objects() lists them on special levels. + */ + hwloc_obj_t child; + + if (show_first_only && *number) + return; + + if (root != obj /* don't show ourself */ + && match_kind(root, show_descendants_kind)) { + char prefix[32] = ""; + if (show_index_prefix) + snprintf(prefix, sizeof(prefix), "%u.%u: ", current_obj, *number); + hwloc_info_show_descendant(topology, root, obj, objs, *number, prefix, verbose); + if (show_first_only) + return; + (*number)++; + } + + child = NULL; + while ((child = hwloc_get_next_child(topology, root, child)) != NULL) + hwloc_info_recurse_descendants(topology, obj, objs, child, number, verbose); +} + +static void hwloc_calc_process_location_info_cb(struct hwloc_calc_location_context_s *lcontext, void *_data __hwloc_attribute_unused, hwloc_obj_t obj) @@ -320,80 +482,76 @@ hwloc_obj_type_snprintf(objs, sizeof(objs), obj, 1); if (show_ancestors) { - char parents[128]; unsigned level = 0; hwloc_obj_t parent = obj; while (parent) { if (show_index_prefix) - snprintf(prefix, sizeof(prefix), "%u.%u: ", current_obj, level); - hwloc_obj_type_snprintf(parents, sizeof(parents), parent, 1); - if (verbose < 0) - printf("%s%s:%u\n", prefix, parents, parent->logical_index); - else if (level) - printf("%s%s L#%u = parent #%u of %s L#%u\n", - prefix, parents, parent->logical_index, level, objs, obj->logical_index); - else - printf("%s%s L#%u\n", prefix, parents, parent->logical_index); - hwloc_info_show_obj(topology, parent, parents, prefix, verbose); + snprintf(prefix, sizeof(prefix), "%u.%u: ", current_obj, level); + hwloc_info_show_ancestor(topology, parent, obj, objs, level, prefix, verbose); + if (show_first_only) + break; parent = parent->parent; level++; } } else if (show_ancestor_depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - char parents[128]; hwloc_obj_t parent = obj; while (parent) { if (parent->depth == show_ancestor_depth) { - hwloc_obj_type_snprintf(parents, sizeof(parents), parent, 1); - if (verbose < 0) - printf("%s%s:%u\n", prefix, parents, parent->logical_index); - else - printf("%s%s L#%u = parent of %s L#%u\n", - prefix, parents, parent->logical_index, objs, obj->logical_index); - hwloc_info_show_obj(topology, parent, parents, prefix, verbose); + hwloc_info_show_ancestor(topology, parent, obj, objs, -1, prefix, verbose); break; } parent = parent->parent; } + } else if (show_ancestor_kind != KIND_NONE) { + hwloc_obj_t parent = obj->parent; /* don't show ourself */ + unsigned level = 0; + while (parent) { + if (match_kind(parent, show_ancestor_kind)) { + if (show_index_prefix) + snprintf(prefix, sizeof(prefix), "%u.%u: ", current_obj, level); + hwloc_info_show_ancestor(topology, parent, obj, objs, level, prefix, verbose); + if (show_first_only) + break; + level++; + } + parent = parent->parent; + } } else if (show_children) { unsigned i = 0; hwloc_obj_t child = NULL; while ((child = hwloc_get_next_child(topology, obj, child)) != NULL) { - char childs[128]; if (show_index_prefix) snprintf(prefix, sizeof(prefix), "%u.%u: ", current_obj, i); - hwloc_obj_type_snprintf(childs, sizeof(childs), child, 1); - if (verbose < 0) - printf("%s%s:%u\n", prefix, childs, child->logical_index); - else - printf("%s%s L#%u = child #%u of %s L#%u\n", - prefix, childs, child->logical_index, i, objs, obj->logical_index); - hwloc_info_show_obj(topology, child, childs, prefix, verbose); + hwloc_info_show_child(topology, child, obj, objs, i, prefix, verbose); + if (show_first_only) + break; i++; } } else if (show_descendants_depth != HWLOC_TYPE_DEPTH_UNKNOWN) { if (show_descendants_depth >= 0) { /* normal level */ - unsigned i = 0; - unsigned n = hwloc_calc_get_nbobjs_inside_sets_by_depth(lcontext, obj->cpuset, obj->nodeset, show_descendants_depth); + struct hwloc_calc_level level; + unsigned i = 0, n; + level.type = HWLOC_OBJ_TYPE_NONE; + level.depth = show_descendants_depth; + level.only_hbm = -1; + level.subtype[0] = '\0'; + level.memory_tier = -1; + level.pci_vendor = level.pci_device = -1; + n = hwloc_calc_get_nbobjs_inside_sets_by_depth(lcontext, obj->cpuset, obj->nodeset, &level); for(i=0; icpuset, obj->nodeset, show_descendants_depth, i); - char childs[128]; + hwloc_obj_t child = hwloc_calc_get_obj_inside_sets_by_depth(lcontext, obj->cpuset, obj->nodeset, &level, i); if (show_index_prefix) snprintf(prefix, sizeof(prefix), "%u.%u: ", current_obj, i); - hwloc_obj_type_snprintf(childs, sizeof(childs), child, 1); - if (verbose < 0) - printf("%s%s:%u\n", prefix, childs, child->logical_index); - else - printf("%s%s L#%u = descendant #%u of %s L#%u\n", - prefix, childs, child->logical_index, i, objs, obj->logical_index); - hwloc_info_show_obj(topology, child, childs, prefix, verbose); + hwloc_info_show_descendant(topology, child, obj, objs, i, prefix, verbose); + if (show_first_only) + break; } } else { /* custom level */ unsigned i = 0; hwloc_obj_t child = NULL; while ((child = hwloc_get_next_obj_by_depth(topology, show_descendants_depth, child)) != NULL) { - char childs[128]; hwloc_obj_t parent = child->parent; if (obj->cpuset) { while (parent && !parent->cpuset) @@ -411,16 +569,16 @@ } if (show_index_prefix) snprintf(prefix, sizeof(prefix), "%u.%u: ", current_obj, i); - hwloc_obj_type_snprintf(childs, sizeof(childs), child, 1); - if (verbose < 0) - printf("%s%s:%u\n", prefix, childs, child->logical_index); - else - printf("%s%s L#%u = descendant #%u of %s L#%u\n", - prefix, childs, child->logical_index, i, objs, obj->logical_index); - hwloc_info_show_obj(topology, child, childs, prefix, verbose); + hwloc_info_show_descendant(topology, child, obj, objs, i, prefix, verbose); + if (show_first_only) + break; i++; } } + } else if (show_descendants_kind != KIND_NONE) { + /* recurse in all children. */ + int number = 0; + hwloc_info_recurse_descendants(topology, obj, objs, obj, &number, verbose); } else if (show_local_memory) { unsigned nrnodes; hwloc_obj_t *nodes; @@ -456,18 +614,13 @@ } } for(i=0; ilogical_index); - else - printf("%s%s L#%u = local memory #%u of %s L#%u\n", - prefix, nodestr, nodes[i]->logical_index, i, objs, obj->logical_index); - hwloc_info_show_obj(topology, nodes[i], nodestr, prefix, verbose); + hwloc_info_show_local_memory(topology, nodes[i], obj, objs, i, prefix, verbose); + if (show_first_only) + break; } } } else { @@ -475,11 +628,7 @@ } free(nodes); } else { - if (verbose < 0) - printf("%s%s:%u\n", prefix, objs, obj->logical_index); - else - printf("%s%s L#%u\n", prefix, objs, obj->logical_index); - hwloc_info_show_obj(topology, obj, objs, prefix, verbose); + hwloc_info_show_single_obj(topology, obj, objs, prefix, verbose); } current_obj++; @@ -495,7 +644,7 @@ unsigned long restrict_flags = 0; char * callname; char * input = NULL; - enum hwloc_utils_input_format input_format = HWLOC_UTILS_INPUT_DEFAULT; + struct hwloc_utils_input_format_s input_format = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; const char *show_ancestor_type = NULL; const char *show_descendants_type = NULL; const char *best_memattr_str = NULL; @@ -539,7 +688,8 @@ mode = HWLOC_INFO_MODE_SUPPORT; else if (!strcmp (argv[0], "-v") || !strcmp (argv[0], "--verbose")) verbose_mode++; - else if (!strcmp (argv[0], "-s") || !strcmp (argv[0], "--silent")) + else if (!strcmp (argv[0], "-q") || !strcmp (argv[0], "--quiet") + || !strcmp (argv[0], "-s") || !strcmp (argv[0], "--silent")) verbose_mode--; else if (!strcmp (argv[0], "-h") || !strcmp (argv[0], "--help")) { usage(callname, stdout); @@ -587,6 +737,9 @@ best_memattr_str = argv[1]; opt = 1; } + else if (!strcmp (argv[0], "--first")) { + show_first_only = 1; + } else if (!strcmp (argv[0], "--filter")) { hwloc_obj_type_t type; char *colon; @@ -721,6 +874,7 @@ if (hwloc_pid_from_number(&pid, pid_number, 0, 1 /* verbose */) < 0 || hwloc_topology_set_pid(topology, pid)) { perror("Setting target pid"); + if (input) hwloc_utils_disable_input_format(&input_format); return EXIT_FAILURE; } } @@ -728,41 +882,58 @@ err = hwloc_topology_load (topology); if (err) { perror("hwloc_topology_load"); + if (input) hwloc_utils_disable_input_format(&input_format); return EXIT_FAILURE; } + if (input) { + hwloc_utils_disable_input_format(&input_format); + } + topodepth = hwloc_topology_get_depth(topology); if (show_ancestor_type) { - err = hwloc_type_sscanf_as_depth(show_ancestor_type, NULL, topology, &show_ancestor_depth); - if (err < 0) { - fprintf(stderr, "unrecognized --ancestor type %s\n", show_ancestor_type); - usage(callname, stderr); - return EXIT_FAILURE; - } - if (show_ancestor_depth == HWLOC_TYPE_DEPTH_UNKNOWN) { - fprintf(stderr, "unavailable --ancestor type %s\n", show_ancestor_type); - return EXIT_FAILURE; - } - if (show_ancestor_depth == HWLOC_TYPE_DEPTH_MULTIPLE) { - fprintf(stderr, "multiple --ancestor type %s\n", show_ancestor_type); - return EXIT_FAILURE; + if (!strncmp(show_ancestor_type, "kind=", 5)) + show_ancestor_kind = parse_kind(show_ancestor_type+5); + else + show_ancestor_kind = parse_kind(show_ancestor_type); + if (show_ancestor_kind == KIND_NONE) { + err = hwloc_type_sscanf_as_depth(show_ancestor_type, NULL, topology, &show_ancestor_depth); + if (err < 0) { + fprintf(stderr, "unrecognized --ancestor type %s\n", show_ancestor_type); + usage(callname, stderr); + return EXIT_FAILURE; + } + if (show_ancestor_depth == HWLOC_TYPE_DEPTH_UNKNOWN) { + fprintf(stderr, "unavailable --ancestor type %s\n", show_ancestor_type); + return EXIT_FAILURE; + } + if (show_ancestor_depth == HWLOC_TYPE_DEPTH_MULTIPLE) { + fprintf(stderr, "multiple --ancestor type %s\n", show_ancestor_type); + return EXIT_FAILURE; + } } } if (show_descendants_type) { + if (!strncmp(show_descendants_type, "kind=", 5)) + show_descendants_kind = parse_kind(show_descendants_type+5); + else + show_descendants_kind = parse_kind(show_descendants_type); + if (show_descendants_kind == KIND_NONE) { err = hwloc_type_sscanf_as_depth(show_descendants_type, NULL, topology, &show_descendants_depth); - if (err < 0) { - fprintf(stderr, "unrecognized --descendants type %s\n", show_descendants_type); - usage(callname, stderr); - return EXIT_FAILURE; - } - if (show_descendants_depth == HWLOC_TYPE_DEPTH_UNKNOWN) { - fprintf(stderr, "unavailable --descendants type %s\n", show_descendants_type); - return EXIT_FAILURE; - } - if (show_descendants_depth == HWLOC_TYPE_DEPTH_MULTIPLE) { - fprintf(stderr, "multiple --descendants type %s\n", show_descendants_type); - return EXIT_FAILURE; + if (err < 0) { + fprintf(stderr, "unrecognized --descendants type %s\n", show_descendants_type); + usage(callname, stderr); + return EXIT_FAILURE; + } + if (show_descendants_depth == HWLOC_TYPE_DEPTH_UNKNOWN) { + fprintf(stderr, "unavailable --descendants type %s\n", show_descendants_type); + return EXIT_FAILURE; + } + if (show_descendants_depth == HWLOC_TYPE_DEPTH_MULTIPLE) { + fprintf(stderr, "multiple --descendants type %s\n", show_descendants_type); + return EXIT_FAILURE; + } } } @@ -871,8 +1042,8 @@ return EXIT_FAILURE; } else { /* try to match a type/depth followed by a special character */ - typelen = strspn(argv[0], "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); - if (typelen && (argv[0][typelen] == ':' || argv[0][typelen] == '=' || argv[0][typelen] == '[')) { + typelen = hwloc_calc_parse_level_size(argv[0]); + if (typelen && (argv[0][typelen] == ':' || argv[0][typelen] == '=')) { err = hwloc_calc_process_location(&lcontext, argv[0], typelen, hwloc_calc_process_location_info_cb, NULL); } diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-ps.1in hwloc-2.10.0/utils/hwloc/hwloc-ps.1in --- hwloc-2.9.2/utils/hwloc/hwloc-ps.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-ps.1in 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" Copyright © 2010-2021 Inria. All rights reserved. +.\" Copyright © 2010-2023 Inria. All rights reserved. .\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. .\" See COPYING in top-level directory. .TH HWLOC-PS "1" "%HWLOC_DATE%" "%PACKAGE_VERSION%" "%PACKAGE_NAME%" @@ -28,6 +28,10 @@ Only show process of PID \fI\fR, even if it is not bound to any specific part of the machine. .TP +\fB\-\-children\-of\-pid \fR +Only show process of PID \fI\fR and its hierarchy of children, +even if they are not bound to any specific part of the machine. +.TP \fB\-\-name \fR Only show processes whose name contains \fI\fR, even if they are not bound to any specific part of the machine. @@ -83,6 +87,10 @@ environment variables) and display it at the end of the line. .TP +\fB\-\-lstopo\-misc\fR +Output a file that may be given to \fBlstopo \-\-misc\-from\fR for displaying +processes/threads as Misc objects. See EXAMPLES below. +.TP \fB\-\-json\-server\fR Run the tool as a JSON server that waits for other process' requests on a port and sends back binding information. @@ -171,6 +179,27 @@ $ hwloc-ps --pid 4759 4759 Machine:0 myprogram +The output may be a file that lstopo uses for adding Misc objects +(more flexible version of lstopo --top): + + $ hwloc-ps --misc-from foo + $ cat foo + name=12444 myprogram + cpuset=0x000000f0 + subtype=Process + + name=12444 mythread1 + cpuset=0x00000050 + subtype=Thread + + name=12444 mythread2 + cpuset=0x000000a0 + subtype=Thread + +This may be directly given to lstopo: + + $ hwloc-ps --misc-from - | lstopo --misc-from - + On Linux, hwloc-ps may also display some process specific environment variable at the end of the line. This is for instance useful for identify MPI ranks among processes: diff -Nru hwloc-2.9.2/utils/hwloc/hwloc-ps.c hwloc-2.10.0/utils/hwloc/hwloc-ps.c --- hwloc-2.9.2/utils/hwloc/hwloc-ps.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc-ps.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2021 Inria. All rights reserved. + * Copyright © 2009-2023 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -35,11 +35,13 @@ static int single_ancestor = 0; #define NO_ONLY_PID -1 static long only_pid = NO_ONLY_PID; +static long children_of_pid = NO_ONLY_PID; static long only_uid; static int json_server = 0; static int json_port = JSON_PORT; static FILE *json_output = NULL; static int verbose = 0; +static FILE *lstopo_misc_output = NULL; void usage(const char *name, FILE *where) { @@ -47,6 +49,7 @@ fprintf (where, "Options:\n"); fprintf (where, " -a Show all processes, including those that are not bound\n"); fprintf (where, " --pid Only show process of pid number \n"); + fprintf (where, " --children-of-pid Only show process of pid number and its children\n"); fprintf (where, " --name Only show processes whose name contains \n"); #ifdef HWLOC_LINUX_SYS fprintf (where, " --uid Only show processes of the user with the given uid\n"); @@ -64,6 +67,7 @@ fprintf (where, " --pid-cmd Append the output of to each PID line\n"); fprintf (where, " --short-name Show only the process short name instead of the path\n"); fprintf (where, " --disallowed Include objects disallowed by administrative limitations\n"); + fprintf (where, " --lstopo-misc Output Misc object to be given to lstopo --misc-from \n"); fprintf (where, " --json-server Run as a JSON server\n"); fprintf (where, " --json-port Use port for JSON server (default is %d)\n", JSON_PORT); fprintf (where, " -v --verbose Increase verbosity\n"); @@ -133,6 +137,45 @@ print_task(topology, proc->threads[i].tid, proc->threads[i].name, proc->threads[i].cpuset, NULL, 1); } +static void print_process_lstopo_misc(hwloc_topology_t topology __hwloc_attribute_unused, + struct hwloc_ps_process *proc) +{ + /* sort of similar to foreach_process_cb() in lstopo.c */ + char name[100]; + char *s; + unsigned i; + + snprintf(name, sizeof(name), "%ld", proc->pid); + if (*proc->name) + snprintf(name, sizeof(name), "%ld %s", proc->pid, proc->name); + hwloc_bitmap_asprintf(&s, proc->cpuset); + fprintf(lstopo_misc_output, + "name=%s\n" + "cpuset=%s\n" + "subtype=Process\n" + "\n", + name, s); + free(s); + + if (proc->nthreads) + for(i=0; inthreads; i++) + if (proc->threads[i].cpuset) { + char task_name[150]; + if (*proc->threads[i].name) + snprintf(task_name, sizeof(task_name), "%s %li %s", name, proc->threads[i].tid, proc->threads[i].name); + else + snprintf(task_name, sizeof(task_name), "%s %li", name, proc->threads[i].tid); + hwloc_bitmap_asprintf(&s, proc->threads[i].cpuset); + fprintf(lstopo_misc_output, + "name=%s\n" + "cpuset=%s\n" + "subtype=Thread\n" + "\n", + task_name, s); + free(s); + } +} + static void print_process_json(hwloc_topology_t topology, struct hwloc_ps_process *proc) { @@ -197,7 +240,7 @@ const char *pidcmd = cbdata; /* don't print anything if the process isn't bound and if no threads are bound and if not showing all */ - if (!proc->bound && (!proc->nthreads || !proc->nboundthreads) && !show_all && !only_name) + if (!proc->bound && (!proc->nthreads || !proc->nboundthreads) && !show_all && !only_name && children_of_pid == NO_ONLY_PID) return; if (pidcmd) @@ -205,6 +248,8 @@ if (json_output) print_process_json(topology, proc); + else if (lstopo_misc_output) + print_process_lstopo_misc(topology, proc); else print_process(topology, proc); } @@ -212,7 +257,11 @@ static int run(hwloc_topology_t topology, hwloc_const_bitmap_t topocpuset, unsigned long psflags, char *pidcmd) { - if (only_pid == NO_ONLY_PID) { + if (children_of_pid != NO_ONLY_PID) { + /* show children */ + return hwloc_ps_foreach_child(topology, topocpuset, children_of_pid, foreach_process_cb, pidcmd, psflags, only_name, only_uid); + + } else if (only_pid == NO_ONLY_PID) { /* show all */ return hwloc_ps_foreach_process(topology, topocpuset, foreach_process_cb, pidcmd, psflags, only_name, only_uid); @@ -235,6 +284,8 @@ if (json_output) print_process_json(topology, &proc); + else if (lstopo_misc_output) + print_process_lstopo_misc(topology, &proc); else print_process(topology, &proc); } @@ -317,6 +368,7 @@ only_name = NULL; only_pid = NO_ONLY_PID; + children_of_pid = NO_ONLY_PID; current = req; while (*current) { if (!strncmp(current, "lastcpulocation ", 16)) { @@ -338,6 +390,10 @@ psflags |= HWLOC_PS_FLAG_THREADS; show_all = 1; break; + } else if (!strncmp(current, "childrenofpid=", 14)) { + children_of_pid = atoi(current+14); + show_all = 1; + break; } else if (!strncmp(current, "name=", 5)) { only_name = current+5; show_all = 1; @@ -418,6 +474,13 @@ } only_pid = strtol(argv[1], NULL, 10); opt = 1; + } else if (!strcmp(argv[0], "--children-of-pid")) { + if (argc < 2) { + usage(callname, stderr); + exit(EXIT_FAILURE); + } + children_of_pid = strtol(argv[1], NULL, 10); + opt = 1; } else if (!strcmp(argv[0], "--name")) { if (argc < 2) { usage(callname, stderr); @@ -449,6 +512,21 @@ pidcmd = argv[1]; opt = 1; + } else if (!strcmp (argv[0], "--lstopo-misc")) { + if (argc < 2) { + usage(callname, stderr); + exit(EXIT_FAILURE); + } + if (!strcmp(argv[1], "-")) + lstopo_misc_output = stdout; + else + lstopo_misc_output = fopen(argv[1], "w"); + if (!lstopo_misc_output) { + fprintf(stderr, "Failed to open --lstopo-misc output `%s' for writing (%s)\n", argv[1], strerror(errno)); + exit(EXIT_FAILURE); + } + opt = 1; + } else if (!strcmp (argv[0], "--json-server")) { json_server = 1; } else if (!strcmp (argv[0], "--json-port")) { @@ -522,5 +600,7 @@ out_with_topology: hwloc_topology_destroy(topology); out: + if (lstopo_misc_output && lstopo_misc_output != stdout) + fclose(lstopo_misc_output); return err; } diff -Nru hwloc-2.9.2/utils/hwloc/hwloc.7in hwloc-2.10.0/utils/hwloc/hwloc.7in --- hwloc-2.9.2/utils/hwloc/hwloc.7in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/hwloc.7in 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.\" Copyright © 2010-2020 Inria. All rights reserved. +.\" Copyright © 2010-2023 Inria. All rights reserved. .\" Copyright © 2010 Université of Bordeaux .\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. .\" See COPYING in top-level directory. @@ -89,6 +89,16 @@ .br .br +Some filters may be added after the type to further specify which +objects are wanted. +\fI[subtype=]\fR selects objects matching the given +type and also its subtype string attribute. +For instance \fINUMA[HBM]\fR selects NUMA nodes of subtype "HBM". +The prefix \fIsubtype=\fR may be avoided if there is no ambiguity. +\fINUMA[tier=X]\fR selects NUMA nodes of tier ("MemoryTier" info attribute). +.br + +.br Indexes may also be specified as ranges. \fIx-y\fR enumerates from index \fIx\fR to \fIy\fR. \fIx:y\fR enumerates \fIy\fR objects starting from index \fIx\fR @@ -201,8 +211,9 @@ A NUMA node; a set of processors around memory which the processors can directly access. . -If \fBhbm\fR is used instead of \fBnumanode\fR in locations, -command-line tools only consider high-bandwidth memory nodes such as Intel Xeon Phi MCDRAM. +If \fBnuma[hbm]\fR is used instead of \fBnumanode\fR in locations, +command-line tools only consider NUMA nodes marked as high-bandwidth memory +(subtype "HBM"). . .TP .B package diff -Nru hwloc-2.9.2/utils/hwloc/misc.h hwloc-2.10.0/utils/hwloc/misc.h --- hwloc-2.9.2/utils/hwloc/misc.h 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/misc.h 2023-12-05 12:32:19.000000000 +0000 @@ -3,6 +3,7 @@ * Copyright © 2009-2022 Inria. All rights reserved. * Copyright © 2009-2012 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. + * Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. * See COPYING in top-level directory. */ @@ -26,6 +27,7 @@ #ifdef HAVE_DIRENT_H #include #endif +#include #include extern void usage(const char *name, FILE *where); @@ -80,15 +82,19 @@ addspaces, " "); } -enum hwloc_utils_input_format { - HWLOC_UTILS_INPUT_DEFAULT, - HWLOC_UTILS_INPUT_XML, - HWLOC_UTILS_INPUT_FSROOT, - HWLOC_UTILS_INPUT_SYNTHETIC, - HWLOC_UTILS_INPUT_CPUID, - HWLOC_UTILS_INPUT_SHMEM, - HWLOC_UTILS_INPUT_ARCHIVE +struct hwloc_utils_input_format_s { + enum hwloc_utils_input_format { + HWLOC_UTILS_INPUT_DEFAULT, + HWLOC_UTILS_INPUT_XML, + HWLOC_UTILS_INPUT_FSROOT, + HWLOC_UTILS_INPUT_SYNTHETIC, + HWLOC_UTILS_INPUT_CPUID, + HWLOC_UTILS_INPUT_SHMEM, + HWLOC_UTILS_INPUT_ARCHIVE + } format; + int oldworkdir; }; +#define HWLOC_UTILS_INPUT_FORMAT_DEFAULT (struct hwloc_utils_input_format_s) { HWLOC_UTILS_INPUT_DEFAULT, -1 } static __hwloc_inline enum hwloc_utils_input_format hwloc_utils_parse_input_format(const char *name, const char *callname) @@ -115,7 +121,7 @@ static __hwloc_inline int hwloc_utils_lookup_input_option(char *argv[], int argc, int *consumed_opts, - char **inputp, enum hwloc_utils_input_format *input_formatp, + char **inputp, struct hwloc_utils_input_format_s *input_formatp, const char *callname) { if (!strcmp (argv[0], "--input") @@ -137,7 +143,8 @@ usage (callname, stderr); exit(EXIT_FAILURE); } - *input_formatp = hwloc_utils_parse_input_format (argv[1], callname); + *input_formatp = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; + input_formatp->format = hwloc_utils_parse_input_format (argv[1], callname); *consumed_opts = 1; return 1; } @@ -149,7 +156,8 @@ exit(EXIT_FAILURE); } *inputp = argv[1]; - *input_formatp = HWLOC_UTILS_INPUT_SYNTHETIC; + *input_formatp = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; + input_formatp->format = HWLOC_UTILS_INPUT_SYNTHETIC; *consumed_opts = 1; return 1; } else if (!strcmp (argv[0], "--xml")) { @@ -158,7 +166,8 @@ exit(EXIT_FAILURE); } *inputp = argv[1]; - *input_formatp = HWLOC_UTILS_INPUT_XML; + *input_formatp = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; + input_formatp->format = HWLOC_UTILS_INPUT_XML; *consumed_opts = 1; return 1; } else if (!strcmp (argv[0], "--fsys-root")) { @@ -167,7 +176,8 @@ exit(EXIT_FAILURE); } *inputp = argv[1]; - *input_formatp = HWLOC_UTILS_INPUT_FSROOT; + *input_formatp = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; + input_formatp->format = HWLOC_UTILS_INPUT_FSROOT; *consumed_opts = 1; return 1; } @@ -232,9 +242,10 @@ static __hwloc_inline int hwloc_utils_enable_input_format(struct hwloc_topology *topology, unsigned long flags, const char *input, - enum hwloc_utils_input_format *input_format, + struct hwloc_utils_input_format_s *input_formatp, int verbose, const char *callname) { + enum hwloc_utils_input_format *input_format = &input_formatp->format; if (*input_format == HWLOC_UTILS_INPUT_DEFAULT && !strcmp(input, "-.xml")) { *input_format = HWLOC_UTILS_INPUT_XML; input = "-"; @@ -307,32 +318,52 @@ } case HWLOC_UTILS_INPUT_ARCHIVE: { -#ifdef HWLOC_ARCHIVEMOUNT_PATH +#ifdef HWLOC_LINUX_SYS char mntpath[] = "/tmp/tmpdir.hwloc.archivemount.XXXXXX"; char mntcmd[512]; char umntcmd[512]; DIR *dir; struct dirent *dirent; - enum hwloc_utils_input_format sub_input_format; + /* oldworkdir == -1 -> close would fail if !defined(O_PATH), but we don't care */ + struct hwloc_utils_input_format_s sub_input_format = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; char *subdir = NULL; int err; +#ifdef O_PATH + if (-1 == input_formatp->oldworkdir) { /* if archivemount'ed recursively, only keep the first oldworkdir */ + sub_input_format.oldworkdir = open(".", O_DIRECTORY|O_PATH); /* more efficient than getcwd(3) */ + if (sub_input_format.oldworkdir < 0) { + perror("Saving current working directory"); + return EXIT_FAILURE; + } + } +#endif if (!mkdtemp(mntpath)) { perror("Creating archivemount directory"); + close(sub_input_format.oldworkdir); return EXIT_FAILURE; } - snprintf(mntcmd, sizeof(mntcmd), "%s -o ro %s %s", HWLOC_ARCHIVEMOUNT_PATH, input, mntpath); + snprintf(mntcmd, sizeof(mntcmd), "archivemount -o ro %s %s", input, mntpath); err = system(mntcmd); if (err) { perror("Archivemount'ing the archive"); rmdir(mntpath); + close(sub_input_format.oldworkdir); return EXIT_FAILURE; } snprintf(umntcmd, sizeof(umntcmd), "umount -l %s", mntpath); /* enter the mount point and stay there so that we can umount+rmdir immediately but still use it later */ - chdir(mntpath); - system(umntcmd); + if (chdir(mntpath) < 0) { + perror("Entering the archivemount'ed archive"); + if (system(umntcmd) < 0) + perror("Unmounting the archivemount'ed archive (ignored)"); + rmdir(mntpath); + close(sub_input_format.oldworkdir); + return EXIT_FAILURE; + } + if (system(umntcmd) < 0) + perror("Unmounting the archivemount'ed archive (ignored)"); rmdir(mntpath); /* there should be a single subdirectory in the archive */ @@ -347,21 +378,23 @@ if (!subdir) { perror("No subdirectory in archivemount directory"); + close(sub_input_format.oldworkdir); return EXIT_FAILURE; } /* call ourself recursively on subdir, it should be either a fsroot or a cpuid directory */ - sub_input_format = HWLOC_UTILS_INPUT_DEFAULT; err = hwloc_utils_enable_input_format(topology, flags, subdir, &sub_input_format, verbose, callname); if (!err) - *input_format = sub_input_format; - else + *input_formatp = sub_input_format; + else { + close(sub_input_format.oldworkdir); return err; - break; + } #else fprintf(stderr, "This installation of hwloc does not support loading from an archive, sorry.\n"); exit(EXIT_FAILURE); #endif + break; } case HWLOC_UTILS_INPUT_SYNTHETIC: @@ -382,6 +415,28 @@ } static __hwloc_inline void +hwloc_utils_disable_input_format(struct hwloc_utils_input_format_s *input_format) +{ + if (-1 < input_format->oldworkdir) { +#ifdef HWLOC_LINUX_SYS +#ifdef O_PATH + int err = fchdir(input_format->oldworkdir); + if (err) { + perror("Restoring current working directory"); + } +#else + fprintf(stderr, "Couldn't restore working directory. Errors may arise.\n"); +#endif + close(input_format->oldworkdir); + input_format->oldworkdir = -1; +#else + fprintf(stderr, "oldworkdir should not have been changed. You should not have reached this execution branch.\n"); + exit(EXIT_FAILURE); +#endif + } +} + +static __hwloc_inline void hwloc_utils_print_distance_matrix(FILE *output, unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *matrix, int logical, int show_types) { unsigned i, j; diff -Nru hwloc-2.9.2/utils/hwloc/test-hwloc-calc.output hwloc-2.10.0/utils/hwloc/test-hwloc-calc.output --- hwloc-2.9.2/utils/hwloc/test-hwloc-calc.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/test-hwloc-calc.output 2023-12-05 12:32:19.000000000 +0000 @@ -76,6 +76,15 @@ # Number of objects at depth 3 in a NUMA Node 16 +# Number of MCDRAM subtype NUMA Nodes +4 + +# List of MCDRAM subtype NUMA Nodes near 2 L3 +3,5 + +# Hierarchical list of MCDRAM subtype NUMA nodes within Package +Package:0.NUMANode:1 Package:0.NUMANode:7 + # List of Machine objects 0 @@ -83,7 +92,7 @@ 1 # List of NUMA Nodes in a range of Cores (again) -2,3 +NUMANode:2,NUMANode:3 # Hierarchical spec for a range of PUs Group0:0.PU:2 Group0:0.PU:3 @@ -130,6 +139,12 @@ # Converting NUMA Nodes from logical to physical 0,2 +# Search cores within single NUMA when they have multiple local NUMA nodes +0x00000060 + +# Search NUMA node within single Group when they have multiple local Groups +0x00000002 + # Physical output of NUMA Nodes when out-of-order in the topology 2,1 @@ -140,10 +155,10 @@ 3,4,5,6 # 2 local nodes larger or equal to a Package (node:2@Package + node:6@Machine), with space separator -2 6 +NUMANode:2 NUMANode:6 # Best-locality local node near a PU (node:1@Die) -1 +NUMANode:1 # Best-capacity local node near a PU (node:6@Machine) 6 diff -Nru hwloc-2.9.2/utils/hwloc/test-hwloc-calc.sh.in hwloc-2.10.0/utils/hwloc/test-hwloc-calc.sh.in --- hwloc-2.9.2/utils/hwloc/test-hwloc-calc.sh.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/test-hwloc-calc.sh.in 2023-12-05 12:32:19.000000000 +0000 @@ -120,6 +120,15 @@ echo "# Number of objects at depth 3 in a NUMA Node" $calc --if synthetic --input "node:4 core:4 pu:4" node:2 -N 3 echo + echo "# Number of MCDRAM subtype NUMA Nodes" + $calc --if xml --input $xmldir/64intel64-fakeKNL-SNC4-hybrid.xml -N 'numa[mcdram]' all + echo + echo "# List of MCDRAM subtype NUMA Nodes near 2 L3" + $calc --if xml --input $xmldir/64intel64-fakeKNL-SNC4-hybrid.xml -I 'numa[mcdram]' l3:1-2 + echo + echo "# Hierarchical list of MCDRAM subtype NUMA nodes within Package" + $calc --if xml --input $xmldir/64intel64-fakeKNL-SNC4-hybrid.xml -H 'pack.numa[mcdram]' 'numa[mcdram]:0' 'numa[mcdram]:3' + echo echo "# List of Machine objects" $calc --if synthetic --input "node:4 core:4 pu:4" root --intersect Machine @@ -128,7 +137,7 @@ $calc --if synthetic --input "node:4 core:4 pu:4" core:4-7 -I NUMANode echo echo "# List of NUMA Nodes in a range of Cores (again)" - $calc --if synthetic --input "node:4 core:4 pu:4" core:10-15 -I NUMANode + $calc --if synthetic --input "node:4 core:4 pu:4" core:10-15 -I NUMANode --oo echo echo "# Hierarchical spec for a range of PUs" @@ -181,6 +190,13 @@ $calc --if synthetic --input "node:4 core:4 pu:4" --ni 0x5 --nodelist --po echo + echo "# Search cores within single NUMA when they have multiple local NUMA nodes" + $calc --if synthetic --input "pack:2 [numa] [numa] core:4 pu:1" sock:1.numa:1.core:1-2 + echo + echo "# Search NUMA node within single Group when they have multiple local Groups" + $calc --if synthetic --input "pack:2 [numa] group:2 core:4 1" --nodeset-output pack:1.group:1.numa:0 + echo + echo "# Physical output of NUMA Nodes when out-of-order in the topology" $calc --if synthetic --input "node:4(indexes=3,2,1,0) pu:2" node:1-2 --po -I node echo @@ -192,10 +208,10 @@ $calc --if synthetic --input "[numa] pack:2 [numa] die:2 [numa] pu:2" --local-memory package:1 echo echo "# 2 local nodes larger or equal to a Package (node:2@Package + node:6@Machine), with space separator" - $calc --if synthetic --input "[numa] pack:2 [numa] die:2 [numa] pu:2" --local-memory-flags 1 --sep " " pack:0 + $calc --if synthetic --input "[numa] pack:2 [numa] die:2 [numa] pu:2" --local-memory-flags 1 --sep " " pack:0 --oo echo echo "# Best-locality local node near a PU (node:1@Die)" - $calc --if synthetic --input "[numa] pack:2 [numa] die:2 [numa] pu:2" --best-memattr locality pu:3 + $calc --if synthetic --input "[numa] pack:2 [numa] die:2 [numa] pu:2" --best-memattr locality pu:3 --oo echo echo "# Best-capacity local node near a PU (node:6@Machine)" $calc --if synthetic --input "[numa(memory=1000000)] pack:2 [numa(memory=100000)] die:2 [numa(memory=1000)] pu:2" --best-memattr capacity pu:4 diff -Nru hwloc-2.9.2/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in hwloc-2.10.0/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in --- hwloc-2.9.2/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/test-hwloc-dump-hwdata/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -104,8 +104,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -347,7 +346,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -474,17 +472,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -553,7 +540,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -576,7 +562,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) AM_CPPFLAGS = $(HWLOC_CPPFLAGS) AM_LDFLAGS = $(HWLOC_LDFLAGS) diff -Nru hwloc-2.9.2/utils/hwloc/test-hwloc-info.output hwloc-2.10.0/utils/hwloc/test-hwloc-info.output --- hwloc-2.9.2/utils/hwloc/test-hwloc-info.output 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/test-hwloc-info.output 2023-12-05 12:32:19.000000000 +0000 @@ -359,6 +359,50 @@ L1dCache:4 L1dCache:5 +# Ancestor caches above L1d +0.0: L2Cache:2 +0.1: L3Cache:0 +0.2: L4Cache:0 +1.0: L2Cache:4 +1.1: L3Cache:1 +1.2: L4Cache:0 + +# Descendant CPU objects below L4 +0.0: Core:0 +0.1: PU:0 +0.2: PU:1 +0.3: Core:1 +0.4: PU:2 +0.5: PU:3 +0.6: Core:2 +0.7: PU:4 +0.8: PU:5 +0.9: Core:3 +0.10: PU:6 +0.11: PU:7 +1.0: Core:12 +1.1: PU:24 +1.2: PU:25 +1.3: Core:13 +1.4: PU:26 +1.5: PU:27 +1.6: Core:14 +1.7: PU:28 +1.8: PU:29 +1.9: Core:15 +1.10: PU:30 +1.11: PU:31 + +# Descendant Memory objects below L3 +0.0: NUMANode:2 +0.1: NUMANode:3 +1.0: NUMANode:17 +1.1: NUMANode:18 + +# Where a NUMA is attached +L3Cache:1 +Package:2 + # Children of L2 and Core of Node, silent L1dCache:2 L1dCache:3 @@ -462,6 +506,23 @@ NUMANode:11 +# MCDRAM subtype NUMA filter +NUMANode:3 +NUMANode:5 + +# Memory Tier 1 filter +NUMANode:6 + +# NVML subtype OSdev type filter +GPU:2 +GPU:5 +GPU:8 +GPU:11 + + # GPU OSdev type filter +GPU:11 + + # cpukinds for the entire machine Machine L#0 type = Machine diff -Nru hwloc-2.9.2/utils/hwloc/test-hwloc-info.sh.in hwloc-2.10.0/utils/hwloc/test-hwloc-info.sh.in --- hwloc-2.9.2/utils/hwloc/test-hwloc-info.sh.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/hwloc/test-hwloc-info.sh.in 2023-12-05 12:32:19.000000000 +0000 @@ -3,7 +3,7 @@ # # Copyright © 2009 CNRS -# Copyright © 2009-2020 Inria. All rights reserved. +# Copyright © 2009-2023 Inria. All rights reserved. # Copyright © 2009 Université Bordeaux # Copyright © 2014 Cisco Systems, Inc. All rights reserved. # See COPYING in top-level directory. @@ -15,6 +15,7 @@ builddir="$HWLOC_top_builddir/utils/hwloc" info="$builddir/hwloc-info" linuxdir="$HWLOC_top_srcdir/tests/hwloc/linux" +xmldir="$HWLOC_top_srcdir/tests/hwloc/xml" HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc/.libs export HWLOC_PLUGINS_PATH @@ -68,6 +69,18 @@ echo "# L1 ancestor of PU range" $info --if synthetic --input "node:2 core:2 l2:2 l1d:2 pu:2" --ancestor l1 -s pu:7-10 echo + echo "# Ancestor caches above L1d" + $info --if synthetic --input "node:2 l4:2 l3:2 core:2 l2:2 l1d:2 pu:2" --ancestor kind=cache -n -s l1d:4 l1d:8 + echo + echo "# Descendant CPU objects below L4" + $info --if synthetic --input "node:2 l4:2 l3:2 core:2 l2:1 pu:2" --descendants kind=cpu -n -s l4:0 l4:3 + echo + echo "# Descendant Memory objects below L3" + $info --if synthetic --input "pack:4 [numa] l3:2 [numa] [numa] core:4 pu:2" --descendants kind=memory -n -s l3:1 l3:7 + echo + echo "# Where a NUMA is attached" + $info --if synthetic --input "pack:4 [numa] l3:2 [numa] [numa] core:4 pu:2" --ancestor kind=normal --first -s numa:3 numa:14 + echo echo "# Children of L2 and Core of Node, silent" $info --if synthetic --input "node:2 core:2 l2:2 l1d:2 pu:2" --children -s l2:1 node:1.core:1 @@ -108,6 +121,20 @@ echo echo + echo "# MCDRAM subtype NUMA filter" + $info --if xml --input $xmldir/64intel64-fakeKNL-SNC4-hybrid.xml -s 'numa[mcdram]:1-2' + echo + echo "# Memory Tier 1 filter" + $info --if xml --input $xmldir/64intel64-fakeKNL-SNC4-hybrid.xml -s 'numa[tier=1]:3' + echo + echo "# NVML subtype OSdev type filter" + $info --if xml --input $xmldir/power8gpudistances.xml -s 'os[nvml]:all' + echo + echo "# GPU OSdev type filter" + $info --if xml --input $xmldir/power8gpudistances.xml -s 'gpu:3-5' + echo + + echo echo "# cpukinds for the entire machine" $info --if xml --input $linuxdir/fakeheterocpunuma.output all echo diff -Nru hwloc-2.9.2/utils/lstopo/Makefile.am hwloc-2.10.0/utils/lstopo/Makefile.am --- hwloc-2.9.2/utils/lstopo/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/lstopo/Makefile.am 2023-12-05 12:32:19.000000000 +0000 @@ -2,6 +2,7 @@ # Copyright © 2009-2012, 2014 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright © 2020 Hewlett Packard Enterprise. All rights reserved. +# Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. # # See COPYING in top-level directory. @@ -89,30 +90,34 @@ @ $(SEDMAN) \ > $@ < $< +hwloc_ls_name=`echo "hwloc-ls" | $(SED) -e "$(transform)"` +lstopo_name=`echo "lstopo" | $(SED) -e "$(transform)"` +lstopo_no_graphics_name=`echo "lstopo-no-graphics" | $(SED) -e "$(transform)"` + install-exec-hook: - rm -f $(DESTDIR)$(bindir)/hwloc-ls$(EXEEXT) - cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) hwloc-ls$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/$(hwloc_ls_name)$(EXEEXT) + cd $(DESTDIR)$(bindir) && $(LN_S) $(lstopo_no_graphics_name)$(EXEEXT) $(hwloc_ls_name)$(EXEEXT) if !HWLOC_HAVE_WINDOWS if !HWLOC_HAVE_CAIRO - rm -f $(DESTDIR)$(bindir)/lstopo - cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) lstopo$(EXEEXT) || true + rm -f $(DESTDIR)$(bindir)/$(lstopo_name)$(EXEEXT) + cd $(DESTDIR)$(bindir) && $(LN_S) $(lstopo_no_graphics_name)$(EXEEXT) $(lstopo_name)$(EXEEXT) || true endif endif install-data-hook: - rm -f $(DESTDIR)$(man1dir)/hwloc-ls.1 - cd $(DESTDIR)$(man1dir) && $(LN_S) lstopo-no-graphics.1 hwloc-ls.1 - rm -f $(DESTDIR)$(man1dir)/lstopo.1 - cd $(DESTDIR)$(man1dir) && $(LN_S) lstopo-no-graphics.1 lstopo.1 + rm -f $(DESTDIR)$(man1dir)/$(hwloc_ls_name).1 + cd $(DESTDIR)$(man1dir) && $(LN_S) $(lstopo_no_graphics_name).1 $(hwloc_ls_name).1 + rm -f $(DESTDIR)$(man1dir)/$(lstopo_name).1 + cd $(DESTDIR)$(man1dir) && $(LN_S) $(lstopo_no_graphics_name).1 $(lstopo_name).1 uninstall-local: - rm -f $(DESTDIR)$(bindir)/hwloc-ls$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/$(hwloc_ls_name)$(EXEEXT) if !HWLOC_HAVE_WINDOWS if !HWLOC_HAVE_CAIRO - rm -f $(DESTDIR)$(bindir)/lstopo$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/$(lstopo_name)$(EXEEXT) endif endif - rm -f $(DESTDIR)$(man1dir)/hwloc-ls.1 $(DESTDIR)$(man1dir)/lstopo.1 + rm -f $(DESTDIR)$(man1dir)/$(hwloc_ls_name).1 $(DESTDIR)$(man1dir)/$(lstopo_name).1 distclean-local: rm -f $(nodist_man_MANS) diff -Nru hwloc-2.9.2/utils/lstopo/Makefile.in hwloc-2.10.0/utils/lstopo/Makefile.in --- hwloc-2.9.2/utils/lstopo/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/lstopo/Makefile.in 2023-12-05 12:32:19.000000000 +0000 @@ -18,6 +18,7 @@ # Copyright © 2009-2012, 2014 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright © 2020 Hewlett Packard Enterprise. All rights reserved. +# Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. # # See COPYING in top-level directory. @@ -124,8 +125,7 @@ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_APPLICATIONS_DATA_DIST) \ @@ -526,7 +526,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -653,17 +652,6 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -732,7 +720,6 @@ libexecdir = @libexecdir@ libhwloc_so_name = @libhwloc_so_name@ libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -755,7 +742,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xz = @xz@ AM_CFLAGS = $(HWLOC_CFLAGS) # Add -I of utils/hwloc for misc.h AM_CPPFLAGS = $(HWLOC_CPPFLAGS) -I$(top_srcdir)/utils/hwloc @@ -791,6 +777,9 @@ -e 's/%PACKAGE_VERSION%/@PACKAGE_VERSION@/g' \ -e 's/%HWLOC_DATE%/@HWLOC_RELEASE_DATE@/g' +hwloc_ls_name = `echo "hwloc-ls" | $(SED) -e "$(transform)"` +lstopo_name = `echo "lstopo" | $(SED) -e "$(transform)"` +lstopo_no_graphics_name = `echo "lstopo-no-graphics" | $(SED) -e "$(transform)"` all: all-am .SUFFIXES: @@ -1923,21 +1912,21 @@ > $@ < $< install-exec-hook: - rm -f $(DESTDIR)$(bindir)/hwloc-ls$(EXEEXT) - cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) hwloc-ls$(EXEEXT) -@HWLOC_HAVE_CAIRO_FALSE@@HWLOC_HAVE_WINDOWS_FALSE@ rm -f $(DESTDIR)$(bindir)/lstopo -@HWLOC_HAVE_CAIRO_FALSE@@HWLOC_HAVE_WINDOWS_FALSE@ cd $(DESTDIR)$(bindir) && $(LN_S) lstopo-no-graphics$(EXEEXT) lstopo$(EXEEXT) || true + rm -f $(DESTDIR)$(bindir)/$(hwloc_ls_name)$(EXEEXT) + cd $(DESTDIR)$(bindir) && $(LN_S) $(lstopo_no_graphics_name)$(EXEEXT) $(hwloc_ls_name)$(EXEEXT) +@HWLOC_HAVE_CAIRO_FALSE@@HWLOC_HAVE_WINDOWS_FALSE@ rm -f $(DESTDIR)$(bindir)/$(lstopo_name)$(EXEEXT) +@HWLOC_HAVE_CAIRO_FALSE@@HWLOC_HAVE_WINDOWS_FALSE@ cd $(DESTDIR)$(bindir) && $(LN_S) $(lstopo_no_graphics_name)$(EXEEXT) $(lstopo_name)$(EXEEXT) || true install-data-hook: - rm -f $(DESTDIR)$(man1dir)/hwloc-ls.1 - cd $(DESTDIR)$(man1dir) && $(LN_S) lstopo-no-graphics.1 hwloc-ls.1 - rm -f $(DESTDIR)$(man1dir)/lstopo.1 - cd $(DESTDIR)$(man1dir) && $(LN_S) lstopo-no-graphics.1 lstopo.1 + rm -f $(DESTDIR)$(man1dir)/$(hwloc_ls_name).1 + cd $(DESTDIR)$(man1dir) && $(LN_S) $(lstopo_no_graphics_name).1 $(hwloc_ls_name).1 + rm -f $(DESTDIR)$(man1dir)/$(lstopo_name).1 + cd $(DESTDIR)$(man1dir) && $(LN_S) $(lstopo_no_graphics_name).1 $(lstopo_name).1 uninstall-local: - rm -f $(DESTDIR)$(bindir)/hwloc-ls$(EXEEXT) -@HWLOC_HAVE_CAIRO_FALSE@@HWLOC_HAVE_WINDOWS_FALSE@ rm -f $(DESTDIR)$(bindir)/lstopo$(EXEEXT) - rm -f $(DESTDIR)$(man1dir)/hwloc-ls.1 $(DESTDIR)$(man1dir)/lstopo.1 + rm -f $(DESTDIR)$(bindir)/$(hwloc_ls_name)$(EXEEXT) +@HWLOC_HAVE_CAIRO_FALSE@@HWLOC_HAVE_WINDOWS_FALSE@ rm -f $(DESTDIR)$(bindir)/$(lstopo_name)$(EXEEXT) + rm -f $(DESTDIR)$(man1dir)/$(hwloc_ls_name).1 $(DESTDIR)$(man1dir)/$(lstopo_name).1 distclean-local: rm -f $(nodist_man_MANS) diff -Nru hwloc-2.9.2/utils/lstopo/lstopo-android.c hwloc-2.10.0/utils/lstopo/lstopo-android.c --- hwloc-2.9.2/utils/lstopo/lstopo-android.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/lstopo/lstopo-android.c 2023-12-05 12:32:19.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2019-2021 Inria. All rights reserved. + * Copyright © 2019-2023 Inria. All rights reserved. * See COPYING in top-level directory. */ @@ -14,31 +14,36 @@ #include "lstopo.h" extern void JNIbox(int r, int g, int b, int x, int y, int width, int height, unsigned style, int gp_index, char *info); -extern void JNItext(char *text, int gp_index, int x, int y, int fontsize, int bold); +extern void JNItext(char *text, int gp_index, int x, int y, int fontsize, int bold, int outside); extern void JNIline(unsigned x1, unsigned y1, unsigned x2, unsigned y2); extern void JNIprepare(int width, int height, int fontsize); #define ANDROID_TEXT_WIDTH(length, fontsize) (((length) * (fontsize))/2) #define ANDROID_FONTSIZE_SCALE(size) (((size) * 11) / 9) -static void native_android_box(struct lstopo_output *loutput, const struct lstopo_color *lcolor, unsigned depth __hwloc_attribute_unused, unsigned x, unsigned width, unsigned y, unsigned height, hwloc_obj_t obj, unsigned box_id __hwloc_attribute_unused) +#define GP_INDEX_MULTIPLIER 100 /* there can be multiple boxes per object, so multiple gp_index by 100 and add the box_id to get a unique box ID */ + +static void native_android_box(struct lstopo_output *loutput, const struct lstopo_color *lcolor, unsigned depth __hwloc_attribute_unused, unsigned x, unsigned width, unsigned y, unsigned height, hwloc_obj_t obj, unsigned box_id) { unsigned cpukind_style = lstopo_obj_cpukind_style(loutput, obj); - int gp_index = -1; + int viewid = -1; int r = lcolor->r, g = lcolor->g, b = lcolor->b; char * info = malloc(1096); const char * sep = " "; unsigned style = 0; if(obj){ - gp_index = obj->gp_index; + /* we could remove this info for factorized objects and bridges, + * but it pretty much doesn't appear at all anyway because it's in the very small bow. + */ + viewid = obj->gp_index * GP_INDEX_MULTIPLIER + box_id; hwloc_obj_attr_snprintf(info, 1096, obj, sep, 1); } if (cpukind_style) style = cpukind_style; - JNIbox(r, g, b, x, y, width, height, style, gp_index, info); + JNIbox(r, g, b, x, y, width, height, style, viewid, info); //Creating a usable java string from char * may trigger an UTF-8 error //This code creates a byte array from the char * variable before creating the java string } @@ -62,16 +67,26 @@ native_android_text(struct lstopo_output *loutput, const struct lstopo_color *lcolor __hwloc_attribute_unused, int size __hwloc_attribute_unused, unsigned depth __hwloc_attribute_unused, unsigned x, unsigned y, const char *text, hwloc_obj_t obj, unsigned text_id __hwloc_attribute_unused) { unsigned cpukind_style = lstopo_obj_cpukind_style(loutput, obj); - int gp_index = -1; + int viewid = -1; int bold = 0; + int outside = 0; - if(obj) - gp_index = obj->gp_index; + if(obj) { + struct lstopo_obj_userdata *lud = obj->userdata; + viewid = obj->gp_index * GP_INDEX_MULTIPLIER; + /* no info box in small boxes */ + if (loutput->factorize_enabled + && lud->factorized == 1 + && obj->parent->arity > loutput->factorize_min[obj->type]) + outside = 1; + else if (obj->type == HWLOC_OBJ_BRIDGE) + outside = 1; + } if (cpukind_style % 2) bold = 1; - JNItext((char *)text, gp_index, x, y, loutput->fontsize, bold); + JNItext((char *)text, viewid, x, y, loutput->fontsize, bold, outside); } static struct draw_methods native_android_draw_methods = { diff -Nru hwloc-2.9.2/utils/lstopo/lstopo-draw.c hwloc-2.10.0/utils/lstopo/lstopo-draw.c --- hwloc-2.9.2/utils/lstopo/lstopo-draw.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/lstopo/lstopo-draw.c 2023-12-05 12:32:19.000000000 +0000 @@ -370,9 +370,6 @@ * Placing children in rectangle */ -/* preferred width/height compromise */ -#define RATIO (4.f/3.f) - /* returns a score <= 1. close to 1 is better */ static __hwloc_inline float rectangle_score(unsigned width, unsigned height, float ratio) @@ -552,10 +549,13 @@ float ratio; int i; - if (parent->type == HWLOC_OBJ_CORE) - ratio = 1/RATIO; + /* preferred width/height compromise */ + if (kind == LSTOPO_CHILD_KIND_MEMORY) + ratio = 8.f; /* very large for memory above objects since the parent is usually very large */ + else if (parent->type == HWLOC_OBJ_CORE) + ratio = 3.f/4.f; /* rather high Core objects since they often contain 2 PUs that we don't want horizontal */ else - ratio = RATIO; + ratio = 4.f/3.f; /* rather largeother objects */ find_children_rectangle(loutput, parent, kind, separator, &rows, &columns, ratio); rowwidth = 0; @@ -625,7 +625,7 @@ unsigned xrel, unsigned yrel /* position of children within parent */) { struct lstopo_obj_userdata *plud = parent->userdata; - enum lstopo_orient_e main_orient, right_orient, below_orient; + enum lstopo_orient_e main_orient, right_orient, below_orient, above_orient; unsigned border = loutput->gridsize; unsigned separator = loutput->gridsize; unsigned separator_below_cache = loutput->gridsize; @@ -673,6 +673,10 @@ below_orient = loutput->below_force_orient; if (below_orient == LSTOPO_ORIENT_NONE) below_orient = loutput->force_orient[parent->type]; + /* place above children in rectangle by default */ + above_orient = loutput->above_force_orient; + if (above_orient == LSTOPO_ORIENT_NONE) + above_orient = LSTOPO_ORIENT_RECT; /* defaults */ plud->children.box = 0; @@ -789,7 +793,6 @@ /* compute the size of the above children section (Memory), if any */ if (plud->above_children.kinds) { - enum lstopo_orient_e morient = LSTOPO_ORIENT_HORIZ; int need_box; assert(plud->above_children.kinds == LSTOPO_CHILD_KIND_MEMORY); @@ -800,7 +803,7 @@ need_box = !hwloc_obj_type_is_memory(parent->type) && (parent->memory_arity + parent->memory_first_child->memory_arity > 1); - place__children(loutput, parent, plud->above_children.kinds, &morient, need_box ? border : 0, separator, &above_children_width, &above_children_height); + place__children(loutput, parent, plud->above_children.kinds, &above_orient, need_box ? border : 0, separator, &above_children_width, &above_children_height); if (parent->type == HWLOC_OBJ_MEMCACHE) above_children_height -= separator; @@ -1134,7 +1137,8 @@ } case HWLOC_OBJ_MISC: - if (loutput->show_process_color && obj->subtype && !strcmp(obj->subtype, "Process")) + if (loutput->show_process_color && obj->subtype && + (!strcmp(obj->subtype, "Process") || !strcmp(obj->subtype, "Thread"))) s->bg = &loutput->palette->process; else s->bg = &loutput->palette->misc; @@ -1733,7 +1737,11 @@ unsigned maxtextwidth = 0, textwidth; unsigned ndl = 0; char hostname[122] = ""; - unsigned long hostname_size = sizeof(hostname); +#if defined(HWLOC_WIN_SYS) && !defined(__CYGWIN__) + DWORD hostname_size = sizeof(hostname); +#else + size_t hostname_size = sizeof(hostname); +#endif unsigned infocount = 0; /* prepare legend lines and compute the width */ diff -Nru hwloc-2.9.2/utils/lstopo/lstopo-no-graphics.1in hwloc-2.10.0/utils/lstopo/lstopo-no-graphics.1in --- hwloc-2.9.2/utils/lstopo/lstopo-no-graphics.1in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/lstopo/lstopo-no-graphics.1in 2023-12-05 12:32:19.000000000 +0000 @@ -86,7 +86,7 @@ The hwloc-info tool may be used to display even more information about specific objects. .TP -\fB\-s\fR \fB\-\-silent\fR +\fB\-q\fR \fB\-\-quiet\fR \fB\-s\fR \fB\-\-silent\fR Reduce the amount of details to show. .TP \fB\-\-distances\fR @@ -149,6 +149,11 @@ .TP \fB\-\-only\fR Only show objects of the given type in the textual output. + +\fI\fR may contain a filter to select specific objects among +the type. For instance \fB\-\-only NUMA[HBM]\fR only shows NUMA nodes +marked with subtype "HBM", while \fB\-\-only "numa[mcdram]"\fR only +shows MCDRAM NUMA nodes on KNL. .TP \fB\-\-filter\fR :, \fB\-\-filter\fR Filter objects of type , or of any type if is "all". @@ -247,15 +252,27 @@ .TP \fB\-\-restrict\fR Restrict the topology to the given cpuset. +This removes some PUs and their now-child-less parents. + +Beware that restricting the PUs in a topology may change the +logical indexes of many objects, including NUMA nodes. .TP \fB\-\-restrict\fR nodeset= -Restrict the topology to the given nodeset, unless --restrict-flags specifies something different. +Restrict the topology to the given nodeset. +(unless \fB\-\-restrict\-flags\fR specifies something different). +This removes some NUMA nodes and their now-child-less parents. + +Beware that restricting the NUMA nodes in a topology may change the +logical indexes of many objects, including PUs. .TP \fB\-\-restrict\fR binding Restrict the topology to the current process binding. This option requires the use of the actual current machine topology (or any other topology with \fB\-\-thissystem\fR or with HWLOC_THISSYSTEM set to 1 in the environment). + +Beware that restricting the topology may change the +logical indexes of many objects, including PUs and NUMA nodes. .TP \fB\-\-restrict\-flags\fR Enforce flags when restricting the topology. @@ -304,6 +321,21 @@ machine are shown. On Linux, kernel threads are not shown. If many processes appear, the output may become hard to read anyway, making the hwloc-ps program more practical. + +See \fB\-\-misc\-from\fR for a customizable variant using \fBhwloc-ps\fR. +.TP +\fB\-\-misc\-from\fR +Add Misc objects as described in containing entries such as: + + name=myMisc1 + cpuset=0x5 + + name=myMisc2 + cpuset=0x7 + subtype=myOptionalSubtype + +This is useful for combining with \fBhwloc-ps --lstopo-misc\fR (see EXAMPLES below) +because hwloc-ps is far more customizable than lstopo's \fB\-\-top\fR option. .TP \fB\-\-children\-order\fR Change the order of the different kinds of children with respect to @@ -338,7 +370,7 @@ Up to hwloc 2.5, the default was rather to \fImemory:above,plain\fR. -Additionally, \fIio:right\fR, \fIio:below\fR, \fImisc:right\fR +Additionally, \fImemory:above\fR, \fIio:right\fR, \fIio:below\fR, \fImisc:right\fR and \fImisc:below\fR may be suffixed with \fI:horiz\fR, \fI:vert\fR or \fI:rect\fR to force the horizontal, vertical or rectangular layout of children inside these sections. @@ -467,6 +499,7 @@ \fB\-\-top\-color\fR Do not colorize task objects in the graphical output when \-\-top is given. Or change the color to the given 3x8bit hexadecimal RGB combination (e.g. \fI#0000ff\fR is blue). +This is actually applied to Misc objects of subtype \fIProcess\fR or \fIThread\fR. .TP \fB\-\-version\fR Report version and exit. @@ -852,6 +885,11 @@ To append the kernel release and version to the graphical legend: lstopo --append-legend "Kernel release: $(uname -r)" --append-legend "Kernel version: $(uname -v)" + +To show where a process and its children are bound by combining with hwloc-ps: + + hwloc-ps --pid-children 23 --lstopo-misc - | lstopo --misc-from - + . .\" ************************** .\" Notes Section diff -Nru hwloc-2.9.2/utils/lstopo/lstopo-text.c hwloc-2.10.0/utils/lstopo/lstopo-text.c --- hwloc-2.9.2/utils/lstopo/lstopo-text.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/lstopo/lstopo-text.c 2023-12-05 12:32:19.000000000 +0000 @@ -190,25 +190,28 @@ { FILE *output = loutput->file; hwloc_obj_t child; - if (loutput->show_only == l->type) { - output_console_obj (loutput, l, 0); - fprintf (output, "\n"); + if (loutput->show_only.type == l->type + || loutput->show_only.depth == l->depth) { + if (!hwloc_calc_check_object_filtered(l, &loutput->show_only)) { + output_console_obj (loutput, l, 0); + fprintf (output, "\n"); + } } /* there can be anything below normal children */ for_each_child(child, l) output_only (loutput, child); /* there can be only memory or Misc below memory children */ - if (hwloc_obj_type_is_memory(loutput->show_only) || loutput->show_only == HWLOC_OBJ_MISC) { + if (loutput->show_only.type == HWLOC_OBJ_TYPE_NONE || hwloc_obj_type_is_memory(loutput->show_only.type) || loutput->show_only.type == HWLOC_OBJ_MISC) { for(child = l->memory_first_child; child; child = child->next_sibling) output_only (loutput, child); } /* there can be only I/O or Misc below I/O children */ - if (hwloc_obj_type_is_io(loutput->show_only) || loutput->show_only == HWLOC_OBJ_MISC) { + if (loutput->show_only.type == HWLOC_OBJ_TYPE_NONE || hwloc_obj_type_is_io(loutput->show_only.type) || loutput->show_only.type == HWLOC_OBJ_MISC) { for_each_io_child(child, l) output_only (loutput, child); } /* there can be only Misc below Misc children */ - if (loutput->show_only == HWLOC_OBJ_MISC) { + if (loutput->show_only.type == HWLOC_OBJ_TYPE_NONE || loutput->show_only.type == HWLOC_OBJ_MISC) { /* Misc can only contain other Misc, no need to recurse otherwise */ for_each_misc_child(child, l) output_only (loutput, child); @@ -504,27 +507,31 @@ * if verbose_mode > 1, print both. */ - if (loutput->show_only != HWLOC_OBJ_TYPE_NONE) { - if (verbose_mode > 1) - fprintf(output, "Only showing %s objects\n", hwloc_obj_type_string(loutput->show_only)); + if (loutput->show_only.depth != HWLOC_TYPE_DEPTH_UNKNOWN) { + if (verbose_mode > 1) { + if (loutput->show_only.type != HWLOC_OBJ_TYPE_NONE) + fprintf(output, "Only showing some %s objects\n", hwloc_obj_type_string(loutput->show_only.type)); + else + fprintf(output, "Only showing some objects at depth %d\n", loutput->show_only.depth); + } output_only (loutput, hwloc_get_root_obj(topology)); } else if (verbose_mode >= 1) { output_topology (loutput, hwloc_get_root_obj(topology), NULL, 0); fprintf(output, "\n"); } - if ((verbose_mode > 1 || !verbose_mode) && loutput->show_only == HWLOC_OBJ_TYPE_NONE) { + if ((verbose_mode > 1 || !verbose_mode) && loutput->show_only.depth == HWLOC_TYPE_DEPTH_UNKNOWN) { hwloc_lstopo_show_summary(output, topology); } - if (verbose_mode > 1 && loutput->show_only == HWLOC_OBJ_TYPE_NONE) { + if (verbose_mode > 1 && loutput->show_only.depth == HWLOC_TYPE_DEPTH_UNKNOWN) { output_distances(loutput); output_memattrs(loutput); output_cpukinds(loutput); output_windows_processor_groups(loutput, verbose_mode > 2); } - if (verbose_mode > 1 && loutput->show_only == HWLOC_OBJ_TYPE_NONE) { + if (verbose_mode > 1 && loutput->show_only.depth == HWLOC_TYPE_DEPTH_UNKNOWN) { hwloc_const_bitmap_t complete = hwloc_topology_get_complete_cpuset(topology); hwloc_const_bitmap_t topo = hwloc_topology_get_topology_cpuset(topology); hwloc_const_bitmap_t allowed = hwloc_topology_get_allowed_cpuset(topology); diff -Nru hwloc-2.9.2/utils/lstopo/lstopo.c hwloc-2.10.0/utils/lstopo/lstopo.c --- hwloc-2.9.2/utils/lstopo/lstopo.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/lstopo/lstopo.c 2023-12-05 12:32:19.000000000 +0000 @@ -4,6 +4,7 @@ * Copyright © 2009-2012, 2015, 2017 Université Bordeaux * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * Copyright © 2020 Hewlett Packard Enterprise. All rights reserved. + * Copyright © 2023 Université de Reims Champagne-Ardenne. All rights reserved. * See COPYING in top-level directory. */ @@ -64,16 +65,11 @@ FILE *open_output(const char *filename, int overwrite) { - const char *extn; struct stat st; if (!filename || !strcmp(filename, "-")) return stdout; - extn = strrchr(filename, '.'); - if (filename[0] == '-' && extn == filename + 1) - return stdout; - if (!stat(filename, &st) && !overwrite) { errno = EEXIST; return NULL; @@ -82,7 +78,7 @@ return fopen(filename, "w"); } -static hwloc_obj_t insert_task(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const char * name, int thread) +static hwloc_obj_t insert_misc(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const char *subtype, const char * name) { hwloc_obj_t group, obj; @@ -103,16 +99,16 @@ hwloc_bitmap_asprintf(&s, cpuset); group = hwloc_get_obj_covering_cpuset(topology, cpuset); hwloc_bitmap_asprintf(&gs, group->cpuset); - fprintf(stderr, "%s `%s' binding %s doesn't match any object, extended to %s before inserting the %s in the topology.\n", - thread ? "Thread" : "Process", name, s, gs, thread ? "thread" : "process"); + fprintf(stderr, "%s `%s' binding %s doesn't match any object, extended to %s before inserting the object.\n", + subtype, name, s, gs); free(s); free(gs); } obj = hwloc_topology_insert_misc_object(topology, group, name); if (!obj) fprintf(stderr, "Failed to insert process `%s'\n", name); - else - obj->subtype = strdup("Process"); + else if (subtype) + obj->subtype = strdup(subtype); return obj; } @@ -121,6 +117,7 @@ struct hwloc_ps_process *proc, void *cbdata __hwloc_attribute_unused) { + /* sort of similar to print_process_lstopo_misc() in hwloc-ps.c */ char name[100]; unsigned i; @@ -129,7 +126,7 @@ snprintf(name, sizeof(name), "%ld %s", proc->pid, proc->name); if (proc->bound) - insert_task(topology, proc->cpuset, name, 0); + insert_misc(topology, proc->cpuset, "Process", name); if (proc->nthreads) for(i=0; inthreads; i++) @@ -141,7 +138,7 @@ else snprintf(task_name, sizeof(task_name), "%s %li", name, proc->threads[i].tid); - insert_task(topology, proc->threads[i].cpuset, task_name, 1); + insert_misc(topology, proc->threads[i].cpuset, "Thread", task_name); } } @@ -158,6 +155,77 @@ HWLOC_PS_FLAG_THREADS | HWLOC_PS_FLAG_SHORTNAME, NULL, HWLOC_PS_ALL_UIDS); } +static void add_one_misc_object_from(hwloc_topology_t topology, + char *subtype, char *name, hwloc_bitmap_t cpuset) +{ + if (!hwloc_bitmap_iszero(cpuset) && subtype && name) { + insert_misc(topology, cpuset, subtype, name); + } else { + char *s; + hwloc_bitmap_asprintf(&s, cpuset); + fprintf(stderr, "Ignoring misc object subtype %s name %s cpuset %s\n", subtype, name, s); + free(s); + } +} + +/* reads Misc description from the FILE* + * entries must look like: + * name=... (must be first) + * cpuset=... (cannot be 0) + * subtype=... (optional) + */ +static void add_misc_objects_from(hwloc_topology_t topology, FILE *from) +{ + char line[256]; + hwloc_bitmap_t cpuset; + char *subtype = NULL; + char *name = NULL; + cpuset = hwloc_bitmap_alloc(); + if (!cpuset) + return; + + while (fgets(line, sizeof line, from)) { + char *end; + + /* remove ending \n */ + end = strchr(line, '\n'); + if (end) + *end = '\0'; + /* ignoring empty lines */ + if (line[0] == '\0') + continue; + + if (!strncmp(line, "name=", 5)) { + /* commit (or ignore) the previous entry */ + if (name) + add_one_misc_object_from(topology, subtype, name, cpuset); + /* start a new entry */ + free(subtype); + subtype = NULL; + free(name); + name = strdup(line+5); + hwloc_bitmap_zero(cpuset); + + } else if (!strncmp(line, "cpuset=", 7)) { + hwloc_bitmap_sscanf(cpuset, line+7); + + } else if (!strncmp(line, "subtype=", 8)) { + free(subtype); + subtype = strdup(line+8); + + } else { + fprintf(stderr, "Unrecognized --misc-from line `%s', ignored\n", line); + } + } + + /* commit (or ignore) the last entry */ + if (name) + add_one_misc_object_from(topology, subtype, name, cpuset); + free(name); + free(subtype); + hwloc_bitmap_free(cpuset); +} + static __hwloc_inline void lstopo_update_factorize_bounds(unsigned min, unsigned *first, unsigned *last) { switch (min) { @@ -308,11 +376,13 @@ static void lstopo_parse_children_order(char *s, unsigned *children_order_p, + enum lstopo_orient_e *above_force_orient_p, enum lstopo_orient_e *right_force_orient_p, enum lstopo_orient_e *below_force_orient_p) { char *tmp, *next; unsigned children_order; + enum lstopo_orient_e above_force_orient = LSTOPO_ORIENT_NONE; enum lstopo_orient_e right_force_orient = LSTOPO_ORIENT_NONE; enum lstopo_orient_e below_force_orient= LSTOPO_ORIENT_NONE; @@ -332,6 +402,15 @@ if (!strcmp(tmp, "memory:above") || !strcmp(tmp, "memoryabove") /* backward compat with 2.5 */) { children_order |= LSTOPO_ORDER_MEMORY_ABOVE; + } else if (!strcmp(tmp, "memory:above:horiz")) { + children_order |= LSTOPO_ORDER_MEMORY_ABOVE; + above_force_orient = LSTOPO_ORIENT_HORIZ; + } else if (!strcmp(tmp, "memory:above:vert")) { + children_order |= LSTOPO_ORDER_MEMORY_ABOVE; + above_force_orient = LSTOPO_ORIENT_VERT; + } else if (!strcmp(tmp, "memory:above:rect")) { + children_order |= LSTOPO_ORDER_MEMORY_ABOVE; + above_force_orient = LSTOPO_ORIENT_RECT; } else if (!strcmp(tmp, "io:right")) { children_order |= LSTOPO_ORDER_IO_RIGHT; @@ -389,6 +468,7 @@ } *children_order_p = children_order; + *above_force_orient_p = above_force_orient; *right_force_orient_p = right_force_orient; *below_force_orient_p = below_force_orient; } @@ -482,7 +562,7 @@ fprintf (where, "Textual output options:\n"); fprintf (where, " --only Only show objects of the given type in the textual output\n"); fprintf (where, " -v --verbose Include additional details\n"); - fprintf (where, " -s --silent Reduce the amount of details to show\n"); + fprintf (where, " -q --quiet -s Reduce the amount of details to show\n"); fprintf (where, " --distances Only show distance matrices\n"); fprintf (where, " --distances-transform \n"); fprintf (where, " Transform distances before displaying them\n"); @@ -567,6 +647,7 @@ " Set flags during the synthetic topology export\n"); /* --shmem-output-addr is undocumented on purpose */ fprintf (where, " --ps --top Display processes within the hierarchy\n"); + fprintf (where, " --misc-from Create Misc objects as defined in "); fprintf (where, " --version Report version and exit\n"); fprintf (where, " -h --help Show this usage\n"); } @@ -712,6 +793,30 @@ return LSTOPO_OUTPUT_ERROR; } +static const char * +output_format_name(enum output_format format) +{ + switch (format) { + case LSTOPO_OUTPUT_DEFAULT: return "default"; + case LSTOPO_OUTPUT_WINDOW: return "window"; + case LSTOPO_OUTPUT_CONSOLE: return "console"; + case LSTOPO_OUTPUT_SYNTHETIC: return "synthetic"; + case LSTOPO_OUTPUT_ASCII: return "ascii"; + case LSTOPO_OUTPUT_TIKZ: return "tikz"; + case LSTOPO_OUTPUT_FIG: return "fig"; + case LSTOPO_OUTPUT_PNG: return "png"; + case LSTOPO_OUTPUT_PDF: return "pdf"; + case LSTOPO_OUTPUT_PS: return "ps"; + case LSTOPO_OUTPUT_SVG: return "svg"; + case LSTOPO_OUTPUT_CAIROSVG: return "cairosvg"; + case LSTOPO_OUTPUT_NATIVESVG: return "nativesvg"; + case LSTOPO_OUTPUT_XML: return "xml"; + case LSTOPO_OUTPUT_SHMEM: return "shmem"; + case LSTOPO_OUTPUT_ERROR: return "error"; + } + abort(); +} + /**************************************************** * Store filters during parsing and apply them later */ @@ -783,7 +888,8 @@ hwloc_bitmap_t allow_cpuset = NULL, allow_nodeset = NULL; char * callname; char * input = NULL; - enum hwloc_utils_input_format input_format = HWLOC_UTILS_INPUT_DEFAULT; + const char *show_only_string = NULL; + struct hwloc_utils_input_format_s input_format = HWLOC_UTILS_INPUT_FORMAT_DEFAULT; enum output_format output_format = LSTOPO_OUTPUT_DEFAULT; struct lstopo_type_filter type_filter[HWLOC_OBJ_TYPE_MAX]; char *restrictstring = NULL; @@ -797,6 +903,7 @@ #endif char *env; int top = 0; + FILE * miscfrom = NULL; int opt; unsigned i; @@ -844,7 +951,6 @@ loutput.show_memattrs_only = 0; loutput.show_cpukinds_only = 0; loutput.show_windows_processor_groups_only = 0; - loutput.show_only = HWLOC_OBJ_TYPE_NONE; loutput.show_cpuset = 0; loutput.show_taskset = 0; loutput.transform_distances = -1; @@ -873,6 +979,7 @@ loutput.force_orient[i] = LSTOPO_ORIENT_HORIZ; loutput.force_orient[HWLOC_OBJ_NUMANODE] = LSTOPO_ORIENT_HORIZ; loutput.force_orient[HWLOC_OBJ_MEMCACHE] = LSTOPO_ORIENT_HORIZ; + loutput.above_force_orient = LSTOPO_ORIENT_NONE; loutput.right_force_orient = LSTOPO_ORIENT_NONE; loutput.below_force_orient = LSTOPO_ORIENT_NONE; for(i=HWLOC_OBJ_TYPE_MIN; i "$file" @DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-lstopo.output "$file" -if test x@ARCHIVEMOUNT@ != x; then - if test x@HWLOC_HAVE_LINUX@ = x1; then - echo "**** Archivemount'ing a Linux fsroot archive ..." - file="$tmp/test-lstopo.archivemount.fsroot.output" - $ls -i $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.tar.bz2 -v - | egrep -v "^assuming " > "$file" - @DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.output "$file" - fi +if which archivemount >/dev/null 2>/dev/null && test x@HWLOC_HAVE_LINUX@ = x1; then + echo "**** Archivemount'ing a Linux fsroot archive ..." + file="$tmp/test-lstopo.archivemount.fsroot.output" + $ls -i $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.tar.bz2 -v - | egrep -v "^assuming " > "$file" + @DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.output "$file" if test x@HWLOC_HAVE_X86_CPUID@ = x1; then echo "**** Archivemount'ing a x86 CPUID archive ..." file="$tmp/test-lstopo.archivemount.cpuid.output" diff -Nru hwloc-2.9.2/utils/netloc/draw/Makefile.am hwloc-2.10.0/utils/netloc/draw/Makefile.am --- hwloc-2.9.2/utils/netloc/draw/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/draw/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -# Copyright © 2013-2014 Cisco Systems, Inc. All rights reserved. -# Copyright © 2013-2014 University of Wisconsin-La Crosse. -# All rights reserved. -# Copyright © 2016-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - -AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - -bin_PROGRAMS = \ - netloc_draw_to_json - -netloc_draw_to_json_SOURCES = \ - netloc_draw_to_json.c - -netloc_draw_to_json_LDADD = \ - $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la - -dist_pkgdata_DATA = \ - netloc_draw.html \ - netloc_draw.js \ - visdist/vis.min.js \ - visdist/vis.min.css diff -Nru hwloc-2.9.2/utils/netloc/draw/Makefile.in hwloc-2.10.0/utils/netloc/draw/Makefile.in --- hwloc-2.9.2/utils/netloc/draw/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/draw/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,844 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright © 2013-2014 Cisco Systems, Inc. All rights reserved. -# Copyright © 2013-2014 University of Wisconsin-La Crosse. -# All rights reserved. -# Copyright © 2016-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -bin_PROGRAMS = netloc_draw_to_json$(EXEEXT) -subdir = utils/netloc/draw -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ - $(top_srcdir)/config/hwloc_check_attributes.m4 \ - $(top_srcdir)/config/hwloc_check_vendor.m4 \ - $(top_srcdir)/config/hwloc_check_visibility.m4 \ - $(top_srcdir)/config/hwloc_components.m4 \ - $(top_srcdir)/config/hwloc_internal.m4 \ - $(top_srcdir)/config/hwloc_pkg.m4 \ - $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(dist_pkgdata_DATA) \ - $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ - $(top_builddir)/include/hwloc/autogen/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" -PROGRAMS = $(bin_PROGRAMS) -am_netloc_draw_to_json_OBJECTS = netloc_draw_to_json.$(OBJEXT) -netloc_draw_to_json_OBJECTS = $(am_netloc_draw_to_json_OBJECTS) -netloc_draw_to_json_DEPENDENCIES = \ - $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/private/autogen -I$(top_builddir)/include/hwloc/autogen -depcomp = $(SHELL) $(top_srcdir)/./config/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/netloc_draw_to_json.Po -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(netloc_draw_to_json_SOURCES) -DIST_SOURCES = $(netloc_draw_to_json_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -DATA = $(dist_pkgdata_DATA) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/./config/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BUNZIPP = @BUNZIPP@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CONFIGURE_DEPENDENCIES = @CONFIGURE_DEPENDENCIES@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CUDA_VERSION = @CUDA_VERSION@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIFF = @DIFF@ -DLLTOOL = @DLLTOOL@ -DOXYGEN = @DOXYGEN@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EPSTOPDF = @EPSTOPDF@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FIG2DEV = @FIG2DEV@ -FILECMD = @FILECMD@ -GREP = @GREP@ -GS = @GS@ -HWLOC_CAIRO_CFLAGS = @HWLOC_CAIRO_CFLAGS@ -HWLOC_CAIRO_LIBS = @HWLOC_CAIRO_LIBS@ -HWLOC_CFLAGS = @HWLOC_CFLAGS@ -HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ -HWLOC_CUDART_CFLAGS = @HWLOC_CUDART_CFLAGS@ -HWLOC_CUDART_CPPFLAGS = @HWLOC_CUDART_CPPFLAGS@ -HWLOC_CUDART_LDFLAGS = @HWLOC_CUDART_LDFLAGS@ -HWLOC_CUDART_LIBS = @HWLOC_CUDART_LIBS@ -HWLOC_CUDA_CFLAGS = @HWLOC_CUDA_CFLAGS@ -HWLOC_CUDA_CPPFLAGS = @HWLOC_CUDA_CPPFLAGS@ -HWLOC_CUDA_LDFLAGS = @HWLOC_CUDA_LDFLAGS@ -HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ -HWLOC_DARWIN_LDFLAGS = @HWLOC_DARWIN_LDFLAGS@ -HWLOC_DIFF_U = @HWLOC_DIFF_U@ -HWLOC_DIFF_W = @HWLOC_DIFF_W@ -HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ -HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ -HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ -HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ -HWLOC_EMBEDDED_LDFLAGS = @HWLOC_EMBEDDED_LDFLAGS@ -HWLOC_EMBEDDED_LIBS = @HWLOC_EMBEDDED_LIBS@ -HWLOC_GL_LIBS = @HWLOC_GL_LIBS@ -HWLOC_HAVE_LEVELZERO = @HWLOC_HAVE_LEVELZERO@ -HWLOC_HAVE_LIBXML2 = @HWLOC_HAVE_LIBXML2@ -HWLOC_HAVE_LINUX = @HWLOC_HAVE_LINUX@ -HWLOC_HAVE_NVML = @HWLOC_HAVE_NVML@ -HWLOC_HAVE_OPENCL = @HWLOC_HAVE_OPENCL@ -HWLOC_HAVE_RSMI = @HWLOC_HAVE_RSMI@ -HWLOC_HAVE_X86_CPUID = @HWLOC_HAVE_X86_CPUID@ -HWLOC_IBVERBS_LIBS = @HWLOC_IBVERBS_LIBS@ -HWLOC_LDFLAGS = @HWLOC_LDFLAGS@ -HWLOC_LEVELZERO_CFLAGS = @HWLOC_LEVELZERO_CFLAGS@ -HWLOC_LEVELZERO_LIBS = @HWLOC_LEVELZERO_LIBS@ -HWLOC_LIBS = @HWLOC_LIBS@ -HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ -HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ -HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ -HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ -HWLOC_MS_LIB = @HWLOC_MS_LIB@ -HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ -HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ -HWLOC_NUMA_LIBS = @HWLOC_NUMA_LIBS@ -HWLOC_NVML_CPPFLAGS = @HWLOC_NVML_CPPFLAGS@ -HWLOC_NVML_LDFLAGS = @HWLOC_NVML_LDFLAGS@ -HWLOC_NVML_LIBS = @HWLOC_NVML_LIBS@ -HWLOC_OPENCL_CPPFLAGS = @HWLOC_OPENCL_CPPFLAGS@ -HWLOC_OPENCL_LDFLAGS = @HWLOC_OPENCL_LDFLAGS@ -HWLOC_OPENCL_LIBS = @HWLOC_OPENCL_LIBS@ -HWLOC_PCIACCESS_CFLAGS = @HWLOC_PCIACCESS_CFLAGS@ -HWLOC_PCIACCESS_LIBS = @HWLOC_PCIACCESS_LIBS@ -HWLOC_PLUGINS_DIR = @HWLOC_PLUGINS_DIR@ -HWLOC_PLUGINS_PATH = @HWLOC_PLUGINS_PATH@ -HWLOC_PS_LIBS = @HWLOC_PS_LIBS@ -HWLOC_RELEASE_DATE = @HWLOC_RELEASE_DATE@ -HWLOC_REQUIRES = @HWLOC_REQUIRES@ -HWLOC_RSMI_CPPFLAGS = @HWLOC_RSMI_CPPFLAGS@ -HWLOC_RSMI_LDFLAGS = @HWLOC_RSMI_LDFLAGS@ -HWLOC_RSMI_LIBS = @HWLOC_RSMI_LIBS@ -HWLOC_TERMCAP_LIBS = @HWLOC_TERMCAP_LIBS@ -HWLOC_VERSION = @HWLOC_VERSION@ -HWLOC_W3_GENERATOR = @HWLOC_W3_GENERATOR@ -HWLOC_X11_CPPFLAGS = @HWLOC_X11_CPPFLAGS@ -HWLOC_X11_LIBS = @HWLOC_X11_LIBS@ -HWLOC_XML_LOCALIZED = @HWLOC_XML_LOCALIZED@ -HWLOC_runstatedir = @HWLOC_runstatedir@ -HWLOC_top_builddir = @HWLOC_top_builddir@ -HWLOC_top_srcdir = @HWLOC_top_srcdir@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LYNX = @LYNX@ -MAKEINDEX = @MAKEINDEX@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -ROCM_VERSION = @ROCM_VERSION@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -W3M = @W3M@ -XMKMF = @XMKMF@ -XMLLINT = @XMLLINT@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libhwloc_so_name = @libhwloc_so_name@ -libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xz = @xz@ -AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - -netloc_draw_to_json_SOURCES = \ - netloc_draw_to_json.c - -netloc_draw_to_json_LDADD = \ - $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la - -dist_pkgdata_DATA = \ - netloc_draw.html \ - netloc_draw.js \ - visdist/vis.min.js \ - visdist/vis.min.css - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/netloc/draw/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign utils/netloc/draw/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -netloc_draw_to_json$(EXEEXT): $(netloc_draw_to_json_OBJECTS) $(netloc_draw_to_json_DEPENDENCIES) $(EXTRA_netloc_draw_to_json_DEPENDENCIES) - @rm -f netloc_draw_to_json$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(netloc_draw_to_json_OBJECTS) $(netloc_draw_to_json_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netloc_draw_to_json.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-dist_pkgdataDATA: $(dist_pkgdata_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ - done - -uninstall-dist_pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) $(DATA) -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/netloc_draw_to_json.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-dist_pkgdataDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/netloc_draw_to_json.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-dist_pkgdataDATA - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dist_pkgdataDATA \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-dist_pkgdataDATA - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru hwloc-2.9.2/utils/netloc/draw/netloc_draw.html hwloc-2.10.0/utils/netloc/draw/netloc_draw.html --- hwloc-2.9.2/utils/netloc/draw/netloc_draw.html 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/draw/netloc_draw.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ - - - - - - - - - - - Network topology - - - - - - - - - - - - - - - -
- -

-
-    
-    
-  
-
diff -Nru hwloc-2.9.2/utils/netloc/draw/netloc_draw.js hwloc-2.10.0/utils/netloc/draw/netloc_draw.js
--- hwloc-2.9.2/utils/netloc/draw/netloc_draw.js	2023-06-28 08:36:22.000000000 +0000
+++ hwloc-2.10.0/utils/netloc/draw/netloc_draw.js	1970-01-01 00:00:00.000000000 +0000
@@ -1,1049 +0,0 @@
-var edges;
-var nodes;
-var links;
-var shownNodes;
-var shownEdges;
-var partitions;
-var mydata;
-var topos;
-const normalSwitchColor = {background: "grey"};
-const normalHostColor = {background: "red"};
-const normalEdgeColor = {color: "grey", highlight: "blue"};
-const paletteNone = ["red"];
-const palette9 = ["blue", "orange", "green", "pink", "brown", "purple", "yellow", "red", "gray"];
-const palette11 = ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f",
-                   "#ff7f00", "#cab2d6", "#6a3d9a", "#ffff99"];
-var nodesWithPhysics;
-var edgesWithPhysics;
-var nodeBandwidthList;
-var edgeBandwidthList;
-var network;
-var description = "";
-const lastColorMode = "bandwidth";
-
-function filterEdge(e) {
-    return (shownNodes.get(e.to) && shownNodes.get(e.from));
-}
-
-function updateDescription() {
-    /* update the desciption of the graph */
-    var num_hosts = shownNodes.get({filter: function(n) {
-        return n.type == "host";
-    }}).length;
-    var num_switches = shownNodes.length-num_hosts;
-    var enabledTopos = shownNodes.distinct("topo");
-    var shownTopos = enabledTopos.reduce(function(a, e) {
-        if (e != -1)
-            a.push(topos[e]);
-        return a;
-    }, []);
-
-    description =
-        '

Stats

' + - shownNodes.length + ' nodes\n' + - shownEdges.length + ' edges\n' + - num_hosts + ' hosts\n' + - num_switches + ' switches\n' + - '

Partitions

' + - '
  • ' + partitions.join('
  • ') + '
' + - '

Hwloc topologies

' + - '
  • ' + shownTopos.sort().join('
  • ') + '
' + - '
'; - document.getElementById('description').innerHTML = description; -} - -function printWithTime(msg) { - if (typeof printWithTime.lastTime == 'undefined' ) { - printWithTime.lastTime = Math.floor(new Date().getTime()/1000); - } - - var time = Math.floor(new Date().getTime()/1000); - var duration = time-printWithTime.lastTime; - printWithTime.lastTime = time; - console.log(msg); - console.log(duration + "s elapsed"); -} - -function handleFileSelect(evt) { - var files = evt.target.files; - var fr = new FileReader(); - fr.onload = function(e) { - printWithTime("Starting..."); - data = e.target.result; - loadFile(data); - }; - fr.readAsText(files[0]); -} - -function renameKey(obj, newkey, oldkey) -{ - return obj.map(function(d) { d[newkey] = d[oldkey]; delete d[oldkey]; return d; }); -} - -function getNeighbours(node) -{ - return node.edges.map(function(e) { - return edges.get(e).to; - }).filter(function(n) { - return shownNodes.get(n); - }); -} - -function palette(size) { - var palette = []; - - if (!size) - return paletteNone; - - if (size <= 9) - return palette9.slice(0, size+1); - - if (size <= 11) - return palette11.slice(0, size+1); - - var v = Math.ceil(Math.pow(size+1, 1/3)); - var value = 255/v; - for( var rStep = 0, r = 0; rStep < v; rStep++) { - for( var gStep = 0, g = 0; gStep < v; gStep++ ) { - for( var bStep = 0, b = 0; bStep < v; bStep++ ) { - if (!r && !g && !b) - continue; - palette.push('rgb(' + Math.round(r) + ', ' + Math.round(g) + ', ' - + Math.round(b) + ')'); - b += value; - } - g += value; - } - r += value; - } - return palette; -} - -function loadFile(data) -{ - printWithTime("File loaded"); - mydata = JSON.parse(data); - printWithTime("JSON parsed"); - partitions = mydata.partitions; - topos = mydata.hwloctopos; - - /* Prepare UI */ - /***********************************************************************/ - /* Add elements to selectColors */ - var selectColors = document.getElementById("selectColors"); - while (selectColors.length > 1) { - selectColors.removeChild(selectColors.lastChild); - } - { - var el = document.createElement("option"); - el.textContent = "normal"; - el.value = "normal"; - selectColors.appendChild(el); - } - if (partitions.length) { - var el = document.createElement("option"); - el.textContent = "partition"; - el.value = "partition"; - selectColors.appendChild(el); - } - if (topos.length) { - var el = document.createElement("option"); - el.textContent = "hwloc"; - el.value = "hwloc"; - selectColors.appendChild(el); - } - { - var el = document.createElement("option"); - el.textContent = "bandwidth"; - el.value = "bandwidth"; - selectColors.appendChild(el); - } - { - var el = document.createElement("option"); - el.textContent = "bandwidth_check"; - el.value = "bandwidth_check"; - selectColors.appendChild(el); - } - - /* Add elements to selectPartition */ - var selectPartition = document.getElementById("selectPartition"); - while (selectPartition.length > 1) { - selectPartition.removeChild(selectPartition.lastChild); - } - var partitionOptions = partitions.slice(); - partitionOptions.unshift("All"); - partitionOptions.forEach(function(partition, i) { - var el = document.createElement("option"); - el.textContent = partition; - el.value = i-1; // because of "All" - selectPartition.appendChild(el); - }); - /***********************************************************************/ - - /* Set edges */ - /***********************************************************************/ - mydata.edges.map( - function(e) {e["label"] = Math.round(parseFloat(e["gbits"]));}); - var gbits_min = Math.min.apply(null, mydata.edges.map(function(e) { return e["gbits"];})); - mydata.edges.map( - function(e) {e["width"] = e["gbits"]/gbits_min; e["physics"] = false;}); - edges = new vis.DataSet({}); - edges.add(mydata.edges); - printWithTime("Dataset edges created"); - /***********************************************************************/ - - /* Set nodes */ - /***********************************************************************/ - mydata.nodes = renameKey(mydata.nodes, "title", "desc"); - mydata.nodes.forEach( function(n) { - n["color"] = n["type"] == "host" ? normalHostColor : normalSwitchColor; - n["bandwidth"] = - edges.get(n["edges"]).map(function(e) { if (!e) return 8; else return e.gbits; }) - .reduce(function(a, b) { return a + b; }, 0); - n["size"] = 10*Math.log(n["bandwidth"]); - n["x"] = n["y"] = 0; - if (mydata.type === "tree") { - n["fixed"] = true; - n["physics"] = true; - } - }); - nodes = new vis.DataSet({}); - nodes.add(mydata.nodes); - printWithTime("Dataset nodes created"); - /***********************************************************************/ - - /* Set links */ - /***********************************************************************/ - links = new vis.DataSet({}); - links.add(mydata.links); - printWithTime("Dataset links created"); - /***********************************************************************/ - - /* Build list of width for nodes */ - nodeBandwidthList = []; - nodes.forEach(function(n) { - if (nodeBandwidthList.indexOf(n.size) == -1) { - nodeBandwidthList.push(n.size); - } - }); - /* Build list of width for edges */ - edgeBandwidthList = []; - edges.forEach(function(e) { - if (edgeBandwidthList.indexOf(e.gbits) == -1) { - edgeBandwidthList.push(e.gbits); - } - }); -} - -function nodeColors() -{ - var e = document.getElementById("selectColors"); - var colorMode = e.options[e.selectedIndex].value; - - if (colorMode == "normal") { - shownNodes.forEach(function(n) { - if (n.type == "host") - shownNodes.update({id: n.id, color: normalHostColor}); - else - shownNodes.update({id: n.id, color: normalSwitchColor}); - }); - - if (lastColorMode == "bandwidth" || lastColorMode == "bandwidth_check") { - shownEdges.forEach(function(n) { - shownEdges.update({id: n.id, color: normalEdgeColor}); - }); - } - - } else if (colorMode == "partition") { - var nodeColors = palette(partitions.length); - shownNodes.forEach(function(n) { - if (n.type == "host") { - var colorIdx = n.part[0]; - shownNodes.update({id: n.id, color: {background: nodeColors[colorIdx]}}); - - } else - shownNodes.update({id: n.id, color: normalSwitchColor}); - }); - - if (lastColorMode == "bandwidth" || lastColorMode == "bandwidth_check") { - shownEdges.forEach(function(n) { - shownEdges.update({id: n.id, color: normalEdgeColor}); - }); - } - - } else if (colorMode == "hwloc") { - var nodeColors = palette(topos.length); - shownNodes.forEach(function(n) { - if (n.type == "host") { - var colorIdx = n.topo; - if (colorIdx != -1) { - shownNodes.update({id: n.id, color: {background: nodeColors[colorIdx]}}); - } - - } else - shownNodes.update({id: n.id, color: normalSwitchColor}); - }); - - if (lastColorMode == "bandwidth" || lastColorMode == "bandwidth_check") { - shownEdges.forEach(function(n) { - shownEdges.update({id: n.id, color: normalEdgeColor}); - }); - } - - } else if (colorMode == "bandwidth") { - var nodeColors = palette(nodeBandwidthList.length); - shownNodes.forEach(function(n) { - var colorIdx = nodeBandwidthList.indexOf(n.size); - if (colorIdx != -1) { - shownNodes.update({id: n.id, color: {background: nodeColors[colorIdx]}}); - } - }); - var edgeColors = palette(edgeBandwidthList.length); - shownEdges.forEach(function(n) { - var colorIdx = edgeBandwidthList.indexOf(n.gbits); - if (colorIdx != -1) { - shownEdges.update({id: n.id, color: {color: edgeColors[colorIdx]}}); - } - }); - - } else if (colorMode == "bandwidth_check") { - var edgeColors = palette(edgeBandwidthList.length); - shownEdges.forEach(function(n) { - var colorIdx = edgeBandwidthList.indexOf(n.gbits); - if (colorIdx != -1) { - shownEdges.update({id: n.id, color: {color: edgeColors[colorIdx]}}); - } - }); - shownNodes.forEach(function(n) { - /* Quick check about in bw = out bd */ - if (n.edges.length == 1) { - var colorIdx = edgeBandwidthList.indexOf(n.bandwidth); - shownNodes.update({id: n.id, color: {background: edgeColors[colorIdx]}}); - - } else { - var colorIdx = edgeBandwidthList.indexOf(n.bandwidth/2); - if (colorIdx != -1) { - shownNodes.update({id: n.id, color: {background: edgeColors[colorIdx]}}); - } else { - shownNodes.update({id: n.id, color: {background: "black"}}); - } - } - }); - } - lastcolorMode = colorMode; -} - -function selectNodesAndEdges(field, value) -{ - var regexp = new RegExp(value, "g"); - var nodeIds; - var nodeSet; - var edgeIds; - var edgeSet; - - switch (field) { - case "part": - var strings = partitions; - matchingStrings = strings.reduce(function(a, e, i) { - if (e.match(regexp)) - a.push(i); - return a; - }, []); - nodeSet = shownNodes.get({filter: function(n) { - for (var e = 0; e < n[field].length; e++) { - var elem = n[field][e]; - for (var f = 0; f < matchingStrings.length; f++) { - if (elem == matchingStrings[f]) - return true; - } - } - return false; - }}); - edgeSet = shownEdges.get({filter: function(n) { - for (var e = 0; e < n[field].length; e++) { - var elem = n[field][e]; - for (var f = 0; f < matchingStrings.length; f++) { - if (elem == matchingStrings[f]) - return true; - } - } - return false; - }}); - break; - case "topo": - var strings = topos; - matchingStrings = strings.reduce(function(a, e, i) { - if (e.match(regexp)) - a.push(i); - return a; - }, []); - nodeSet = shownNodes.get({filter: function(n) { - var elem = n[field]; - for (var f = 0; f < matchingStrings.length; f++) { - if (elem == matchingStrings[f]) - return true; - } - return false; - }}); - edgeSet = []; - break; - default: - nodeSet = shownNodes.get({filter: function(n) { - return n[field] ? n[field].toString().match(regexp): false; - }}); - edgeSet = shownEdges.get({filter: function(e) { - return e[field] ? e[field].toString().match(regexp): false; - }}); - } - nodeIds = nodeSet.map(function(n) { return n.id; }); - edgeIds = edgeSet.map(function(e) { return e.id; }); - - network.setSelection({edges: edgeIds, nodes: nodeIds}, {highlightEdges: false}); - showSelectedNodes(); -} - -function showSelectedEdges() -{ - var infos = ""; - - var edgeIds = network.getSelectedEdges(); - var nodeIds = network.getSelectedNodes(); - - infos += '

' + edgeIds.length + ' edges selected

'; - if (!nodeIds.length) { - var neighbours = []; - edgeIds.forEach(function(edgeId, id) { - var edge = edges.get(edgeId); - var dest = nodes.get(edge.to); - var src = nodes.get(edge.from); - - infos += '

edge #' + (id+1) + '

' + - 'ID: ' + edge.id + '\n' + - 'Partitions: ' + edge.part.map(function(p){return partitions[p]}) - .join(', ') + '\n' + - '\t' + src.title + '(' + src.id + ') - ' + - dest.title + '(' + dest.id + '): ' + - edge.label + 'Gb\n'; - - var edgeLinks = edge.links; - edgeLinks.forEach(function(linkId) { - var link = links.get(linkId); - infos += '\t\tlink ' + linkId + ' (' - + link.src_port + '->' + link.dst_port + '):' - + link.gbits + 'Gb\n'; - }); - }); - } - document.getElementById('desc_selected').innerHTML += infos; -} - -function showSelectedNodes() -{ - document.getElementById('desc_selected').innerHTML = ''; - var infos = ""; - - var edgeIds = network.getSelectedEdges(); - var nodeIds = network.getSelectedNodes(); - - var neighbourLists = []; - var similarNeighbours = null; - if (nodeIds.length) { - infos += '

' + nodeIds.length + ' nodes selected

'; - - var inputNodes = shownNodes.get(nodeIds); - inputNodes.forEach(function(node) { - var nodeEdges = node.edges; - var neighbourText = []; - var neighbours = []; - - nodeEdges.forEach(function(edgeId) { - var edge = edges.get(edgeId); - var dest = nodes.get(edge.to); - - var s = '\t' + dest.title + ' (' + dest.id + ') - edgeId ' - + edgeId + ': ' + edge.label + 'Gb\n'; - - var edgeLinks = edge.links; - edgeLinks.forEach(function(linkId) { - var link = links.get(linkId); - s += '\t\tlink ' + linkId + ' (' - + link.src_port + '->' + link.dst_port + '):' - + link.gbits + 'Gb\n'; - }); - neighbourText.push(s); - neighbours.push(dest.id); - }); - - sub = node.sub.map(function(s) { - return nodes.get(s).title; - }); - - infos += - '

' + node.title + '

' + - 'ID: ' + node.id + ' Hostname: ' + node.hostname + '\n' + - 'Partitions: ' + node.part.map(function(p){return partitions[p]}) - .join(', ') + '\n' + - 'Subnodes: ' + sub.join(', ') + '\n' + - neighbourText.length + ' neighbours:\n' + neighbourText.sort().join('') + - 'Total bandwidth: ' + node.bandwidth + '\n' + - ((node.topo != -1) ? ('Hwloc topology: ' + topos[node.topo]): ''); - - if (!similarNeighbours) { - similarNeighbours = neighbours; - } else { - similarNeighbours = similarNeighbours.filter(function(n) { - return neighbours.indexOf(n) != -1; - }); - } - neighbourLists.push(neighbours); - }); - } - - if (nodeIds.length > 1) { - var s = []; - similarNeighbours.forEach(function(n) { - s.push('\t' + nodes.get(n).title + '\n'); - }); - infos += - '

Similar neighbours

' + - similarNeighbours.length + ' similar neighbours:\n' + s.sort().join(''); - infos += - '

Specific neighbours

'; - nodeIds.forEach(function(n, idx) { - infos += '\t' + shownNodes.get(n).title + ": " + - neighbourLists[idx] - .filter(function(n) - {return similarNeighbours.indexOf(n) < 0;}) - .map(function(n) - {return shownNodes.get(n).title;}) - .sort().join(', ') + - '\n'; - }); - } - - document.getElementById('desc_selected').innerHTML += infos; -} - -function search() -{ - var selectSearch = document.getElementById("selectSearch"); - var field = selectSearch.options[selectSearch.selectedIndex].value; - - if (field == "") { - - } else { - var searchValue = document.getElementById("searchValue"); - var value = searchValue.value; - selectNodesAndEdges(field, value); - } -} - -function draw() -{ - printWithTime("Draw"); - var selectPartition = document.getElementById("selectPartition"); - var partition = parseInt( - selectPartition.options[selectPartition.selectedIndex].value); - - var subNodes = new vis.DataSet(nodes.get({filter: function (n) { return n.merged == 0 }})); - printWithTime("Nodes filtered"); - - var subEdges; - if (partition == -1) { // for "All" - shownNodes = subNodes; - subEdges = new vis.DataSet(edges.get({filter: filterEdge})); - } else { - shownNodes = new vis.DataSet(subNodes.get({filter: function (n) { - return n.part.indexOf(partition) > -1; - }})); - subEdges = new vis.DataSet(edges.get({filter: function (e) { - return shownNodes.get(e.to) && shownNodes.get(e.from) - && e.part.indexOf(partition) > -1; - }})); - } - printWithTime("subdatasets created"); - - /* Keep edges in only one way */ - shownEdges = new vis.DataSet(subEdges.get({filter: function (e) { - //return (subNodes.get(e.from) && subNodes.get(e.from).type != "host"); // DEBUG XXX - /* We'd rather keep the edge where e.from > e.to, so we would keep the - ones from virtual nodes which would ease the expansion. - */ - if (e.from > e.to) { - if (!subEdges.get(e.reverse)) { - e.arrows = {to: true}; - } - return true; - - } else if (!subEdges.get(e.reverse)) { - e.arrows = {to: true}; - return true; - - } else - return false; - }})); - printWithTime("Edges filtered (keep one way)"); - - var physicsEnabled = true; - var selectColor = document.getElementById("selectColors"); - var colorMode = - selectColor.options[selectColor.selectedIndex].value; - if (colorMode != "") - nodeColors(); - else - selectColor.selectedIndex = 1; - - updateDescription(); - printWithTime("Description updated"); - - /* Set nodes positions */ - if (mydata.type === "tree"){ - physicsEnabled = false; - var stack = []; - var current_ring; - var node_pool = new vis.DataSet(shownNodes.get().map( function (n) { - n.crt_nedges = getNeighbours(n).length; - n.subtreeSize = n.size * Math.PI * 2; - n.initAngle = 0; - return n; - })); - while (0 < node_pool.length) { - current_ring = node_pool.get({filter: function (n) { return 1 >= n.crt_nedges }}); - if (current_ring.length > 0) { - node_pool.remove(current_ring); - current_ring.forEach( function (node) { - node_pool.get( - getNeighbours(node), - {returnType: 'Array', filter: function (nbg) { return null !== nbg }} - ).forEach( function (nbg) { - nbg.subtreeSize += node.subtreeSize / 2 / Math.PI * 2.3; - nbg.crt_nedges--; - node_pool.update(nbg); - }); - }); - } else { - /* tree "root" is made of multiple nodes */ - /* Step 1: Extract any node not connected to the last - * saved stack level. - */ - var substack = []; - current_ring = node_pool.get({filter: function (n) { - return 0 === stack[stack.length-1].get( - getNeighbours(n), - {returnType: 'Array', - filter: function (nbg) { return null !== nbg } - }).length}}); - node_pool.remove(current_ring); - substack.push(new vis.DataSet(current_ring)); - current_ring.forEach( function (n) { - node_pool.get(getNeighbours(n),{ - returnType:'Array', - filter: function (nbg) { return null !== nbg } - }).forEach( function (nbg) { - nbg.crt_nedges--; - node_pool.update(nbg); - }); - }); - while (current_ring.length > 0) { - current_ring = substack[substack.length-1].get({ - filter: function (n) { - return 0 === substack[substack.length-1].get( - getNeighbours(n), - {returnType: 'Array', - filter: function (nbg) { return null !== nbg } - }).length}}); - if (current_ring.length > 0) { - substack[substack.length-1].remove(current_ring); - substack.push(new vis.DataSet(current_ring)); - } - } - /* Step 2: Consider nodes with highest neighbors in - * remaining pool to be closer to the root. - */ - var max_nedges = node_pool.get() - .reduce(function (r, n) { - return Math.max(r, n.crt_nedges) - }, -Infinity); - while(max_nedges > 0) { - current_ring = node_pool.get({ - filter: function(n){ return max_nedges <= n.crt_nedges } - }); - node_pool.remove(current_ring); - substack.push(new vis.DataSet(current_ring)); - current_ring.forEach( function (n) { - node_pool.get(getNeighbours(n),{ - returnType:'Array', - filter: function (nbg) { return null !== nbg } - }).forEach( function (nbg) { - nbg.crt_nedges--; - node_pool.update(nbg); - }); - }); - max_nedges = node_pool.get() - .reduce( function (r,n) { - return Math.max(r,n.crt_nedges) - }, -Infinity); - } - - if (node_pool.length > 0) { /* Add remaining nodes */ - current_ring = node_pool.get({returnType: 'Array'}); - node_pool.remove(current_ring); - substack.push(new vis.DataSet(current_ring)); - } - /* Propagate subtree sizes */ - while(substack.length > 1) { - var sons = substack.pop(); - sons.get({returnType: 'Array'}).forEach( function (n) { - substack[substack.length-1].get(getNeighbours(n), { - returnType:'Array', - filter: function (nbg) { return null !== nbg } - }).forEach( function (nbg) { - nbg.subtreeSize += n.subtreeSize / 2 / Math.PI * 2.3; - substack[substack.length-1].update(nbg); - }); - }); - stack.push(sons); - } - current_ring = substack.pop().get({returnType: 'Array'}); - } - stack.push(new vis.DataSet(current_ring)); - } - printWithTime("Tree built"); - /* If root is made of multiple nodes, separate them around 0 */ - if (stack[stack.length-1].length > 1) { - /* Step 3: Display multiple root around 0, and - * corresponding subtrees around as a single circle. - */ - var ds = stack.pop(); - var subtreeSize = ds.get().reduce( function (r, n) { - return r + n.size * 2 - }, 0) / 2 / Math.PI; - var subsubtreeSize = Math.max(ds.get().reduce( function (r, n) { - return r + n.subtreeSize / 2 / Math.PI - }, 0) / 3 / Math.PI,stack[stack.length-1].get().reduce( function (r, n) { - return r + n.size - }, 0) / Math.PI, subtreeSize * 2 * Math.PI); - if (stack.length == 1) { - var arrBig = ds.get().map(function (n) { - return {id: n.id, nb_neighbours: stack[stack.length-1].get(getNeighbours(n), { - returnType: 'Array', - filter: function(nbg) { return null !== nbg && nbg.x === 0 && nbg.y === 0} - }).length} - }).sort(function (a,b) { - return a.nb_neighbours < b.nb_neighbours ? -1 - : a.nb_neighbours > b.nb_neighbours ? 1 : 0; - }); - var arrSmall = arrBig.splice(ds.length/2,ds.length/2).reverse(); - var arrOrdered = []; - for (var i=0, l=arrSmall.length; i= node.edges.length) { - nodesWithPhysics.push(edge.to); - shownNodes.update({id: edge.to, physics: true, fixed: false}); - } - var node = shownNodes.get(edge.from); - if (1 >= node.edges.length) { - nodesWithPhysics.push(edge.from); - shownNodes.update({id: edge.from, physics: true, fixed: false}); - } - }); - }); - network.on("dragEnd", function (params) { - edgesWithPhysics.forEach(function(edgeWithPhysic) { - shownEdges.update({id: edgeWithPhysic, physics: false, fixed: true}); - }); - nodesWithPhysics.forEach(function(nodeWithPhysic) { - shownNodes.update({id: nodeWithPhysic, physics: false, fixed: true}); - }); - }); - } - - network.on("stabilizationIterationsDone", function () { - //network.setOptions({ - // nodes: {physics: false}, - // edges: {physics: false}, - // layout: {improvedLayout: false}, - //}); - shownEdges.getIds().forEach(function(e) { - shownEdges.update({id: e, physics: false}); - }); - shownNodes.getIds().forEach(function(n) { - shownNodes.update({id: n, physics: false}); - }); - }); -} - -function expandSelected() -{ - nodeIds = network.getSelectedNodes(); - nodeIds.forEach(function(n) { - // TODO - node = shownNodes.get(n); - neighbours = getNeighbours(node); - - /* Physics enabled for neighbours */ - neighbours.forEach(function(nbg) { - printWithTime(nbg + " -> physics"); - shownNodes.update({id: nbg, physics: true, fixed: true}); - }); - - /* The selected nodes are removed (then replaced) */ - shownEdges.remove(node.edges); - printWithTime(shownNodes.remove(node) + " -> removed"); - var selectedNodes = []; - node.sub.forEach(function(s) { - subnode = nodes.get(s); - subnode.physics = false; - shownNodes.add(subnode); - shownEdges.add(edges.get(subnode.edges), {filter: filterEdge}); - selectedNodes.push(subnode.id); - }); - network.selectNodes(selectedNodes); - showSelectedNodes(); - }); - updateDescription(); -} - -function mergeNode(node) -{ - // TODO -} - -function prepareImage() -{ - function export_SVG() { - - function Node (x, y, r, c) { - var cx, cy, radius, fill; - this.node = document.createElementNS('http://www.w3.org/2000/svg','circle'); - this.attribute = function (key,val) { - if (val === undefined) return this.node.getAttribute(key); - this.node.setAttribute(key,val); - return val; - } - this.getCoord = function () {return {cx: cx, cy: cy}} - this.setCoord = function (obj) { - if (undefined === obj) return; - cx = this.attribute('cx', obj.cx); - cy = this.attribute('cy', obj.cy); - } - this.getSize = function () {return r} - this.setSize = function (r) {radius = this.attribute('r', r)} - this.getColor = function () {return fill} - this.setColor = function (c) {fill = this.attribute('fill', c)} - // Init - cx = this.attribute.apply(this, ['cx', x]); - cy = this.attribute.apply(this, ['cy', y]); - radius = this.attribute.apply(this, ['r', r]); - fill = this.attribute.apply(this, ['fill', c]); - } - - function Edge (x1, y1, x2, y2, w, c, l) { - var from, to, width, label, color; - this.edge = document.createElementNS('http://www.w3.org/2000/svg','line'); - this.attribute = function (key,val) { - if (val === undefined) return this.edge.getAttribute(key); - this.edge.setAttribute(key,val); - return val; - } - this.style = function (key,val) { - if (undefined === val) return this.edge.style[key]; - this.edge.style[key] = val; - return val; - } - this.getCoords = function () {return {from: from, to: to}} - this.setCoords = function (obj) { - if (undefined === obj) return; - from.x = this.attribute('x1', obj.from === undefined ? undefined : obj.from.x); - from.y = this.attribute('y1', obj.from === undefined ? undefined : obj.from.y); - to.x = this.attribute('x2', obj.to === undefined ? undefined : obj.to.x); - to.y = this.attribute('y2', obj.to === undefined ? undefined : obj.to.y); - } - this.getWidth = function () {return width} - this.setWidth = function (w) {width = this.style('stroke-width', w)} - this.getColor = function () {return color} - this.setColor = function (color) {fill = this.style('stroke', color)} - // TO BE ADDED: label - // Init - from = {x: this.attribute.apply(this, ['x1', x1]), - y: this.attribute.apply(this, ['y1', y1])}; - to = {x: this.attribute.apply(this, ['x2', x2]), - y: this.attribute.apply(this, ['y2', y2])}; - width = this.style.apply(this, ['stroke-width', w]); - color = this.style.apply(this, ['stroke', c]); - label = l - } - - var nodeArr = shownNodes.get(); - var bounds = nodeArr.reduce( function (bounds, node) { - return {minx: Math.min(bounds.minx, node.x), maxx: Math.max(bounds.maxx, node.x), - miny: Math.min(bounds.miny, node.y), maxy: Math.max(bounds.maxy, node.y), - maxr: Math.max(bounds.maxr, node.size)}; - }, {minx: Infinity, miny: Infinity, maxx: -Infinity, maxy: -Infinity, maxr: -Infinity}); - var SVGCanvas = document.createElementNS('http://www.w3.org/2000/svg','svg'); - SVGCanvas.setAttribute('version', '1.1'); - SVGCanvas.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); - SVGCanvas.setAttribute('width', bounds.maxx - bounds.minx + 2 * bounds.maxr); - SVGCanvas.setAttribute('height', bounds.maxy - bounds.miny + 2 * bounds.maxr); - shownEdges.get().map( function (edge) { - return {from: shownNodes.get(edge.from), to: shownNodes.get(edge.to), - width: edge.width, color: edge.color.color, label: edge.label}; - }).forEach( function (obj) { - SVGCanvas.appendChild(new Edge(obj.from.x - bounds.minx + bounds.maxr, - obj.from.y - bounds.miny + bounds.maxr, - obj.to.x - bounds.minx + bounds.maxr, - obj.to.y - bounds.miny + bounds.maxr, - obj.width, obj.color, obj.label ).edge); - }); - nodeArr.forEach( function (node) { - SVGCanvas.appendChild(new Node(node.x - bounds.minx + bounds.maxr, - node.y - bounds.miny + bounds.maxr, - node.size, node.color.background).node); - }); - // Return text version of complete SVG image - return document.createElement('div').appendChild(SVGCanvas).parentNode.innerHTML; - } - - var img = btoa(export_SVG()); - var link = document.createElement('a'); - link.setAttribute('href-lang', 'image/svg+xml'); - link.setAttribute('href', 'data:image/svg+xml;base64,\n'+img); - link.setAttribute('title', 'netloc_draw.svg'); - link.appendChild(document.createTextNode("image")); - document.getElementById('imageLink').appendChild(link); -} diff -Nru hwloc-2.9.2/utils/netloc/draw/netloc_draw_to_json.c hwloc-2.10.0/utils/netloc/draw/netloc_draw_to_json.c --- hwloc-2.9.2/utils/netloc/draw/netloc_draw_to_json.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/draw/netloc_draw_to_json.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,628 +0,0 @@ -/* - * Copyright © 2016-2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -#include -#include -#include -#include -#include - -#include "private/netloc.h" -#include "netloc.h" - -#define JSON_DRAW_FILE_LINK_ID "id" -#define JSON_DRAW_FILE_LINK_SRC "from" -#define JSON_DRAW_FILE_LINK_SRC_PORT "src_port" -#define JSON_DRAW_FILE_LINK_DST "to" -#define JSON_DRAW_FILE_LINK_DST_PORT "dst_port" -#define JSON_DRAW_FILE_LINK_WIDTH "width" -#define JSON_DRAW_FILE_LINK_SPEED "speed" -#define JSON_DRAW_FILE_LINK_GBITS "gbits" -#define JSON_DRAW_FILE_LINK_OTHER_WAY "reverse" -#define JSON_DRAW_FILE_LINK_PARTITIONS "part" -#define JSON_DRAW_FILE_EDGE_ID "id" -#define JSON_DRAW_FILE_EDGE_SRC "from" -#define JSON_DRAW_FILE_EDGE_DST "to" -#define JSON_DRAW_FILE_EDGE_GBITS "gbits" -#define JSON_DRAW_FILE_EDGE_LINKS "links" -#define JSON_DRAW_FILE_EDGE_PARTITIONS "part" -#define JSON_DRAW_FILE_EDGE_SUBEDGES "subedges" -#define JSON_DRAW_FILE_EDGE_OTHER_WAY "reverse" -#define JSON_DRAW_FILE_NODE_ID "id" -#define JSON_DRAW_FILE_NODE_EDGES "edges" -#define JSON_DRAW_FILE_NODE_MERGED "merged" -#define JSON_DRAW_FILE_NODE_SUBNODES "sub" -#define JSON_DRAW_FILE_NODE_PARTITIONS "part" -#define JSON_DRAW_FILE_NODE_DESC "desc" -#define JSON_DRAW_FILE_NODE_HOSTNAME "hostname" -#define JSON_DRAW_FILE_NODE_HWLOCTOPO "topo" -#define JSON_DRAW_FILE_NODE_EDGES "edges" -#define JSON_DRAW_FILE_NODE_TYPE "type" -#define JSON_DRAW_FILE_EDGES_LIST "list" -#define JSON_DRAW_FILE_PATH_ID "id" -#define JSON_DRAW_FILE_PATH_LINKS "links" -#define JSON_DRAW_FILE_PATHS "paths" - -#define JSON_DRAW_FILE_GRAPH_TYPE "type" -#define JSON_DRAW_FILE_NODES "nodes" -#define JSON_DRAW_FILE_EDGES "edges" -#define JSON_DRAW_FILE_LINKS "links" -#define JSON_DRAW_FILE_PARTITIONS "partitions" -#define JSON_DRAW_FILE_HWLOCTOPOS "hwloctopos" - -/******************************************************************************/ -/* Functions to handle JSON */ -/******************************************************************************/ -typedef enum { - JSON_STRING, - JSON_INT, - JSON_FLOAT, - JSON_ARRAY, - JSON_DICT -} json_type; - -typedef struct { - int num; - int allocated; - char **strings; -} contents_t; - -typedef struct { - json_type type; - contents_t *contents; -} json_t; - -static contents_t *contents_new(int allocated) -{ - contents_t *contents = (contents_t *)malloc(sizeof(contents_t)); - contents->strings = (char **)malloc(sizeof(char *[allocated])); - contents->allocated = allocated; - contents->num = 0; - return contents; -} - -static void contents_add(contents_t *contents, char *string) -{ - if (contents->num == contents->allocated) { - if (contents->allocated) - { - char **new_strings = (char **) - realloc(contents->strings, sizeof(char *[2*contents->allocated])); - if (!new_strings) - return; - contents->strings = new_strings; - contents->allocated *= 2; - } else { - contents->strings = (char **) malloc(sizeof(char *[1])); - if (!contents->strings) - return; - contents->allocated = 1; - } - } - contents->strings[contents->num] = string; - contents->num++; -} - -static void contents_destruct(contents_t *contents) -{ - free(contents->strings); - free(contents); -} - -static void contents_cat(contents_t *dest, contents_t *src) -{ - int size = src->num; - if (dest->num+size > dest->allocated) { - if (dest->allocated) - { - dest->strings = (char **) - realloc(dest->strings, sizeof(char *[dest->allocated+size])); - dest->allocated += size; - } else { - dest->strings = (char **) - realloc(dest->strings, sizeof(char *[size])); - dest->allocated = size; - } - } - memcpy(&dest->strings[dest->num], src->strings, sizeof(char *[src->num])); - dest->num += src->num; -} - -static void json_close_object(json_t *object) -{ - switch (object->type) { - case JSON_ARRAY: - contents_add(object->contents, strdup("]")); - break; - case JSON_DICT: - contents_add(object->contents, strdup("}")); - break; - default: - ; - } -} -static contents_t *get_content_and_destroy(json_t *object) -{ - contents_t *contents = object->contents; - json_close_object(object); - free(object); - return contents; -} - -json_t *json_dict_new() -{ - json_t *dict = (json_t *)malloc(sizeof(json_t)); - dict->type = JSON_DICT; - dict->contents = contents_new(3); - contents_add(dict->contents, strdup("{")); - return dict; -} - -void json_dict_add(json_t *dict, char *field, json_t *child) -{ - assert(dict->type == JSON_DICT); - - if (dict->contents->num > 1) { - contents_add(dict->contents, strdup(",")); - } - char *field_string; - asprintf(&field_string, "\"%s\":", field); - contents_add(dict->contents, field_string); - contents_t *child_contents = get_content_and_destroy(child); - contents_cat(dict->contents, child_contents); - contents_destruct(child_contents); -} - -json_t *json_array_new() -{ - json_t *array = (json_t *)malloc(sizeof(json_t)); - array->type = JSON_ARRAY; - array->contents = contents_new(3); - contents_add(array->contents, strdup("[")); - return array; -} - -void json_array_add(json_t *array, json_t *child) -{ - assert(array->type == JSON_ARRAY); - - if (array->contents->num > 1) { - contents_add(array->contents, strdup(",")); - } - contents_t *child_contents = get_content_and_destroy(child); - contents_cat(array->contents, child_contents); - contents_destruct(child_contents); -} - -json_t *json_string_new(char *value) -{ - json_t *string = (json_t *)malloc(sizeof(json_t)); - string->type = JSON_STRING; - string->contents = contents_new(1); - - char *new_value; - asprintf(&new_value, "\"%s\"", value); - contents_add(string->contents, new_value); - return string; -} - -json_t *json_int_new(int value) -{ - json_t *integer = (json_t *)malloc(sizeof(json_t)); - integer->type = JSON_INT; - integer->contents = contents_new(1); - - char *new_value; - asprintf(&new_value, "%d", value); - contents_add(integer->contents, new_value); - return integer; -} - -json_t *json_float_new(float value) -{ - json_t *real = (json_t *)malloc(sizeof(json_t)); - real->type = JSON_FLOAT; - real->contents = contents_new(1); - - char *new_value; - asprintf(&new_value, "%f", value); - contents_add(real->contents, new_value); - return real; -} - -void json_write(FILE *file, json_t *object) -{ - json_close_object(object);; - for (int i = 0; i < object->contents->num; i++) { - fprintf(file, "%s", object->contents->strings[i]); - } -} - -void json_free(json_t *object) -{ - for (int i = 0; i < object->contents->num; i++) { - free(object->contents->strings[i]); - } - free(object->contents->strings); - free(object->contents); - free(object); -} - -/* End of JSON functions */ -/******************************************************************************/ - -static char *remove_quote(char *string) -{ - if (string[0] == '\'') - return strndup(string+1, strlen(string)-2); - else - return strndup(string, strlen(string)); -} - -static int handle_link(netloc_physical_link_t *link, json_t *json_links) -{ - //netloc_node_t *src, *dest; - char *src = link->src->physical_id; - char *dest = link->dest->physical_id; - - json_t *json_link = json_dict_new(); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_ID, json_int_new(link->id)); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_SRC, json_string_new(src)); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_SRC_PORT, json_int_new(link->ports[0])); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_DST, json_string_new(dest)); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_DST_PORT, json_int_new(link->ports[1])); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_WIDTH, json_string_new(link->width)); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_SPEED, json_string_new(link->speed)); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_GBITS, json_float_new(link->gbits)); - json_dict_add(json_link, - JSON_DRAW_FILE_LINK_OTHER_WAY, json_int_new(link->other_way_id)); - - json_t *json_partitions = json_array_new(); - - for (unsigned int p = 0; p < netloc_get_num_partitions(link); p++) - { - int partition = netloc_get_partition(link, p); - json_array_add(json_partitions, json_int_new(partition)); - } - json_dict_add(json_link, JSON_DRAW_FILE_LINK_PARTITIONS, json_partitions); - - json_array_add(json_links, json_link); - - return 0; -} - -static int handle_edge(netloc_edge_t *edge, json_t *json_edges) -{ - //netloc_node_t *src, *dest; - char *src = edge->node->physical_id; - char *dest = edge->dest->physical_id; - - json_t *json_edge = json_dict_new(); - - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_ID, json_int_new(edge->id)); - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_SRC, json_string_new(src)); - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_DST, json_string_new(dest)); - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_GBITS, json_float_new(edge->total_gbits)); - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_OTHER_WAY, json_int_new(edge->other_way->id)); - - /* Links */ - json_t *json_links = json_array_new(); - for (unsigned int l = 0; l < netloc_edge_get_num_links(edge); l++) - { - netloc_physical_link_t *link = netloc_edge_get_link(edge, l); - json_array_add(json_links, json_int_new(link->id)); - } - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_LINKS, json_links); - - /* Partition list */ - json_t *json_partitions = json_array_new(); - for (unsigned int p = 0; p < netloc_get_num_partitions(edge); p++) - { - int partition = netloc_get_partition(edge, p); - json_array_add(json_partitions, json_int_new(partition)); - } - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_PARTITIONS, json_partitions); - - /* Subnode edges */ - json_t *json_subedges = json_array_new(); - for (unsigned int s = 0; s < netloc_edge_get_num_subedges(edge); s++) - { - netloc_edge_t *subedge = netloc_edge_get_subedge(edge, s); - json_array_add(json_subedges, json_int_new(subedge->id)); - handle_edge(subedge, json_edges); - } - json_dict_add(json_edge, JSON_DRAW_FILE_EDGE_SUBEDGES, json_subedges); - - json_array_add(json_edges, json_edge); - - return 0; -} - -static int handle_node(netloc_node_t *node, json_t *json_nodes, - json_t *json_edges, int merged) -{ - char *id = node->physical_id; - char *desc = remove_quote(node->description); - char *hostname = node->hostname; - int topoIdx = node->hwlocTopoIdx; - - json_t *json_node = json_dict_new(); - json_dict_add(json_node, JSON_DRAW_FILE_NODE_ID, json_string_new(id)); - json_dict_add(json_node, JSON_DRAW_FILE_NODE_DESC, json_string_new(desc)); - json_dict_add(json_node, JSON_DRAW_FILE_NODE_HOSTNAME, json_string_new(hostname)); - json_dict_add(json_node, JSON_DRAW_FILE_NODE_HWLOCTOPO, json_int_new(topoIdx)); - json_dict_add(json_node, JSON_DRAW_FILE_NODE_MERGED, json_int_new(merged)); - - /* Subnodes */ - json_t *json_subnodes = json_array_new(); - for (unsigned int s = 0; s < netloc_node_get_num_subnodes(node); s++) - { - netloc_node_t *subnode = netloc_node_get_subnode(node, s); - handle_node(subnode, json_nodes, json_edges, 1); - json_array_add(json_subnodes, json_string_new(subnode->physical_id)); - } - json_dict_add(json_node, JSON_DRAW_FILE_NODE_SUBNODES, json_subnodes); - - /* Edges */ - json_t *json_edge_ids = json_array_new(); - netloc_edge_t *edge, *edge_tmp; - netloc_node_iter_edges(node, edge, edge_tmp) { - json_array_add(json_edge_ids, json_int_new(edge->id)); - handle_edge(edge, json_edges); - } - json_dict_add(json_node, JSON_DRAW_FILE_NODE_EDGES, json_edge_ids); - - /* Partitions */ - json_t *json_partitions = json_array_new(); - for (unsigned int p = 0; p < netloc_get_num_partitions(node); p++) - { - int partition = netloc_get_partition(node, p); - json_array_add(json_partitions, json_int_new(partition)); - } - json_dict_add(json_node, JSON_DRAW_FILE_NODE_PARTITIONS, json_partitions); - - if (netloc_node_is_host(node)) { - json_dict_add(json_node, JSON_DRAW_FILE_NODE_TYPE, json_string_new("host")); - } - else if (netloc_node_is_switch(node)) { - json_dict_add(json_node, JSON_DRAW_FILE_NODE_TYPE, json_string_new("switch")); - } - else { - json_dict_add(json_node, JSON_DRAW_FILE_NODE_TYPE, json_string_new("unknown")); - } - - json_array_add(json_nodes, json_node); - - free(desc); - return 0; -} - -static int handle_path(netloc_node_t *node, json_t *json_paths) -{ - char *id = node->physical_id; - - json_t *json_node_paths = json_dict_new(); - json_dict_add(json_node_paths, JSON_DRAW_FILE_PATH_ID, json_string_new(id)); - - /* Paths */ - json_t *json_path_list = json_array_new(); - netloc_path_t *path, *path_tmp; - netloc_node_iter_paths(node, path, path_tmp) { - json_t *json_node_path = json_dict_new(); - json_dict_add(json_node_path, JSON_DRAW_FILE_PATH_ID, - json_string_new(path->dest_id)); - - json_t *json_links = json_array_new(); - netloc_physical_link_t **plink; - netloc_path_iter_links(path,plink) { - json_array_add(json_links, json_int_new((*plink)->id)); - } - json_dict_add(json_node_path, JSON_DRAW_FILE_PATH_LINKS, - json_links); - json_array_add(json_path_list, json_node_path); - } - json_dict_add(json_node_paths, JSON_DRAW_FILE_PATHS, json_path_list); - - json_array_add(json_paths, json_node_paths); - - return 0; -} - -static int handle_partitions(netloc_topology_t *topology, json_t *json_partitions) -{ - char **ppartition; - netloc_topology_iter_partitions(topology, ppartition) { - json_array_add(json_partitions, json_string_new(*ppartition)); - } - return 0; -} - -static int handle_topos(netloc_topology_t *topology, json_t *json_topos) -{ - char **ptopo; - netloc_topology_iter_hwloctopos(topology, ptopo) { - json_array_add(json_topos, json_string_new(*ptopo)); - } - return 0; -} - -static int write_json(netloc_topology_t *topology, FILE *output) -{ - json_t *json_root = json_dict_new(); - - /* Graph type */ - json_dict_add(json_root, JSON_DRAW_FILE_GRAPH_TYPE, json_string_new("tree")); - - /* Nodes */ - json_t *json_nodes = json_array_new(); - json_t *json_edges = json_array_new(); - netloc_node_t *node, *node_tmp; - HASH_ITER(hh, topology->nodes, node, node_tmp) { - handle_node(node, json_nodes, json_edges, 0); - } - json_dict_add(json_root, JSON_DRAW_FILE_NODES, json_nodes); - json_dict_add(json_root, JSON_DRAW_FILE_EDGES, json_edges); - - /* Physical links */ - json_t *json_links = json_array_new(); - netloc_physical_link_t *link, *link_tmp; - HASH_ITER(hh, topology->physical_links, link, link_tmp) { - handle_link(link, json_links); - } - json_dict_add(json_root, JSON_DRAW_FILE_LINKS, json_links); - - /* Paths */ - json_t *json_paths = json_array_new(); - HASH_ITER(hh, topology->nodes, node, node_tmp) { - handle_path(node, json_paths); - } - json_dict_add(json_root, JSON_DRAW_FILE_PATHS, json_paths); - - /* Partitions */ - json_t *json_partitions = json_array_new(); - handle_partitions(topology, json_partitions); - json_dict_add(json_root, JSON_DRAW_FILE_PARTITIONS, json_partitions); - - /* Hwloc topologies */ - json_t *json_topos = json_array_new(); - handle_topos(topology, json_topos); - json_dict_add(json_root, JSON_DRAW_FILE_HWLOCTOPOS, json_topos); - - json_write(output, json_root); - json_free(json_root); - - return 0; -} - -static int netloc_to_json_draw(netloc_topology_t *topology) -{ - int ret; - static FILE *output; - char *node_uri = topology->topopath; - int basename_len = strlen(node_uri)-10; - char *basename = (char *)malloc((basename_len+1)*sizeof(char)); - char *draw; - - netloc_topology_read_hwloc(topology, 0, NULL); - - strncpy(basename, node_uri, basename_len); - basename[basename_len] = '\0'; - - asprintf(&draw, "%s-%s.json", basename, "draw"); - output = fopen(draw, "w"); - free(draw); - if (output == NULL) { - perror("fopen: "); - ret = NETLOC_ERROR; - goto ERROR; - } - - write_json(topology, output); - - ret = NETLOC_SUCCESS; - fclose(output); -ERROR: - free(basename); - - return ret; -} - -static char *read_param(int *argc, char ***argv) -{ - if (!*argc) - return NULL; - - char *ret = **argv; - (*argv)++; - (*argc)--; - - return ret; -} - -void help(char *name, FILE *f) -{ - fprintf(f, "Usage: %s \n", name); -} - -int main(int argc, char **argv) -{ - char *prog_name = basename(argv[0]); - - if (argc != 2) { - help(prog_name, stderr); - return -1; - } - read_param(&argc, &argv); - - char *param; - param = read_param(&argc, &argv); - - char *netlocpath; - if (!strcmp(param, "--help")) { - help(prog_name, stdout); - return 0; - } else { - netlocpath = param; - } - - DIR *netlocdir = opendir(netlocpath); - if (!netlocdir) { - fprintf(stderr, "Error: Cannot open the directory <%s>.\n", netlocpath); - return NETLOC_ERROR; - } - - struct dirent *dir_entry = NULL; - while ((dir_entry = readdir(netlocdir)) != NULL) { - char *topopath; -#ifdef _DIRENT_HAVE_D_TYPE - /* Skip directories if the filesystem returns a useful d_type. - * Otherwise, continue and let the actual opening will fail later. - */ - if( DT_DIR == dir_entry->d_type ) { - continue; - } -#endif - - /* Skip if does not end in .txt extension */ - if( NULL == strstr(dir_entry->d_name, "-nodes.txt") ) { - continue; - } - - asprintf(&topopath, "%s/%s", netlocpath, dir_entry->d_name); - - netloc_topology_t *topology; - topology = netloc_topology_construct(topopath); - if (topology == NULL) { - fprintf(stderr, "Error: netloc_topology_construct failed\n"); - return NETLOC_ERROR; - } - - netloc_edge_reset_uid(); - - netloc_to_json_draw(topology); - - netloc_topology_destruct(topology); - } - closedir(netlocdir); - - return 0; -} - diff -Nru hwloc-2.9.2/utils/netloc/infiniband/Makefile.am hwloc-2.10.0/utils/netloc/infiniband/Makefile.am --- hwloc-2.9.2/utils/netloc/infiniband/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/infiniband/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -# Copyright © 2013 Cisco Systems, Inc. All rights reserved. -# Copyright © 2013 University of Wisconsin-La Crosse. -# All rights reserved. -# Copyright © 2015-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# -bin_SCRIPTS = \ - netloc_ib_gather_raw -CLEANFILES = $(bin_SCRIPTS) - -install-exec-hook: - $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/netloc_ib_gather_raw > $(DESTDIR)$(bindir)/netloc_ib_gather_raw.tmp && mv -f $(DESTDIR)$(bindir)/netloc_ib_gather_raw.tmp $(DESTDIR)$(bindir)/netloc_ib_gather_raw - chmod +x $(DESTDIR)$(bindir)/netloc_ib_gather_raw - -AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - -bin_PROGRAMS = \ - netloc_ib_extract_dats - -netloc_ib_extract_dats_SOURCES = \ - netloc_ib_extract_dats.c - -netloc_ib_extract_dats_LDADD = \ - $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la diff -Nru hwloc-2.9.2/utils/netloc/infiniband/Makefile.in hwloc-2.10.0/utils/netloc/infiniband/Makefile.in --- hwloc-2.9.2/utils/netloc/infiniband/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/infiniband/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,865 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -bin_PROGRAMS = netloc_ib_extract_dats$(EXEEXT) -subdir = utils/netloc/infiniband -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ - $(top_srcdir)/config/hwloc_check_attributes.m4 \ - $(top_srcdir)/config/hwloc_check_vendor.m4 \ - $(top_srcdir)/config/hwloc_check_visibility.m4 \ - $(top_srcdir)/config/hwloc_components.m4 \ - $(top_srcdir)/config/hwloc_internal.m4 \ - $(top_srcdir)/config/hwloc_pkg.m4 \ - $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ - $(top_builddir)/include/hwloc/autogen/config.h -CONFIG_CLEAN_FILES = netloc_ib_gather_raw -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_netloc_ib_extract_dats_OBJECTS = netloc_ib_extract_dats.$(OBJEXT) -netloc_ib_extract_dats_OBJECTS = $(am_netloc_ib_extract_dats_OBJECTS) -netloc_ib_extract_dats_DEPENDENCIES = \ - $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -SCRIPTS = $(bin_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/private/autogen -I$(top_builddir)/include/hwloc/autogen -depcomp = $(SHELL) $(top_srcdir)/./config/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/netloc_ib_extract_dats.Po -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(netloc_ib_extract_dats_SOURCES) -DIST_SOURCES = $(netloc_ib_extract_dats_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(srcdir)/netloc_ib_gather_raw.in \ - $(top_srcdir)/./config/depcomp README -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BUNZIPP = @BUNZIPP@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CONFIGURE_DEPENDENCIES = @CONFIGURE_DEPENDENCIES@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CUDA_VERSION = @CUDA_VERSION@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIFF = @DIFF@ -DLLTOOL = @DLLTOOL@ -DOXYGEN = @DOXYGEN@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EPSTOPDF = @EPSTOPDF@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FIG2DEV = @FIG2DEV@ -FILECMD = @FILECMD@ -GREP = @GREP@ -GS = @GS@ -HWLOC_CAIRO_CFLAGS = @HWLOC_CAIRO_CFLAGS@ -HWLOC_CAIRO_LIBS = @HWLOC_CAIRO_LIBS@ -HWLOC_CFLAGS = @HWLOC_CFLAGS@ -HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ -HWLOC_CUDART_CFLAGS = @HWLOC_CUDART_CFLAGS@ -HWLOC_CUDART_CPPFLAGS = @HWLOC_CUDART_CPPFLAGS@ -HWLOC_CUDART_LDFLAGS = @HWLOC_CUDART_LDFLAGS@ -HWLOC_CUDART_LIBS = @HWLOC_CUDART_LIBS@ -HWLOC_CUDA_CFLAGS = @HWLOC_CUDA_CFLAGS@ -HWLOC_CUDA_CPPFLAGS = @HWLOC_CUDA_CPPFLAGS@ -HWLOC_CUDA_LDFLAGS = @HWLOC_CUDA_LDFLAGS@ -HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ -HWLOC_DARWIN_LDFLAGS = @HWLOC_DARWIN_LDFLAGS@ -HWLOC_DIFF_U = @HWLOC_DIFF_U@ -HWLOC_DIFF_W = @HWLOC_DIFF_W@ -HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ -HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ -HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ -HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ -HWLOC_EMBEDDED_LDFLAGS = @HWLOC_EMBEDDED_LDFLAGS@ -HWLOC_EMBEDDED_LIBS = @HWLOC_EMBEDDED_LIBS@ -HWLOC_GL_LIBS = @HWLOC_GL_LIBS@ -HWLOC_HAVE_LEVELZERO = @HWLOC_HAVE_LEVELZERO@ -HWLOC_HAVE_LIBXML2 = @HWLOC_HAVE_LIBXML2@ -HWLOC_HAVE_LINUX = @HWLOC_HAVE_LINUX@ -HWLOC_HAVE_NVML = @HWLOC_HAVE_NVML@ -HWLOC_HAVE_OPENCL = @HWLOC_HAVE_OPENCL@ -HWLOC_HAVE_RSMI = @HWLOC_HAVE_RSMI@ -HWLOC_HAVE_X86_CPUID = @HWLOC_HAVE_X86_CPUID@ -HWLOC_IBVERBS_LIBS = @HWLOC_IBVERBS_LIBS@ -HWLOC_LDFLAGS = @HWLOC_LDFLAGS@ -HWLOC_LEVELZERO_CFLAGS = @HWLOC_LEVELZERO_CFLAGS@ -HWLOC_LEVELZERO_LIBS = @HWLOC_LEVELZERO_LIBS@ -HWLOC_LIBS = @HWLOC_LIBS@ -HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ -HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ -HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ -HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ -HWLOC_MS_LIB = @HWLOC_MS_LIB@ -HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ -HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ -HWLOC_NUMA_LIBS = @HWLOC_NUMA_LIBS@ -HWLOC_NVML_CPPFLAGS = @HWLOC_NVML_CPPFLAGS@ -HWLOC_NVML_LDFLAGS = @HWLOC_NVML_LDFLAGS@ -HWLOC_NVML_LIBS = @HWLOC_NVML_LIBS@ -HWLOC_OPENCL_CPPFLAGS = @HWLOC_OPENCL_CPPFLAGS@ -HWLOC_OPENCL_LDFLAGS = @HWLOC_OPENCL_LDFLAGS@ -HWLOC_OPENCL_LIBS = @HWLOC_OPENCL_LIBS@ -HWLOC_PCIACCESS_CFLAGS = @HWLOC_PCIACCESS_CFLAGS@ -HWLOC_PCIACCESS_LIBS = @HWLOC_PCIACCESS_LIBS@ -HWLOC_PLUGINS_DIR = @HWLOC_PLUGINS_DIR@ -HWLOC_PLUGINS_PATH = @HWLOC_PLUGINS_PATH@ -HWLOC_PS_LIBS = @HWLOC_PS_LIBS@ -HWLOC_RELEASE_DATE = @HWLOC_RELEASE_DATE@ -HWLOC_REQUIRES = @HWLOC_REQUIRES@ -HWLOC_RSMI_CPPFLAGS = @HWLOC_RSMI_CPPFLAGS@ -HWLOC_RSMI_LDFLAGS = @HWLOC_RSMI_LDFLAGS@ -HWLOC_RSMI_LIBS = @HWLOC_RSMI_LIBS@ -HWLOC_TERMCAP_LIBS = @HWLOC_TERMCAP_LIBS@ -HWLOC_VERSION = @HWLOC_VERSION@ -HWLOC_W3_GENERATOR = @HWLOC_W3_GENERATOR@ -HWLOC_X11_CPPFLAGS = @HWLOC_X11_CPPFLAGS@ -HWLOC_X11_LIBS = @HWLOC_X11_LIBS@ -HWLOC_XML_LOCALIZED = @HWLOC_XML_LOCALIZED@ -HWLOC_runstatedir = @HWLOC_runstatedir@ -HWLOC_top_builddir = @HWLOC_top_builddir@ -HWLOC_top_srcdir = @HWLOC_top_srcdir@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LYNX = @LYNX@ -MAKEINDEX = @MAKEINDEX@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -ROCM_VERSION = @ROCM_VERSION@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -W3M = @W3M@ -XMKMF = @XMKMF@ -XMLLINT = @XMLLINT@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libhwloc_so_name = @libhwloc_so_name@ -libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xz = @xz@ - -# Copyright © 2013 Cisco Systems, Inc. All rights reserved. -# Copyright © 2013 University of Wisconsin-La Crosse. -# All rights reserved. -# Copyright © 2015-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# -bin_SCRIPTS = \ - netloc_ib_gather_raw - -CLEANFILES = $(bin_SCRIPTS) -AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - -netloc_ib_extract_dats_SOURCES = \ - netloc_ib_extract_dats.c - -netloc_ib_extract_dats_LDADD = \ - $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/netloc/infiniband/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign utils/netloc/infiniband/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -netloc_ib_gather_raw: $(top_builddir)/config.status $(srcdir)/netloc_ib_gather_raw.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -netloc_ib_extract_dats$(EXEEXT): $(netloc_ib_extract_dats_OBJECTS) $(netloc_ib_extract_dats_DEPENDENCIES) $(EXTRA_netloc_ib_extract_dats_DEPENDENCIES) - @rm -f netloc_ib_extract_dats$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(netloc_ib_extract_dats_OBJECTS) $(netloc_ib_extract_dats_LDADD) $(LIBS) -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netloc_ib_extract_dats.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/netloc_ib_extract_dats.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-binSCRIPTS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/netloc_ib_extract_dats.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS - -.MAKE: install-am install-exec-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-binSCRIPTS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS - -.PRECIOUS: Makefile - - -install-exec-hook: - $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/netloc_ib_gather_raw > $(DESTDIR)$(bindir)/netloc_ib_gather_raw.tmp && mv -f $(DESTDIR)$(bindir)/netloc_ib_gather_raw.tmp $(DESTDIR)$(bindir)/netloc_ib_gather_raw - chmod +x $(DESTDIR)$(bindir)/netloc_ib_gather_raw - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru hwloc-2.9.2/utils/netloc/infiniband/README hwloc-2.10.0/utils/netloc/infiniband/README --- hwloc-2.9.2/utils/netloc/infiniband/README 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/infiniband/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -Normal way to use this: -* get some hwloc outputs from some nodes (at least enough nodes to make all subnets available) - and store them as .xml in a single directory -* run netloc-ib-gather-raw.pl --hwloc-dir --raw-dir - - If you cannot run the entire script as root, add --sudo to run ib* programs as root. - - If some subnets are not accessible from the local node, they will be skipped. - Add --verbose to see where you could run the same command to discover other subnets. - - If one subnet doesn't work for some reason, use --force-subnet instead of --hwloc-dir. -* make sure netloc_ib_reader and friends are in PATH -* run netloc-ib-extract-dats.pl --raw-dir --out-dir diff -Nru hwloc-2.9.2/utils/netloc/infiniband/netloc_ib_extract_dats.c hwloc-2.10.0/utils/netloc/infiniband/netloc_ib_extract_dats.c --- hwloc-2.9.2/utils/netloc/infiniband/netloc_ib_extract_dats.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/infiniband/netloc_ib_extract_dats.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1120 +0,0 @@ -/* - * Copyright © 2016-2018 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE // for asprintf -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include - -#include // for dirname - -#include -#include -#include -#include -#include -#include -#include - -int global_link_idx = 0; - -typedef struct { - UT_hash_handle hh; /* makes this structure hashable */ - char dest[20]; /* key */ - float total_gbits; - UT_array *physical_link_idx; - int *partitions; -} edge_t; - -typedef struct { - UT_hash_handle hh; /* makes this structure hashable */ - char physical_id[20]; /* key */ - long logical_id; - int type; - char *description; - edge_t *edges; - int main_partition; - char *hostname; - int *partitions; - UT_array *physical_links; -} node_t; -node_t *nodes = NULL; - -typedef struct { - int int_id; // TODO long long - int ports[2]; - node_t *dest; - char *width; - char *speed; - float gbits; - char *description; - int *partitions; - int other_id; - edge_t *parent_edge; - node_t *parent_node; -} physical_link_t; -UT_icd physical_link_icd = {sizeof(physical_link_t), NULL, NULL, NULL }; - -UT_icd partitions_icd = {sizeof(char *), NULL, NULL, NULL }; -UT_array *partitions = NULL; - -const int NODE_TYPE_HOST = 0; -const int NODE_TYPE_SWITH = 1; -const int NODE_TYPE_UNKNOWN = 2; - -/* Route tables */ -typedef struct { - UT_hash_handle hh; /* makes this structure hashable */ - char physical_id[20]; /* key */ - int port; -} route_dest_t; -typedef struct { - UT_hash_handle hh; /* makes this structure hashable */ - char physical_id[20]; /* key */ - route_dest_t *dest; -} route_source_t; -route_source_t *routes = NULL; - -/* Paths tables */ -typedef struct { - UT_hash_handle hh; /* makes this structure hashable */ - char physical_id[20]; /* key */ - node_t *node; - UT_array *links; -} path_dest_t; -typedef struct { - UT_hash_handle hh; /* makes this structure hashable */ - char physical_id[20]; /* key */ - node_t *node; - path_dest_t *dest; -} path_source_t; -path_source_t *paths = NULL; - -int read_routes(char *subnet, char *path, char *route_filename); -int read_discover(char *subnet, char *discover_path, char *filename); -int write_into_file(char *subnet, char *path, char *hwlocpath); - -static void get_match(char *line, int nmatch, regmatch_t pmatch[], char *matches[]) -{ - for (int i = 0; i < nmatch; i++) { - regmatch_t current_match = pmatch[i]; - size_t len = current_match.rm_eo-current_match.rm_so; - matches[i] = (char *)malloc((len+1)*sizeof(char)); - strncpy(matches[i], line+current_match.rm_so, len); - matches[i][len] = '\0'; - } -} - -/* We suppose the description of nodes is like that: ([^ ]*).* - * while \1 is the hostname - */ -static char *node_find_hostname(node_t *node) -{ - char *name = node->description; - int max_size = strlen(name); - char *hostname = (char *)malloc(max_size*sizeof(char)); - - /* Looking for the name of the hostname */ - int i = 0; - if (name[0] == '\'') - name++; - while (i < max_size && - ((name[i] >= 'a' && name[i] <= 'z') || - (name[i] >= '0' && name[i] <= '9') || - (name[i] == '-'))) { - hostname[i] = name[i]; - i++; - } - hostname[i++] = '\0'; - char *old_hostname = hostname; - hostname = realloc(hostname, i*sizeof(char)); - if (!hostname) { - fprintf(stderr, "Oups: cannot reallocate memory\n"); - hostname = old_hostname; - } - return hostname; -} - -node_t *get_node(node_t **nodes, char *type, char *lid, - char *guid, char *subnet, char *desc) -{ - node_t *node; - char *id; - - asprintf(&id, "%.4s:%.4s:%.4s:%.4s", - guid, guid+4, guid+8, guid+12); - - // TODO check guid format - HASH_FIND_STR(*nodes, id, node); /* id already in the hash? */ - if (!node) { - size_t size = sizeof(*node)+sizeof(char)*(strlen(desc)+1); - node = (node_t *) malloc(size); - sprintf(node->physical_id, "%s", id); - - node->logical_id = atol(lid); - if (!strcmp(type, "CA")) - node->type = NODE_TYPE_HOST; - else if (!strcmp(type, "SW")) - node->type = NODE_TYPE_SWITH; - else - node->type = NODE_TYPE_UNKNOWN; - node->edges = NULL; - node->description = strdup(desc); - node->hostname = node_find_hostname(node); - node->main_partition = -1; - node->partitions = NULL; - - utarray_new(node->physical_links, &physical_link_icd); - - HASH_ADD_STR(*nodes, physical_id, node); /* guid: name of key field */ - } - free(id); - - return node; -} - -static int find_other_physical_link(physical_link_t *link) -{ - node_t *dest = link->dest; - unsigned int dest_port = link->ports[1]; - - physical_link_t *other_link = (physical_link_t *) - utarray_eltptr(dest->physical_links, dest_port-1); - - return other_link->int_id; -} - -static float compute_gbits(char *speed, char *width) -{ - float rate; - float encoding; - float gb_per_x; - int x; - - if (strcmp(speed, "SDR")) { - rate = 2.5; - encoding = 8.0/10; - } else if (strcmp(speed, "DDR")) { - rate = 5; - encoding = 8.0/10; - } else if (strcmp(speed, "QDR")) { - rate = 10; - encoding = 8.0/10; - } else if (strcmp(speed, "FDR")) { - rate = 14.0625; - encoding = 64.0/66; - } else if (strcmp(speed, "FDR10")) { - rate = 10; - encoding = 64.0/66; - } else if (strcmp(speed, "EDR")) { - rate = 25; - encoding = 64.0/66; - } else { - return 1; - } - gb_per_x = rate*encoding; - - regex_t width_re; - regcomp(&width_re, "([[:digit:]]*)x", REG_EXTENDED); - if (!regexec(&width_re, width, (size_t)0, NULL, 0)) { - x = atoi(width); - } else { - x = 0.0; - } - - regfree(&width_re); - - return x*gb_per_x; -} - -int build_paths(void) -{ - node_t *node_src, *node_dest, *node_tmp1, *node_tmp2; - HASH_ITER(hh, nodes, node_src, node_tmp1) { - if (node_src->type != NODE_TYPE_HOST) - continue; - char *id_src = node_src->physical_id; - - path_source_t *path = (path_source_t *) - malloc(sizeof(path_source_t)); - sprintf(path->physical_id, "%s", id_src); - path->node = node_src; - path->dest = NULL; - HASH_ADD_STR(paths, physical_id, path); - - HASH_ITER(hh, nodes, node_dest, node_tmp2) { - if (node_dest->type != NODE_TYPE_HOST) - continue; - - if (node_dest == node_src) { - continue; - } - - UT_array *found_links = NULL; - utarray_new(found_links, &ut_ptr_icd); - int completed = 1; - - char *id_dest = node_dest->physical_id; - - physical_link_t *link = (physical_link_t *) - utarray_eltptr(node_src->physical_links, 0); - utarray_push_back(found_links, &link); - - node_t *node_cur = link->dest; - while (node_cur != node_dest) { - route_source_t *route_source; - route_dest_t *route_dest; - char *id_cur = node_cur->physical_id; - HASH_FIND_STR(routes, id_cur, route_source); - if (!route_source) { - completed = 0; - break; - } - HASH_FIND_STR(route_source->dest, id_dest, route_dest); - if (!route_dest) { - completed = 0; - break; - } - - unsigned int port = route_dest->port; - link = (physical_link_t *) - utarray_eltptr(node_cur->physical_links, port-1); - utarray_push_back(found_links, &link); - node_cur = link->dest; - } - - if (completed) { - path_dest_t *path_dest = (path_dest_t *) - malloc(sizeof(path_dest_t)); - sprintf(path_dest->physical_id, "%s", id_dest); - path_dest->node = node_dest; - path_dest->links = found_links; - HASH_ADD_STR(path->dest, physical_id, path_dest); - } else { - utarray_free(found_links); - } - } - } - return 0; -} - -/* We suppose the hostname of nodes is like that: ([a-z]*).* - * while \1 is the name of the partition - */ -static char *node_find_partition_name(node_t *node) -{ - char *name; - int max_size; - char *partition; - - max_size = strlen(node->hostname); - partition = (char *)malloc((max_size+1)*sizeof(char)); - name = node->hostname; - - /* Looking for the name of the partition */ - int i = 0; - while (i < max_size && (name[i] >= 'a' && name[i] <= 'z')) { - partition[i] = name[i]; - i++; - } - partition[i++] = '\0'; - - char *old_partition = partition; - partition = realloc(partition, i*sizeof(char)); - if (!partition) { - fprintf(stderr, "Oups: cannot reallocate memory\n"); - partition = old_partition; - } - return partition; -} - - -int netloc_topology_find_partitions(void) -{ - int ret = 0; - int num_nodes; - char **partition_names; - node_t **hosts; - - num_nodes = HASH_COUNT(nodes); - partition_names = (char **)malloc(num_nodes*sizeof(char *)); - hosts = (node_t **)malloc(num_nodes*sizeof(node_t *)); - - /* Save all the partition names */ - int n = 0; - node_t *node, *node_tmp; - HASH_ITER(hh, nodes, node, node_tmp) { - if (node->type != NODE_TYPE_HOST) - continue; - partition_names[n] = node_find_partition_name(node); - hosts[n] = node; - n++; - } - - /* Associate the field partition in the nodes to the correct partition - * index - */ - int num_hosts = n; - int num_partitions = 0; - for (int n1 = 0; n1 < num_hosts; n1++) { - if (!partition_names[n1]) - continue; - partition_names[num_partitions] = partition_names[n1]; - hosts[n1]->main_partition = num_partitions; - - for (int n2 = n1+1; n2 < num_hosts; n2++) { - if (!partition_names[n2]) - continue; - - if (!strcmp(partition_names[n1], partition_names[n2])) { - free(partition_names[n2]); - partition_names[n2] = NULL; - hosts[n2]->main_partition = num_partitions; - } - } - num_partitions++; - } - - printf("%d partitions found\n", num_partitions); - utarray_new(partitions, &partitions_icd); - utarray_reserve(partitions, num_partitions); - for (int p = 0; p < num_partitions; p++) { - printf("\t'%s'\n", partition_names[p]); - utarray_push_back(partitions, partition_names+p); - } - free(partition_names); - free(hosts); - - return ret; -} - -int netloc_topology_set_partitions(void) -{ - /* Find the main partition for each node */ - netloc_topology_find_partitions(); - - node_t *node, *node_tmp; - HASH_ITER(hh, nodes, node, node_tmp) { - node->partitions = (int *) - calloc(utarray_len(partitions), sizeof(int)); - if (node->main_partition != -1) - node->partitions[node->main_partition] = 1; - - edge_t *edge, *edge_tmp; - HASH_ITER(hh, node->edges, edge, edge_tmp) { - edge->partitions = (int *) - calloc(utarray_len(partitions), sizeof(int)); - } - } - - /* Set the partitions for the physical links considering if there is in a - * path between two nodes of a partition */ - path_source_t *path_src, *path_src_tmp; - HASH_ITER(hh, paths, path_src, path_src_tmp) { - node_t *node_src = path_src->node; - int partition = node_src->main_partition; - path_dest_t *path_dest, *path_dest_tmp; - HASH_ITER(hh, path_src->dest, path_dest, path_dest_tmp) { - node_t *node_dest = path_dest->node; - if (node_dest->main_partition != partition) - continue; - - for (unsigned int l = 0; l < utarray_len(path_dest->links); l++) { - physical_link_t *link = *(physical_link_t **) - utarray_eltptr(path_dest->links, l); - if (!link->partitions) { - link->partitions = (int *) - calloc(utarray_len(partitions), sizeof(int)); - } - link->partitions[partition] = 1; - link->parent_node->partitions[partition] = 1; - link->parent_edge->partitions[partition] = 1; - } - } - } - return 0; -} - -void help(char *name, FILE *f) -{ - fprintf(f, "Usage: %s " - "[--hwloc-dir ]\n" - "\thwloc-dir can be an absolute path " - "or a relative path from out-dir\n", name); -} - -int main(int argc, char **argv) -{ - DIR *indir, *outdir; - char *prog_name = basename(argv[0]); - char *inpath = NULL, *outpath = NULL, *hwlocpath = NULL; - - if (argc != 2 && argc != 3 && argc != 5) { - goto error_param; - } - argc--; argv++; - - if (!strcmp(*argv, "--help")) { - help(prog_name, stdout); - return 0; - } - - inpath = *argv; - argc--; argv++; - - if (!argc) - goto error_param; - outpath = *argv; - argc--; argv++; - - while (argc > 0) { - if (!strcmp(*argv, "--hwloc-dir")) { - argc--; argv++; - if (!argc) - goto error_param; - hwlocpath = *argv; - } else if (!strcmp(*argv, "--help")) { - help(prog_name, stdout); - return 0; - } else { - goto error_param; - } - argc--; - argv++; - } - - if (!outpath || !inpath) { - goto error_param; - } - - indir = opendir(inpath); - if (!indir) { - fprintf(stderr, "Couldn't open input directory: \"%s\"\n", inpath); - perror("opendir"); - return 2; - } - - outdir = opendir(outpath); - if (!outdir) { - fprintf(stderr, "Couldn't open output directory: \"%s\"\n", outpath); - perror("opendir"); - closedir(outdir); - return 2; - } - - if (hwlocpath) { - char *realpath; - if (hwlocpath[0] != '/') { - asprintf(&realpath, "%s/%s", outpath, hwlocpath); - } else { - realpath = strdup(hwlocpath); - } - - DIR *hwlocdir = opendir(realpath); - if (!hwlocdir) { - fprintf(stderr, "Couldn't open hwloc directory: \"%s\"\n", realpath); - perror("opendir"); - closedir(indir); - closedir(outdir); - free(realpath); - return 2; - } - free(realpath); - closedir(hwlocdir); - } - - regex_t subnet_regexp; - regcomp(&subnet_regexp, "^ib-subnet-([0-9a-fA-F:]{19}).txt$", REG_EXTENDED); - struct dirent *entry; - while ((entry = readdir(indir))) { - nodes = NULL; - int subnet_found; - char *filename = entry->d_name; - - subnet_found = !(regexec(&subnet_regexp, filename, 0, NULL, 0)); - if (subnet_found) { - global_link_idx = 0; - char *discover_filename; - char *route_filename; - char *subnet; - asprintf(&subnet, "%.19s", filename+10); - - discover_filename = filename; - read_discover(subnet, inpath, discover_filename); - - asprintf(&route_filename, "%s/ibroutes-%s", inpath, subnet); - struct stat s; - int err = stat(route_filename, &s); - if (-1 == err) { - if (errno == ENOENT) { - printf("No route directory found for subnet %s\n", subnet); - } else { - perror("stat"); - exit(1); - } - } else { - if (S_ISDIR(s.st_mode)) { - char *route_filename; - asprintf(&route_filename, "ibroutes-%s", subnet); - read_routes(subnet, inpath, route_filename); - free(route_filename); - } else { - printf("No route directory found for subnet %s\n", subnet); - } - } - free(route_filename); - - build_paths(); - netloc_topology_set_partitions(); - - write_into_file(subnet, outpath, hwlocpath); - - /* Free node hash table */ - node_t *node, *node_tmp; - HASH_ITER(hh, nodes, node, node_tmp) { - HASH_DEL(nodes, node); - - /* Free nodes */ - free(node->description); - - /* Edges */ - edge_t *edge, *edge_tmp; - HASH_ITER(hh, node->edges, edge, edge_tmp) { - HASH_DEL(node->edges, edge); - utarray_free(edge->physical_link_idx); - free(edge->partitions); - free(edge); - } - - free(node->hostname); - free(node->partitions); - - /* Physical links */ - for (unsigned int l = 0; l < utarray_len(node->physical_links); l++) { - physical_link_t *link = (physical_link_t *) - utarray_eltptr(node->physical_links, l); - free(link->width); - free(link->speed); - free(link->description); - free(link->partitions); - } - utarray_free(node->physical_links); - - free(node); - } - - /* Free Partitions */ - for (char **ppartition = (char **)utarray_front(partitions); - ppartition != NULL; - ppartition = (char **)utarray_next(partitions, ppartition)) { - free(*ppartition); - } - utarray_free(partitions); - - /* Free Routes */ - route_source_t *route, *route_tmp; - HASH_ITER(hh, routes, route, route_tmp) { - HASH_DEL(routes, route); - - route_dest_t *routed, *routed_tmp; - HASH_ITER(hh, route->dest, routed, routed_tmp) { - HASH_DEL(route->dest, routed); - free(routed); - } - free(route); - } - - /* Free Paths */ - path_source_t *path, *path_tmp; - HASH_ITER(hh, paths, path, path_tmp) { - HASH_DEL(paths, path); - - path_dest_t *pathd, *pathd_tmp; - HASH_ITER(hh, path->dest, pathd, pathd_tmp) { - HASH_DEL(path->dest, pathd); - utarray_free(pathd->links); - free(pathd); - } - free(path); - } - - free(subnet); - } - } - regfree(&subnet_regexp); - closedir(indir); - closedir(outdir); - - return 0; - -error_param: - fprintf(stderr, "Wrong parameters\n"); - help(prog_name, stderr); - return 1; -} - -int read_discover(char *subnet, char *path, char *filename) -{ - char *line = NULL; - size_t size = 0; - char *discover_path; - FILE *discover_file; - - asprintf(&discover_path, "%s/%s", path, filename); - discover_file = fopen(discover_path, "r"); - free(discover_path); - - if (!discover_file) { - perror("fopen"); - exit(-1); - } - - regex_t dr_re; - regcomp(&dr_re, "^DR", REG_EXTENDED); - - regex_t link_re; - regcomp(&link_re, "^" - "(CA|SW)[[:space:]]+" // Source type - "([[:digit:]]+)[[:space:]]+" // Source lid - "([[:digit:]]+)[[:space:]]+" // Source port id - "0x([0-9a-f]{16})[[:space:]]+" // Source guid - "([[:digit:]]+x)[[:space:]]" // Connection width - "([^[:space:]]*)[[:space:]]+" // Connection speed - "-[[:space:]]+" // Dash seperator - "(CA|SW)[[:space:]]+" // Dest type - "([[:digit:]]+)[[:space:]]+" // Dest lid - "([[:digit:]]+)[[:space:]]+" // Dest port id - "0x([0-9a-f]{16})[[:space:]]+" // Dest guid - "\\([[:space:]]*(.*)[[:space:]]*\\)" // Description - , - REG_EXTENDED); - - regex_t nolink_re; - regcomp(&nolink_re, "^" - "(CA|SW)[[:space:]]+" // Source type - "([[:digit:]]+)[[:space:]]+" // Source lid - "([[:digit:]]+)[[:space:]]+" // Source port id - "0x([0-9a-f]{16})[[:space:]]+" // Source guid - , - REG_EXTENDED); - - int read; - errno = 0; /* getline can return -1 even if no error (EOF) */ - while ((read = getline(&line, &size, discover_file)) > 0) { - const int link_nfields = 12; - const int nolink_nfields = 7; - const int max_nfields = 12; - regmatch_t pmatch[max_nfields]; - char *matches[max_nfields]; - char *src_type; - char *src_lid; - char *src_port_id; - char *src_guid; - char *width; - char *speed; - char *dest_type; - char *dest_lid; - char *dest_port_id; - char *dest_guid; - char *link_desc; - char *src_desc = NULL; - char *dest_desc = NULL; - int have_peer; - - if (!regexec(&dr_re, line, (size_t)0, NULL, 0)) { - /* DR line */ - continue; - } - else if (!regexec(&link_re, line, (size_t)link_nfields, pmatch, 0)) { - /* peer associated: port is active */ - have_peer = 1; - get_match(line, link_nfields, pmatch, matches); - src_type = matches[ 1]; - src_lid = matches[ 2]; - src_port_id = matches[ 3]; - src_guid = matches[ 4]; - width = matches[ 5]; - speed = matches[ 6]; - dest_type = matches[ 7]; - dest_lid = matches[ 8]; - dest_port_id = matches[ 9]; - dest_guid = matches[10]; - link_desc = matches[11]; - free(matches[0]); - - /* Analyse description */ - regex_t desc_re; - regcomp(&desc_re, "(.*)" " - " "(.*)", REG_EXTENDED); - if (!regexec(&desc_re, link_desc, (size_t)3, pmatch, 0)) { - get_match(link_desc, 3, pmatch, matches); - src_desc = matches[1]; - dest_desc = matches[2]; - free(matches[0]); - } - else { - src_desc = (char *)calloc(1, sizeof(char)); - dest_desc = (char *)calloc(1, sizeof(char)); - } - regfree(&desc_re); - - } - else if (!regexec(&nolink_re, line, (size_t)nolink_nfields, pmatch, 0)) { - /* no peer associated: port is not active */ - have_peer = 0; - get_match(line, nolink_nfields, pmatch, matches); - src_type = matches[ 1]; - src_lid = matches[ 2]; - src_port_id = matches[ 3]; - src_guid = matches[ 4]; - width = matches[ 5]; - speed = matches[ 6]; - free(matches[0]); - } - else { - printf("Warning: line not recognized: \n\t%s\n", line); - continue; - } - - /* Compute gbits */ - float gbits = compute_gbits(speed, width); - - /* Add the link to the edge list */ - if (have_peer) { - /* Get the source node */ - node_t *src_node = - get_node(&nodes, src_type, src_lid, src_guid, subnet, src_desc); - - node_t *dest_node = - get_node(&nodes, dest_type, dest_lid, dest_guid, subnet, dest_desc); - - edge_t *edge; - HASH_FIND_STR(src_node->edges, dest_node->physical_id, edge); - /* Creation of the edge */ - if (!edge) { - edge = (edge_t *) malloc(sizeof(edge_t)); - strcpy(edge->dest, dest_node->physical_id); - edge->total_gbits = 0; - edge->partitions = NULL; - utarray_new(edge->physical_link_idx, &ut_int_icd); - HASH_ADD_STR(src_node->edges, dest, edge); - } - - /* Creation of the physical link */ - physical_link_t link[1]; - link->int_id = global_link_idx++; - link->ports[0] = atoi(src_port_id); - link->ports[1] = atoi(dest_port_id); - link->width = strdup(width); - link->speed = strdup(speed); - link->dest = dest_node; - link->gbits = gbits; - edge->total_gbits += gbits; - link->description = strdup(link_desc); - link->partitions = NULL; - link->parent_edge = edge; - link->parent_node = src_node; - link->other_id = -1; - - unsigned int port_idx = link->ports[0]-1; - /* NB: there is no function to set a specific index */ - if (port_idx+1 > utarray_len(src_node->physical_links)) { - utarray_insert(src_node->physical_links, link, port_idx); - } else { - physical_link_t *dest_link = (physical_link_t *) - utarray_eltptr(src_node->physical_links, port_idx); - memcpy(dest_link, link, sizeof(physical_link_t)); - } - - utarray_push_back(edge->physical_link_idx, &port_idx); - - free(src_desc); - free(dest_desc); - free(dest_type); - free(dest_lid); - free(dest_port_id); - free(dest_guid); - free(link_desc); - } - - free(src_type); - free(src_lid); - free(src_port_id); - free(src_guid); - free(width); - free(speed); - } - - int failed = 0; - if (read == -1 && errno) { - perror("getline:"); - failed = 1; - } - - free(line); - regfree(&dr_re); - regfree(&link_re); - regfree(&nolink_re); - fclose(discover_file); - - if (failed) - exit(-1); - - - /* Find the link in the other way */ - node_t *node, *node_tmp; - HASH_ITER(hh, nodes, node, node_tmp) { - unsigned int num_links = utarray_len(node->physical_links); - for (unsigned int i = 0; i < num_links; i++) { - physical_link_t *link = (physical_link_t *) - utarray_eltptr(node->physical_links, i); - if (!link->dest) - continue; - link->other_id = find_other_physical_link(link); - } - } - - return 0; -} - -char *partition_list_to_string(int *partition_list) -{ - if (!partition_list) - return strdup(""); - - int first = 1; - int offset = 0; - int num_partitions = utarray_len(partitions); - char tmp[20]; - int max_length = num_partitions*(sprintf(tmp, "%d", num_partitions)+1)+1; - - char *string = (char *)malloc(max_length*sizeof(char)); - string[0] = '\0'; - for (int p = 0; p < num_partitions; p++) { - if (partition_list[p] != 0) { - if (!first) - offset += sprintf(string+offset, ":"); - offset += sprintf(string+offset, "%d", p); - first = 0; - } - } - return string; -} - -int write_into_file(char *subnet, char *path, char *hwlocpath) -{ - char *output_path; - asprintf(&output_path, "%s/IB-%s-nodes.txt", path, subnet); - FILE *output = fopen(output_path, "w"); - - if (!output) { - perror("fopen"); - printf("Wrong output_path: %s\n", output_path); - exit(-1); - } - free(output_path); - - fprintf(output, "%d\n", NETLOCFILE_VERSION); - fprintf(output, "%s\n", subnet); - fprintf(output, "%s\n", hwlocpath? hwlocpath: ""); - - /* Write nodes into file */ - fprintf(output, "%d\n", HASH_COUNT(nodes)); - node_t *node, *node_tmp; - HASH_ITER(hh, nodes, node, node_tmp) { - fprintf(output, "%s,", node->physical_id); - fprintf(output, "%ld,", node->logical_id); - fprintf(output, "%d,", node->type); - char *partition_str = partition_list_to_string(node->partitions); - fprintf(output, "%s,", partition_str); - free(partition_str); - fprintf(output, "%s,", node->description); - fprintf(output, "%s", node->hostname); - fprintf(output, "\n"); - } - - /* Write edges into file */ - HASH_ITER(hh, nodes, node, node_tmp) { - edge_t *edge, *edge_tmp; - fprintf(output, "%s", node->physical_id); - HASH_ITER(hh, node->edges, edge, edge_tmp) { - unsigned int num_links = utarray_len(edge->physical_link_idx); - fprintf(output, ",%s,", edge->dest); - fprintf(output, "%f,", edge->total_gbits); - char *partition_str = partition_list_to_string(edge->partitions); - fprintf(output, "%s,", partition_str); - free(partition_str); - fprintf(output, "%u,", num_links); - for (unsigned int l = 0; l < num_links; l++) { - unsigned int link_idx = *(unsigned int *) - utarray_eltptr(edge->physical_link_idx, l); - physical_link_t *link = (physical_link_t *) - utarray_eltptr(node->physical_links, link_idx); - fprintf(output, "%d,", link->int_id); - fprintf(output, "%d,", link->ports[0]); - fprintf(output, "%d,", link->ports[1]); - fprintf(output, "%s,", link->width); - fprintf(output, "%s,", link->speed); - fprintf(output, "%f,", link->gbits); - fprintf(output, "%s,", link->description); - fprintf(output, "%d,", link->other_id); - char *partition_str = partition_list_to_string(link->partitions); - fprintf(output, "%s", partition_str); - free(partition_str); - fprintf(output, "%s", l == num_links-1 ? "": ","); - } - } - fprintf(output, "\n"); - } - - /* Write partitions into file */ - for (char **ppartition = (char **)utarray_front(partitions); - ppartition != NULL; - ppartition = (char **)utarray_next(partitions, ppartition)) - fprintf(output, "%s%s", *ppartition, - utarray_next(partitions, ppartition)? ",": ""); - fprintf(output, "\n"); - - /* Write paths into file */ - path_source_t *path_src, *path_src_tmp; - HASH_ITER(hh, paths, path_src, path_src_tmp) { - node_t *node_src = path_src->node; - path_dest_t *path_dest, *path_dest_tmp; - HASH_ITER(hh, path_src->dest, path_dest, path_dest_tmp) { - node_t *node_dest = path_dest->node; - fprintf(output, "%s,%s", - node_src->physical_id, node_dest->physical_id); - for (unsigned int l = 0; l < utarray_len(path_dest->links); l++) { - physical_link_t *link = *(physical_link_t **) - utarray_eltptr(path_dest->links, l); - fprintf(output, ",%d", link->int_id); - } - fprintf(output, "\n"); - } - } - - fclose(output); - - return 0; -} - -int read_routes(char *subnet, char *path, char *route_dirname) -{ - char *route_path; - DIR *dir; - - asprintf(&route_path, "%s/%s", path, route_dirname); - dir = opendir(route_path); - - printf("Read subnet: %s\n", subnet); - - if (dir != NULL) { - char *line = NULL; - size_t size = 0; - regex_t route_filename_regexp; - regcomp(&route_filename_regexp, "^ibroute-[0-9a-fA-F:]{19}-([0-9]*).txt$", REG_EXTENDED); - struct dirent *entry; - while ((entry = readdir(dir))) { - char *filename = entry->d_name; - - if (!(regexec(&route_filename_regexp, filename, 0, NULL, 0))) { - char *route_filename; - asprintf(&route_filename, "%s/%s", route_path, filename); - FILE *route_file = fopen(route_filename, "r"); - - if (!route_file) { - perror("fopen"); - exit(-1); - } - - free(route_filename); - - regex_t header_re; - regcomp(&header_re, "^Unicast lids.*" - "guid[[:space:]]+0x([0-9a-f]{16}).*:", REG_EXTENDED); - - regex_t route_re; - regcomp(&route_re, "^" - "0x([0-9a-f]+)[[:space:]]+" // Dest lid - "([[:digit:]]+)[[:space:]]+" // Port id - ":[[:space:]]+[(]" // Separator - "(Channel Adapter|Switch)[[:space:]]+" // Type - "portguid 0x([0-9a-f]{16}):" // Dest guid - , - REG_EXTENDED); - - int read; - - route_source_t *route = NULL; - while ((read = getline(&line, &size, route_file)) > 0) { - regmatch_t pmatch[5]; - char *matches[5]; - int port; - char dest_guid[20]; - - if (!regexec(&header_re, line, (size_t)2, pmatch, 0)) { - char guid[20]; - get_match(line, 2, pmatch, matches); - sprintf(guid, "%.4s:%.4s:%.4s:%.4s", - matches[1], matches[1]+4, matches[1]+8, matches[1]+12); - for (int m = 0; m < 2; m++) { - free(matches[m]); - } - - HASH_FIND_STR(routes, guid, route); - if (!route) { - route = (route_source_t *) malloc(sizeof(route_source_t)); - sprintf(route->physical_id, "%s", guid); - route->dest = NULL; - HASH_ADD_STR(routes, physical_id, route); - } - } - else if (!regexec(&route_re, line, (size_t)5, pmatch, 0)) { - if (!route) { - fprintf(stderr, "Malformed route file %s\n", filename); - exit(-1); - } - route_dest_t *route_dest; - get_match(line, 5, pmatch, matches); - port = atoi(matches[2]); - sprintf(dest_guid, "%.4s:%.4s:%.4s:%.4s", - matches[4], matches[4]+4, matches[4]+8, matches[4]+12); - for (int m = 0; m < 5; m++) { - free(matches[m]); - } - - route_dest = (route_dest_t *) malloc(sizeof(route_dest_t)); - sprintf(route_dest->physical_id, "%s", dest_guid); - route_dest->port = port; - HASH_ADD_STR(route->dest, physical_id, route_dest); - } - } - fclose(route_file); - regfree(&header_re); - regfree(&route_re); - } - } - free(line); - regfree(&route_filename_regexp); - } - - - free(route_path); - closedir(dir); - - return 0; -} - diff -Nru hwloc-2.9.2/utils/netloc/infiniband/netloc_ib_gather_raw.in hwloc-2.10.0/utils/netloc/infiniband/netloc_ib_gather_raw.in --- hwloc-2.9.2/utils/netloc/infiniband/netloc_ib_gather_raw.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/infiniband/netloc_ib_gather_raw.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,477 +0,0 @@ -#!/usr/bin/env perl - -# -# Copyright © 2013-2017 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - -use strict; - -use Getopt::Long; - -my $HWLOC_top_builddir = "@HWLOC_top_builddir@"; -my $prefix = "@prefix@"; -my $exec_prefix = "@exec_prefix@"; -my $bindir = "@bindir@"; -# this will be changed into $bindir/... during make install -my $locallstopo = "$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics"; - -my $hwlocdir = undef; -my $outdir = undef; -my @forcesubnets; -my $needsudo = 0; -my $ibnetdiscover = "/usr/sbin/ibnetdiscover"; -my $ibroute = "/usr/sbin/ibroute"; -my $verbose = 0; -my $force = 0; -my $dryrun = 0; -my $ignoreerrors = 0; -my $help = 0; -my $sleep = 0; - -my $sleepcount = 0; -sub sleep_between_probes { - my $indent = shift; - if ($sleep) { - print $indent."... Sleeping $sleep seconds between probes ...\n" unless $sleepcount; - sleep $sleep if $sleepcount; - $sleepcount++; - } -} - -&Getopt::Long::Configure("bundling"); -my $ok = Getopt::Long::GetOptions( - "hwloc-dir=s" => \$hwlocdir, - "force-subnet=s" => \@forcesubnets, - "sudo" => \$needsudo, - "ibnetdiscover=s" => \$ibnetdiscover, - "ibroute=s" => \$ibroute, - "sleep=i" => \$sleep, - "ignore-errors" => \$ignoreerrors, - "verbose|v" => \$verbose, - "force|f" => \$force, - "dry-run" => \$dryrun, - "help|h" => \$help - ); - -if ($help or !$ok or !defined $ARGV[0]) { - print "$0 [options] \n"; - print " Dumps topology information to /ib-raw/\n"; - print " Subnets are guessed from the /hwloc/ directory where\n"; - print " the hwloc XML exports of some nodes are stored.\n"; - print "Options:\n"; - print " --sudo\n"; - print " Pass sudo to internal ibnetdiscover and ibroute invocations.\n"; - print " Useful when the entire script cannot run as root.\n"; - print " --hwloc-dir \n"; - print " Use instead of /hwloc/ for hwloc XML exports.\n"; - print " --force-subnet [:]: to force the discovery\n"; - print " Do not guess subnets from hwloc XML exports.\n"; - print " Force discovery on local board port \n"; - print " and optionally force the subnet id \n"; - print " instead of reading it from the first GID.\n"; - print " Examples: --force-subnet mlx4_0:1\n"; - print " --force-subnet fe80:0000:0000:0000:mlx4_0:1\n"; - print " --ibnetdiscover /path/to/ibnetdiscover\n"; - print " --ibroute /path/to/ibroute\n"; - print " Specify exact location of programs. Default is /usr/bin/\n"; - print " --sleep \n"; - print " Sleep for seconds between invocations of programs probing the network\n"; - print " --ignore-errors\n"; - print " Ignore errors from ibnetdiscover and ibroute, assume their outputs are ok\n"; - print " --force -f\n"; - print " Always rediscover to overwrite existing files without asking\n"; - print " --verbose -v\n"; - print " Add verbose messages\n"; - print " --dry-run\n"; - print " Do not actually run programs or modify anything\n"; - print " --help -h\n"; - print " Show this help\n"; - exit(1); -} - -my $outdir = $ARGV[0]; - -mkdir $outdir unless $dryrun; -die "$outdir isn't a directory\n" unless -d $outdir; -mkdir "$outdir/ib-raw" unless $dryrun; -die "$outdir/ib-raw isn't a directory\n" unless -d "$outdir/ib-raw"; - -my $sudo = $needsudo ? "sudo" : ""; - -if (`id -u` ne 0 and !$sudo and !$dryrun) { - print "WARNING: Not running as root.\n"; -} - -# subnets that will be discovered locally -my %subnets_todiscover; - -######################################### -# Read forced subnets -if (@forcesubnets) { - print "Enforcing list of subnets to discover:\n"; - foreach my $subnetstring (@forcesubnets) { - if ($subnetstring =~ /^([0-9a-fA-F:]{19}):([0-9a-z_-]+):([0-9]+)$/) { - my $subnet = $1; - my $boardname = $2; - my $portnum = $3; - print " Subnet $subnet from local board $boardname port $portnum.\n"; - $subnets_todiscover{$subnet}->{localboardname} = $boardname; - $subnets_todiscover{$subnet}->{localportnum} = $portnum; - - } elsif ($subnetstring =~ /^([0-9a-z_-]+):([0-9]+)$/) { - my $boardname = $1; - my $portnum = $2; - my $subnet; - print " Unknown subnet from local board $boardname port $portnum.\n"; - my $filename = "/sys/class/infiniband/$boardname/ports/$portnum/gids/0"; - if (open FILE, $filename) { - my $line = ; - if ($line =~ /^([0-9a-fA-F:]{19}):([0-9a-fA-F:]{19})$/) { - $subnet = $1 - } - close FILE; - } - if (defined $subnet) { - print " Found subnet $subnet from first GID.\n"; - $subnets_todiscover{$subnet}->{localboardname} = $boardname; - $subnets_todiscover{$subnet}->{localportnum} = $portnum; - } else { - print " Couldn't read subnet from GID $filename, ignoring.\n"; - } - - } else { - print " Cannot parse --force-subnet $subnetstring, ignoring.\n"; - } - } - print "\n"; - -} else { - ######################################### - # Guess subnets from hwloc - if (!defined $hwlocdir) { - $hwlocdir = "${outdir}/hwloc"; - print "Using $hwlocdir as hwloc lstopo XML directory.\n\n"; - } - - mkdir $hwlocdir unless $dryrun; - die "$hwlocdir isn't a directory\n" unless -d $hwlocdir; - - # at least get the local hwloc XML - my $hostname = `hostname`; - chomp $hostname; - my $lstopooutput = "$hwlocdir/${hostname}.xml"; - if (!-f $lstopooutput) { - print "Exporting local node hwloc XML...\n"; - print " Running lstopo-no-graphics...\n"; - my $cmd = "$locallstopo -f $lstopooutput"; - if ($dryrun) { - print " NOT running $cmd\n" if $verbose; - } else { - my $ret = system "$cmd" ; - if ($ret and !$ignoreerrors) { - print " Failed (exit code $ret).\n"; - } - } - print "\n"; - } - - # $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{$gidnum}->{subnet} and ->{guid} = xxxx:xxxx:xxxx:xxxx - # $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{invalid} = 1 - # $servers{$hostname}->{subnets}->{$subnet} = 1 - my %servers; - - # $subnets{$subnet}->{$hostname} = 1; - my %subnets; - - opendir DIR, $hwlocdir - or die "Failed to open hwloc directory ($!).\n"; - # list subnets by ports - while (my $hwlocfile = readdir DIR) { - my $hostname; - if ($hwlocfile =~ /(.+).xml$/) { - $hostname = $1; - } else { - next; - } - - open FILE, "$hwlocdir/$hwlocfile" or next; - my $boardname = undef; - my $portnum = undef; - while (my $line = ) { - if ($line =~ //) { - $boardname = $1; - } elsif (defined $boardname) { - if ($line =~ /<\/object>/) { - $boardname = undef; - } elsif ($line =~ //) { - $servers{$hostname}->{gids}->{$boardname}->{$1}->{$2}->{subnet} = $3; - $servers{$hostname}->{gids}->{$boardname}->{$1}->{$2}->{guid} = $4; - } elsif ($line =~ //) { - # lid must be between 0x1 and 0xbfff - if ((hex $2) < 1 or (hex $2) > 49151) { - $servers{$hostname}->{gids}->{$boardname}->{$1}->{invalid} = 1; - } - } elsif ($line =~ //) { - # state must be active = 4 - if ($2 != 4) { - $servers{$hostname}->{gids}->{$boardname}->{$1}->{invalid} = 1; - } - } - } - } - close FILE; - } - closedir DIR; - - # remove down/inactive ports/servers/... - foreach my $hostname (keys %servers) { - foreach my $boardname (keys %{$servers{$hostname}->{gids}}) { - foreach my $portnum (keys %{$servers{$hostname}->{gids}->{$boardname}}) { - delete $servers{$hostname}->{gids}->{$boardname}->{$portnum} - if exists $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{invalid}; - } - delete $servers{$hostname}->{gids}->{$boardname} - unless keys %{$servers{$hostname}->{gids}->{$boardname}}; - } - delete $servers{$hostname} - unless keys %{$servers{$hostname}->{gids}}; - } - - # fill list of hostnames per subnets and subnets per hostnames - foreach my $hostname (keys %servers) { - foreach my $boardname (keys %{$servers{$hostname}->{gids}}) { - foreach my $portnum (keys %{$servers{$hostname}->{gids}->{$boardname}}) { - foreach my $gidid (keys %{$servers{$hostname}->{gids}->{$boardname}->{$portnum}}) { - my $subnet = $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{$gidid}->{subnet}; - $servers{$hostname}->{subnets}->{$subnet} = 1; - $subnets{$subnet}->{$hostname} = 1; - } - } - } - } - - my $nrsubnets = scalar (keys %subnets); - print "Found $nrsubnets subnets in hwloc directory:\n"; - # find local subnets - my $localhostname = `hostname`; chomp $localhostname; - { - my $hostname = $localhostname; - foreach my $boardname (keys %{$servers{$hostname}->{gids}}) { - foreach my $portnum (keys %{$servers{$hostname}->{gids}->{$boardname}}) { - foreach my $gidid (keys %{$servers{$hostname}->{gids}->{$boardname}->{$portnum}}) { - my $subnet = $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{$gidid}->{subnet}; - if (!exists $subnets_todiscover{$subnet}) { - print " Subnet $subnet is locally accessible from board $boardname port $portnum.\n"; - $subnets_todiscover{$subnet}->{localboardname} = $boardname; - $subnets_todiscover{$subnet}->{localportnum} = $portnum; - } elsif ($verbose) { - print " Subnet $subnet is also locally accessible from board $boardname port $portnum.\n"; - } - } - } - } - } - # find non-locally accessible subnets - foreach my $subnet (keys %subnets) { - next if exists $subnets{$subnet}->{$localhostname}; - print " Subnet $subnet is NOT locally accessible.\n"; - my @hostnames = (keys %{$subnets{$subnet}}); - if ($verbose) { - print " Subnet $subnet is accessible from nodes:\n"; - foreach my $hostname (@hostnames) { - print " $hostname\n"; - } - } else { - print " Subnet $subnet is accessible from node ".$hostnames[0]; - print " (and ".(@hostnames-1)." others)" if (@hostnames > 1); - print "\n"; - } - } - print "\n"; - - # list nodes that are connected to all subnets, if the local isn't - if (scalar keys %{$servers{$localhostname}->{subnets}} != $nrsubnets) { - my @fullyconnectedhostnames; - foreach my $hostname (keys %servers) { - if (scalar keys %{$servers{$hostname}->{subnets}} == $nrsubnets) { - push @fullyconnectedhostnames, $hostname; - } - } - if (@fullyconnectedhostnames) { - if ($verbose) { - print "All subnets are accessible from nodes:\n"; - foreach my $hostname (@fullyconnectedhostnames) { - print " $hostname\n"; - } - } else { - print "All subnets are accessible from node ".$fullyconnectedhostnames[0]; - print " (and ".(@fullyconnectedhostnames-1)." others)" if (@fullyconnectedhostnames > 1); - print "\n"; - } - } else { - print "No node is connected to all subnets.\n"; - } - print "\n"; - } -} - -########################### -# Discovery routines - -# ibnetdiscover has GUIDs in the form of 0xXXXXXXXXXXXXXXXX, but hwloc -# has GUIDs in the form of XXXX:XXXX:XXXX:XXXX. So just arbitrarily -# choose hwloc's form and convert everything to that format. -sub normalize_guid { - my ($guid) = @_; - - return "" - if ($guid eq ""); - - $guid =~ m/0x(.{4})(.{4})(.{4})(.{4})/; - return "$1:$2:$3:$4"; -} - -sub getroutes { - my $subnet = shift; - my $boardname = shift; - my $portnum = shift; - my $ibnetdiscoveroutput = shift; - my $ibrouteoutdir = shift; - my $lids; - - if (!open(FILE, $ibnetdiscoveroutput)) { - print " Couldn't open $ibnetdiscoveroutput\n"; - return; - } - - while () { - # We only need lines that begin with SW - next - if (! /^SW /); - - # Split out the columns. Yay regexps. One form of line has - # both source and destination information. The other form - # only has source information (because it's not hooked up to - # anything -- usually a switch port that doesn't have anything - # plugged in to it). - chomp; - my $line = $_; - - my ($have_peer, $src_name, $src_type, $src_lid, $src_port_id, - $src_guid, $width, $speed, $dest_type, $dest_lid, $dest_port_id, - $dest_guid, $dest_name); - - # First, assume that the line has both a port and a peer. - if ($line !~ m/^SW\s+(\d+)\s+(\d+)\s+(0x[0-9a-f]{16})\s+(\d+x)\s([^\s]*)\s+-\s+(CA|SW)\s+(\d+)\s+(\d+)\s+(0x[0-9a-f]{16})\s+\(\s+'(.+?)'\s+-\s+'(.+?)'\s\)/) { - # If we get here, there was no peer -- just a port. - $have_peer = 0; - - if ($line !~ m/^SW\s+(\d+)\s+(\d+)\s+(0x[0-9a-f]{16})\s+(\d+x)\s([^\s]*)\s+'(.+?)'/) { - print "Line cannot be parsed:\n$line\n"; - next; - } - $src_lid = $1; # This is a decimal number - $src_port_id = $2; # This is a decimal number - $src_guid = $3; - $width = $4; - $speed = $5; - $src_name = $6; - } else { - $have_peer = 1; - - $src_lid = $1; # This is a decimal number - $src_port_id = $2; # This is a decimal number - $src_guid = $3; - $width = $4; - $speed = $5; - $dest_type = $6; - $dest_lid = $7; # This is a decimal number - $dest_port_id = $8; # This is a decimal number - $dest_guid = $9; - $src_name = $10; - $dest_name = $11; - } - - # Convert GUIDs to the form xxxx:xxxx:xxxx:xxxx - $src_guid = normalize_guid($src_guid); - $dest_guid = normalize_guid($dest_guid) - if ($have_peer); - - # If the source switch LID already exists, then just keep - # going. - next - if (exists($lids->{$src_lid})); - - # Run ibroute on this switch LID - my $ibrouteoutput = "$ibrouteoutdir/ibroute-$subnet-$src_lid.txt"; - print " Running ibroute for switch '$src_name' LID $src_lid...\n"; - my $cmd = "$sudo $ibroute -C $boardname -P $portnum $src_lid"; - if ($dryrun) { - print " NOT running $cmd\n" if $verbose; - } else { - sleep_between_probes (" "); - my $ret = system "$cmd > ${ibrouteoutput}.new" ; - if (!$ret or $ignoreerrors) { - unlink ${ibrouteoutput}; - rename "${ibrouteoutput}.new", "${ibrouteoutput}"; - } else { - unlink "${ibrouteoutput}.new"; - print " Failed (exit code $ret).\n"; - next; - } - } - - $lids->{$src_lid} = 1; - } - - close FILE; -} - -##############################" -# Discover subnets for real - -foreach my $subnet (keys %subnets_todiscover) { - my $boardname = $subnets_todiscover{$subnet}->{localboardname}; - my $portnum = $subnets_todiscover{$subnet}->{localportnum}; - - print "Looking at $subnet (through local board $boardname port $portnum)...\n"; - - my $ibnetdiscoveroutput = "$outdir/ib-raw/ib-subnet-$subnet.txt"; - my $ibrouteoutdir = "$outdir/ib-raw/ibroutes-$subnet"; - - if (-f $ibnetdiscoveroutput and !$force) { - print " $ibnetdiscoveroutput already exists, discover again? (y/n) "; - my $answer = ; - next if $answer !~ /^y/; - } - - print " Running ibnetdiscover...\n"; - my $cmd = "$sudo $ibnetdiscover -s -l -g -H -S -R -p -C $boardname -P $portnum"; - if ($dryrun) { - print " NOT running $cmd\n" if $verbose; - } else { - sleep_between_probes (" "); - print " $cmd\n" if $verbose; - my $ret = system "$cmd > ${ibnetdiscoveroutput}.new" ; - if (!$ret or $ignoreerrors) { - unlink ${ibnetdiscoveroutput}; - rename "${ibnetdiscoveroutput}.new", "${ibnetdiscoveroutput}"; - } else { - unlink "${ibnetdiscoveroutput}.new"; - print " Failed (exit code $ret).\n"; - next; - } - } - - print " Getting routes...\n"; - if (!$dryrun) { - system("rm -rf $ibrouteoutdir"); - mkdir $ibrouteoutdir unless $dryrun; - die "$ibrouteoutdir isn't a directory\n" unless -d $ibrouteoutdir; - } - getroutes $subnet, $boardname, $portnum, $ibnetdiscoveroutput, $ibrouteoutdir; -} diff -Nru hwloc-2.9.2/utils/netloc/mpi/Makefile.am hwloc-2.10.0/utils/netloc/mpi/Makefile.am --- hwloc-2.9.2/utils/netloc/mpi/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/mpi/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -# Copyright © 2016-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - -AM_CPPFLAGS = $(HWLOC_CPPFLAGS) \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include -AM_LDFLAGS = $(HWLOC_LDFLAGS) - -LDADD = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la - -if BUILD_MPITOOLS -bin_PROGRAMS = \ - netloc_rank_order \ - netloc_mpi_find_hosts - -if BUILD_NETLOCSCOTCH -bin_PROGRAMS += \ - netloc_mpi_rank_file -endif -endif - -netloc_rank_order_SOURCES = netloc_rank_order.c - -netloc_mpi_find_hosts_SOURCES = netloc_mpi_find_hosts.c -netloc_mpi_find_hosts_CPPFLAGS = $(AM_CPPFLAGS) $(MPI_CPPFLAGS) -netloc_mpi_find_hosts_LDADD = $(LDADD) $(MPI_LDADD) - -if BUILD_NETLOCSCOTCH -netloc_mpi_rank_file_SOURCES = netloc_mpi_rank_file.c -netloc_mpi_rank_file_LDADD = $(LDADD) \ - $(top_builddir)/netloc/libnetlocscotch.la \ - -lscotch -lscotcherr -lm -lpthread -endif diff -Nru hwloc-2.9.2/utils/netloc/mpi/Makefile.in hwloc-2.10.0/utils/netloc/mpi/Makefile.in --- hwloc-2.9.2/utils/netloc/mpi/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/mpi/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,840 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright © 2016-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@BUILD_MPITOOLS_TRUE@bin_PROGRAMS = netloc_rank_order$(EXEEXT) \ -@BUILD_MPITOOLS_TRUE@ netloc_mpi_find_hosts$(EXEEXT) \ -@BUILD_MPITOOLS_TRUE@ $(am__EXEEXT_1) -@BUILD_MPITOOLS_TRUE@@BUILD_NETLOCSCOTCH_TRUE@am__append_1 = \ -@BUILD_MPITOOLS_TRUE@@BUILD_NETLOCSCOTCH_TRUE@ netloc_mpi_rank_file - -subdir = utils/netloc/mpi -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ - $(top_srcdir)/config/hwloc_check_attributes.m4 \ - $(top_srcdir)/config/hwloc_check_vendor.m4 \ - $(top_srcdir)/config/hwloc_check_visibility.m4 \ - $(top_srcdir)/config/hwloc_components.m4 \ - $(top_srcdir)/config/hwloc_internal.m4 \ - $(top_srcdir)/config/hwloc_pkg.m4 \ - $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ - $(top_builddir)/include/hwloc/autogen/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -@BUILD_MPITOOLS_TRUE@@BUILD_NETLOCSCOTCH_TRUE@am__EXEEXT_1 = netloc_mpi_rank_file$(EXEEXT) -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_netloc_mpi_find_hosts_OBJECTS = \ - netloc_mpi_find_hosts-netloc_mpi_find_hosts.$(OBJEXT) -netloc_mpi_find_hosts_OBJECTS = $(am_netloc_mpi_find_hosts_OBJECTS) -am__DEPENDENCIES_1 = -netloc_mpi_find_hosts_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -am__netloc_mpi_rank_file_SOURCES_DIST = netloc_mpi_rank_file.c -@BUILD_NETLOCSCOTCH_TRUE@am_netloc_mpi_rank_file_OBJECTS = \ -@BUILD_NETLOCSCOTCH_TRUE@ netloc_mpi_rank_file.$(OBJEXT) -netloc_mpi_rank_file_OBJECTS = $(am_netloc_mpi_rank_file_OBJECTS) -@BUILD_NETLOCSCOTCH_TRUE@netloc_mpi_rank_file_DEPENDENCIES = $(LDADD) \ -@BUILD_NETLOCSCOTCH_TRUE@ $(top_builddir)/netloc/libnetlocscotch.la -am_netloc_rank_order_OBJECTS = netloc_rank_order.$(OBJEXT) -netloc_rank_order_OBJECTS = $(am_netloc_rank_order_OBJECTS) -netloc_rank_order_LDADD = $(LDADD) -netloc_rank_order_DEPENDENCIES = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/private/autogen -I$(top_builddir)/include/hwloc/autogen -depcomp = $(SHELL) $(top_srcdir)/./config/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = \ - ./$(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Po \ - ./$(DEPDIR)/netloc_mpi_rank_file.Po \ - ./$(DEPDIR)/netloc_rank_order.Po -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(netloc_mpi_find_hosts_SOURCES) \ - $(netloc_mpi_rank_file_SOURCES) $(netloc_rank_order_SOURCES) -DIST_SOURCES = $(netloc_mpi_find_hosts_SOURCES) \ - $(am__netloc_mpi_rank_file_SOURCES_DIST) \ - $(netloc_rank_order_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/./config/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BUNZIPP = @BUNZIPP@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CONFIGURE_DEPENDENCIES = @CONFIGURE_DEPENDENCIES@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CUDA_VERSION = @CUDA_VERSION@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIFF = @DIFF@ -DLLTOOL = @DLLTOOL@ -DOXYGEN = @DOXYGEN@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EPSTOPDF = @EPSTOPDF@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FIG2DEV = @FIG2DEV@ -FILECMD = @FILECMD@ -GREP = @GREP@ -GS = @GS@ -HWLOC_CAIRO_CFLAGS = @HWLOC_CAIRO_CFLAGS@ -HWLOC_CAIRO_LIBS = @HWLOC_CAIRO_LIBS@ -HWLOC_CFLAGS = @HWLOC_CFLAGS@ -HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ -HWLOC_CUDART_CFLAGS = @HWLOC_CUDART_CFLAGS@ -HWLOC_CUDART_CPPFLAGS = @HWLOC_CUDART_CPPFLAGS@ -HWLOC_CUDART_LDFLAGS = @HWLOC_CUDART_LDFLAGS@ -HWLOC_CUDART_LIBS = @HWLOC_CUDART_LIBS@ -HWLOC_CUDA_CFLAGS = @HWLOC_CUDA_CFLAGS@ -HWLOC_CUDA_CPPFLAGS = @HWLOC_CUDA_CPPFLAGS@ -HWLOC_CUDA_LDFLAGS = @HWLOC_CUDA_LDFLAGS@ -HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ -HWLOC_DARWIN_LDFLAGS = @HWLOC_DARWIN_LDFLAGS@ -HWLOC_DIFF_U = @HWLOC_DIFF_U@ -HWLOC_DIFF_W = @HWLOC_DIFF_W@ -HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ -HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ -HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ -HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ -HWLOC_EMBEDDED_LDFLAGS = @HWLOC_EMBEDDED_LDFLAGS@ -HWLOC_EMBEDDED_LIBS = @HWLOC_EMBEDDED_LIBS@ -HWLOC_GL_LIBS = @HWLOC_GL_LIBS@ -HWLOC_HAVE_LEVELZERO = @HWLOC_HAVE_LEVELZERO@ -HWLOC_HAVE_LIBXML2 = @HWLOC_HAVE_LIBXML2@ -HWLOC_HAVE_LINUX = @HWLOC_HAVE_LINUX@ -HWLOC_HAVE_NVML = @HWLOC_HAVE_NVML@ -HWLOC_HAVE_OPENCL = @HWLOC_HAVE_OPENCL@ -HWLOC_HAVE_RSMI = @HWLOC_HAVE_RSMI@ -HWLOC_HAVE_X86_CPUID = @HWLOC_HAVE_X86_CPUID@ -HWLOC_IBVERBS_LIBS = @HWLOC_IBVERBS_LIBS@ -HWLOC_LDFLAGS = @HWLOC_LDFLAGS@ -HWLOC_LEVELZERO_CFLAGS = @HWLOC_LEVELZERO_CFLAGS@ -HWLOC_LEVELZERO_LIBS = @HWLOC_LEVELZERO_LIBS@ -HWLOC_LIBS = @HWLOC_LIBS@ -HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ -HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ -HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ -HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ -HWLOC_MS_LIB = @HWLOC_MS_LIB@ -HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ -HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ -HWLOC_NUMA_LIBS = @HWLOC_NUMA_LIBS@ -HWLOC_NVML_CPPFLAGS = @HWLOC_NVML_CPPFLAGS@ -HWLOC_NVML_LDFLAGS = @HWLOC_NVML_LDFLAGS@ -HWLOC_NVML_LIBS = @HWLOC_NVML_LIBS@ -HWLOC_OPENCL_CPPFLAGS = @HWLOC_OPENCL_CPPFLAGS@ -HWLOC_OPENCL_LDFLAGS = @HWLOC_OPENCL_LDFLAGS@ -HWLOC_OPENCL_LIBS = @HWLOC_OPENCL_LIBS@ -HWLOC_PCIACCESS_CFLAGS = @HWLOC_PCIACCESS_CFLAGS@ -HWLOC_PCIACCESS_LIBS = @HWLOC_PCIACCESS_LIBS@ -HWLOC_PLUGINS_DIR = @HWLOC_PLUGINS_DIR@ -HWLOC_PLUGINS_PATH = @HWLOC_PLUGINS_PATH@ -HWLOC_PS_LIBS = @HWLOC_PS_LIBS@ -HWLOC_RELEASE_DATE = @HWLOC_RELEASE_DATE@ -HWLOC_REQUIRES = @HWLOC_REQUIRES@ -HWLOC_RSMI_CPPFLAGS = @HWLOC_RSMI_CPPFLAGS@ -HWLOC_RSMI_LDFLAGS = @HWLOC_RSMI_LDFLAGS@ -HWLOC_RSMI_LIBS = @HWLOC_RSMI_LIBS@ -HWLOC_TERMCAP_LIBS = @HWLOC_TERMCAP_LIBS@ -HWLOC_VERSION = @HWLOC_VERSION@ -HWLOC_W3_GENERATOR = @HWLOC_W3_GENERATOR@ -HWLOC_X11_CPPFLAGS = @HWLOC_X11_CPPFLAGS@ -HWLOC_X11_LIBS = @HWLOC_X11_LIBS@ -HWLOC_XML_LOCALIZED = @HWLOC_XML_LOCALIZED@ -HWLOC_runstatedir = @HWLOC_runstatedir@ -HWLOC_top_builddir = @HWLOC_top_builddir@ -HWLOC_top_srcdir = @HWLOC_top_srcdir@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LYNX = @LYNX@ -MAKEINDEX = @MAKEINDEX@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -ROCM_VERSION = @ROCM_VERSION@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -W3M = @W3M@ -XMKMF = @XMKMF@ -XMLLINT = @XMLLINT@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libhwloc_so_name = @libhwloc_so_name@ -libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xz = @xz@ -AM_CPPFLAGS = $(HWLOC_CPPFLAGS) \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - -AM_LDFLAGS = $(HWLOC_LDFLAGS) -LDADD = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/hwloc/libhwloc.la - -netloc_rank_order_SOURCES = netloc_rank_order.c -netloc_mpi_find_hosts_SOURCES = netloc_mpi_find_hosts.c -netloc_mpi_find_hosts_CPPFLAGS = $(AM_CPPFLAGS) $(MPI_CPPFLAGS) -netloc_mpi_find_hosts_LDADD = $(LDADD) $(MPI_LDADD) -@BUILD_NETLOCSCOTCH_TRUE@netloc_mpi_rank_file_SOURCES = netloc_mpi_rank_file.c -@BUILD_NETLOCSCOTCH_TRUE@netloc_mpi_rank_file_LDADD = $(LDADD) \ -@BUILD_NETLOCSCOTCH_TRUE@ $(top_builddir)/netloc/libnetlocscotch.la \ -@BUILD_NETLOCSCOTCH_TRUE@ -lscotch -lscotcherr -lm -lpthread - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/netloc/mpi/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign utils/netloc/mpi/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -netloc_mpi_find_hosts$(EXEEXT): $(netloc_mpi_find_hosts_OBJECTS) $(netloc_mpi_find_hosts_DEPENDENCIES) $(EXTRA_netloc_mpi_find_hosts_DEPENDENCIES) - @rm -f netloc_mpi_find_hosts$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(netloc_mpi_find_hosts_OBJECTS) $(netloc_mpi_find_hosts_LDADD) $(LIBS) - -netloc_mpi_rank_file$(EXEEXT): $(netloc_mpi_rank_file_OBJECTS) $(netloc_mpi_rank_file_DEPENDENCIES) $(EXTRA_netloc_mpi_rank_file_DEPENDENCIES) - @rm -f netloc_mpi_rank_file$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(netloc_mpi_rank_file_OBJECTS) $(netloc_mpi_rank_file_LDADD) $(LIBS) - -netloc_rank_order$(EXEEXT): $(netloc_rank_order_OBJECTS) $(netloc_rank_order_DEPENDENCIES) $(EXTRA_netloc_rank_order_DEPENDENCIES) - @rm -f netloc_rank_order$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(netloc_rank_order_OBJECTS) $(netloc_rank_order_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netloc_mpi_rank_file.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netloc_rank_order.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -netloc_mpi_find_hosts-netloc_mpi_find_hosts.o: netloc_mpi_find_hosts.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netloc_mpi_find_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netloc_mpi_find_hosts-netloc_mpi_find_hosts.o -MD -MP -MF $(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Tpo -c -o netloc_mpi_find_hosts-netloc_mpi_find_hosts.o `test -f 'netloc_mpi_find_hosts.c' || echo '$(srcdir)/'`netloc_mpi_find_hosts.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Tpo $(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netloc_mpi_find_hosts.c' object='netloc_mpi_find_hosts-netloc_mpi_find_hosts.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netloc_mpi_find_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netloc_mpi_find_hosts-netloc_mpi_find_hosts.o `test -f 'netloc_mpi_find_hosts.c' || echo '$(srcdir)/'`netloc_mpi_find_hosts.c - -netloc_mpi_find_hosts-netloc_mpi_find_hosts.obj: netloc_mpi_find_hosts.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netloc_mpi_find_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netloc_mpi_find_hosts-netloc_mpi_find_hosts.obj -MD -MP -MF $(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Tpo -c -o netloc_mpi_find_hosts-netloc_mpi_find_hosts.obj `if test -f 'netloc_mpi_find_hosts.c'; then $(CYGPATH_W) 'netloc_mpi_find_hosts.c'; else $(CYGPATH_W) '$(srcdir)/netloc_mpi_find_hosts.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Tpo $(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netloc_mpi_find_hosts.c' object='netloc_mpi_find_hosts-netloc_mpi_find_hosts.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(netloc_mpi_find_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netloc_mpi_find_hosts-netloc_mpi_find_hosts.obj `if test -f 'netloc_mpi_find_hosts.c'; then $(CYGPATH_W) 'netloc_mpi_find_hosts.c'; else $(CYGPATH_W) '$(srcdir)/netloc_mpi_find_hosts.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Po - -rm -f ./$(DEPDIR)/netloc_mpi_rank_file.Po - -rm -f ./$(DEPDIR)/netloc_rank_order.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/netloc_mpi_find_hosts-netloc_mpi_find_hosts.Po - -rm -f ./$(DEPDIR)/netloc_mpi_rank_file.Po - -rm -f ./$(DEPDIR)/netloc_rank_order.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-binPROGRAMS - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru hwloc-2.9.2/utils/netloc/mpi/netloc_mpi_find_hosts.c hwloc-2.10.0/utils/netloc/mpi/netloc_mpi_find_hosts.c --- hwloc-2.9.2/utils/netloc/mpi/netloc_mpi_find_hosts.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/mpi/netloc_mpi_find_hosts.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -/* - * Copyright © 2017 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -#include -#include -#include -#include - -typedef struct { - UT_hash_handle hh; /* Makes this structure hashable */ - char *name; /* Hash key */ - UT_array *slots; - UT_array *ranks; -} node_t; - -int main(int argc, char **argv) -{ - int rank; - int num_ranks; - MPI_Status status; - hwloc_topology_t topology; - hwloc_cpuset_t set; - int pu_rank = -1; - char name[1024]; - int resultlen; - int master; /* To be responsible for a node */ - int one = 1; - int zero = 0; - - MPI_Init(&argc,&argv); - - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &num_ranks); - - if (argc != 2) { - if (rank == 0) - fprintf(stderr, "Usage: %s \n", argv[0]); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - hwloc_topology_init(&topology); - hwloc_topology_load(topology); - set = hwloc_bitmap_alloc(); - hwloc_get_cpubind(topology, set, 0); - pu_rank = hwloc_bitmap_first(set); - - MPI_Get_processor_name(name, &resultlen); - resultlen++; - - if (rank == 0) { - FILE *output; - output = fopen(argv[1], "w"); - if (!output) { - perror("fopen"); - MPI_Abort(MPI_COMM_WORLD, 2); - } - - node_t *nodes = NULL; - node_t *node; - - master = 1; - - /* Rank 0 info */ - /* Find node */ - HASH_FIND_PTR(nodes, &name, node); - /* If node does not exist yet, create it */ - if (!node) { - node = (node_t *)malloc(sizeof(node_t)); - node->name = name; - utarray_new(node->slots, &ut_int_icd); - utarray_new(node->ranks, &ut_int_icd); - HASH_ADD_KEYPTR(hh, nodes, node->name, strlen(node->name), node); - } - /* Add the slot to the list of slots */ - utarray_push_back(node->slots, &pu_rank); - utarray_push_back(node->ranks, &rank); - - /* Info about other ranks */ - for (int p = 1; p < num_ranks; p++) { - /* Receive node name size, and slot index */ - char *nodename; - int buffer[2]; - MPI_Recv (buffer, 2, MPI_INT, p, 0, MPI_COMM_WORLD, &status); - int size = buffer[0]; - int slot = buffer[1]; - - /* Receive node name */ - nodename = (char *)malloc(sizeof(char[size])); - MPI_Recv(nodename, size, MPI_CHAR, p, 0, MPI_COMM_WORLD, &status); - - /* Find node */ - HASH_FIND_STR(nodes, nodename, node); - /* If node does not exist yet, create it */ - if (!node) { - node = (node_t *)malloc(sizeof(node_t)); - node->name = nodename; - utarray_new(node->slots, &ut_int_icd); - utarray_new(node->ranks, &ut_int_icd); - HASH_ADD_KEYPTR(hh, nodes, node->name, strlen(node->name), node); - - /* p will be the master for node */ - MPI_Send(&one, 1, MPI_INT, p, 0, MPI_COMM_WORLD); - - } else { - /* p won't be a master */ - MPI_Send(&zero, 1, MPI_INT, p, 0, MPI_COMM_WORLD); - } - /* Add the slot to the list of slots */ - utarray_push_back(node->slots, &slot); - utarray_push_back(node->ranks, &p); - } - - /* Write the list of nodes and slots by node */ - - /* Number of nodes */ - int num_nodes = HASH_COUNT(nodes); - fprintf(output, "%d", num_nodes); - - /* Names of nodes */ - node_t *node_tmp; - HASH_ITER(hh, nodes, node, node_tmp) { - fprintf(output, " %s", node->name); - } - - /* Number of slots by node */ - HASH_ITER(hh, nodes, node, node_tmp) { - int num_slots = utarray_len(node->slots); - fprintf(output, " %d", num_slots); - } - - /* List of slots */ - HASH_ITER(hh, nodes, node, node_tmp) { - int num_slots = utarray_len(node->slots); - int *slots = (int *)node->slots->d; - int *ranks = (int *)node->ranks->d; - for (int s = 0; s < num_slots; s++) { - fprintf(output, " %d", slots[s]); - fprintf(output, " %d", ranks[s]); - } - } - fclose(output); - } else { - int buffer[2]; - buffer[0] = resultlen; - buffer[1] = pu_rank; - /* Send node name size, and slot index */ - MPI_Send(buffer, 2, MPI_INT, 0, 0, MPI_COMM_WORLD); - /* Send node name */ - MPI_Send(name, resultlen, MPI_CHAR, 0, 0, MPI_COMM_WORLD); - - /* Receive if is a master or not */ - MPI_Recv (&master, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status); - } - - /* In charge of writing hwloc file */ - if (master) { - /* Get the Netloc topology to find hwloc path */ - char *topopath = getenv("NETLOC_TOPOFILE"); - if (!topopath) { - fprintf(stderr, "Error: you need to set NETLOC_TOPOFILE in your environment.\n"); - } else { - topopath = strdup(topopath); - netloc_topology_t *netloc_topology = netloc_topology_construct(topopath); - if (netloc_topology == NULL) { - fprintf(stderr, "Error: netloc_topology_construct failed\n"); - free(topopath); - return NETLOC_ERROR; - } - - /* Find hwloc dir path */ - char *hwloc_path; - if (netloc_topology->hwlocpath[0] != '/') { - char *path_tmp = strdup(netloc_topology->topopath); - asprintf(&hwloc_path, "%s/%s", dirname(path_tmp), netloc_topology->hwlocpath); - free(path_tmp); - } else { - hwloc_path = strdup(netloc_topology->hwlocpath); - } - - /* Check if already have an hwloc file */ - /* We try to find a diff file */ - char *hwloc_file; - asprintf(&hwloc_file, "%s/%s.diff.xml", hwloc_path, name); - FILE *fxml; - if ((fxml = fopen(hwloc_file, "r"))) { - fclose(fxml); - free(hwloc_file); - hwloc_file = NULL; - } else { - free(hwloc_file); - /* We try to find a regular file */ - asprintf(&hwloc_file, "%s/%s.xml", hwloc_path, name); - if ((fxml = fopen(hwloc_file, "r"))) { - fclose(fxml); - free(hwloc_file); - hwloc_file = NULL; - } - } - - /* if there is no hwloc file, let's write one */ - if (hwloc_file) { - if (hwloc_topology_export_xml(topology, hwloc_file, 0) == -1) { - fprintf(stderr, "Error: netloc_topology_construct failed\n"); - free(topopath); - return NETLOC_ERROR; - } - free(hwloc_path); - free(hwloc_file); - } - } - } - - MPI_Finalize(); -} diff -Nru hwloc-2.9.2/utils/netloc/mpi/netloc_mpi_rank_file.c hwloc-2.10.0/utils/netloc/mpi/netloc_mpi_rank_file.c --- hwloc-2.9.2/utils/netloc/mpi/netloc_mpi_rank_file.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/mpi/netloc_mpi_rank_file.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright © 2016 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ - -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - int ret; - netlocscotch_core_t *cores; - int num_processes; - - char *comm_filename; - char *rank_filename; - - assert(argc == 3); - - comm_filename = argv[1]; - rank_filename = argv[2]; - - ret = netlocscotch_get_mapping_from_comm_file(comm_filename, &num_processes, &cores); - - if (ret != NETLOC_SUCCESS) { - fprintf(stderr, "Error: netlocscotch_get_mapping_from_comm_file failed\n"); - return NETLOC_ERROR; - } - - FILE *rank_file = fopen(rank_filename, "w"); - if (!rank_file) { - perror("fopen"); - ret = NETLOC_ERROR; - - } else { - for (int p = 0; p < num_processes; p++) { - fprintf(rank_file, "rank %d=%s slot=%d\n", - p, cores[p].nodename, cores[p].core); - } - fclose(rank_file); - } - - for (int p = 0; p < num_processes; p++) { - free(cores[p].nodename); - } - free(cores); - - return ret; -} - diff -Nru hwloc-2.9.2/utils/netloc/mpi/netloc_rank_order.c hwloc-2.10.0/utils/netloc/mpi/netloc_rank_order.c --- hwloc-2.9.2/utils/netloc/mpi/netloc_rank_order.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/mpi/netloc_rank_order.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright © 2016 Inria. All rights reserved. - * - * $COPYRIGHT$ - * - * Additional copyrights may follow - * See COPYING in top-level directory. - * - * $HEADER$ - */ - -#define _GNU_SOURCE /* See feature_test_macros(7) */ -#include -#include - -#include -#include - -static int compareint(void const *a, void const *b) -{ - const int *int_a = (const int *)a; - const int *int_b = (const int *)b; - return *int_a-*int_b; -} - - -int main(int argc, char **argv) -{ - int ret; - /* First we need to get the topology of the whole machine */ - netloc_arch_t arch; - ret = netloc_arch_build(&arch, 0); - if( NETLOC_SUCCESS != ret ) { - return ret; - } - - /* Set the current nodes and slots in the arch */ - ret = netloc_arch_set_current_resources(&arch); - if( NETLOC_SUCCESS != ret ) { - return ret; - } - int num_nodes = arch.num_current_hosts; - - /* Order the idx_list to have the nodes sorted */ - qsort(arch.current_hosts, num_nodes, sizeof(*arch.current_hosts), compareint); - - /* Show the list */ - for (int n = 0; n < num_nodes; n++) { - netloc_arch_node_t *arch_node = arch.node_slot_by_idx[arch.current_hosts[n]].node; - qsort(arch_node->current_slots, arch_node->num_current_slots, - sizeof(*arch_node->current_slots), compareint); - - for (int s = 0; s < arch_node->num_current_slots; s++) { - int slot_idx = arch_node->current_slots[s]; - int slot = arch_node->slot_os_idx[slot_idx]; - printf("%s %d", arch_node->name, slot); - } - } - - return NETLOC_SUCCESS; -} diff -Nru hwloc-2.9.2/utils/netloc/scotch/Makefile.am hwloc-2.10.0/utils/netloc/scotch/Makefile.am --- hwloc-2.9.2/utils/netloc/scotch/Makefile.am 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/scotch/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -# Copyright © 2016-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - -AM_CPPFLAGS = $(HWLOC_CPPFLAGS) \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include -AM_LDFLAGS = $(HWLOC_LDFLAGS) - -LDADD = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/netloc/libnetlocscotch.la \ - $(top_builddir)/hwloc/libhwloc.la \ - -lscotch -lscotcherr -lm -lpthread - -if BUILD_NETLOCSCOTCH -bin_PROGRAMS = \ - netlocscotch_get_arch -endif - -netlocscotch_get_arch_SOURCES = \ - netlocscotch_get_arch.c diff -Nru hwloc-2.9.2/utils/netloc/scotch/Makefile.in hwloc-2.10.0/utils/netloc/scotch/Makefile.in --- hwloc-2.9.2/utils/netloc/scotch/Makefile.in 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/scotch/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,788 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright © 2016-2018 Inria. All rights reserved. -# -# See COPYING in top-level directory. -# -# $HEADER$ -# - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@BUILD_NETLOCSCOTCH_TRUE@bin_PROGRAMS = \ -@BUILD_NETLOCSCOTCH_TRUE@ netlocscotch_get_arch$(EXEEXT) -subdir = utils/netloc/scotch -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/hwloc.m4 \ - $(top_srcdir)/config/hwloc_check_attributes.m4 \ - $(top_srcdir)/config/hwloc_check_vendor.m4 \ - $(top_srcdir)/config/hwloc_check_visibility.m4 \ - $(top_srcdir)/config/hwloc_components.m4 \ - $(top_srcdir)/config/hwloc_internal.m4 \ - $(top_srcdir)/config/hwloc_pkg.m4 \ - $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/netloc.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/private/autogen/config.h \ - $(top_builddir)/include/hwloc/autogen/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_netlocscotch_get_arch_OBJECTS = netlocscotch_get_arch.$(OBJEXT) -netlocscotch_get_arch_OBJECTS = $(am_netlocscotch_get_arch_OBJECTS) -netlocscotch_get_arch_LDADD = $(LDADD) -netlocscotch_get_arch_DEPENDENCIES = \ - $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/netloc/libnetlocscotch.la \ - $(top_builddir)/hwloc/libhwloc.la -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/private/autogen -I$(top_builddir)/include/hwloc/autogen -depcomp = $(SHELL) $(top_srcdir)/./config/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/netlocscotch_get_arch.Po -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(netlocscotch_get_arch_SOURCES) -DIST_SOURCES = $(netlocscotch_get_arch_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/./config/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCHIVEMOUNT = @ARCHIVEMOUNT@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BUNZIPP = @BUNZIPP@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CONFIGURE_DEPENDENCIES = @CONFIGURE_DEPENDENCIES@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CUDA_VERSION = @CUDA_VERSION@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIFF = @DIFF@ -DLLTOOL = @DLLTOOL@ -DOXYGEN = @DOXYGEN@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EPSTOPDF = @EPSTOPDF@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FIG2DEV = @FIG2DEV@ -FILECMD = @FILECMD@ -GREP = @GREP@ -GS = @GS@ -HWLOC_CAIRO_CFLAGS = @HWLOC_CAIRO_CFLAGS@ -HWLOC_CAIRO_LIBS = @HWLOC_CAIRO_LIBS@ -HWLOC_CFLAGS = @HWLOC_CFLAGS@ -HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@ -HWLOC_CUDART_CFLAGS = @HWLOC_CUDART_CFLAGS@ -HWLOC_CUDART_CPPFLAGS = @HWLOC_CUDART_CPPFLAGS@ -HWLOC_CUDART_LDFLAGS = @HWLOC_CUDART_LDFLAGS@ -HWLOC_CUDART_LIBS = @HWLOC_CUDART_LIBS@ -HWLOC_CUDA_CFLAGS = @HWLOC_CUDA_CFLAGS@ -HWLOC_CUDA_CPPFLAGS = @HWLOC_CUDA_CPPFLAGS@ -HWLOC_CUDA_LDFLAGS = @HWLOC_CUDA_LDFLAGS@ -HWLOC_CUDA_LIBS = @HWLOC_CUDA_LIBS@ -HWLOC_DARWIN_LDFLAGS = @HWLOC_DARWIN_LDFLAGS@ -HWLOC_DIFF_U = @HWLOC_DIFF_U@ -HWLOC_DIFF_W = @HWLOC_DIFF_W@ -HWLOC_DL_LIBS = @HWLOC_DL_LIBS@ -HWLOC_EMBEDDED_CFLAGS = @HWLOC_EMBEDDED_CFLAGS@ -HWLOC_EMBEDDED_CPPFLAGS = @HWLOC_EMBEDDED_CPPFLAGS@ -HWLOC_EMBEDDED_LDADD = @HWLOC_EMBEDDED_LDADD@ -HWLOC_EMBEDDED_LDFLAGS = @HWLOC_EMBEDDED_LDFLAGS@ -HWLOC_EMBEDDED_LIBS = @HWLOC_EMBEDDED_LIBS@ -HWLOC_GL_LIBS = @HWLOC_GL_LIBS@ -HWLOC_HAVE_LEVELZERO = @HWLOC_HAVE_LEVELZERO@ -HWLOC_HAVE_LIBXML2 = @HWLOC_HAVE_LIBXML2@ -HWLOC_HAVE_LINUX = @HWLOC_HAVE_LINUX@ -HWLOC_HAVE_NVML = @HWLOC_HAVE_NVML@ -HWLOC_HAVE_OPENCL = @HWLOC_HAVE_OPENCL@ -HWLOC_HAVE_RSMI = @HWLOC_HAVE_RSMI@ -HWLOC_HAVE_X86_CPUID = @HWLOC_HAVE_X86_CPUID@ -HWLOC_IBVERBS_LIBS = @HWLOC_IBVERBS_LIBS@ -HWLOC_LDFLAGS = @HWLOC_LDFLAGS@ -HWLOC_LEVELZERO_CFLAGS = @HWLOC_LEVELZERO_CFLAGS@ -HWLOC_LEVELZERO_LIBS = @HWLOC_LEVELZERO_LIBS@ -HWLOC_LIBS = @HWLOC_LIBS@ -HWLOC_LIBS_PRIVATE = @HWLOC_LIBS_PRIVATE@ -HWLOC_LIBXML2_CFLAGS = @HWLOC_LIBXML2_CFLAGS@ -HWLOC_LIBXML2_LIBS = @HWLOC_LIBXML2_LIBS@ -HWLOC_LTDL_LIBS = @HWLOC_LTDL_LIBS@ -HWLOC_MS_LIB = @HWLOC_MS_LIB@ -HWLOC_MS_LIB_ARCH = @HWLOC_MS_LIB_ARCH@ -HWLOC_NUMA_CFLAGS = @HWLOC_NUMA_CFLAGS@ -HWLOC_NUMA_LIBS = @HWLOC_NUMA_LIBS@ -HWLOC_NVML_CPPFLAGS = @HWLOC_NVML_CPPFLAGS@ -HWLOC_NVML_LDFLAGS = @HWLOC_NVML_LDFLAGS@ -HWLOC_NVML_LIBS = @HWLOC_NVML_LIBS@ -HWLOC_OPENCL_CPPFLAGS = @HWLOC_OPENCL_CPPFLAGS@ -HWLOC_OPENCL_LDFLAGS = @HWLOC_OPENCL_LDFLAGS@ -HWLOC_OPENCL_LIBS = @HWLOC_OPENCL_LIBS@ -HWLOC_PCIACCESS_CFLAGS = @HWLOC_PCIACCESS_CFLAGS@ -HWLOC_PCIACCESS_LIBS = @HWLOC_PCIACCESS_LIBS@ -HWLOC_PLUGINS_DIR = @HWLOC_PLUGINS_DIR@ -HWLOC_PLUGINS_PATH = @HWLOC_PLUGINS_PATH@ -HWLOC_PS_LIBS = @HWLOC_PS_LIBS@ -HWLOC_RELEASE_DATE = @HWLOC_RELEASE_DATE@ -HWLOC_REQUIRES = @HWLOC_REQUIRES@ -HWLOC_RSMI_CPPFLAGS = @HWLOC_RSMI_CPPFLAGS@ -HWLOC_RSMI_LDFLAGS = @HWLOC_RSMI_LDFLAGS@ -HWLOC_RSMI_LIBS = @HWLOC_RSMI_LIBS@ -HWLOC_TERMCAP_LIBS = @HWLOC_TERMCAP_LIBS@ -HWLOC_VERSION = @HWLOC_VERSION@ -HWLOC_W3_GENERATOR = @HWLOC_W3_GENERATOR@ -HWLOC_X11_CPPFLAGS = @HWLOC_X11_CPPFLAGS@ -HWLOC_X11_LIBS = @HWLOC_X11_LIBS@ -HWLOC_XML_LOCALIZED = @HWLOC_XML_LOCALIZED@ -HWLOC_runstatedir = @HWLOC_runstatedir@ -HWLOC_top_builddir = @HWLOC_top_builddir@ -HWLOC_top_srcdir = @HWLOC_top_srcdir@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LYNX = @LYNX@ -MAKEINDEX = @MAKEINDEX@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MPI_CPPFLAGS = @MPI_CPPFLAGS@ -MPI_LDADD = @MPI_LDADD@ -NETLOC_CFLAGS = @NETLOC_CFLAGS@ -NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@ -NETLOC_EMBEDDED_CFLAGS = @NETLOC_EMBEDDED_CFLAGS@ -NETLOC_EMBEDDED_CPPFLAGS = @NETLOC_EMBEDDED_CPPFLAGS@ -NETLOC_EMBEDDED_LDADD = @NETLOC_EMBEDDED_LDADD@ -NETLOC_EMBEDDED_LIBS = @NETLOC_EMBEDDED_LIBS@ -NETLOC_LDFLAGS = @NETLOC_LDFLAGS@ -NETLOC_LIBS = @NETLOC_LIBS@ -NETLOC_LIBS_PRIVATE = @NETLOC_LIBS_PRIVATE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -ROCM_VERSION = @ROCM_VERSION@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -W3M = @W3M@ -XMKMF = @XMKMF@ -XMLLINT = @XMLLINT@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libhwloc_so_name = @libhwloc_so_name@ -libhwloc_so_version = @libhwloc_so_version@ -libnetloc_so_version = @libnetloc_so_version@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xz = @xz@ -AM_CPPFLAGS = $(HWLOC_CPPFLAGS) \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - -AM_LDFLAGS = $(HWLOC_LDFLAGS) -LDADD = $(top_builddir)/netloc/libnetloc.la \ - $(top_builddir)/netloc/libnetlocscotch.la \ - $(top_builddir)/hwloc/libhwloc.la \ - -lscotch -lscotcherr -lm -lpthread - -netlocscotch_get_arch_SOURCES = \ - netlocscotch_get_arch.c - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/netloc/scotch/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign utils/netloc/scotch/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -netlocscotch_get_arch$(EXEEXT): $(netlocscotch_get_arch_OBJECTS) $(netlocscotch_get_arch_DEPENDENCIES) $(EXTRA_netlocscotch_get_arch_DEPENDENCIES) - @rm -f netlocscotch_get_arch$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(netlocscotch_get_arch_OBJECTS) $(netlocscotch_get_arch_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlocscotch_get_arch.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/netlocscotch_get_arch.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/netlocscotch_get_arch.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-binPROGRAMS - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru hwloc-2.9.2/utils/netloc/scotch/netlocscotch_get_arch.c hwloc-2.10.0/utils/netloc/scotch/netlocscotch_get_arch.c --- hwloc-2.9.2/utils/netloc/scotch/netlocscotch_get_arch.c 2023-06-28 08:36:22.000000000 +0000 +++ hwloc-2.10.0/utils/netloc/scotch/netlocscotch_get_arch.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -#include // for scotch -#include -#include -#include -#include - -void help(char *name, FILE *f) -{ - fprintf(f, "Usage: %s [subarchfile]\n" - "\t%s --help\n", name, name); -} - -int main(int argc, char **argv) -{ - int ret; - SCOTCH_Arch arch; - SCOTCH_Arch subarch; - - char *arch_filename = NULL; - char *subarch_filename = NULL; - - if (argc == 1 || argc > 3) { - help(argv[0], stdout); - return 1; - } - - if (argc == 2) { - if (!strcmp(*argv, "--help")) { - help(argv[0], stdout); - return 0; - } else { - arch_filename = argv[1]; - } - } else if (argc == 3) { - arch_filename = argv[1]; - subarch_filename = argv[2]; - } - - ret = netlocscotch_build_global_arch(&arch); - if( NETLOC_SUCCESS != ret ) { - return ret; - } - FILE *arch_file = fopen(arch_filename, "w"); - SCOTCH_archSave(&arch, arch_file); - fclose(arch_file); - - if (subarch_filename) { - ret = netlocscotch_build_current_arch(&arch, &subarch); - if( NETLOC_SUCCESS != ret ) { - return ret; - } - FILE *subarch_file = fopen(subarch_filename, "w"); - SCOTCH_archSave(&subarch, subarch_file); - fclose(subarch_file); - SCOTCH_archExit(&subarch); - } - - SCOTCH_archExit(&arch); - - return 0; -} -