From 34deb0db97976cdde22bb3db56322ca90d0f5186 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 3 Oct 2011 14:12:38 +0000 Subject: [PATCH] Sync with final hwloc 1.2.2 release This commit was SVN r25221. --- opal/mca/hwloc/hwloc122ompi/hwloc/NEWS | 3 +- opal/mca/hwloc/hwloc122ompi/hwloc/README | 5 +- opal/mca/hwloc/hwloc122ompi/hwloc/VERSION | 4 +- .../hwloc/config/hwloc_get_version.sh | 2 +- .../mca/hwloc/hwloc122ompi/hwloc/configure.ac | 2 +- .../hwloc/hwloc122ompi/hwloc/include/hwloc.h | 75 ++++++++++++++++--- .../hwloc122ompi/hwloc/include/hwloc/helper.h | 15 ++++ .../hwloc122ompi/hwloc/include/hwloc/rename.h | 3 + .../hwloc/include/private/autogen/config.h.in | 2 +- .../hwloc122ompi/hwloc/src/topology-linux.c | 3 +- 10 files changed, 95 insertions(+), 19 deletions(-) diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/NEWS b/opal/mca/hwloc/hwloc122ompi/hwloc/NEWS index 9964c7ea37..8baf3e478c 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/NEWS +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/NEWS @@ -23,7 +23,8 @@ Version 1.2.2 * Fix XML import of very large page sizes or counts on 32bits platform, thanks to Karsten Hopp for the RedHat ticket. * Fix crash when administrator limitations such as Linux cgroup require - to restrict distance matrices. + to restrict distance matrices. Thanks to Ake Sandgren for reporting the + problem. * Fix the removal of objects such as AMD Magny-Cours dual-node sockets in case of administrator restrictions. * Improve error reporting and messages in case of wrong synthetic topology diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/README b/opal/mca/hwloc/hwloc122ompi/hwloc/README index fec1e43e4f..f7f9dc03d1 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/README +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/README @@ -335,7 +335,8 @@ The basic interface is available in hwloc.h. It essentially offers low-level routines for advanced programmers that want to manually manipulate objects and follow links between them. Documentation for everything in hwloc.h are provided later in this document. Developers should also look at hwloc/helper.h (and also -in this document, which provides good higher-level topology traversal examples. +in 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. @@ -684,5 +685,5 @@ Make sure to have had a look at those too! ------------------------------------------------------------------------------- -Generated on Thu Sep 22 2011 10:07:44 for Hardware Locality (hwloc) by doxygen +Generated on Mon Oct 3 2011 09:54:38 for Hardware Locality (hwloc) by doxygen 1.7.4 diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/VERSION b/opal/mca/hwloc/hwloc122ompi/hwloc/VERSION index 5d6eea940c..b2d8262040 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/VERSION +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/VERSION @@ -16,7 +16,7 @@ release=2 # requirement is that it must be entirely printable ASCII characters # and have no white space. -greek=ompirc2 +greek=ompi # If want_repo_rev=1, then the SVN r number will be included in the overall # hwloc version number in some form. @@ -41,7 +41,7 @@ want_repo_rev=1 # from an SVN checkout, if repo_rev=-1, then its value is replaced # with the output of "svnversion". -repo_rev=r3839 +repo_rev=r3896 # The date when this release was created diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/config/hwloc_get_version.sh b/opal/mca/hwloc/hwloc122ompi/hwloc/config/hwloc_get_version.sh index cc63e562f0..bff4b63d01 100755 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/config/hwloc_get_version.sh +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/config/hwloc_get_version.sh @@ -12,7 +12,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved. +# Copyright © 2008-2010 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/configure.ac b/opal/mca/hwloc/hwloc122ompi/hwloc/configure.ac index d52cf8beba..21bf8853a2 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/configure.ac +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/configure.ac @@ -86,7 +86,7 @@ AC_SUBST([libhwloc_so_version]) AH_TOP([/* -*- c -*- * * Copyright © 2009 CNRS, INRIA., Université Bordeaux 1 All rights reserved. - * Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved. + * Copyright © 2009 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc.h b/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc.h index 6da16d574e..159d114108 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc.h +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc.h @@ -6,6 +6,36 @@ * See COPYING in top-level directory. */ +/*===================================================================== + * PLEASE GO READ THE DOCUMENTATION! + * ------------------------------------------------ + * $tarball_directory/doc/doxygen-doc/ + * or + * http://www.open-mpi.org/projects/hwloc/doc/ + *===================================================================== + * + * FAIR WARNING: Do NOT expect to be able to figure out all the + * subtleties of hwloc by simply reading function prototypes and + * constant descrptions here in this file. + * + * Hwloc has wonderful documentation in both PDF and HTML formats for + * your reading pleasure. The formal documentation explains a LOT of + * hwloc-specific concepts, provides definitions, and discusses the + * "big picture" for many of the things that you'll find here in this + * header file. + * + * The PDF/HTML documentation was generated via Doxygen; much of what + * you'll see in there is also here in this file. BUT THERE IS A LOT + * THAT IS IN THE PDF/HTML THAT IS ***NOT*** IN hwloc.h! + * + * There are entire paragraph-length descriptions, discussions, and + * pretty prictures to explain subtle corner cases, provide concrete + * examples, etc. + * + * Please, go read the documentation. :-) + * + *=====================================================================*/ + /** \file * \brief The hwloc API. * @@ -398,7 +428,7 @@ union hwloc_obj_attr_u { /** \brief Cache-specific Object Attributes */ struct hwloc_cache_attr_s { hwloc_uint64_t size; /**< \brief Size of cache in bytes */ - unsigned depth; /**< \brief Depth of cache */ + unsigned depth; /**< \brief Depth of cache (e.g., L1, L2, ...etc.) */ unsigned linesize; /**< \brief Cache-line size in bytes */ } cache; /** \brief Group-specific Object Attributes */ @@ -775,7 +805,7 @@ HWLOC_DECLSPEC const struct hwloc_topology_support *hwloc_topology_get_support(h -/** \defgroup hwlocality_tinker Tinker with topologies. +/** \defgroup hwlocality_tinker Tinker With Topologies. * @{ */ @@ -860,8 +890,13 @@ HWLOC_DECLSPEC int hwloc_topology_restrict(hwloc_topology_t __hwloc_restrict top -/** \defgroup hwlocality_information Get some Topology Information +/** \defgroup hwlocality_information Get Some Topology Information * @{ + * + * Be sure to see the figure in \ref termsanddefs that shows a + * complete topology tree, including depths, child/sibling/cousin + * relationships, and an example of an asymmetric topology where one + * socket has fewer caches than its peers. */ /** \brief Get the depth of the hierarchical tree of objects. @@ -895,7 +930,8 @@ enum hwloc_get_type_depth_e { */ HWLOC_DECLSPEC hwloc_obj_type_t hwloc_get_depth_type (hwloc_topology_t topology, unsigned depth) __hwloc_attribute_pure; -/** \brief Returns the width of level at depth \p depth */ +/** \brief Returns the width of level at depth \p depth. + */ HWLOC_DECLSPEC unsigned hwloc_get_nbobjs_by_depth (hwloc_topology_t topology, unsigned depth) __hwloc_attribute_pure; /** \brief Returns the width of level type \p type @@ -929,6 +965,11 @@ HWLOC_DECLSPEC int hwloc_topology_is_thissystem(hwloc_topology_t __hwloc_restri /** \defgroup hwlocality_traversal Retrieve Objects * @{ + * + * Be sure to see the figure in \ref termsanddefs that shows a + * complete topology tree, including depths, child/sibling/cousin + * relationships, and an example of an asymmetric topology where one + * socket has fewer caches than its peers. */ /** \brief Returns the topology object at logical index \p idx from depth \p depth */ @@ -1146,24 +1187,30 @@ typedef enum { * support of CPU bindings, i.e. potentially * return -1 with errno set to ENOSYS in some * cases. + * + * This flag is only meaningful when + * used with functions that set the + * CPU binding. It is ignored when + * used with functions that get CPU + * binding information. */ } hwloc_cpubind_flags_t; -/** \brief Bind current process or thread on cpus given in bitmap \p set +/** \brief Bind current process or thread on cpus given in bitmap \p set. * * \return -1 with errno set to ENOSYS if the action is not supported * \return -1 with errno set to EXDEV if the binding cannot be enforced */ HWLOC_DECLSPEC int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags); -/** \brief Get current process or thread binding +/** \brief Get current process or thread binding. * * Writes into \p set the cpuset which the process or thread (according to \e * flags) was last bound to. */ HWLOC_DECLSPEC int hwloc_get_cpubind(hwloc_topology_t topology, hwloc_cpuset_t set, int flags); -/** \brief Bind a process \p pid on cpus given in bitmap \p set +/** \brief Bind a process \p pid on cpus given in bitmap \p set. * * \note hwloc_pid_t is pid_t on unix platforms, and HANDLE on native Windows * platforms @@ -1172,17 +1219,21 @@ HWLOC_DECLSPEC int hwloc_get_cpubind(hwloc_topology_t topology, hwloc_cpuset_t s */ HWLOC_DECLSPEC int hwloc_set_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_const_cpuset_t set, int flags); -/** \brief Get the current binding of process \p pid +/** \brief Get the current binding of process \p pid. * * \note hwloc_pid_t is pid_t on unix platforms, and HANDLE on native Windows * platforms * * \note HWLOC_CPUBIND_THREAD can not be used in \p flags. + * + * \note As a special case on Linux, if a tid (thread ID) is supplied + * instead of a pid (process ID), the binding for that specific thread + * is returned. */ HWLOC_DECLSPEC int hwloc_get_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags); #ifdef hwloc_thread_t -/** \brief Bind a thread \p thread on cpus given in bitmap \p set +/** \brief Bind a thread \p thread on cpus given in bitmap \p set. * * \note hwloc_thread_t is pthread_t on unix platforms, and HANDLE on native * Windows platforms @@ -1193,7 +1244,7 @@ HWLOC_DECLSPEC int hwloc_set_thread_cpubind(hwloc_topology_t topology, hwloc_thr #endif #ifdef hwloc_thread_t -/** \brief Get the current binding of thread \p tid +/** \brief Get the current binding of thread \p tid. * * \note hwloc_thread_t is pthread_t on unix platforms, and HANDLE on native * Windows platforms @@ -1220,6 +1271,10 @@ HWLOC_DECLSPEC int hwloc_get_last_cpu_location(hwloc_topology_t topology, hwloc_ * outdated. * * \note HWLOC_CPUBIND_THREAD can not be used in \p flags. + * + * \note As a special case on Linux, if a tid (thread ID) is supplied + * instead of a pid (process ID), the binding for that specific thread + * is returned. */ HWLOC_DECLSPEC int hwloc_get_proc_last_cpu_location(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags); diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/helper.h b/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/helper.h index 45a538491b..ed949aaba0 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/helper.h +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/helper.h @@ -28,6 +28,11 @@ extern "C" { /** \defgroup hwlocality_helper_types Object Type Helpers * @{ + * + * Be sure to see the figure in \ref termsanddefs that shows a + * complete topology tree, including depths, child/sibling/cousin + * relationships, and an example of an asymmetric topology where one + * socket has fewer caches than its peers. */ /** \brief Returns the depth of objects of type \p type or below @@ -82,6 +87,11 @@ hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type) /** \defgroup hwlocality_helper_traversal_basic Basic Traversal Helpers * @{ + * + * Be sure to see the figure in \ref termsanddefs that shows a + * complete topology tree, including depths, child/sibling/cousin + * relationships, and an example of an asymmetric topology where one + * socket has fewer caches than its peers. */ /** \brief Returns the top-object of the topology-tree. @@ -514,6 +524,11 @@ hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute /** \defgroup hwlocality_helper_traversal Advanced Traversal Helpers * @{ + * + * Be sure to see the figure in \ref termsanddefs that shows a + * complete topology tree, including depths, child/sibling/cousin + * relationships, and an example of an asymmetric topology where one + * socket has fewer caches than its peers. */ /** \brief Do a depth-first traversal of the topology to find and sort diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/rename.h b/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/rename.h index e287788e13..cb9bf9954e 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/rename.h +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/include/hwloc/rename.h @@ -263,6 +263,9 @@ extern "C" { #define hwloc_cpuset_zero HWLOC_NAME(cpuset_zero) #define hwloc_cpuset_fill HWLOC_NAME(cpuset_fill) #define hwloc_cpuset_from_ulong HWLOC_NAME(cpuset_from_ulong) +#define hwloc_cpuset_taskset_snprintf HWLOC_NAME(cpuset_taskset_snprintf) +#define hwloc_cpuset_taskset_asprintf HWLOC_NAME(cpuset_taskset_asprintf) +#define hwloc_cpuset_taskset_sscanf HWLOC_NAME(cpuset_taskset_sscanf) #define hwloc_cpuset_from_ith_ulong HWLOC_NAME(cpuset_from_ith_ulong) #define hwloc_cpuset_to_ulong HWLOC_NAME(cpuset_to_ulong) diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/include/private/autogen/config.h.in b/opal/mca/hwloc/hwloc122ompi/hwloc/include/private/autogen/config.h.in index d3daa8f020..6171202c0e 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/include/private/autogen/config.h.in +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/include/private/autogen/config.h.in @@ -3,7 +3,7 @@ /* -*- c -*- * * Copyright © 2009 CNRS, INRIA., Université Bordeaux 1 All rights reserved. - * Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved. + * Copyright © 2009 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow diff --git a/opal/mca/hwloc/hwloc122ompi/hwloc/src/topology-linux.c b/opal/mca/hwloc/hwloc122ompi/hwloc/src/topology-linux.c index b5a04feb7c..df877dce23 100644 --- a/opal/mca/hwloc/hwloc122ompi/hwloc/src/topology-linux.c +++ b/opal/mca/hwloc/hwloc122ompi/hwloc/src/topology-linux.c @@ -2059,7 +2059,7 @@ hwloc_read_raw(const char *p, const char *p1, size_t *bytes_read, int root_fd) file = hwloc_open(fname, root_fd); if (-1 == file) { - goto out; + goto out_no_close; } if (fstat(file, &fs)) { goto out; @@ -2079,6 +2079,7 @@ hwloc_read_raw(const char *p, const char *p1, size_t *bytes_read, int root_fd) out: close(file); + out_no_close: if (NULL != fname) { free(fname); }