which implements a cleaner API for xc_{topology,numa}info.
This patch provides basic topology enumeration in hwloc. Xen support should
be built automatically given an appropriate version of libxenctrl (i.e. with
the above patch) in the build environment.
Xen support can be built as a plugin (to remove direct dependences on
libxenctrl), and is disabled by default. In dom0, use
`HWLOC_COMPONENETS=xen ./lstop ...`
to enable Xen system topology enumeration in preference to the faked topology
which the kernel gets to see.
This patch provides basic support for PUs, cores, sockets and numa nodes, with
numa nodes being annotated with availabe memory[1]. It has been sanity tested
on various different servers in our testing pool.
Some of this patch includes folded patches from Brice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
[1] It turns out Xen's idea of memory attached to a node includes pages
mapping IO regions. This is a hypervisor bug has been raised on xen-devel.
Brice Goglin [Tue, 11 Feb 2014 09:46:54 +0000 (10:46 +0100)]
x86: make the x86 detection configurable with flags (internally)
Use flags to enable full discovery, caches only, or annotating cpuinfo only.
Enable them depending on whether caches or other objects being already present.
Brice Goglin [Mon, 3 Feb 2014 19:21:59 +0000 (20:21 +0100)]
Add hwloc_obj_type_sscanf() to extend hwloc_obj_type_of_string()
The former was already used in hwloc-calc.h to parse things like
"L2iCache" or "Group3". Make it officially part of the API and
deprecate the old hwloc_obj_type_of_string().
Brice Goglin [Mon, 27 Jan 2014 17:45:34 +0000 (18:45 +0100)]
Linux: use the uname architecture to better match cpumodel information
Look at the uname architecture to select which cpuinfo parsing function
will be used.
For now, we have one for x86/x86_64/mic, one for ia64 and one for arm.
Others (or when the architecture is unknown, when fsroot was changed
and there's no /proc/hwloc-nofile-info) fallback to the default "dumb"
parsing function.
Brice Goglin [Mon, 27 Jan 2014 15:19:27 +0000 (16:19 +0100)]
Linux: allow to read uname from fake fs root
Read a new "fake" /proc/hwloc-nofile-info where we can store things
that cannot be saved as a file. Put the output of uname there when
gathering the topology and use it on input to overwrite local or
missing data.
This improves testing under tests/linux by allowing architecture
specific code to run from fake fsroot. Will be useful for advanced
cpuinfo parsing.
We manually remove /proc/hwloc-nofile-info in test-gather-topology.sh
because it only partially brings fake fsroot information.
Removing it creates the same !is_thissystem() output from the fake
fsroot and from the real machine.
Once we gather other information in /proc/hwloc-nofile-info:
* sysconf(_SC_LARGE_PAGESIZE);
* hwloc_getpagesize();
* hwloc_fallback_nbprocessors(topology);
we may be able to really use /proc/hwloc-nofile-info in test-gather-topology.sh
and really discover the exact same thing from the saved topology and
from the original machine. We'll see that later.
Brice Goglin [Tue, 28 Jan 2014 14:41:57 +0000 (15:41 +0100)]
Fix cpuid on windows 64bits so that the x86 backend is enabled as expected
unsigned long isn't 64bits on win64, so the cpuid assembly code fails to
build during configure (%ebx and %rbx gets mixed in the assembly),
and the entire x86 backend gets disabled.
Use hwloc_uint64_t instead. It needs hwloc/autogen/config.h which isn't
ready during configure yet, so manually add #include/#define during
the cpuid check.
Brice Goglin [Thu, 23 Jan 2014 14:54:20 +0000 (15:54 +0100)]
dist: don't automatically rebuild doxygen on each make dist
Warn if the doc doesn't exist, or just use what's already there.
contrib/dist/make_dist_tarball takes care of removing/recreating the doc,
and the doc is already correctly rebuilt in most cases, it is built by
make dist when not already available.
No need to keep complex rules for always rebuilding the doc just in case
somebody ever builds a tarball manually and ends up containing an outdated
doc for some reason.
Remove --enable-doxygen from make distcheck now that things are simple.
Brice Goglin [Wed, 22 Jan 2014 15:22:57 +0000 (16:22 +0100)]
Fix make dist during make distcheck
It wants to generate doxygen docs, but it doesn't by default
since it builds from a tarball. Force --enable-doxygen to fix that.
By the way, no need to double-check that doc/readme were generated
before building the tarball. config/distscript.csh is called on dist
and it does things as expected.
Also add a better error message when make dist fails because
PDFs do not exist yet, and doxygen isn't available.
Ideally, we'd just remove distscript.csh to make things much simpler
but I don't want to break more things today.
Brice Goglin [Tue, 21 Jan 2014 14:31:24 +0000 (15:31 +0100)]
configure: Fix the disabling of doxygen when building from tarballs
We check if we are in a developer tree, display the result, but do nothing with it.
Add the relevant code to update enable_doxygen accordingly if it wasn't forced
on the command-line.
This was unnoticed for a long time because we distribute hwloc.tag,
which causes tarball-builds not to regenerate the doc.
But they will regenerate it as soon as a dependency changes.
Now doxygen is entirely disabled properly in tarball-builds for real
as long as --enable-doxygen is not given.
Brice Goglin [Thu, 16 Jan 2014 20:06:15 +0000 (21:06 +0100)]
linux/NUMA: Work around buggy NUMA node cpusets
If Linux reports multiple nodes with intersecting (or identical) cpusets,
they get merged and the Linux backend asserts false.
Don't assert when insertion returns a merge error anymore.
Just disable NUMA distances if that ever happens since one
object is missing (instead of removing the corresponding row/column).
The BIOS is buggy, the matrix would likely be meaningless anyway.
Thanks to Jeff Becker for reporting the problem on the OMPI list.
By the way, fix the number of nodes returned by look_sysfsnode()
when we failed to read/create some NUMA objects.
Jeff Squyres [Fri, 10 Jan 2014 17:05:48 +0000 (09:05 -0800)]
Change the logic in bind.c to only include <malloc.h> if we don't have posix_memalign.
In http://www.open-mpi.org/community/lists/devel/2014/01/13619.php,
Paul Hargrove found a compiler warning on OpenBSD where <malloc.h>
exists, but is not intended to be used (and doesn't error out, so
AC_CHECK_HEADERS says its ok).
This is equivalent to hwloc_get_proc_last_cpu_location(THREAD) on Linux,
but it's better for clarity to have this Linux specific call as well
(and it was already implemented internally)
Rob Latham [Fri, 6 Dec 2013 00:09:06 +0000 (09:09 +0900)]
automake subdir-object mode needs check for -c -o
Older automake versions (at least 1.13.1) will complain if we asked for subdir
mode and we did not verify that both -c and -o flags work (AM_PROG_CC_C_O)
Brice Goglin [Wed, 6 Nov 2013 08:49:00 +0000 (09:49 +0100)]
Remove Cairo dependency on X11 and factorize X11 tests
Per discussion on the mailing list, it doesn't look like Cairo needs
X11 any more (it doesn't on OS X to generate PDFs and PNGs). So
remove the dependency in configure.ac.
Also, move the X11 tests from outside of the Cairo tests (and outside
of the GL tests) to be in the main configure logic.
By the way, rename HWLOC_HAVE_X11 into HWLOC_HAVE_X11_KEYSYM to avoid
confusion between Xlib.h/XOpenDisplay being available (what GL needs)
and Xutil.h+keysym.h being available too (what lstopo/X11 needs).
Brice Goglin [Thu, 17 Oct 2013 17:04:50 +0000 (19:04 +0200)]
linux/mic: add a MICSerialNumber info attribute when running inside the MIC
OMPI people want an easy way to recognize MICs and nodes using hwloc.
We already have MICSerialNumber inside OS devices in the host topology,
add the same to the root object of MIC topologies.
Unfortunately, we couldn't find anything better than parsing /proc/elog
to find that number.
Jeff Squyres [Fri, 4 Oct 2013 02:19:48 +0000 (19:19 -0700)]
Fix make_nightly_snapshot processing.
Leave *only one place* where "git desribe" is invoked and set into the
snapshot_version field in VERSION: the make_nightly_snapshot script.
distscript.csh no longer twiddles the VERSION file.
Jeff Squyres [Thu, 3 Oct 2013 14:50:55 +0000 (10:50 -0400)]
Updates for tarball generation to handle new git infrastructure.
- No longer download latest config.sub|guess in distscript.csh; the
GNU Autotools are updated frequently enough these days that the
bundled versions are fine
- Rename nightly/create_tarball.sh -> nightly/make_snapshot_tarball
- Add "snapshot" and "snapshot_version" fields in VERSION; removed
want_repo_rev and repo_rev fields
- Updated make_dist_tarball and make_snapshot_tarball to handle git
- Do not handle SVN or Mercurial repos any more
- Somewhat simplified hwloc_get_version.sh:
- Never fill in a repo version number; always just report what is in
VERSION already (and error out if there's not enough information
in VERSION). Only distscript.csh will insert a value into
VERSION:snapshot_version (when needed).
- Removed extra CLI options (e.g., get major/minor/etc. version
number components)
hwloc-calc.h: make location parsing more reliab...
hwloc-calc.h: make location parsing more reliable and add useful error messages
Use strtol() instead of atoi() when parsing type strings, depth, and ranges,
and error-out if some spurious characters are found.
Will avoid unexpected results when using wrong separators.
Thanks for Bertrand Putigny for reporting the problem by mistake.