From fe9857adaaf523e8fa0defd6c308093ca5201b41 Mon Sep 17 00:00:00 2001 From: Shiqing Fan Date: Sat, 21 Jul 2012 22:44:58 +0000 Subject: [PATCH] remove files that are not necessary for hwloc windows build. This commit was SVN r26826. --- CMakeLists.txt | 1 + contrib/Makefile.am | 11 - .../CMakeModules/opal_hwloc_config.cmake | 2 + contrib/platform/win32/include/hwloc/bitmap.h | 335 ---- contrib/platform/win32/include/hwloc/cpuset.h | 75 - contrib/platform/win32/include/hwloc/cuda.h | 135 -- contrib/platform/win32/include/hwloc/cudart.h | 131 -- .../win32/include/hwloc/glibc-sched.h | 121 -- contrib/platform/win32/include/hwloc/helper.h | 1351 ----------------- .../win32/include/hwloc/linux-libnuma.h | 462 ------ contrib/platform/win32/include/hwloc/linux.h | 64 - .../win32/include/hwloc/myriexpress.h | 111 -- .../win32/include/hwloc/openfabrics-verbs.h | 85 -- contrib/platform/win32/include/hwloc/rename.h | 559 ------- 14 files changed, 3 insertions(+), 3440 deletions(-) delete mode 100644 contrib/platform/win32/include/hwloc/bitmap.h delete mode 100644 contrib/platform/win32/include/hwloc/cpuset.h delete mode 100644 contrib/platform/win32/include/hwloc/cuda.h delete mode 100644 contrib/platform/win32/include/hwloc/cudart.h delete mode 100644 contrib/platform/win32/include/hwloc/glibc-sched.h delete mode 100644 contrib/platform/win32/include/hwloc/helper.h delete mode 100644 contrib/platform/win32/include/hwloc/linux-libnuma.h delete mode 100644 contrib/platform/win32/include/hwloc/linux.h delete mode 100644 contrib/platform/win32/include/hwloc/myriexpress.h delete mode 100644 contrib/platform/win32/include/hwloc/openfabrics-verbs.h delete mode 100644 contrib/platform/win32/include/hwloc/rename.h diff --git a/CMakeLists.txt b/CMakeLists.txt index f4b32aaad8..95a8ffabb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,6 +104,7 @@ INCLUDE (find_flex) FIND_FLEX() ADD_SUBDIRECTORY(opal) +INCLUDE_DIRECTORIES(${HWLOC_PATH}/hwloc/include) # set up the libevent include dirs INCLUDE_DIRECTORIES (${LIBEVENT_INCLUDE_DIRS}) ADD_SUBDIRECTORY(ompi) diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 48db7a744f..fe53f47ab9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -124,17 +124,6 @@ EXTRA_DIST = \ platform/win32/CMakeModules/fortran_check_real16_c_equiv.cmake \ platform/win32/CMakeModules/opal_hwloc_config.cmake \ platform/win32/include/hwloc/autogen/config.h \ - platform/win32/include/hwloc/bitmap.h \ - platform/win32/include/hwloc/cpuset.h \ - platform/win32/include/hwloc/cuda.h \ - platform/win32/include/hwloc/cudart.h \ - platform/win32/include/hwloc/glibc-sched.h \ - platform/win32/include/hwloc/helper.h \ - platform/win32/include/hwloc/linux-libnuma.h \ - platform/win32/include/hwloc/linux.h \ - platform/win32/include/hwloc/myriexpress.h \ - platform/win32/include/hwloc/openfabrics-verbs.h \ - platform/win32/include/hwloc/rename.h \ platform/win32/include/private/autogen/config.h \ platform/cisco/macosx-dynamic \ platform/cisco/macosx-dynamic.conf \ diff --git a/contrib/platform/win32/CMakeModules/opal_hwloc_config.cmake b/contrib/platform/win32/CMakeModules/opal_hwloc_config.cmake index c3722baa89..f6ae082d61 100644 --- a/contrib/platform/win32/CMakeModules/opal_hwloc_config.cmake +++ b/contrib/platform/win32/CMakeModules/opal_hwloc_config.cmake @@ -16,6 +16,8 @@ INCLUDE_DIRECTORIES ("${CURRENT_PATH}/" "${CURRENT_PATH}/../" "${CURRENT_PATH}/hwloc/include/") +SET(HWLOC_PATH ${CURRENT_PATH} CACHE INERNAL "path to hwloc dir") + SET(RESULT_COMPONENT_FILES ${RESULT_COMPONENT_FILES} ${CURRENT_PATH}/${hwloc_dir}_component.c diff --git a/contrib/platform/win32/include/hwloc/bitmap.h b/contrib/platform/win32/include/hwloc/bitmap.h deleted file mode 100644 index cd9ce2e175..0000000000 --- a/contrib/platform/win32/include/hwloc/bitmap.h +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright © 2009 CNRS - * Copyright © 2009-2011 inria. All rights reserved. - * Copyright © 2009-2011 Université Bordeaux 1 - * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief The bitmap API, for use in hwloc itself. - */ - -#ifndef HWLOC_BITMAP_H -#define HWLOC_BITMAP_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_bitmap The bitmap API - * - * The ::hwloc_bitmap_t type represents a set of objects, typically OS - * processors -- which may actually be hardware threads (represented - * by ::hwloc_cpuset_t, which is a typedef for ::hwloc_bitmap_t) -- or - * memory nodes (represented by ::hwloc_nodeset_t, which is also a - * typedef for ::hwloc_bitmap_t). - * - * Both CPU and node sets are always indexed by OS physical number. - * - * \note CPU sets and nodesets are described in \ref hwlocality_sets. - * - * A bitmap may be of infinite size. - * @{ - */ - - -/** \brief - * Set of bits represented as an opaque pointer to an internal bitmap. - */ -typedef struct hwloc_bitmap_s * hwloc_bitmap_t; -/** \brief a non-modifiable ::hwloc_bitmap_t */ -typedef const struct hwloc_bitmap_s * hwloc_const_bitmap_t; - - -/* - * Bitmap allocation, freeing and copying. - */ - -/** \brief Allocate a new empty bitmap. - * - * \returns A valid bitmap or \c NULL. - * - * The bitmap should be freed by a corresponding call to - * hwloc_bitmap_free(). - */ -HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_alloc(void) __hwloc_attribute_malloc; - -/** \brief Allocate a new full bitmap. */ -HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_alloc_full(void) __hwloc_attribute_malloc; - -/** \brief Free bitmap \p bitmap. - * - * If \p bitmap is \c NULL, no operation is performed. - */ -HWLOC_DECLSPEC void hwloc_bitmap_free(hwloc_bitmap_t bitmap); - -/** \brief Duplicate bitmap \p bitmap by allocating a new bitmap and copying \p bitmap contents. - * - * If \p bitmap is \c NULL, \c NULL is returned. - */ -HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc; - -/** \brief Copy the contents of bitmap \p src into the already allocated bitmap \p dst */ -HWLOC_DECLSPEC void hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src); - - -/* - * Bitmap/String Conversion - */ - -/** \brief Stringify a bitmap. - * - * Up to \p buflen characters may be written in buffer \p buf. - * - * If \p buflen is 0, \p buf may safely be \c NULL. - * - * \return the number of character that were actually written if not truncating, - * or that would have been written (not including the ending \\0). - */ -HWLOC_DECLSPEC int hwloc_bitmap_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap); - -/** \brief Stringify a bitmap into a newly allocated string. - */ -HWLOC_DECLSPEC int hwloc_bitmap_asprintf(char ** strp, hwloc_const_bitmap_t bitmap); - -/** \brief Parse a bitmap string and stores it in bitmap \p bitmap. - */ -HWLOC_DECLSPEC int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string); - -/** \brief Stringify a bitmap in the list format. - * - * Lists are comma-separated indexes or ranges. - * Ranges are dash separated indexes. - * The last range may not have a ending indexes if the bitmap is infinite. - * - * Up to \p buflen characters may be written in buffer \p buf. - * - * If \p buflen is 0, \p buf may safely be \c NULL. - * - * \return the number of character that were actually written if not truncating, - * or that would have been written (not including the ending \\0). - */ -HWLOC_DECLSPEC int hwloc_bitmap_list_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap); - -/** \brief Stringify a bitmap into a newly allocated list string. - */ -HWLOC_DECLSPEC int hwloc_bitmap_list_asprintf(char ** strp, hwloc_const_bitmap_t bitmap); - -/** \brief Parse a list string and stores it in bitmap \p bitmap. - */ -HWLOC_DECLSPEC int hwloc_bitmap_list_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string); - -/** \brief Stringify a bitmap in the taskset-specific format. - * - * The taskset command manipulates bitmap strings that contain a single - * (possible very long) hexadecimal number starting with 0x. - * - * Up to \p buflen characters may be written in buffer \p buf. - * - * If \p buflen is 0, \p buf may safely be \c NULL. - * - * \return the number of character that were actually written if not truncating, - * or that would have been written (not including the ending \\0). - */ -HWLOC_DECLSPEC int hwloc_bitmap_taskset_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap); - -/** \brief Stringify a bitmap into a newly allocated taskset-specific string. - */ -HWLOC_DECLSPEC int hwloc_bitmap_taskset_asprintf(char ** strp, hwloc_const_bitmap_t bitmap); - -/** \brief Parse a taskset-specific bitmap string and stores it in bitmap \p bitmap. - */ -HWLOC_DECLSPEC int hwloc_bitmap_taskset_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string); - - -/* - * Building bitmaps. - */ - -/** \brief Empty the bitmap \p bitmap */ -HWLOC_DECLSPEC void hwloc_bitmap_zero(hwloc_bitmap_t bitmap); - -/** \brief Fill bitmap \p bitmap with all possible indexes (even if those objects don't exist or are otherwise unavailable) */ -HWLOC_DECLSPEC void hwloc_bitmap_fill(hwloc_bitmap_t bitmap); - -/** \brief Empty the bitmap \p bitmap and add bit \p id */ -HWLOC_DECLSPEC void hwloc_bitmap_only(hwloc_bitmap_t bitmap, unsigned id); - -/** \brief Fill the bitmap \p and clear the index \p id */ -HWLOC_DECLSPEC void hwloc_bitmap_allbut(hwloc_bitmap_t bitmap, unsigned id); - -/** \brief Setup bitmap \p bitmap from unsigned long \p mask */ -HWLOC_DECLSPEC void hwloc_bitmap_from_ulong(hwloc_bitmap_t bitmap, unsigned long mask); - -/** \brief Setup bitmap \p bitmap from unsigned long \p mask used as \p i -th subset */ -HWLOC_DECLSPEC void hwloc_bitmap_from_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask); - - -/* - * Modifying bitmaps. - */ - -/** \brief Add index \p id in bitmap \p bitmap */ -HWLOC_DECLSPEC void hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id); - -/** \brief Add indexes from \p begin to \p end in bitmap \p bitmap. - * - * If \p end is \c -1, the range is infinite. - */ -HWLOC_DECLSPEC void hwloc_bitmap_set_range(hwloc_bitmap_t bitmap, unsigned begin, int end); - -/** \brief Replace \p i -th subset of bitmap \p bitmap with unsigned long \p mask */ -HWLOC_DECLSPEC void hwloc_bitmap_set_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask); - -/** \brief Remove index \p id from bitmap \p bitmap */ -HWLOC_DECLSPEC void hwloc_bitmap_clr(hwloc_bitmap_t bitmap, unsigned id); - -/** \brief Remove indexes from \p begin to \p end in bitmap \p bitmap. - * - * If \p end is \c -1, the range is infinite. - */ -HWLOC_DECLSPEC void hwloc_bitmap_clr_range(hwloc_bitmap_t bitmap, unsigned begin, int end); - -/** \brief Keep a single index among those set in bitmap \p bitmap - * - * May be useful before binding so that the process does not - * have a chance of migrating between multiple logical CPUs - * in the original mask. - */ -HWLOC_DECLSPEC void hwloc_bitmap_singlify(hwloc_bitmap_t bitmap); - - -/* - * Consulting bitmaps. - */ - -/** \brief Convert the beginning part of bitmap \p bitmap into unsigned long \p mask */ -HWLOC_DECLSPEC unsigned long hwloc_bitmap_to_ulong(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure; - -/** \brief Convert the \p i -th subset of bitmap \p bitmap into unsigned long mask */ -HWLOC_DECLSPEC unsigned long hwloc_bitmap_to_ith_ulong(hwloc_const_bitmap_t bitmap, unsigned i) __hwloc_attribute_pure; - -/** \brief Test whether index \p id is part of bitmap \p bitmap */ -HWLOC_DECLSPEC int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id) __hwloc_attribute_pure; - -/** \brief Test whether bitmap \p bitmap is empty */ -HWLOC_DECLSPEC int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure; - -/** \brief Test whether bitmap \p bitmap is completely full */ -HWLOC_DECLSPEC int hwloc_bitmap_isfull(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure; - -/** \brief Compute the first index (least significant bit) in bitmap \p bitmap - * - * \return -1 if no index is set. - */ -HWLOC_DECLSPEC int hwloc_bitmap_first(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure; - -/** \brief Compute the next index in bitmap \p bitmap which is after index \p prev - * - * If \p prev is -1, the first index is returned. - * - * \return -1 if no index with higher index is bitmap. - */ -HWLOC_DECLSPEC int hwloc_bitmap_next(hwloc_const_bitmap_t bitmap, int prev) __hwloc_attribute_pure; - -/** \brief Compute the last index (most significant bit) in bitmap \p bitmap - * - * \return -1 if no index is bitmap, or if the index bitmap is infinite. - */ -HWLOC_DECLSPEC int hwloc_bitmap_last(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure; - -/** \brief Compute the "weight" of bitmap \p bitmap (i.e., number of - * indexes that are in the bitmap). - * - * \return the number of indexes that are in the bitmap. - */ -HWLOC_DECLSPEC int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure; - -/** \brief Loop macro iterating on bitmap \p bitmap - * \hideinitializer - * - * \p index is the loop variable; it should be an unsigned int. The - * first iteration will set \p index to the lowest index in the bitmap. - * Successive iterations will iterate through, in order, all remaining - * indexes that in the bitmap. To be specific: each iteration will return a - * value for \p index such that hwloc_bitmap_isset(bitmap, index) is true. - * - * The assert prevents the loop from being infinite if the bitmap is infinite. - */ -#define hwloc_bitmap_foreach_begin(id, bitmap) \ -do { \ - assert(hwloc_bitmap_weight(bitmap) != -1); \ - for (id = hwloc_bitmap_first(bitmap); \ - (unsigned) id != (unsigned) -1; \ - id = hwloc_bitmap_next(bitmap, id)) { \ -/** \brief End of loop. Needs a terminating ';'. - * \hideinitializer - * - * \sa hwloc_bitmap_foreach_begin */ -#define hwloc_bitmap_foreach_end() \ - } \ -} while (0) - - -/* - * Combining bitmaps. - */ - -/** \brief Or bitmaps \p bitmap1 and \p bitmap2 and store the result in bitmap \p res */ -HWLOC_DECLSPEC void hwloc_bitmap_or (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2); - -/** \brief And bitmaps \p bitmap1 and \p bitmap2 and store the result in bitmap \p res */ -HWLOC_DECLSPEC void hwloc_bitmap_and (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2); - -/** \brief And bitmap \p bitmap1 and the negation of \p bitmap2 and store the result in bitmap \p res */ -HWLOC_DECLSPEC void hwloc_bitmap_andnot (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2); - -/** \brief Xor bitmaps \p bitmap1 and \p bitmap2 and store the result in bitmap \p res */ -HWLOC_DECLSPEC void hwloc_bitmap_xor (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2); - -/** \brief Negate bitmap \p bitmap and store the result in bitmap \p res */ -HWLOC_DECLSPEC void hwloc_bitmap_not (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap); - - -/* - * Comparing bitmaps. - */ - -/** \brief Test whether bitmaps \p bitmap1 and \p bitmap2 intersects */ -HWLOC_DECLSPEC int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure; - -/** \brief Test whether bitmap \p sub_bitmap is part of bitmap \p super_bitmap */ -HWLOC_DECLSPEC int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap) __hwloc_attribute_pure; - -/** \brief Test whether bitmap \p bitmap1 is equal to bitmap \p bitmap2 */ -HWLOC_DECLSPEC int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure; - -/** \brief Compare bitmaps \p bitmap1 and \p bitmap2 using their lowest index. - * - * Smaller least significant bit is smaller. - * The empty bitmap is considered higher than anything. - */ -HWLOC_DECLSPEC int hwloc_bitmap_compare_first(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure; - -/** \brief Compare bitmaps \p bitmap1 and \p bitmap2 using their highest index. - * - * Higher most significant bit is higher. - * The empty bitmap is considered lower than anything. - */ -HWLOC_DECLSPEC int hwloc_bitmap_compare(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure; - -/** @} */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_BITMAP_H */ diff --git a/contrib/platform/win32/include/hwloc/cpuset.h b/contrib/platform/win32/include/hwloc/cpuset.h deleted file mode 100644 index 742ee1c958..0000000000 --- a/contrib/platform/win32/include/hwloc/cpuset.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright © 2009 CNRS - * Copyright © 2009-2010 inria. All rights reserved. - * Copyright © 2009-2010 Université Bordeaux 1 - * Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief The old deprecated Cpuset API. - * This interface should not be used anymore, it will be dropped in a later release. - * - * hwloc/bitmap.h should be used instead. Most hwloc_cpuset_foo functions are - * replaced with hwloc_bitmap_foo. The only exceptions are: - * - hwloc_cpuset_from_string -> hwloc_bitmap_sscanf - * - hwloc_cpuset_cpu -> hwloc_bitmap_only - * - hwloc_cpuset_all_but_cpu -> hwloc_bitmap_allbut - */ - -#ifndef HWLOC_CPUSET_H -#define HWLOC_CPUSET_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "hwloc/bitmap.h" - -static __hwloc_inline hwloc_bitmap_t __hwloc_attribute_deprecated hwloc_cpuset_alloc(void) { return hwloc_bitmap_alloc(); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_free(hwloc_bitmap_t bitmap) { hwloc_bitmap_free(bitmap); } -static __hwloc_inline hwloc_bitmap_t __hwloc_attribute_deprecated hwloc_cpuset_dup(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_dup(bitmap); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src) { hwloc_bitmap_copy(dst, src); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_snprintf(buf, buflen, bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_asprintf(char ** strp, hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_asprintf(strp, bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_from_string(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string) { return hwloc_bitmap_sscanf(bitmap, string); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_zero(hwloc_bitmap_t bitmap) { hwloc_bitmap_zero(bitmap); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_fill(hwloc_bitmap_t bitmap) { hwloc_bitmap_fill(bitmap); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_from_ulong(hwloc_bitmap_t bitmap, unsigned long mask) { hwloc_bitmap_from_ulong(bitmap, mask); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_from_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask) { hwloc_bitmap_from_ith_ulong(bitmap, i, mask); } -static __hwloc_inline unsigned __hwloc_attribute_deprecated long hwloc_cpuset_to_ulong(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_to_ulong(bitmap); } -static __hwloc_inline unsigned __hwloc_attribute_deprecated long hwloc_cpuset_to_ith_ulong(hwloc_const_bitmap_t bitmap, unsigned i) { return hwloc_bitmap_to_ith_ulong(bitmap, i); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_cpu(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_only(bitmap, index_); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_all_but_cpu(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_allbut(bitmap, index_); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_set(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_set(bitmap, index_); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_set_range(hwloc_bitmap_t bitmap, unsigned begin, unsigned end) { hwloc_bitmap_set_range(bitmap, begin, end); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_set_ith_ulong(hwloc_bitmap_t bitmap, unsigned i, unsigned long mask) { hwloc_bitmap_set_ith_ulong(bitmap, i, mask); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_clr(hwloc_bitmap_t bitmap, unsigned index_) { hwloc_bitmap_clr(bitmap, index_); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_clr_range(hwloc_bitmap_t bitmap, unsigned begin, unsigned end) { hwloc_bitmap_clr_range(bitmap, begin, end); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isset(hwloc_const_bitmap_t bitmap, unsigned index_) { return hwloc_bitmap_isset(bitmap, index_); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_iszero(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_iszero(bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isfull(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_isfull(bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isequal(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { return hwloc_bitmap_isequal(bitmap1, bitmap2); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_intersects(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { return hwloc_bitmap_intersects(bitmap1, bitmap2); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_isincluded(hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap) { return hwloc_bitmap_isincluded(sub_bitmap, super_bitmap); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { hwloc_bitmap_or(res, bitmap1, bitmap2); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_and(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { hwloc_bitmap_and(res, bitmap1, bitmap2); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_andnot(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { hwloc_bitmap_andnot(res, bitmap1, bitmap2); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_xor(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { hwloc_bitmap_xor(res, bitmap1, bitmap2); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_not(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap) { hwloc_bitmap_not(res, bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_first(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_first(bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_last(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_last(bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_next(hwloc_const_bitmap_t bitmap, unsigned prev) { return hwloc_bitmap_next(bitmap, prev); } -static __hwloc_inline void __hwloc_attribute_deprecated hwloc_cpuset_singlify(hwloc_bitmap_t bitmap) { hwloc_bitmap_singlify(bitmap); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_compare_first(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { return hwloc_bitmap_compare_first(bitmap1, bitmap2); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_compare(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) { return hwloc_bitmap_compare(bitmap1, bitmap2); } -static __hwloc_inline int __hwloc_attribute_deprecated hwloc_cpuset_weight(hwloc_const_bitmap_t bitmap) { return hwloc_bitmap_weight(bitmap); } - -#define hwloc_cpuset_foreach_begin hwloc_bitmap_foreach_begin -#define hwloc_cpuset_foreach_end hwloc_bitmap_foreach_end - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* HWLOC_CPUSET_H */ diff --git a/contrib/platform/win32/include/hwloc/cuda.h b/contrib/platform/win32/include/hwloc/cuda.h deleted file mode 100644 index 85ef500422..0000000000 --- a/contrib/platform/win32/include/hwloc/cuda.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright © 2010-2012 inria. All rights reserved. - * Copyright © 2010-2011 Université Bordeaux 1 - * Copyright © 2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and the CUDA Driver API. - * - * Applications that use both hwloc and the CUDA Driver API may want to - * include this file so as to get topology information for CUDA devices. - * - */ - -#ifndef HWLOC_CUDA_H -#define HWLOC_CUDA_H - -#include -#include -#include -#include - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_cuda CUDA Driver API Specific Functions - * @{ - */ - -/** \brief Return the domain, bus and device IDs of device \p cudevice. - */ -static __hwloc_inline int -hwloc_cuda_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused, - CUdevice cudevice, int *domain, int *bus, int *dev) -{ - CUresult cres; - -#if CUDA_VERSION >= 4000 - cres = cuDeviceGetAttribute(domain, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, cudevice); - if (cres != CUDA_SUCCESS) { - errno = ENOSYS; - return -1; - } -#else - *domain = 0; -#endif - cres = cuDeviceGetAttribute(bus, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, cudevice); - if (cres != CUDA_SUCCESS) { - errno = ENOSYS; - return -1; - } - cres = cuDeviceGetAttribute(dev, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, cudevice); - if (cres != CUDA_SUCCESS) { - errno = ENOSYS; - return -1; - } - - return 0; -} - -/** \brief Get the CPU set of logical processors that are physically - * close to device \p cudevice. - * - * For the given CUDA Driver API device \p cudevice, read the corresponding - * kernel-provided cpumap file and return the corresponding CPU set. - * This function is currently only implemented in a meaningful way for - * Linux; other systems will simply get a full cpuset. - * - * Topology \p topology must match the current machine. - */ -static __hwloc_inline int -hwloc_cuda_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused, - CUdevice cudevice, hwloc_cpuset_t set) -{ -#ifdef HWLOC_LINUX_SYS - /* If we're on Linux, use the sysfs mechanism to get the local cpus */ -#define HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX 128 - char path[HWLOC_CUDA_DEVICE_SYSFS_PATH_MAX]; - FILE *sysfile = NULL; - int domainid, busid, deviceid; - - if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domainid, &busid, &deviceid)) - return -1; - - sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", domainid, busid, deviceid); - sysfile = fopen(path, "r"); - if (!sysfile) - return -1; - - hwloc_linux_parse_cpumap_file(sysfile, set); - if (hwloc_bitmap_iszero(set)) - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); - - fclose(sysfile); -#else - /* Non-Linux systems simply get a full cpuset */ - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); -#endif - return 0; -} - -/** \brief Get the hwloc object for the PCI device corresponding - * to device \p cudevice. - * - * For the given CUDA Runtime API device \p cudevice, return the hwloc PCI - * object containing the device. Returns NULL if there is none. - * - * IO devices detection must be enabled in topology \p topology. - */ -static __hwloc_inline hwloc_obj_t -hwloc_cuda_get_device_pcidev(hwloc_topology_t topology, CUdevice cudevice) -{ - int domain, bus, dev; - - if (hwloc_cuda_get_device_pci_ids(topology, cudevice, &domain, &bus, &dev)) - return NULL; - - return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0); -} - -/** @} */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_CUDA_H */ diff --git a/contrib/platform/win32/include/hwloc/cudart.h b/contrib/platform/win32/include/hwloc/cudart.h deleted file mode 100644 index 2122d7fb60..0000000000 --- a/contrib/platform/win32/include/hwloc/cudart.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright © 2010-2012 inria. All rights reserved. - * Copyright © 2010-2011 Université Bordeaux 1 - * Copyright © 2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and the CUDA Runtime API. - * - * Applications that use both hwloc and the CUDA Runtime API may want to - * include this file so as to get topology information for CUDA devices. - * - */ - -#ifndef HWLOC_CUDART_H -#define HWLOC_CUDART_H - -#include -#include -#include -#include - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_cudart CUDA Runtime API Specific Functions - * @{ - */ - -/** \brief Return the domain, bus and device IDs of device \p device. - */ -static __hwloc_inline int -hwloc_cudart_get_device_pci_ids(hwloc_topology_t topology __hwloc_attribute_unused, - int device, int *domain, int *bus, int *dev) -{ - cudaError_t cerr; - struct cudaDeviceProp prop; - - cerr = cudaGetDeviceProperties(&prop, device); - if (cerr) { - errno = ENOSYS; - return -1; - } - -#if CUDART_VERSION >= 4000 - *domain = prop.pciDomainID; -#else - *domain = 0; -#endif - - *bus = prop.pciBusID; - *dev = prop.pciDeviceID; - - return 0; -} - -/** \brief Get the CPU set of logical processors that are physically - * close to device \p device. - * - * For the given CUDA Runtime API device \p device, read the corresponding - * kernel-provided cpumap file and return the corresponding CPU set. - * This function is currently only implemented in a meaningful way for - * Linux; other systems will simply get a full cpuset. - * - * Topology \p topology must match the current machine. - */ -static __hwloc_inline int -hwloc_cudart_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused, - int device, hwloc_cpuset_t set) -{ -#ifdef HWLOC_LINUX_SYS - /* If we're on Linux, use the sysfs mechanism to get the local cpus */ -#define HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX 128 - char path[HWLOC_CUDART_DEVICE_SYSFS_PATH_MAX]; - FILE *sysfile = NULL; - int domain, bus, dev; - - if (hwloc_cudart_get_device_pci_ids(topology, device, &domain, &bus, &dev)) - return -1; - - sprintf(path, "/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", domain, bus, dev); - sysfile = fopen(path, "r"); - if (!sysfile) - return -1; - - hwloc_linux_parse_cpumap_file(sysfile, set); - if (hwloc_bitmap_iszero(set)) - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); - - fclose(sysfile); -#else - /* Non-Linux systems simply get a full cpuset */ - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); -#endif - return 0; -} - -/** \brief Get the hwloc object for the PCI device corresponding - * to device \p device. - * - * For the given CUDA Runtime API device \p device, return the hwloc PCI - * object containing the device. Returns NULL if there is none. - * - * IO devices detection must be enabled in topology \p topology. - */ -static __hwloc_inline hwloc_obj_t -hwloc_cudart_get_device_pcidev(hwloc_topology_t topology, int device) -{ - int domain, bus, dev; - - if (hwloc_cudart_get_device_pci_ids(topology, device, &domain, &bus, &dev)) - return NULL; - - return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0); -} - -/** @} */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_CUDART_H */ diff --git a/contrib/platform/win32/include/hwloc/glibc-sched.h b/contrib/platform/win32/include/hwloc/glibc-sched.h deleted file mode 100644 index a5f0346414..0000000000 --- a/contrib/platform/win32/include/hwloc/glibc-sched.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright © 2009 CNRS - * Copyright © 2009-2012 inria. All rights reserved. - * Copyright © 2009-2011 Université Bordeaux 1 - * Copyright © 2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and glibc scheduling routines. - * - * Applications that use both hwloc and glibc scheduling routines such as - * sched_getaffinity may want to include this file so as to ease conversion - * between their respective types. - * - * \note Topology \p topology must match the current machine. - */ - -#ifndef HWLOC_GLIBC_SCHED_H -#define HWLOC_GLIBC_SCHED_H - -#include -#include -#include - -#if !defined _GNU_SOURCE || !defined _SCHED_H || (!defined CPU_SETSIZE && !defined sched_priority) -#error Please make sure to include sched.h before including glibc-sched.h, and define _GNU_SOURCE before any inclusion of sched.h -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifdef HWLOC_HAVE_CPU_SET - - -/** \defgroup hwlocality_glibc_sched Helpers for manipulating glibc sched affinity - * @{ - */ - - -/** \brief Convert hwloc CPU set \p toposet into glibc sched affinity CPU set \p schedset - * - * This function may be used before calling sched_setaffinity or any other function - * that takes a cpu_set_t as input parameter. - * - * \p schedsetsize should be sizeof(cpu_set_t) unless \p schedset was dynamically allocated with CPU_ALLOC - */ -static __hwloc_inline int -hwloc_cpuset_to_glibc_sched_affinity(hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t hwlocset, - cpu_set_t *schedset, size_t schedsetsize) -{ -#ifdef CPU_ZERO_S - unsigned cpu; - CPU_ZERO_S(schedsetsize, schedset); - hwloc_bitmap_foreach_begin(cpu, hwlocset) - CPU_SET_S(cpu, schedsetsize, schedset); - hwloc_bitmap_foreach_end(); -#else /* !CPU_ZERO_S */ - unsigned cpu; - CPU_ZERO(schedset); - assert(schedsetsize == sizeof(cpu_set_t)); - hwloc_bitmap_foreach_begin(cpu, hwlocset) - CPU_SET(cpu, schedset); - hwloc_bitmap_foreach_end(); -#endif /* !CPU_ZERO_S */ - return 0; -} - -/** \brief Convert glibc sched affinity CPU set \p schedset into hwloc CPU set - * - * This function may be used before calling sched_setaffinity or any other function - * that takes a cpu_set_t as input parameter. - * - * \p schedsetsize should be sizeof(cpu_set_t) unless \p schedset was dynamically allocated with CPU_ALLOC - */ -static __hwloc_inline int -hwloc_cpuset_from_glibc_sched_affinity(hwloc_topology_t topology __hwloc_attribute_unused, hwloc_cpuset_t hwlocset, - const cpu_set_t *schedset, size_t schedsetsize) -{ - int cpu; -#ifdef CPU_ZERO_S - int count; -#endif - hwloc_bitmap_zero(hwlocset); -#ifdef CPU_ZERO_S - count = CPU_COUNT_S(schedsetsize, schedset); - cpu = 0; - while (count) { - if (CPU_ISSET_S(cpu, schedsetsize, schedset)) { - hwloc_bitmap_set(hwlocset, cpu); - count--; - } - cpu++; - } -#else /* !CPU_ZERO_S */ - /* sched.h does not support dynamic cpu_set_t (introduced in glibc 2.7), - * assume we have a very old interface without CPU_COUNT (added in 2.6) - */ - assert(schedsetsize == sizeof(cpu_set_t)); - for(cpu=0; cpu -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \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 - * - * If no object of this type is present on the underlying architecture, the - * function returns the depth of the first "present" object typically found - * inside \p type. - * - * If some objects of the given type exist in different levels, for instance - * L1 and L2 caches, the function returns HWLOC_TYPE_DEPTH_MULTIPLE. - */ -static __hwloc_inline int -hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure; -static __hwloc_inline int -hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type) -{ - int depth = hwloc_get_type_depth(topology, type); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) - return depth; - - /* find the highest existing level with type order >= */ - for(depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU); ; depth--) - if (hwloc_compare_types(hwloc_get_depth_type(topology, depth), type) < 0) - return depth+1; - - /* Shouldn't ever happen, as there is always a SYSTEM level with lower order and known depth. */ - /* abort(); */ -} - -/** \brief Returns the depth of objects of type \p type or above - * - * If no object of this type is present on the underlying architecture, the - * function returns the depth of the first "present" object typically - * containing \p type. - * - * If some objects of the given type exist in different levels, for instance - * L1 and L2 caches, the function returns HWLOC_TYPE_DEPTH_MULTIPLE. - */ -static __hwloc_inline int -hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type) __hwloc_attribute_pure; -static __hwloc_inline int -hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type) -{ - int depth = hwloc_get_type_depth(topology, type); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) - return depth; - - /* find the lowest existing level with type order <= */ - for(depth = 0; ; depth++) - if (hwloc_compare_types(hwloc_get_depth_type(topology, depth), type) > 0) - return depth-1; - - /* Shouldn't ever happen, as there is always a PU level with higher order and known depth. */ - /* abort(); */ -} - -/** @} */ - - - -/** \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. - * - * Its type is typically ::HWLOC_OBJ_MACHINE but it could be different - * for complex topologies. This function replaces the old deprecated - * hwloc_get_system_obj(). - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_root_obj (hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_root_obj (hwloc_topology_t topology) -{ - return hwloc_get_obj_by_depth (topology, 0, 0); -} - -/** \brief Returns the ancestor object of \p obj at depth \p depth. */ -static __hwloc_inline hwloc_obj_t -hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology __hwloc_attribute_unused, unsigned depth, hwloc_obj_t obj) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology __hwloc_attribute_unused, unsigned depth, hwloc_obj_t obj) -{ - hwloc_obj_t ancestor = obj; - if (obj->depth < depth) - return NULL; - while (ancestor && ancestor->depth > depth) - ancestor = ancestor->parent; - return ancestor; -} - -/** \brief Returns the ancestor object of \p obj with type \p type. */ -static __hwloc_inline hwloc_obj_t -hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_type_t type, hwloc_obj_t obj) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_type_t type, hwloc_obj_t obj) -{ - hwloc_obj_t ancestor = obj->parent; - while (ancestor && ancestor->type != type) - ancestor = ancestor->parent; - return ancestor; -} - -/** \brief Returns the next object at depth \p depth. - * - * If \p prev is \c NULL, return the first object at depth \p depth. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_obj_by_depth (hwloc_topology_t topology, unsigned depth, hwloc_obj_t prev) -{ - if (!prev) - return hwloc_get_obj_by_depth (topology, depth, 0); - if (prev->depth != depth) - return NULL; - return prev->next_cousin; -} - -/** \brief Returns the next object of type \p type. - * - * If \p prev is \c NULL, return the first object at type \p type. If - * there are multiple or no depth for given type, return \c NULL and - * let the caller fallback to hwloc_get_next_obj_by_depth(). - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, - hwloc_obj_t prev) -{ - int depth = hwloc_get_type_depth(topology, type); - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE) - return NULL; - return hwloc_get_next_obj_by_depth (topology, depth, prev); -} - -/** \brief Returns the object of type ::HWLOC_OBJ_PU with \p os_index. - * - * \note The \p os_index field of object should most of the times only be - * used for pretty-printing purpose. Type ::HWLOC_OBJ_PU is the only case - * where \p os_index could actually be useful, when manually binding to - * processors. - * However, using CPU sets to hide this complexity should often be preferred. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_pu_obj_by_os_index(hwloc_topology_t topology, unsigned os_index) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_pu_obj_by_os_index(hwloc_topology_t topology, unsigned os_index) -{ - hwloc_obj_t obj = NULL; - while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PU, obj)) != NULL) - if (obj->os_index == os_index) - return obj; - return NULL; -} - -/** \brief Return the next child. - * - * If \p prev is \c NULL, return the first child. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_child (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t parent, hwloc_obj_t prev) -{ - if (!prev) - return parent->first_child; - if (prev->parent != parent) - return NULL; - return prev->next_sibling; -} - -/** \brief Returns the common parent object to objects lvl1 and lvl2 */ -static __hwloc_inline hwloc_obj_t -hwloc_get_common_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj1, hwloc_obj_t obj2) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_common_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj1, hwloc_obj_t obj2) -{ - /* the loop isn't so easy since intermediate ancestors may have - * different depth, causing us to alternate between using obj1->parent - * and obj2->parent. Also, even if at some point we find ancestors of - * of the same depth, their ancestors may have different depth again. - */ - while (obj1 != obj2) { - while (obj1->depth > obj2->depth) - obj1 = obj1->parent; - while (obj2->depth > obj1->depth) - obj2 = obj2->parent; - if (obj1 != obj2 && obj1->depth == obj2->depth) { - obj1 = obj1->parent; - obj2 = obj2->parent; - } - } - return obj1; -} - -/** \brief Returns true if \p obj is inside the subtree beginning with \p subtree_root. - * - * \note This function assumes that both \p obj and \p subtree_root have a \p cpuset. - */ -static __hwloc_inline int -hwloc_obj_is_in_subtree (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj, hwloc_obj_t subtree_root) __hwloc_attribute_pure; -static __hwloc_inline int -hwloc_obj_is_in_subtree (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj, hwloc_obj_t subtree_root) -{ - return hwloc_bitmap_isincluded(obj->cpuset, subtree_root->cpuset); -} - -/** @} */ - - - -/** \defgroup hwlocality_helper_find_inside Finding Objects Inside a CPU set - * @{ - */ - -/** \brief Get the first largest object included in the given cpuset \p set. - * - * \return the first object that is included in \p set and whose parent is not. - * - * This is convenient for iterating over all largest objects within a CPU set - * by doing a loop getting the first largest object and clearing its CPU set - * from the remaining CPU set. - * - * \note This function cannot work if the root object does not have a CPU set, - * e.g. if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_first_largest_obj_inside_cpuset(hwloc_topology_t topology, hwloc_const_cpuset_t set) -{ - hwloc_obj_t obj = hwloc_get_root_obj(topology); - if (!obj->cpuset || !hwloc_bitmap_intersects(obj->cpuset, set)) - return NULL; - while (!hwloc_bitmap_isincluded(obj->cpuset, set)) { - /* while the object intersects without being included, look at its children */ - hwloc_obj_t child = NULL; - while ((child = hwloc_get_next_child(topology, obj, child)) != NULL) { - if (child->cpuset && hwloc_bitmap_intersects(child->cpuset, set)) - break; - } - if (!child) - /* no child intersects, return their father */ - return obj; - /* found one intersecting child, look at its children */ - obj = child; - } - /* obj is included, return it */ - return obj; -} - -/** \brief Get the set of largest objects covering exactly a given cpuset \p set - * - * \return the number of objects returned in \p objs. - * - * \note This function cannot work if the root object does not have a CPU set, - * e.g. if the topology is made of different machines. - */ -HWLOC_DECLSPEC int hwloc_get_largest_objs_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, - hwloc_obj_t * __hwloc_restrict objs, int max); - -/** \brief Return the next object at depth \p depth included in CPU set \p set. - * - * If \p prev is \c NULL, return the first object at depth \p depth - * included in \p set. The next invokation should pass the previous - * return value in \p prev so as to obtain the next object in \p set. - * - * \note This function cannot work if objects at the given depth do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, - unsigned depth, hwloc_obj_t prev) -{ - hwloc_obj_t next = hwloc_get_next_obj_by_depth(topology, depth, prev); - if (!next || !next->cpuset) - return NULL; - while (next && !hwloc_bitmap_isincluded(next->cpuset, set)) - next = next->next_cousin; - return next; -} - -/** \brief Return the next object of type \p type included in CPU set \p set. - * - * If there are multiple or no depth for given type, return \c NULL - * and let the caller fallback to - * hwloc_get_next_obj_inside_cpuset_by_depth(). - * - * \note This function cannot work if objects of the given type do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, - hwloc_obj_type_t type, hwloc_obj_t prev) -{ - int depth = hwloc_get_type_depth(topology, type); - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE) - return NULL; - return hwloc_get_next_obj_inside_cpuset_by_depth(topology, set, depth, prev); -} - -/** \brief Return the (logically) \p idx -th object at depth \p depth included in CPU set \p set. - * - * \note This function cannot work if objects at the given depth do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, - unsigned depth, unsigned idx) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, - unsigned depth, unsigned idx) -{ - hwloc_obj_t obj = hwloc_get_obj_by_depth (topology, depth, 0); - unsigned count = 0; - if (!obj || !obj->cpuset) - return NULL; - while (obj) { - if (hwloc_bitmap_isincluded(obj->cpuset, set)) { - if (count == idx) - return obj; - count++; - } - obj = obj->next_cousin; - } - return NULL; -} - -/** \brief Return the \p idx -th object of type \p type included in CPU set \p set. - * - * If there are multiple or no depth for given type, return \c NULL - * and let the caller fallback to - * hwloc_get_obj_inside_cpuset_by_depth(). - * - * \note This function cannot work if objects of the given type do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, - hwloc_obj_type_t type, unsigned idx) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, - hwloc_obj_type_t type, unsigned idx) -{ - int depth = hwloc_get_type_depth(topology, type); - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE) - return NULL; - return hwloc_get_obj_inside_cpuset_by_depth(topology, set, depth, idx); -} - -/** \brief Return the number of objects at depth \p depth included in CPU set \p set. - * - * \note This function cannot work if objects at the given depth do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline unsigned -hwloc_get_nbobjs_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, - unsigned depth) __hwloc_attribute_pure; -static __hwloc_inline unsigned -hwloc_get_nbobjs_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, - unsigned depth) -{ - hwloc_obj_t obj = hwloc_get_obj_by_depth (topology, depth, 0); - unsigned count = 0; - if (!obj || !obj->cpuset) - return 0; - while (obj) { - if (hwloc_bitmap_isincluded(obj->cpuset, set)) - count++; - obj = obj->next_cousin; - } - return count; -} - -/** \brief Return the number of objects of type \p type included in CPU set \p set. - * - * If no object for that type exists inside CPU set \p set, 0 is - * returned. If there are several levels with objects of that type - * inside CPU set \p set, -1 is returned. - * - * \note This function cannot work if objects of the given type do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline int -hwloc_get_nbobjs_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, - hwloc_obj_type_t type) __hwloc_attribute_pure; -static __hwloc_inline int -hwloc_get_nbobjs_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, - hwloc_obj_type_t type) -{ - int depth = hwloc_get_type_depth(topology, type); - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN) - return 0; - if (depth == HWLOC_TYPE_DEPTH_MULTIPLE) - return -1; /* FIXME: agregate nbobjs from different levels? */ - return hwloc_get_nbobjs_inside_cpuset_by_depth(topology, set, depth); -} - -/** \brief Return the logical index among the objects included in CPU set \p set. - * - * Consult all objects in the same level as \p obj and inside CPU set \p set - * in the logical order, and return the index of \p obj within them. - * If \p set covers the entire topology, this is the logical index of \p obj. - * Otherwise, this is similar to a logical index within the part of the topology - * defined by CPU set \p set. - */ -static __hwloc_inline int -hwloc_get_obj_index_inside_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set, - hwloc_obj_t obj) __hwloc_attribute_pure; -static __hwloc_inline int -hwloc_get_obj_index_inside_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set, - hwloc_obj_t obj) -{ - int idx = 0; - if (!hwloc_bitmap_isincluded(obj->cpuset, set)) - return -1; - /* count how many objects are inside the cpuset on the way from us to the beginning of the level */ - while ((obj = obj->prev_cousin) != NULL) - if (hwloc_bitmap_isincluded(obj->cpuset, set)) - idx++; - return idx; -} - -/** @} */ - - - -/** \defgroup hwlocality_helper_find_covering Finding a single Object covering at least CPU set - * @{ - */ - -/** \brief Get the child covering at least CPU set \p set. - * - * \return \c NULL if no child matches or if \p set is empty. - * - * \note This function cannot work if parent does not have a CPU set. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_child_covering_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set, - hwloc_obj_t parent) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_child_covering_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set, - hwloc_obj_t parent) -{ - hwloc_obj_t child; - if (!parent->cpuset || hwloc_bitmap_iszero(set)) - return NULL; - child = parent->first_child; - while (child) { - if (child->cpuset && hwloc_bitmap_isincluded(set, child->cpuset)) - return child; - child = child->next_sibling; - } - return NULL; -} - -/** \brief Get the lowest object covering at least CPU set \p set - * - * \return \c NULL if no object matches or if \p set is empty. - * - * \note This function cannot work if the root object does not have a CPU set, - * e.g. if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) -{ - struct hwloc_obj *current = hwloc_get_root_obj(topology); - if (hwloc_bitmap_iszero(set) || !current->cpuset || !hwloc_bitmap_isincluded(set, current->cpuset)) - return NULL; - while (1) { - hwloc_obj_t child = hwloc_get_child_covering_cpuset(topology, set, current); - if (!child) - return current; - current = child; - } -} - - -/** @} */ - - - -/** \defgroup hwlocality_helper_find_coverings Finding a set of similar Objects covering at least a CPU set - * @{ - */ - -/** \brief Iterate through same-depth objects covering at least CPU set \p set - * - * If object \p prev is \c NULL, return the first object at depth \p - * depth covering at least part of CPU set \p set. The next - * invokation should pass the previous return value in \p prev so as - * to obtain the next object covering at least another part of \p set. - * - * \note This function cannot work if objects at the given depth do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_obj_covering_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, - unsigned depth, hwloc_obj_t prev) -{ - hwloc_obj_t next = hwloc_get_next_obj_by_depth(topology, depth, prev); - if (!next || !next->cpuset) - return NULL; - while (next && !hwloc_bitmap_intersects(set, next->cpuset)) - next = next->next_cousin; - return next; -} - -/** \brief Iterate through same-type objects covering at least CPU set \p set - * - * If object \p prev is \c NULL, return the first object of type \p - * type covering at least part of CPU set \p set. The next invokation - * should pass the previous return value in \p prev so as to obtain - * the next object of type \p type covering at least another part of - * \p set. - * - * If there are no or multiple depths for type \p type, \c NULL is returned. - * The caller may fallback to hwloc_get_next_obj_covering_cpuset_by_depth() - * for each depth. - * - * \note This function cannot work if objects of the given type do - * not have CPU sets or if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_obj_covering_cpuset_by_type(hwloc_topology_t topology, hwloc_const_cpuset_t set, - hwloc_obj_type_t type, hwloc_obj_t prev) -{ - int depth = hwloc_get_type_depth(topology, type); - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN || depth == HWLOC_TYPE_DEPTH_MULTIPLE) - return NULL; - return hwloc_get_next_obj_covering_cpuset_by_depth(topology, set, depth, prev); -} - -/** @} */ - - - -/** \defgroup hwlocality_helper_find_cache Cache-specific Finding Helpers - * @{ - */ - -/** \brief Get the first cache covering a cpuset \p set - * - * \return \c NULL if no cache matches. - * - * \note This function cannot work if the root object does not have a CPU set, - * e.g. if the topology is made of different machines. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_cache_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_cache_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set) -{ - hwloc_obj_t current = hwloc_get_obj_covering_cpuset(topology, set); - while (current) { - if (current->type == HWLOC_OBJ_CACHE) - return current; - current = current->parent; - } - return NULL; -} - -/** \brief Get the first cache shared between an object and somebody else. - * - * \return \c NULL if no cache matches or if an invalid object is given. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj) -{ - hwloc_obj_t current = obj->parent; - if (!obj->cpuset) - return NULL; - while (current && current->cpuset) { - if (!hwloc_bitmap_isequal(current->cpuset, obj->cpuset) - && current->type == HWLOC_OBJ_CACHE) - return current; - current = current->parent; - } - return NULL; -} - -/** @} */ - - - -/** \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 - * - * all objects that are at the same depth than \p src. - * Report in \p objs up to \p max physically closest ones to \p src. - * - * \return the number of objects returned in \p objs. - * - * \return 0 if \p src is an I/O object. - * - * \note This function requires the \p src object to have a CPU set. - */ -/* TODO: rather provide an iterator? Provide a way to know how much should be allocated? By returning the total number of objects instead? */ -HWLOC_DECLSPEC unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t * __hwloc_restrict objs, unsigned max); - -/** \brief Find an object below another object, both specified by types and indexes. - * - * Start from the top system object and find object of type \p type1 - * and logical index \p idx1. Then look below this object and find another - * object of type \p type2 and logical index \p idx2. Indexes are specified - * within the parent, not withing the entire system. - * - * For instance, if type1 is SOCKET, idx1 is 2, type2 is CORE and idx2 - * is 3, return the fourth core object below the third socket. - * - * \note This function requires these objects to have a CPU set. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_below_by_type (hwloc_topology_t topology, - hwloc_obj_type_t type1, unsigned idx1, - hwloc_obj_type_t type2, unsigned idx2) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_below_by_type (hwloc_topology_t topology, - hwloc_obj_type_t type1, unsigned idx1, - hwloc_obj_type_t type2, unsigned idx2) -{ - hwloc_obj_t obj; - obj = hwloc_get_obj_by_type (topology, type1, idx1); - if (!obj || !obj->cpuset) - return NULL; - return hwloc_get_obj_inside_cpuset_by_type(topology, obj->cpuset, type2, idx2); -} - -/** \brief Find an object below a chain of objects specified by types and indexes. - * - * This is a generalized version of hwloc_get_obj_below_by_type(). - * - * Arrays \p typev and \p idxv must contain \p nr types and indexes. - * - * Start from the top system object and walk the arrays \p typev and \p idxv. - * For each type and logical index couple in the arrays, look under the previously found - * object to find the index-th object of the given type. - * Indexes are specified within the parent, not withing the entire system. - * - * For instance, if nr is 3, typev contains NODE, SOCKET and CORE, - * and idxv contains 0, 1 and 2, return the third core object below - * the second socket below the first NUMA node. - * - * \note This function requires all these objects and the root object - * to have a CPU set. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv) __hwloc_attribute_pure; -static __hwloc_inline hwloc_obj_t -hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv) -{ - hwloc_obj_t obj = hwloc_get_root_obj(topology); - int i; - for(i=0; icpuset) - return NULL; - obj = hwloc_get_obj_inside_cpuset_by_type(topology, obj->cpuset, typev[i], idxv[i]); - } - return obj; -} - -/** @} */ - - - -/** \defgroup hwlocality_helper_binding Binding Helpers - * @{ - */ - -/** \brief Distribute \p n items over the topology under \p root - * - * Array \p cpuset will be filled with \p n cpusets recursively distributed - * linearly over the topology under \p root, down to depth \p until (which can - * be INT_MAX to distribute down to the finest level). - * - * This is typically useful when an application wants to distribute \p n - * threads over a machine, giving each of them as much private cache as - * possible and keeping them locally in number order. - * - * The caller may typically want to also call hwloc_bitmap_singlify() - * before binding a thread so that it does not move at all. - * - * \note This function requires the \p root object to have a CPU set. - */ -static __hwloc_inline void -hwloc_distributev(hwloc_topology_t topology, hwloc_obj_t *root, unsigned n_roots, hwloc_cpuset_t *cpuset, unsigned n, unsigned until); -static __hwloc_inline void -hwloc_distribute(hwloc_topology_t topology, hwloc_obj_t root, hwloc_cpuset_t *cpuset, unsigned n, unsigned until) -{ - unsigned i; - if (!root->arity || n == 1 || root->depth >= until) { - /* Got to the bottom, we can't split any more, put everything there. */ - for (i=0; icpuset); - return; - } - hwloc_distributev(topology, root->children, root->arity, cpuset, n, until); -} - -/** \brief Distribute \p n items over the topology under \p roots - * - * This is the same as hwloc_distribute, but takes an array of roots instead of - * just one root. - * - * \note This function requires the \p roots objects to have a CPU set. - */ -static __hwloc_inline void -hwloc_distributev(hwloc_topology_t topology, hwloc_obj_t *roots, unsigned n_roots, hwloc_cpuset_t *cpuset, unsigned n, unsigned until) -{ - unsigned i; - unsigned tot_weight; - hwloc_cpuset_t *cpusetp = cpuset; - - tot_weight = 0; - for (i = 0; i < n_roots; i++) - if (roots[i]->cpuset) - tot_weight += hwloc_bitmap_weight(roots[i]->cpuset); - - for (i = 0; i < n_roots && tot_weight; i++) { - /* Give to roots[i] a portion proportional to its weight */ - unsigned weight = roots[i]->cpuset ? hwloc_bitmap_weight(roots[i]->cpuset) : 0; - unsigned chunk = (n * weight + tot_weight-1) / tot_weight; - hwloc_distribute(topology, roots[i], cpusetp, chunk, until); - cpusetp += chunk; - tot_weight -= weight; - n -= chunk; - } -} - -/** \brief Allocate some memory on the given nodeset \p nodeset - * - * This is similar to hwloc_alloc_membind except that it is allowed to change - * the current memory binding policy, thus providing more binding support, at - * the expense of changing the current state. - */ -static __hwloc_inline void * -hwloc_alloc_membind_policy_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) -{ - void *p = hwloc_alloc_membind_nodeset(topology, len, nodeset, policy, flags); - if (p) - return p; - hwloc_set_membind_nodeset(topology, nodeset, policy, flags); - p = hwloc_alloc(topology, len); - if (p && policy != HWLOC_MEMBIND_FIRSTTOUCH) - /* Enforce the binding by touching the data */ - memset(p, 0, len); - return p; -} - -/** \brief Allocate some memory on the memory nodes near given cpuset \p cpuset - * - * This is similar to hwloc_alloc_membind_policy_nodeset, but for a given cpuset. - */ -static __hwloc_inline void * -hwloc_alloc_membind_policy(hwloc_topology_t topology, size_t len, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags) -{ - void *p = hwloc_alloc_membind(topology, len, cpuset, policy, flags); - if (p) - return p; - hwloc_set_membind(topology, cpuset, policy, flags); - p = hwloc_alloc(topology, len); - if (p && policy != HWLOC_MEMBIND_FIRSTTOUCH) - /* Enforce the binding by touching the data */ - memset(p, 0, len); - return p; -} - -/** @} */ - - - -/** \defgroup hwlocality_helper_cpuset Cpuset Helpers - * @{ - */ -/** \brief Get complete CPU set - * - * \return the complete CPU set of logical processors of the system. If the - * topology is the result of a combination of several systems, NULL is - * returned. - * - * \note The returned cpuset is not newly allocated and should thus not be - * changed or freed; hwloc_cpuset_dup must be used to obtain a local copy. - */ -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_complete_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_complete_cpuset(hwloc_topology_t topology) -{ - return hwloc_get_root_obj(topology)->complete_cpuset; -} - -/** \brief Get topology CPU set - * - * \return the CPU set of logical processors of the system for which hwloc - * provides topology information. This is equivalent to the cpuset of the - * system object. If the topology is the result of a combination of several - * systems, NULL is returned. - * - * \note The returned cpuset is not newly allocated and should thus not be - * changed or freed; hwloc_cpuset_dup must be used to obtain a local copy. - */ -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_topology_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_topology_cpuset(hwloc_topology_t topology) -{ - return hwloc_get_root_obj(topology)->cpuset; -} - -/** \brief Get online CPU set - * - * \return the CPU set of online logical processors of the system. If the - * topology is the result of a combination of several systems, NULL is - * returned. - * - * \note The returned cpuset is not newly allocated and should thus not be - * changed or freed; hwloc_cpuset_dup must be used to obtain a local copy. - */ -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_online_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_online_cpuset(hwloc_topology_t topology) -{ - return hwloc_get_root_obj(topology)->online_cpuset; -} - -/** \brief Get allowed CPU set - * - * \return the CPU set of allowed logical processors of the system. If the - * topology is the result of a combination of several systems, NULL is - * returned. - * - * \note The returned cpuset is not newly allocated and should thus not be - * changed or freed, hwloc_cpuset_dup must be used to obtain a local copy. - */ -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_allowed_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_const_cpuset_t -hwloc_topology_get_allowed_cpuset(hwloc_topology_t topology) -{ - return hwloc_get_root_obj(topology)->allowed_cpuset; -} - -/** @} */ - - - -/** \defgroup hwlocality_helper_nodeset Nodeset Helpers - * @{ - */ -/** \brief Get complete node set - * - * \return the complete node set of memory of the system. If the - * topology is the result of a combination of several systems, NULL is - * returned. - * - * \note The returned nodeset is not newly allocated and should thus not be - * changed or freed; hwloc_nodeset_dup must be used to obtain a local copy. - */ -static __hwloc_inline hwloc_const_nodeset_t -hwloc_topology_get_complete_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_const_nodeset_t -hwloc_topology_get_complete_nodeset(hwloc_topology_t topology) -{ - return hwloc_get_root_obj(topology)->complete_nodeset; -} - -/** \brief Get topology node set - * - * \return the node set of memory of the system for which hwloc - * provides topology information. This is equivalent to the nodeset of the - * system object. If the topology is the result of a combination of several - * systems, NULL is returned. - * - * \note The returned nodeset is not newly allocated and should thus not be - * changed or freed; hwloc_nodeset_dup must be used to obtain a local copy. - */ -static __hwloc_inline hwloc_const_nodeset_t -hwloc_topology_get_topology_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_const_nodeset_t -hwloc_topology_get_topology_nodeset(hwloc_topology_t topology) -{ - return hwloc_get_root_obj(topology)->nodeset; -} - -/** \brief Get allowed node set - * - * \return the node set of allowed memory of the system. If the - * topology is the result of a combination of several systems, NULL is - * returned. - * - * \note The returned nodeset is not newly allocated and should thus not be - * changed or freed, hwloc_nodeset_dup must be used to obtain a local copy. - */ -static __hwloc_inline hwloc_const_nodeset_t -hwloc_topology_get_allowed_nodeset(hwloc_topology_t topology) __hwloc_attribute_pure; -static __hwloc_inline hwloc_const_nodeset_t -hwloc_topology_get_allowed_nodeset(hwloc_topology_t topology) -{ - return hwloc_get_root_obj(topology)->allowed_nodeset; -} - -/** @} */ - - - -/** \defgroup hwlocality_helper_nodeset_convert Conversion between cpuset and nodeset - * - * There are two semantics for converting cpusets to nodesets depending on how - * non-NUMA machines are handled. - * - * When manipulating nodesets for memory binding, non-NUMA machines should be - * considered as having a single NUMA node. The standard conversion routines - * below should be used so that marking the first bit of the nodeset means - * that memory should be bound to a non-NUMA whole machine. - * - * When manipulating nodesets as an actual list of NUMA nodes without any - * need to handle memory binding on non-NUMA machines, the strict conversion - * routines may be used instead. - * @{ - */ - -/** \brief Convert a CPU set into a NUMA node set and handle non-NUMA cases - * - * If some NUMA nodes have no CPUs at all, this function never sets their - * indexes in the output node set, even if a full CPU set is given in input. - * - * If the topology contains no NUMA nodes, the machine is considered - * as a single memory node, and the following behavior is used: - * If \p cpuset is empty, \p nodeset will be emptied as well. - * Otherwise \p nodeset will be entirely filled. - */ -static __hwloc_inline void -hwloc_cpuset_to_nodeset(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, hwloc_nodeset_t nodeset) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - hwloc_obj_t obj; - - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN) { - if (hwloc_bitmap_iszero(cpuset)) - hwloc_bitmap_zero(nodeset); - else - /* Assume the whole system */ - hwloc_bitmap_fill(nodeset); - return; - } - - hwloc_bitmap_zero(nodeset); - obj = NULL; - while ((obj = hwloc_get_next_obj_covering_cpuset_by_depth(topology, cpuset, depth, obj)) != NULL) - hwloc_bitmap_set(nodeset, obj->os_index); -} - -/** \brief Convert a CPU set into a NUMA node set without handling non-NUMA cases - * - * This is the strict variant of ::hwloc_cpuset_to_nodeset. It does not fix - * non-NUMA cases. If the topology contains some NUMA nodes, behave exactly - * the same. However, if the topology contains no NUMA nodes, return an empty - * nodeset. - */ -static __hwloc_inline void -hwloc_cpuset_to_nodeset_strict(struct hwloc_topology *topology, hwloc_const_cpuset_t cpuset, hwloc_nodeset_t nodeset) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - hwloc_obj_t obj; - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN ) - return; - hwloc_bitmap_zero(nodeset); - obj = NULL; - while ((obj = hwloc_get_next_obj_covering_cpuset_by_depth(topology, cpuset, depth, obj)) != NULL) - hwloc_bitmap_set(nodeset, obj->os_index); -} - -/** \brief Convert a NUMA node set into a CPU set and handle non-NUMA cases - * - * If the topology contains no NUMA nodes, the machine is considered - * as a single memory node, and the following behavior is used: - * If \p nodeset is empty, \p cpuset will be emptied as well. - * Otherwise \p cpuset will be entirely filled. - * This is useful for manipulating memory binding sets. - */ -static __hwloc_inline void -hwloc_cpuset_from_nodeset(hwloc_topology_t topology, hwloc_cpuset_t cpuset, hwloc_const_nodeset_t nodeset) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - hwloc_obj_t obj; - - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN ) { - if (hwloc_bitmap_iszero(nodeset)) - hwloc_bitmap_zero(cpuset); - else - /* Assume the whole system */ - hwloc_bitmap_fill(cpuset); - return; - } - - hwloc_bitmap_zero(cpuset); - obj = NULL; - while ((obj = hwloc_get_next_obj_by_depth(topology, depth, obj)) != NULL) { - if (hwloc_bitmap_isset(nodeset, obj->os_index)) - /* no need to check obj->cpuset because objects in levels always have a cpuset */ - hwloc_bitmap_or(cpuset, cpuset, obj->cpuset); - } -} - -/** \brief Convert a NUMA node set into a CPU set without handling non-NUMA cases - * - * This is the strict variant of ::hwloc_cpuset_from_nodeset. It does not fix - * non-NUMA cases. If the topology contains some NUMA nodes, behave exactly - * the same. However, if the topology contains no NUMA nodes, return an empty - * cpuset. - */ -static __hwloc_inline void -hwloc_cpuset_from_nodeset_strict(struct hwloc_topology *topology, hwloc_cpuset_t cpuset, hwloc_const_nodeset_t nodeset) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - hwloc_obj_t obj; - if (depth == HWLOC_TYPE_DEPTH_UNKNOWN ) - return; - hwloc_bitmap_zero(cpuset); - obj = NULL; - while ((obj = hwloc_get_next_obj_by_depth(topology, depth, obj)) != NULL) - if (hwloc_bitmap_isset(nodeset, obj->os_index)) - /* no need to check obj->cpuset because objects in levels always have a cpuset */ - hwloc_bitmap_or(cpuset, cpuset, obj->cpuset); -} - -/** @} */ - - - -/** \defgroup hwlocality_distances Distances - * @{ - */ - -/** \brief Get the distances between all objects at the given depth. - * - * \return a distances structure containing a matrix with all distances - * between all objects at the given depth. - * - * Slot i+nbobjs*j contains the distance from the object of logical index i - * the object of logical index j. - * - * \note This function only returns matrices covering the whole topology, - * without any unknown distance value. Those matrices are available in - * top-level object of the hierarchy. Matrices of lower objects are not - * reported here since they cover only part of the machine. - * - * The returned structure belongs to the hwloc library. The caller should - * not modify or free it. - * - * \return \c NULL if no such distance matrix exists. - */ - -static __hwloc_inline const struct hwloc_distances_s * -hwloc_get_whole_distance_matrix_by_depth(hwloc_topology_t topology, unsigned depth) -{ - hwloc_obj_t root = hwloc_get_root_obj(topology); - unsigned i; - for(i=0; idistances_count; i++) - if (root->distances[i]->relative_depth == depth) - return root->distances[i]; - return NULL; -} - -/** \brief Get the distances between all objects of a given type. - * - * \return a distances structure containing a matrix with all distances - * between all objects of the given type. - * - * Slot i+nbobjs*j contains the distance from the object of logical index i - * the object of logical index j. - * - * \note This function only returns matrices covering the whole topology, - * without any unknown distance value. Those matrices are available in - * top-level object of the hierarchy. Matrices of lower objects are not - * reported here since they cover only part of the machine. - * - * The returned structure belongs to the hwloc library. The caller should - * not modify or free it. - * - * \return \c NULL if no such distance matrix exists. - */ - -static __hwloc_inline const struct hwloc_distances_s * -hwloc_get_whole_distance_matrix_by_type(hwloc_topology_t topology, hwloc_obj_type_t type) -{ - int depth = hwloc_get_type_depth(topology, type); - if (depth < 0) - return NULL; - return hwloc_get_whole_distance_matrix_by_depth(topology, depth); -} - -/** \brief Get distances for the given depth and covering some objects - * - * Return a distance matrix that describes depth \p depth and covers at - * least object \p obj and all its children. - * - * When looking for the distance between some objects, a common ancestor should - * be passed in \p obj. - * - * \p firstp is set to logical index of the first object described by the matrix. - * - * The returned structure belongs to the hwloc library. The caller should - * not modify or free it. - */ -static __hwloc_inline const struct hwloc_distances_s * -hwloc_get_distance_matrix_covering_obj_by_depth(hwloc_topology_t topology, - hwloc_obj_t obj, unsigned depth, - unsigned *firstp) -{ - while (obj && obj->cpuset) { - unsigned i; - for(i=0; idistances_count; i++) - if (obj->distances[i]->relative_depth == depth - obj->depth) { - if (!obj->distances[i]->nbobjs) - continue; - *firstp = hwloc_get_next_obj_inside_cpuset_by_depth(topology, obj->cpuset, depth, NULL)->logical_index; - return obj->distances[i]; - } - obj = obj->parent; - } - return NULL; -} - -/** \brief Get the latency in both directions between two objects. - * - * Look at ancestor objects from the bottom to the top until one of them - * contains a distance matrix that matches the objects exactly. - * - * \p latency gets the value from object \p obj1 to \p obj2, while - * \p reverse_latency gets the reverse-direction value, which - * may be different on some architectures. - * - * \return -1 if no ancestor contains a matching latency matrix. - */ -static __hwloc_inline int -hwloc_get_latency(hwloc_topology_t topology, - hwloc_obj_t obj1, hwloc_obj_t obj2, - float *latency, float *reverse_latency) -{ - hwloc_obj_t ancestor; - const struct hwloc_distances_s * distances; - unsigned first_logical ; - - if (obj1->depth != obj2->depth) { - errno = EINVAL; - return -1; - } - - ancestor = hwloc_get_common_ancestor_obj(topology, obj1, obj2); - distances = hwloc_get_distance_matrix_covering_obj_by_depth(topology, ancestor, obj1->depth, &first_logical); - if (distances && distances->latency) { - const float * latency_matrix = distances->latency; - unsigned nbobjs = distances->nbobjs; - unsigned l1 = obj1->logical_index - first_logical; - unsigned l2 = obj2->logical_index - first_logical; - *latency = latency_matrix[l1*nbobjs+l2]; - *reverse_latency = latency_matrix[l2*nbobjs+l1]; - return 0; - } - - errno = ENOSYS; - return -1; -} - -/** @} */ - - - -/** \defgroup hwlocality_advanced_io Advanced I/O object traversal helpers - * @{ - */ - -/** \brief Get the first non-I/O ancestor object. - * - * Given the I/O object \p ioobj, find the smallest non-I/O ancestor - * object. This regular object may then be used for binding because - * its locality is the same as \p ioobj. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_non_io_ancestor_obj(hwloc_topology_t topology __hwloc_attribute_unused, - hwloc_obj_t ioobj) -{ - hwloc_obj_t obj = ioobj; - while (obj && !obj->cpuset) { - obj = obj->parent; - } - return obj; -} - -/** \brief Get the next PCI device in the system. - * - * \return the first PCI device if \p prev is \c NULL. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_pcidev(hwloc_topology_t topology, hwloc_obj_t prev) -{ - return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_PCI_DEVICE, prev); -} - -/** \brief Find the PCI device object matching the PCI bus id - * given domain, bus device and function PCI bus id. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_pcidev_by_busid(hwloc_topology_t topology, - unsigned domain, unsigned bus, unsigned dev, unsigned func) -{ - hwloc_obj_t obj = NULL; - while ((obj = hwloc_get_next_pcidev(topology, obj)) != NULL) { - if (obj->attr->pcidev.domain == domain - && obj->attr->pcidev.bus == bus - && obj->attr->pcidev.dev == dev - && obj->attr->pcidev.func == func) - return obj; - } - return NULL; -} - -/** \brief Find the PCI device object matching the PCI bus id - * given as a string xxxx:yy:zz.t or yy:zz.t. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_pcidev_by_busidstring(hwloc_topology_t topology, const char *busid) -{ - unsigned domain = 0; /* default */ - unsigned bus, dev, func; - - if (sscanf(busid, "%x:%x.%x", &bus, &dev, &func) != 3 - && sscanf(busid, "%x:%x:%x.%x", &domain, &bus, &dev, &func) != 4) { - errno = EINVAL; - return NULL; - } - - return hwloc_get_pcidev_by_busid(topology, domain, bus, dev, func); -} - -/** \brief Get the next OS device in the system. - * - * \return the first OS device if \p prev is \c NULL. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev) -{ - return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_OS_DEVICE, prev); -} - -/** \brief Get the next bridge in the system. - * - * \return the first bridge if \p prev is \c NULL. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_next_bridge(hwloc_topology_t topology, hwloc_obj_t prev) -{ - return hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_BRIDGE, prev); -} - -/* \brief Checks whether a given bridge covers a given PCI bus. - */ -static __hwloc_inline int -hwloc_bridge_covers_pcibus(hwloc_obj_t bridge, - unsigned domain, unsigned bus) -{ - return bridge->type == HWLOC_OBJ_BRIDGE - && bridge->attr->bridge.downstream_type == HWLOC_OBJ_BRIDGE_PCI - && bridge->attr->bridge.downstream.pci.domain == domain - && bridge->attr->bridge.downstream.pci.secondary_bus <= bus - && bridge->attr->bridge.downstream.pci.subordinate_bus >= bus; -} - -/** \brief Find the hostbridge that covers the given PCI bus. - * - * This is useful for finding the locality of a bus because - * it is the hostbridge parent cpuset. - */ -static __hwloc_inline hwloc_obj_t -hwloc_get_hostbridge_by_pcibus(hwloc_topology_t topology, - unsigned domain, unsigned bus) -{ - hwloc_obj_t obj = NULL; - while ((obj = hwloc_get_next_bridge(topology, obj)) != NULL) { - if (hwloc_bridge_covers_pcibus(obj, domain, bus)) { - /* found bridge covering this pcibus, make sure it's a hostbridge */ - assert(obj->attr->bridge.upstream_type == HWLOC_OBJ_BRIDGE_HOST); - assert(obj->parent->type != HWLOC_OBJ_BRIDGE); - assert(obj->parent->cpuset); - return obj; - } - } - return NULL; -} - -/** @} */ - - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_HELPER_H */ diff --git a/contrib/platform/win32/include/hwloc/linux-libnuma.h b/contrib/platform/win32/include/hwloc/linux-libnuma.h deleted file mode 100644 index efac4c22e3..0000000000 --- a/contrib/platform/win32/include/hwloc/linux-libnuma.h +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Copyright © 2009 CNRS - * Copyright © 2009-2012 inria. All rights reserved. - * Copyright © 2009-2010, 2012 Université Bordeaux 1 - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and Linux libnuma. - * - * Applications that use both Linux libnuma and hwloc may want to - * include this file so as to ease conversion between their respective types. - * - * This helper also offers a consistent behavior on non-NUMA machines - * or non-NUMA-aware kernels by assuming that the machines have a single - * NUMA node. - * - * \note Topology \p topology must match the current machine. - * - * \note The behavior of libnuma is undefined if the kernel is not NUMA-aware. - * (when CONFIG_NUMA is not set in the kernel configuration). - * This helper and libnuma may thus not be strictly compatible in this case, - * which may be detected by checking whether numa_available() returns -1. - */ - -#ifndef HWLOC_LINUX_LIBNUMA_H -#define HWLOC_LINUX_LIBNUMA_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_linux_libnuma_ulongs Helpers for manipulating Linux libnuma unsigned long masks - * @{ - */ - - -/** \brief Convert hwloc CPU set \p cpuset into the array of unsigned long \p mask - * - * \p mask is the array of unsigned long that will be filled. - * \p maxnode contains the maximal node number that may be stored in \p mask. - * \p maxnode will be set to the maximal node number that was found, plus one. - * - * This function may be used before calling set_mempolicy, mbind, migrate_pages - * or any other function that takes an array of unsigned long and a maximal - * node number as input parameter. - */ -static __hwloc_inline int -hwloc_cpuset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, - unsigned long *mask, unsigned long *maxnode) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - unsigned long outmaxnode = -1; - - /* round-up to the next ulong and clear all bytes */ - *maxnode = (*maxnode + 8*sizeof(*mask) - 1) & ~(8*sizeof(*mask) - 1); - memset(mask, 0, *maxnode/8); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - while ((node = hwloc_get_next_obj_covering_cpuset_by_type(topology, cpuset, HWLOC_OBJ_NODE, node)) != NULL) { - if (node->os_index >= *maxnode) - continue; - mask[node->os_index/sizeof(*mask)/8] |= 1UL << (node->os_index % (sizeof(*mask)*8)); - if (outmaxnode == (unsigned long) -1 || outmaxnode < node->os_index) - outmaxnode = node->os_index; - } - - } else { - /* if no numa, libnuma assumes we have a single node */ - if (!hwloc_bitmap_iszero(cpuset)) { - mask[0] = 1; - outmaxnode = 0; - } - } - - *maxnode = outmaxnode+1; - return 0; -} - -/** \brief Convert hwloc NUMA node set \p nodeset into the array of unsigned long \p mask - * - * \p mask is the array of unsigned long that will be filled. - * \p maxnode contains the maximal node number that may be stored in \p mask. - * \p maxnode will be set to the maximal node number that was found, plus one. - * - * This function may be used before calling set_mempolicy, mbind, migrate_pages - * or any other function that takes an array of unsigned long and a maximal - * node number as input parameter. - */ -static __hwloc_inline int -hwloc_nodeset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, - unsigned long *mask, unsigned long *maxnode) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - unsigned long outmaxnode = -1; - - /* round-up to the next ulong and clear all bytes */ - *maxnode = (*maxnode + 8*sizeof(*mask) - 1) & ~(8*sizeof(*mask) - 1); - memset(mask, 0, *maxnode/8); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - while ((node = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NODE, node)) != NULL) { - if (node->os_index >= *maxnode) - continue; - if (!hwloc_bitmap_isset(nodeset, node->os_index)) - continue; - mask[node->os_index/sizeof(*mask)/8] |= 1UL << (node->os_index % (sizeof(*mask)*8)); - if (outmaxnode == (unsigned long) -1 || outmaxnode < node->os_index) - outmaxnode = node->os_index; - } - - } else { - /* if no numa, libnuma assumes we have a single node */ - if (!hwloc_bitmap_iszero(nodeset)) { - mask[0] = 1; - outmaxnode = 0; - } - } - - *maxnode = outmaxnode+1; - return 0; -} - -/** \brief Convert the array of unsigned long \p mask into hwloc CPU set - * - * \p mask is a array of unsigned long that will be read. - * \p maxnode contains the maximal node number that may be read in \p mask. - * - * This function may be used after calling get_mempolicy or any other function - * that takes an array of unsigned long as output parameter (and possibly - * a maximal node number as input parameter). - */ -static __hwloc_inline int -hwloc_cpuset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_cpuset_t cpuset, - const unsigned long *mask, unsigned long maxnode) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - hwloc_bitmap_zero(cpuset); - while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) - if (node->os_index < maxnode - && (mask[node->os_index/sizeof(*mask)/8] & (1UL << (node->os_index % (sizeof(*mask)*8))))) - hwloc_bitmap_or(cpuset, cpuset, node->cpuset); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (mask[0] & 1) - hwloc_bitmap_copy(cpuset, hwloc_topology_get_complete_cpuset(topology)); - else - hwloc_bitmap_zero(cpuset); - } - - return 0; -} - -/** \brief Convert the array of unsigned long \p mask into hwloc NUMA node set - * - * \p mask is a array of unsigned long that will be read. - * \p maxnode contains the maximal node number that may be read in \p mask. - * - * This function may be used after calling get_mempolicy or any other function - * that takes an array of unsigned long as output parameter (and possibly - * a maximal node number as input parameter). - */ -static __hwloc_inline int -hwloc_nodeset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_nodeset_t nodeset, - const unsigned long *mask, unsigned long maxnode) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - hwloc_bitmap_zero(nodeset); - while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) - if (node->os_index < maxnode - && (mask[node->os_index/sizeof(*mask)/8] & (1UL << (node->os_index % (sizeof(*mask)*8))))) - hwloc_bitmap_set(nodeset, node->os_index); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (mask[0] & 1) - hwloc_bitmap_fill(nodeset); - else - hwloc_bitmap_zero(nodeset); - } - - return 0; -} - -/** @} */ - - - -/** \defgroup hwlocality_linux_libnuma_bitmask Helpers for manipulating Linux libnuma bitmask - * @{ - */ - - -/** \brief Convert hwloc CPU set \p cpuset into the returned libnuma bitmask - * - * The returned bitmask should later be freed with numa_bitmask_free. - * - * This function may be used before calling many numa_ functions - * that use a struct bitmask as an input parameter. - * - * \return newly allocated struct bitmask. - */ -static __hwloc_inline struct bitmask * -hwloc_cpuset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset) __hwloc_attribute_malloc; -static __hwloc_inline struct bitmask * -hwloc_cpuset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - struct bitmask *bitmask = numa_allocate_cpumask(); - if (!bitmask) - return NULL; - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - while ((node = hwloc_get_next_obj_covering_cpuset_by_type(topology, cpuset, HWLOC_OBJ_NODE, node)) != NULL) - if (node->memory.local_memory) - numa_bitmask_setbit(bitmask, node->os_index); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (!hwloc_bitmap_iszero(cpuset)) - numa_bitmask_setbit(bitmask, 0); - } - - return bitmask; -} - -/** \brief Convert hwloc NUMA node set \p nodeset into the returned libnuma bitmask - * - * The returned bitmask should later be freed with numa_bitmask_free. - * - * This function may be used before calling many numa_ functions - * that use a struct bitmask as an input parameter. - * - * \return newly allocated struct bitmask. - */ -static __hwloc_inline struct bitmask * -hwloc_nodeset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset) __hwloc_attribute_malloc; -static __hwloc_inline struct bitmask * -hwloc_nodeset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - struct bitmask *bitmask = numa_allocate_cpumask(); - if (!bitmask) - return NULL; - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - while ((node = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NODE, node)) != NULL) - if (hwloc_bitmap_isset(nodeset, node->os_index) && node->memory.local_memory) - numa_bitmask_setbit(bitmask, node->os_index); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (!hwloc_bitmap_iszero(nodeset)) - numa_bitmask_setbit(bitmask, 0); - } - - return bitmask; -} - -/** \brief Convert libnuma bitmask \p bitmask into hwloc CPU set \p cpuset - * - * This function may be used after calling many numa_ functions - * that use a struct bitmask as an output parameter. - */ -static __hwloc_inline int -hwloc_cpuset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_cpuset_t cpuset, - const struct bitmask *bitmask) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - hwloc_bitmap_zero(cpuset); - while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) - if (numa_bitmask_isbitset(bitmask, node->os_index)) - hwloc_bitmap_or(cpuset, cpuset, node->cpuset); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (numa_bitmask_isbitset(bitmask, 0)) - hwloc_bitmap_copy(cpuset, hwloc_topology_get_complete_cpuset(topology)); - else - hwloc_bitmap_zero(cpuset); - } - - return 0; -} - -/** \brief Convert libnuma bitmask \p bitmask into hwloc NUMA node set \p nodeset - * - * This function may be used after calling many numa_ functions - * that use a struct bitmask as an output parameter. - */ -static __hwloc_inline int -hwloc_nodeset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_nodeset_t nodeset, - const struct bitmask *bitmask) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - hwloc_bitmap_zero(nodeset); - while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) - if (numa_bitmask_isbitset(bitmask, node->os_index)) - hwloc_bitmap_set(nodeset, node->os_index); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (numa_bitmask_isbitset(bitmask, 0)) - hwloc_bitmap_fill(nodeset); - else - hwloc_bitmap_zero(nodeset); - } - - return 0; -} - -/** @} */ - - - -#ifdef NUMA_VERSION1_COMPATIBILITY -/** \defgroup hwlocality_linux_libnuma_nodemask Helpers for manipulating Linux libnuma nodemask_t - * - * \note The Linux libnuma nodemask_t interface is deprecated and - * its implementation is at least incorrect with respect to sparse - * NUMA node ids. It is strongly advised to use struct bitmask - * instead of nodemask_t, or even to use hwloc directly. - * - * @{ - */ - - -/** \brief Convert hwloc CPU set \p cpuset into libnuma nodemask \p nodemask - * - * This function may be used before calling some old libnuma functions - * that use a nodemask_t as an input parameter. - */ -static __hwloc_inline int -hwloc_cpuset_to_linux_libnuma_nodemask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, - nodemask_t *nodemask) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - nodemask_zero(nodemask); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - while ((node = hwloc_get_next_obj_covering_cpuset_by_type(topology, cpuset, HWLOC_OBJ_NODE, node)) != NULL) - nodemask_set(nodemask, node->os_index); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (!hwloc_bitmap_iszero(cpuset)) - nodemask_set(nodemask, 0); - } - - return 0; -} - -/** \brief Convert hwloc NUMA node set \p nodeset into libnuma nodemask \p nodemask - * - * This function may be used before calling some old libnuma functions - * that use a nodemask_t as an input parameter. - */ -static __hwloc_inline int -hwloc_nodeset_to_linux_libnuma_nodemask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, - nodemask_t *nodemask) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - nodemask_zero(nodemask); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - while ((node = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NODE, node)) != NULL) - if (hwloc_bitmap_isset(nodeset, node->os_index)) - nodemask_set(nodemask, node->os_index); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (!hwloc_bitmap_iszero(nodeset)) - nodemask_set(nodemask, 0); - } - - return 0; -} - -/** \brief Convert libnuma nodemask \p nodemask into hwloc CPU set \p cpuset - * - * This function may be used before calling some old libnuma functions - * that use a nodemask_t as an output parameter. - */ -static __hwloc_inline int -hwloc_cpuset_from_linux_libnuma_nodemask(hwloc_topology_t topology, hwloc_cpuset_t cpuset, - const nodemask_t *nodemask) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - hwloc_bitmap_zero(cpuset); - while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) - if (nodemask_isset(nodemask, node->os_index)) - hwloc_bitmap_or(cpuset, cpuset, node->cpuset); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (nodemask_isset(nodemask, 0)) - hwloc_bitmap_copy(cpuset, hwloc_topology_get_complete_cpuset(topology)); - else - hwloc_bitmap_zero(cpuset); - } - - return 0; -} - -/** \brief Convert libnuma nodemask \p nodemask into hwloc NUMA node set \p nodeset - * - * This function may be used before calling some old libnuma functions - * that use a nodemask_t as an output parameter. - */ -static __hwloc_inline int -hwloc_nodeset_from_linux_libnuma_nodemask(hwloc_topology_t topology, hwloc_nodeset_t nodeset, - const nodemask_t *nodemask) -{ - int depth = hwloc_get_type_depth(topology, HWLOC_OBJ_NODE); - - if (depth != HWLOC_TYPE_DEPTH_UNKNOWN) { - hwloc_obj_t node = NULL; - hwloc_bitmap_zero(nodeset); - while ((node = hwloc_get_next_obj_by_depth(topology, depth, node)) != NULL) - if (nodemask_isset(nodemask, node->os_index)) - hwloc_bitmap_set(nodeset, node->os_index); - } else { - /* if no numa, libnuma assumes we have a single node */ - if (nodemask_isset(nodemask, 0)) - hwloc_bitmap_fill(nodeset); - else - hwloc_bitmap_zero(nodeset); - } - - return 0; -} - -/** @} */ -#endif /* NUMA_VERSION1_COMPATIBILITY */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_LINUX_NUMA_H */ diff --git a/contrib/platform/win32/include/hwloc/linux.h b/contrib/platform/win32/include/hwloc/linux.h deleted file mode 100644 index 9dde650e34..0000000000 --- a/contrib/platform/win32/include/hwloc/linux.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright © 2009 CNRS - * Copyright © 2009-2010 inria. All rights reserved. - * Copyright © 2009-2011 Université Bordeaux 1 - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and Linux. - * - * Applications that use hwloc on Linux may want to include this file - * if using some low-level Linux features. - */ - -#ifndef HWLOC_LINUX_H -#define HWLOC_LINUX_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_linux Linux-only helpers - * - * This includes helpers for manipulating linux kernel cpumap files, and hwloc - * equivalents of the Linux sched_setaffinity and sched_getaffinity system calls. - * - * @{ - */ - -/** \brief Convert a linux kernel cpumap file \p file into hwloc CPU set. - * - * Might be used when reading CPU set from sysfs attributes such as topology - * and caches for processors, or local_cpus for devices. - */ -HWLOC_DECLSPEC int hwloc_linux_parse_cpumap_file(FILE *file, hwloc_cpuset_t set); - -/** \brief Bind a thread \p tid on cpus given in cpuset \p set - * - * The behavior is exactly the same as the Linux sched_setaffinity system call, - * but uses a hwloc cpuset. - */ -HWLOC_DECLSPEC int hwloc_linux_set_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set); - -/** \brief Get the current binding of thread \p tid - * - * The behavior is exactly the same as the Linux sched_getaffinity system call, - * but uses a hwloc cpuset. - */ -HWLOC_DECLSPEC int hwloc_linux_get_tid_cpubind(hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set); - -/** @} */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_GLIBC_SCHED_H */ diff --git a/contrib/platform/win32/include/hwloc/myriexpress.h b/contrib/platform/win32/include/hwloc/myriexpress.h deleted file mode 100644 index 0f87c45d2c..0000000000 --- a/contrib/platform/win32/include/hwloc/myriexpress.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright © 2010-2012 inria. All rights reserved. - * Copyright © 2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and Myrinet Express. - * - * Applications that use both hwloc and Myrinet Express verbs may want to - * include this file so as to get topology information for Myrinet hardware. - * - */ - -#ifndef HWLOC_MYRIEXPRESS_H -#define HWLOC_MYRIEXPRESS_H - -#include -#include -#include - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_myriexpress Myrinet Express-Specific Functions - * @{ - */ - -/** \brief Get the CPU set of logical processors that are physically - * close the MX board \p id. - * - * For the given Myrinet Express board index \p id, read the - * OS-provided NUMA node and return the corresponding CPU set. - * - * Topology \p topology must match the current machine. - */ -static __hwloc_inline int -hwloc_mx_board_get_device_cpuset(hwloc_topology_t topology, - unsigned id, hwloc_cpuset_t set) -{ - uint32_t in, out; - - in = id; - if (mx_get_info(NULL, MX_NUMA_NODE, &in, sizeof(in), &out, sizeof(out)) != MX_SUCCESS) { - errno = EINVAL; - return -1; - } - - if (out != (uint32_t) -1) { - hwloc_obj_t obj = NULL; - while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NODE, obj)) != NULL) - if (obj->os_index == out) { - hwloc_bitmap_copy(set, obj->cpuset); - goto out; - } - } - /* fallback to the full topology cpuset */ - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); - - out: - return 0; -} - -/** \brief Get the CPU set of logical processors that are physically - * close to endpoint \p endpoint. - * - * For the given Myrinet Express endpoint \p endpoint, read the - * OS-provided NUMA node and return the corresponding CPU set. - * - * Topology \p topology must match the current machine. - */ -static __hwloc_inline int -hwloc_mx_endpoint_get_device_cpuset(hwloc_topology_t topology, - mx_endpoint_t endpoint, hwloc_cpuset_t set) -{ - uint64_t nid; - uint32_t nindex, eid; - mx_endpoint_addr_t eaddr; - - if (mx_get_endpoint_addr(endpoint, &eaddr) != MX_SUCCESS) { - errno = EINVAL; - return -1; - } - - if (mx_decompose_endpoint_addr(eaddr, &nid, &eid) != MX_SUCCESS) { - errno = EINVAL; - return -1; - } - - if (mx_nic_id_to_board_number(nid, &nindex) != MX_SUCCESS) { - errno = EINVAL; - return -1; - } - - return hwloc_mx_board_get_device_cpuset(topology, nindex, set); -} - -/** @} */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_MYRIEXPRESS_H */ diff --git a/contrib/platform/win32/include/hwloc/openfabrics-verbs.h b/contrib/platform/win32/include/hwloc/openfabrics-verbs.h deleted file mode 100644 index c21e5f4825..0000000000 --- a/contrib/platform/win32/include/hwloc/openfabrics-verbs.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright © 2009 CNRS - * Copyright © 2009-2012 inria. All rights reserved. - * Copyright © 2009-2010 Université Bordeaux 1 - * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. - * See COPYING in top-level directory. - */ - -/** \file - * \brief Macros to help interaction between hwloc and OpenFabrics - * verbs. - * - * Applications that use both hwloc and OpenFabrics verbs may want to - * include this file so as to get topology information for OpenFabrics - * hardware. - * - */ - -#ifndef HWLOC_OPENFABRICS_VERBS_H -#define HWLOC_OPENFABRICS_VERBS_H - -#include -#include -#include - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** \defgroup hwlocality_openfabrics OpenFabrics-Specific Functions - * @{ - */ - -/** \brief Get the CPU set of logical processors that are physically - * close to device \p ibdev. - * - * For the given OpenFabrics device \p ibdev, read the corresponding - * kernel-provided cpumap file and return the corresponding CPU set. - * This function is currently only implemented in a meaningful way for - * Linux; other systems will simply get a full cpuset. - * - * Topology \p topology must match the current machine. - */ -static __hwloc_inline int -hwloc_ibv_get_device_cpuset(hwloc_topology_t topology __hwloc_attribute_unused, - struct ibv_device *ibdev, hwloc_cpuset_t set) -{ -#ifdef HWLOC_LINUX_SYS - /* If we're on Linux, use the verbs-provided sysfs mechanism to - get the local cpus */ -#define HWLOC_OPENFABRICS_VERBS_SYSFS_PATH_MAX 128 - char path[HWLOC_OPENFABRICS_VERBS_SYSFS_PATH_MAX]; - FILE *sysfile = NULL; - - sprintf(path, "/sys/class/infiniband/%s/device/local_cpus", - ibv_get_device_name(ibdev)); - sysfile = fopen(path, "r"); - if (!sysfile) - return -1; - - hwloc_linux_parse_cpumap_file(sysfile, set); - if (hwloc_bitmap_iszero(set)) - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); - - fclose(sysfile); -#else - /* Non-Linux systems simply get a full cpuset */ - hwloc_bitmap_copy(set, hwloc_topology_get_complete_cpuset(topology)); -#endif - return 0; -} - -/** @} */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_OPENFABRICS_VERBS_H */ diff --git a/contrib/platform/win32/include/hwloc/rename.h b/contrib/platform/win32/include/hwloc/rename.h deleted file mode 100644 index 9fa4ac497f..0000000000 --- a/contrib/platform/win32/include/hwloc/rename.h +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. - * Copyright © 2010-2011 inria. All rights reserved. - * See COPYING in top-level directory. - */ - -#ifndef HWLOC_RENAME_H -#define HWLOC_RENAME_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Only enact these defines if we're actually renaming the symbols - (i.e., avoid trying to have no-op defines if we're *not* - renaming). */ - -#if HWLOC_SYM_TRANSFORM - -/* Use a preprocessor two-step in order to get the prefixing right. - Make 2 macros: HWLOC_NAME and HWLOC_NAME_CAPS for renaming - things. */ - -#define HWLOC_MUNGE_NAME(a, b) HWLOC_MUNGE_NAME2(a, b) -#define HWLOC_MUNGE_NAME2(a, b) a ## b -#define HWLOC_NAME(name) HWLOC_MUNGE_NAME(HWLOC_SYM_PREFIX, hwloc_ ## name) -#define HWLOC_NAME_CAPS(name) HWLOC_MUNGE_NAME(HWLOC_SYM_PREFIX_CAPS, hwloc_ ## name) - -/* Now define all the "real" names to be the prefixed names. This - allows us to use the real names throughout the code base (i.e., - "hwloc_"); the preprocessor will adjust to have the prefixed - name under the covers. */ - -/* Names from hwloc.h */ - -#define hwloc_get_api_version HWLOC_NAME(get_api_version) - -#define hwloc_topology HWLOC_NAME(topology) -#define hwloc_topology_t HWLOC_NAME(topology_t) - -#define hwloc_cpuset_t HWLOC_NAME(cpuset_t) -#define hwloc_const_cpuset_t HWLOC_NAME(const_cpuset_t) -#define hwloc_nodeset_t HWLOC_NAME(nodeset_t) -#define hwloc_const_nodeset_t HWLOC_NAME(const_nodeset_t) - -#define HWLOC_OBJ_SYSTEM HWLOC_NAME_CAPS(OBJ_SYSTEM) -#define HWLOC_OBJ_MACHINE HWLOC_NAME_CAPS(OBJ_MACHINE) -#define HWLOC_OBJ_NODE HWLOC_NAME_CAPS(OBJ_NODE) -#define HWLOC_OBJ_SOCKET HWLOC_NAME_CAPS(OBJ_SOCKET) -#define HWLOC_OBJ_CACHE HWLOC_NAME_CAPS(OBJ_CACHE) -#define HWLOC_OBJ_CORE HWLOC_NAME_CAPS(OBJ_CORE) -#define HWLOC_OBJ_PU HWLOC_NAME_CAPS(OBJ_PU) -#define HWLOC_OBJ_MISC HWLOC_NAME_CAPS(OBJ_MISC) -#define HWLOC_OBJ_GROUP HWLOC_NAME_CAPS(OBJ_GROUP) -#define HWLOC_OBJ_BRIDGE HWLOC_NAME_CAPS(OBJ_BRIDGE) -#define HWLOC_OBJ_PCI_DEVICE HWLOC_NAME_CAPS(OBJ_PCI_DEVICE) -#define HWLOC_OBJ_OS_DEVICE HWLOC_NAME_CAPS(OBJ_OS_DEVICE) -#define HWLOC_OBJ_TYPE_MAX HWLOC_NAME_CAPS(OBJ_TYPE_MAX) -#define hwloc_obj_type_t HWLOC_NAME(obj_type_t) - -#define hwloc_obj_bridge_type_e HWLOC_NAME(obj_bridge_type_e) -#define hwloc_obj_bridge_type_t HWLOC_NAME(obj_bridge_type_t) -#define HWLOC_OBJ_BRIDGE_HOST HWLOC_NAME_CAPS(OBJ_BRIDGE_HOST) -#define HWLOC_OBJ_BRIDGE_PCI HWLOC_NAME_CAPS(OBJ_BRIDGE_PCI) - -#define hwloc_obj_osdev_type_e HWLOC_NAME(obj_osdev_type_e) -#define hwloc_obj_osdev_type_t HWLOC_NAME(obj_osdev_type_t) -#define HWLOC_OBJ_OSDEV_BLOCK HWLOC_NAME_CAPS(OBJ_OSDEV_BLOCK) -#define HWLOC_OBJ_OSDEV_GPU HWLOC_NAME_CAPS(OBJ_OSDEV_GPU) -#define HWLOC_OBJ_OSDEV_NETWORK HWLOC_NAME_CAPS(OBJ_OSDEV_NETWORK) -#define HWLOC_OBJ_OSDEV_OPENFABRICS HWLOC_NAME_CAPS(OBJ_OSDEV_OPENFABRICS) -#define HWLOC_OBJ_OSDEV_DMA HWLOC_NAME_CAPS(OBJ_OSDEV_DMA) - -#define hwloc_compare_types HWLOC_NAME(compare_types) - -#define hwloc_compare_types_e HWLOC_NAME(compare_types_e) -#define HWLOC_TYPE_UNORDERED HWLOC_NAME_CAPS(TYPE_UNORDERED) - -#define hwloc_obj_memory_s HWLOC_NAME(obj_memory_s) -#define hwloc_obj_memory_page_type_s HWLOC_NAME(obj_memory_page_type_s) - -#define hwloc_obj HWLOC_NAME(obj) -#define hwloc_obj_t HWLOC_NAME(obj_t) - -#define hwloc_distances_s HWLOC_NAME(distances_s) -#define hwloc_obj_info_s HWLOC_NAME(obj_info_s) - -#define hwloc_obj_attr_u HWLOC_NAME(obj_attr_u) -#define hwloc_cache_attr_s HWLOC_NAME(cache_attr_s) -#define hwloc_group_attr_s HWLOC_NAME(group_attr_s) -#define hwloc_pcidev_attr_s HWLOC_NAME(pcidev_attr_s) -#define hwloc_bridge_attr_s HWLOC_NAME(bridge_attr_s) -#define hwloc_osdev_attr_s HWLOC_NAME(osdev_attr_s) - -#define hwloc_topology_init HWLOC_NAME(topology_init) -#define hwloc_topology_load HWLOC_NAME(topology_load) -#define hwloc_topology_destroy HWLOC_NAME(topology_destroy) -#define hwloc_topology_check HWLOC_NAME(topology_check) -#define hwloc_topology_ignore_type HWLOC_NAME(topology_ignore_type) -#define hwloc_topology_ignore_type_keep_structure HWLOC_NAME(topology_ignore_type_keep_structure) -#define hwloc_topology_ignore_all_keep_structure HWLOC_NAME(topology_ignore_all_keep_structure) - -#define hwloc_topology_flags_e HWLOC_NAME(topology_flags_e) - -#define HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM HWLOC_NAME_CAPS(TOPOLOGY_FLAG_WHOLE_SYSTEM) -#define HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM HWLOC_NAME_CAPS(TOPOLOGY_FLAG_IS_THISSYSTEM) -#define HWLOC_TOPOLOGY_FLAG_IO_DEVICES HWLOC_NAME_CAPS(TOPOLOGY_FLAG_IO_DEVICES) -#define HWLOC_TOPOLOGY_FLAG_IO_BRIDGES HWLOC_NAME_CAPS(TOPOLOGY_FLAG_IO_BRIDGES) -#define HWLOC_TOPOLOGY_FLAG_WHOLE_IO HWLOC_NAME_CAPS(TOPOLOGY_FLAG_WHOLE_IO) - -#define hwloc_topology_set_flags HWLOC_NAME(topology_set_flags) -#define hwloc_topology_set_fsroot HWLOC_NAME(topology_set_fsroot) -#define hwloc_topology_set_pid HWLOC_NAME(topology_set_pid) -#define hwloc_topology_set_synthetic HWLOC_NAME(topology_set_synthetic) -#define hwloc_topology_set_xml HWLOC_NAME(topology_set_xml) -#define hwloc_topology_set_xmlbuffer HWLOC_NAME(topology_set_xmlbuffer) -#define hwloc_topology_set_custom HWLOC_NAME(topology_set_custom) -#define hwloc_topology_set_distance_matrix HWLOC_NAME(topology_set_distance_matrix) - -#define hwloc_topology_discovery_support HWLOC_NAME(topology_discovery_support) -#define hwloc_topology_cpubind_support HWLOC_NAME(topology_cpubind_support) -#define hwloc_topology_membind_support HWLOC_NAME(topology_membind_support) -#define hwloc_topology_support HWLOC_NAME(topology_support) -#define hwloc_topology_get_support HWLOC_NAME(topology_get_support) -#define hwloc_topology_export_xml HWLOC_NAME(topology_export_xml) -#define hwloc_topology_export_xmlbuffer HWLOC_NAME(topology_export_xmlbuffer) -#define hwloc_free_xmlbuffer HWLOC_NAME(free_xmlbuffer) - -#define hwloc_topology_insert_misc_object_by_cpuset HWLOC_NAME(topology_insert_misc_object_by_cpuset) -#define hwloc_topology_insert_misc_object_by_parent HWLOC_NAME(topology_insert_misc_object_by_parent) - -#define hwloc_custom_insert_topology HWLOC_NAME(custom_insert_topology) -#define hwloc_custom_insert_group_object_by_parent HWLOC_NAME(custom_insert_group_object_by_parent) - -#define hwloc_restrict_flags_e HWLOC_NAME(restrict_flags_e) -#define HWLOC_RESTRICT_FLAG_ADAPT_DISTANCES HWLOC_NAME_CAPS(RESTRICT_FLAG_ADAPT_DISTANCES) -#define HWLOC_RESTRICT_FLAG_ADAPT_MISC HWLOC_NAME_CAPS(RESTRICT_FLAG_ADAPT_MISC) -#define HWLOC_RESTRICT_FLAG_ADAPT_IO HWLOC_NAME_CAPS(RESTRICT_FLAG_ADAPT_IO) -#define hwloc_topology_restrict HWLOC_NAME(topology_restrict) - -#define hwloc_topology_get_depth HWLOC_NAME(topology_get_depth) -#define hwloc_get_type_depth HWLOC_NAME(get_type_depth) - -#define hwloc_get_type_depth_e HWLOC_NAME(get_type_depth_e) -#define HWLOC_TYPE_DEPTH_UNKNOWN HWLOC_NAME_CAPS(TYPE_DEPTH_UNKNOWN) -#define HWLOC_TYPE_DEPTH_MULTIPLE HWLOC_NAME_CAPS(TYPE_DEPTH_MULTIPLE) -#define HWLOC_TYPE_DEPTH_BRIDGE HWLOC_NAME_CAPS(TYPE_DEPTH_BRIDGE) -#define HWLOC_TYPE_DEPTH_PCI_DEVICE HWLOC_NAME_CAPS(TYPE_DEPTH_PCI_DEVICE) -#define HWLOC_TYPE_DEPTH_OS_DEVICE HWLOC_NAME_CAPS(TYPE_DEPTH_OS_DEVICE) - -#define hwloc_get_depth_type HWLOC_NAME(get_depth_type) -#define hwloc_get_nbobjs_by_depth HWLOC_NAME(get_nbobjs_by_depth) -#define hwloc_get_nbobjs_by_type HWLOC_NAME(get_nbobjs_by_type) - -#define hwloc_topology_is_thissystem HWLOC_NAME(topology_is_thissystem) - -#define hwloc_get_obj_by_depth HWLOC_NAME(get_obj_by_depth ) -#define hwloc_get_obj_by_type HWLOC_NAME(get_obj_by_type ) - -#define hwloc_obj_type_string HWLOC_NAME(obj_type_string ) -#define hwloc_obj_type_of_string HWLOC_NAME(obj_type_of_string ) -#define hwloc_obj_type_snprintf HWLOC_NAME(obj_type_snprintf ) -#define hwloc_obj_attr_snprintf HWLOC_NAME(obj_attr_snprintf ) -#define hwloc_obj_snprintf HWLOC_NAME(obj_snprintf) -#define hwloc_obj_cpuset_snprintf HWLOC_NAME(obj_cpuset_snprintf) -#define hwloc_obj_get_info_by_name HWLOC_NAME(obj_get_info_by_name) -#define hwloc_obj_add_info HWLOC_NAME(obj_add_info) - -#define HWLOC_CPUBIND_PROCESS HWLOC_NAME_CAPS(CPUBIND_PROCESS) -#define HWLOC_CPUBIND_THREAD HWLOC_NAME_CAPS(CPUBIND_THREAD) -#define HWLOC_CPUBIND_STRICT HWLOC_NAME_CAPS(CPUBIND_STRICT) -#define HWLOC_CPUBIND_NOMEMBIND HWLOC_NAME_CAPS(CPUBIND_NOMEMBIND) - -#define hwloc_cpubind_flags_t HWLOC_NAME(cpubind_flags_t) - -#define hwloc_set_cpubind HWLOC_NAME(set_cpubind) -#define hwloc_get_cpubind HWLOC_NAME(get_cpubind) -#define hwloc_set_proc_cpubind HWLOC_NAME(set_proc_cpubind) -#define hwloc_get_proc_cpubind HWLOC_NAME(get_proc_cpubind) -#define hwloc_set_thread_cpubind HWLOC_NAME(set_thread_cpubind) -#define hwloc_get_thread_cpubind HWLOC_NAME(get_thread_cpubind) - -#define hwloc_get_last_cpu_location HWLOC_NAME(get_last_cpu_location) -#define hwloc_get_proc_last_cpu_location HWLOC_NAME(get_proc_last_cpu_location) - -#define HWLOC_MEMBIND_DEFAULT HWLOC_NAME_CAPS(MEMBIND_DEFAULT) -#define HWLOC_MEMBIND_FIRSTTOUCH HWLOC_NAME_CAPS(MEMBIND_FIRSTTOUCH) -#define HWLOC_MEMBIND_BIND HWLOC_NAME_CAPS(MEMBIND_BIND) -#define HWLOC_MEMBIND_INTERLEAVE HWLOC_NAME_CAPS(MEMBIND_INTERLEAVE) -#define HWLOC_MEMBIND_REPLICATE HWLOC_NAME_CAPS(MEMBIND_REPLICATE) -#define HWLOC_MEMBIND_NEXTTOUCH HWLOC_NAME_CAPS(MEMBIND_NEXTTOUCH) -#define HWLOC_MEMBIND_MIXED HWLOC_NAME_CAPS(MEMBIND_MIXED) - -#define hwloc_membind_policy_t HWLOC_NAME(membind_policy_t) - -#define HWLOC_MEMBIND_PROCESS HWLOC_NAME_CAPS(MEMBIND_PROCESS) -#define HWLOC_MEMBIND_THREAD HWLOC_NAME_CAPS(MEMBIND_THREAD) -#define HWLOC_MEMBIND_STRICT HWLOC_NAME_CAPS(MEMBIND_STRICT) -#define HWLOC_MEMBIND_MIGRATE HWLOC_NAME_CAPS(MEMBIND_MIGRATE) -#define HWLOC_MEMBIND_NOCPUBIND HWLOC_NAME_CAPS(MEMBIND_NOCPUBIND) - -#define hwloc_membind_flags_t HWLOC_NAME(membind_flags_t) - -#define hwloc_set_membind_nodeset HWLOC_NAME(set_membind_nodeset) -#define hwloc_set_membind HWLOC_NAME(set_membind) -#define hwloc_get_membind_nodeset HWLOC_NAME(get_membind_nodeset) -#define hwloc_get_membind HWLOC_NAME(get_membind) -#define hwloc_set_proc_membind_nodeset HWLOC_NAME(set_proc_membind_nodeset) -#define hwloc_set_proc_membind HWLOC_NAME(set_proc_membind) -#define hwloc_get_proc_membind_nodeset HWLOC_NAME(get_proc_membind_nodeset) -#define hwloc_get_proc_membind HWLOC_NAME(get_proc_membind) -#define hwloc_set_area_membind_nodeset HWLOC_NAME(set_area_membind_nodeset) -#define hwloc_set_area_membind HWLOC_NAME(set_area_membind) -#define hwloc_get_area_membind_nodeset HWLOC_NAME(get_area_membind_nodeset) -#define hwloc_get_area_membind HWLOC_NAME(get_area_membind) -#define hwloc_alloc_membind_nodeset HWLOC_NAME(alloc_membind_nodeset) -#define hwloc_alloc_membind HWLOC_NAME(alloc_membind) -#define hwloc_alloc HWLOC_NAME(alloc) -#define hwloc_free HWLOC_NAME(free) - -#define hwloc_get_non_io_ancestor_obj HWLOC_NAME(get_non_io_ancestor_obj) -#define hwloc_get_next_pcidev HWLOC_NAME(get_next_pcidev) -#define hwloc_get_pcidev_by_busid HWLOC_NAME(get_pcidev_by_busid) -#define hwloc_get_pcidev_by_busidstring HWLOC_NAME(get_pcidev_by_busidstring) -#define hwloc_get_next_osdev HWLOC_NAME(get_next_osdev) -#define hwloc_get_next_bridge HWLOC_NAME(get_next_bridge) -#define hwloc_bridge_covers_pcibus HWLOC_NAME(bridge_covers_pcibus) -#define hwloc_get_hostbridge_by_pcibus HWLOC_NAME(get_hostbridge_by_pcibus) - -/* hwloc/bitmap.h */ - -#define hwloc_bitmap_s HWLOC_NAME(bitmap_s) -#define hwloc_bitmap_t HWLOC_NAME(bitmap_t) -#define hwloc_const_bitmap_t HWLOC_NAME(const_bitmap_t) - -#define hwloc_bitmap_alloc HWLOC_NAME(bitmap_alloc) -#define hwloc_bitmap_alloc_full HWLOC_NAME(bitmap_alloc_full) -#define hwloc_bitmap_free HWLOC_NAME(bitmap_free) -#define hwloc_bitmap_dup HWLOC_NAME(bitmap_dup) -#define hwloc_bitmap_copy HWLOC_NAME(bitmap_copy) -#define hwloc_bitmap_snprintf HWLOC_NAME(bitmap_snprintf) -#define hwloc_bitmap_asprintf HWLOC_NAME(bitmap_asprintf) -#define hwloc_bitmap_sscanf HWLOC_NAME(bitmap_sscanf) -#define hwloc_bitmap_list_snprintf HWLOC_NAME(bitmap_list_snprintf) -#define hwloc_bitmap_list_asprintf HWLOC_NAME(bitmap_list_asprintf) -#define hwloc_bitmap_list_sscanf HWLOC_NAME(bitmap_list_sscanf) -#define hwloc_bitmap_taskset_snprintf HWLOC_NAME(bitmap_taskset_snprintf) -#define hwloc_bitmap_taskset_asprintf HWLOC_NAME(bitmap_taskset_asprintf) -#define hwloc_bitmap_taskset_sscanf HWLOC_NAME(bitmap_taskset_sscanf) -#define hwloc_bitmap_zero HWLOC_NAME(bitmap_zero) -#define hwloc_bitmap_fill HWLOC_NAME(bitmap_fill) -#define hwloc_bitmap_from_ulong HWLOC_NAME(bitmap_from_ulong) - -#define hwloc_bitmap_from_ith_ulong HWLOC_NAME(bitmap_from_ith_ulong) -#define hwloc_bitmap_to_ulong HWLOC_NAME(bitmap_to_ulong) -#define hwloc_bitmap_to_ith_ulong HWLOC_NAME(bitmap_to_ith_ulong) -#define hwloc_bitmap_only HWLOC_NAME(bitmap_only) -#define hwloc_bitmap_allbut HWLOC_NAME(bitmap_allbut) -#define hwloc_bitmap_set HWLOC_NAME(bitmap_set) -#define hwloc_bitmap_set_range HWLOC_NAME(bitmap_set_range) -#define hwloc_bitmap_set_ith_ulong HWLOC_NAME(bitmap_set_ith_ulong) -#define hwloc_bitmap_clr HWLOC_NAME(bitmap_clr) -#define hwloc_bitmap_clr_range HWLOC_NAME(bitmap_clr_range) -#define hwloc_bitmap_isset HWLOC_NAME(bitmap_isset) -#define hwloc_bitmap_iszero HWLOC_NAME(bitmap_iszero) -#define hwloc_bitmap_isfull HWLOC_NAME(bitmap_isfull) -#define hwloc_bitmap_isequal HWLOC_NAME(bitmap_isequal) -#define hwloc_bitmap_intersects HWLOC_NAME(bitmap_intersects) -#define hwloc_bitmap_isincluded HWLOC_NAME(bitmap_isincluded) -#define hwloc_bitmap_or HWLOC_NAME(bitmap_or) -#define hwloc_bitmap_and HWLOC_NAME(bitmap_and) -#define hwloc_bitmap_andnot HWLOC_NAME(bitmap_andnot) -#define hwloc_bitmap_xor HWLOC_NAME(bitmap_xor) -#define hwloc_bitmap_not HWLOC_NAME(bitmap_not) -#define hwloc_bitmap_first HWLOC_NAME(bitmap_first) -#define hwloc_bitmap_last HWLOC_NAME(bitmap_last) -#define hwloc_bitmap_next HWLOC_NAME(bitmap_next) -#define hwloc_bitmap_singlify HWLOC_NAME(bitmap_singlify) -#define hwloc_bitmap_compare_first HWLOC_NAME(bitmap_compare_first) -#define hwloc_bitmap_compare HWLOC_NAME(bitmap_compare) -#define hwloc_bitmap_weight HWLOC_NAME(bitmap_weight) - -/* hwloc/cpuset.h -- deprecated but still available */ - -#define hwloc_cpuset_alloc HWLOC_NAME(cpuset_alloc) -#define hwloc_cpuset_free HWLOC_NAME(cpuset_free) -#define hwloc_cpuset_dup HWLOC_NAME(cpuset_dup) -#define hwloc_cpuset_copy HWLOC_NAME(cpuset_copy) -#define hwloc_cpuset_snprintf HWLOC_NAME(cpuset_snprintf) -#define hwloc_cpuset_asprintf HWLOC_NAME(cpuset_asprintf) -#define hwloc_cpuset_from_string HWLOC_NAME(cpuset_from_string) -#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) -#define hwloc_cpuset_to_ith_ulong HWLOC_NAME(cpuset_to_ith_ulong) -#define hwloc_cpuset_cpu HWLOC_NAME(cpuset_cpu) -#define hwloc_cpuset_all_but_cpu HWLOC_NAME(cpuset_all_but_cpu) -#define hwloc_cpuset_set HWLOC_NAME(cpuset_set) -#define hwloc_cpuset_set_range HWLOC_NAME(cpuset_set_range) -#define hwloc_cpuset_set_ith_ulong HWLOC_NAME(cpuset_set_ith_ulong) -#define hwloc_cpuset_clr HWLOC_NAME(cpuset_clr) -#define hwloc_cpuset_clr_range HWLOC_NAME(cpuset_clr_range) -#define hwloc_cpuset_isset HWLOC_NAME(cpuset_isset) -#define hwloc_cpuset_iszero HWLOC_NAME(cpuset_iszero) -#define hwloc_cpuset_isfull HWLOC_NAME(cpuset_isfull) -#define hwloc_cpuset_isequal HWLOC_NAME(cpuset_isequal) -#define hwloc_cpuset_intersects HWLOC_NAME(cpuset_intersects) -#define hwloc_cpuset_isincluded HWLOC_NAME(cpuset_isincluded) -#define hwloc_cpuset_or HWLOC_NAME(cpuset_or) -#define hwloc_cpuset_and HWLOC_NAME(cpuset_and) -#define hwloc_cpuset_andnot HWLOC_NAME(cpuset_andnot) -#define hwloc_cpuset_xor HWLOC_NAME(cpuset_xor) -#define hwloc_cpuset_not HWLOC_NAME(cpuset_not) -#define hwloc_cpuset_first HWLOC_NAME(cpuset_first) -#define hwloc_cpuset_last HWLOC_NAME(cpuset_last) -#define hwloc_cpuset_next HWLOC_NAME(cpuset_next) -#define hwloc_cpuset_singlify HWLOC_NAME(cpuset_singlify) -#define hwloc_cpuset_compare_first HWLOC_NAME(cpuset_compare_first) -#define hwloc_cpuset_compare HWLOC_NAME(cpuset_compare) -#define hwloc_cpuset_weight HWLOC_NAME(cpuset_weight) - -/* hwloc/helper.h */ - -#define hwloc_get_type_or_below_depth HWLOC_NAME(get_type_or_below_depth) -#define hwloc_get_type_or_above_depth HWLOC_NAME(get_type_or_above_depth) -#define hwloc_get_root_obj HWLOC_NAME(get_root_obj) -#define hwloc_get_system_obj HWLOC_NAME(get_system_obj) -#define hwloc_get_ancestor_obj_by_depth HWLOC_NAME(get_ancestor_obj_by_depth) -#define hwloc_get_ancestor_obj_by_type HWLOC_NAME(get_ancestor_obj_by_type) -#define hwloc_get_next_obj_by_depth HWLOC_NAME(get_next_obj_by_depth) -#define hwloc_get_next_obj_by_type HWLOC_NAME(get_next_obj_by_type) -#define hwloc_get_pu_obj_by_os_index HWLOC_NAME(get_pu_obj_by_os_index) -#define hwloc_get_next_child HWLOC_NAME(get_next_child) -#define hwloc_get_common_ancestor_obj HWLOC_NAME(get_common_ancestor_obj) -#define hwloc_obj_is_in_subtree HWLOC_NAME(obj_is_in_subtree) -#define hwloc_get_first_largest_obj_inside_cpuset HWLOC_NAME(get_first_largest_obj_inside_cpuset) -#define hwloc_get_largest_objs_inside_cpuset HWLOC_NAME(get_largest_objs_inside_cpuset) -#define hwloc_get_next_obj_inside_cpuset_by_depth HWLOC_NAME(get_next_obj_inside_cpuset_by_depth) -#define hwloc_get_next_obj_inside_cpuset_by_type HWLOC_NAME(get_next_obj_inside_cpuset_by_type) -#define hwloc_get_obj_inside_cpuset_by_depth HWLOC_NAME(get_obj_inside_cpuset_by_depth) -#define hwloc_get_obj_inside_cpuset_by_type HWLOC_NAME(get_obj_inside_cpuset_by_type) -#define hwloc_get_nbobjs_inside_cpuset_by_depth HWLOC_NAME(get_nbobjs_inside_cpuset_by_depth) -#define hwloc_get_nbobjs_inside_cpuset_by_type HWLOC_NAME(get_nbobjs_inside_cpuset_by_type) -#define hwloc_get_child_covering_cpuset HWLOC_NAME(get_child_covering_cpuset) -#define hwloc_get_obj_covering_cpuset HWLOC_NAME(get_obj_covering_cpuset) -#define hwloc_get_next_obj_covering_cpuset_by_depth HWLOC_NAME(get_next_obj_covering_cpuset_by_depth) -#define hwloc_get_next_obj_covering_cpuset_by_type HWLOC_NAME(get_next_obj_covering_cpuset_by_type) -#define hwloc_get_cache_covering_cpuset HWLOC_NAME(get_cache_covering_cpuset) -#define hwloc_get_shared_cache_covering_obj HWLOC_NAME(get_shared_cache_covering_obj) -#define hwloc_get_closest_objs HWLOC_NAME(get_closest_objs) -#define hwloc_get_obj_below_by_type HWLOC_NAME(get_obj_below_by_type) -#define hwloc_get_obj_below_array_by_type HWLOC_NAME(get_obj_below_array_by_type) -#define hwloc_distributev HWLOC_NAME(distributev) -#define hwloc_distribute HWLOC_NAME(distribute) -#define hwloc_alloc_membind_policy HWLOC_NAME(alloc_membind_policy) -#define hwloc_alloc_membind_policy_nodeset HWLOC_NAME(alloc_membind_policy_nodeset) -#define hwloc_topology_get_complete_cpuset HWLOC_NAME(topology_get_complete_cpuset) -#define hwloc_topology_get_topology_cpuset HWLOC_NAME(topology_get_topology_cpuset) -#define hwloc_topology_get_online_cpuset HWLOC_NAME(topology_get_online_cpuset) -#define hwloc_topology_get_allowed_cpuset HWLOC_NAME(topology_get_allowed_cpuset) -#define hwloc_topology_get_complete_nodeset HWLOC_NAME(topology_get_complete_nodeset) -#define hwloc_topology_get_topology_nodeset HWLOC_NAME(topology_get_topology_nodeset) -#define hwloc_topology_get_allowed_nodeset HWLOC_NAME(topology_get_allowed_nodeset) -#define hwloc_cpuset_to_nodeset HWLOC_NAME(cpuset_to_nodeset) -#define hwloc_cpuset_to_nodeset_strict HWLOC_NAME(cpuset_to_nodeset_strict) -#define hwloc_cpuset_from_nodeset HWLOC_NAME(cpuset_from_nodeset) -#define hwloc_cpuset_from_nodeset_strict HWLOC_NAME(cpuset_from_nodeset_strict) -#define hwloc_get_whole_distance_matrix_by_depth HWLOC_NAME(get_whole_distance_matrix_by_depth) -#define hwloc_get_whole_distance_matrix_by_type HWLOC_NAME(get_whole_distance_matrix_by_type) -#define hwloc_get_distance_matrix_covering_obj_by_depth HWLOC_NAME(get_distance_matrix_covering_obj_by_depth) -#define hwloc_get_latency HWLOC_NAME(get_latency) - -/* glibc-sched.h */ - -#define hwloc_cpuset_to_glibc_sched_affinity HWLOC_NAME(cpuset_to_glibc_sched_affinity) -#define hwloc_cpuset_from_glibc_sched_affinity HWLOC_NAME(cpuset_from_glibc_sched_affinity) - -/* linux-libnuma.h */ - -#define hwloc_cpuset_to_linux_libnuma_ulongs HWLOC_NAME(cpuset_to_linux_libnuma_ulongs) -#define hwloc_nodeset_to_linux_libnuma_ulongs HWLOC_NAME(nodeset_to_linux_libnuma_ulongs) -#define hwloc_cpuset_from_linux_libnuma_ulongs HWLOC_NAME(cpuset_from_linux_libnuma_ulongs) -#define hwloc_nodeset_from_linux_libnuma_ulongs HWLOC_NAME(nodeset_from_linux_libnuma_ulongs) -#define hwloc_cpuset_to_linux_libnuma_bitmask HWLOC_NAME(cpuset_to_linux_libnuma_bitmask) -#define hwloc_nodeset_to_linux_libnuma_bitmask HWLOC_NAME(nodeset_to_linux_libnuma_bitmask) -#define hwloc_cpuset_from_linux_libnuma_bitmask HWLOC_NAME(cpuset_from_linux_libnuma_bitmask) -#define hwloc_nodeset_from_linux_libnuma_bitmask HWLOC_NAME(nodeset_from_linux_libnuma_bitmask) -#define hwloc_cpuset_to_linux_libnuma_nodemask HWLOC_NAME(cpuset_to_linux_libnuma_nodemask) -#define hwloc_nodeset_to_linux_libnuma_nodemask HWLOC_NAME(nodeset_to_linux_libnuma_nodemask) -#define hwloc_cpuset_from_linux_libnuma_nodemask HWLOC_NAME(cpuset_from_linux_libnuma_nodemask) -#define hwloc_nodeset_from_linux_libnuma_nodemask HWLOC_NAME(nodeset_from_linux_libnuma_nodemask) - -/* linux.h */ - -#define hwloc_linux_parse_cpumap_file HWLOC_NAME(linux_parse_cpumap_file) -#define hwloc_linux_set_tid_cpubind HWLOC_NAME(linux_set_tid_cpubind) -#define hwloc_linux_get_tid_cpubind HWLOC_NAME(linux_get_tid_cpubind) - -/* openfabrics-verbs.h */ - -#define hwloc_ibv_get_device_cpuset HWLOC_NAME(ibv_get_device_cpuset) - -/* myriexpress.h */ - -#define hwloc_mx_board_get_device_cpuset HWLOC_NAME(mx_board_get_device_cpuset) -#define hwloc_mx_endpoint_get_device_cpuset HWLOC_NAME(mx_endpoint_get_device_cpuset) - -/* cuda.h */ - -#define hwloc_cuda_get_device_pci_ids HWLOC_NAME(cuda_get_device_pci_ids) -#define hwloc_cuda_get_device_cpuset HWLOC_NAME(cuda_get_device_cpuset) -#define hwloc_cuda_get_device_pcidev HWLOC_NAME(cuda_get_device_pcidev) - -/* cudart.h */ - -#define hwloc_cudart_get_device_pci_ids HWLOC_NAME(cudart_get_device_pci_ids) -#define hwloc_cudart_get_device_cpuset HWLOC_NAME(cudart_get_device_cpuset) -#define hwloc_cudart_get_device_pcidev HWLOC_NAME(cudart_get_device_pcidev) - -/* private/debug.h */ - -#define hwloc_debug HWLOC_NAME(debug) - -/* private/misc.h */ - -#define hwloc_snprintf HWLOC_NAME(snprintf) -#define hwloc_namecoloncmp HWLOC_NAME(namecoloncmp) -/* FIXME: hwloc_ffsl may be a macro, but it may not be defined yet */ -#define hwloc_ffs32 HWLOC_NAME(ffs32) -/* FIXME: hwloc_flsl may be a macro, but it may not be defined yet */ -#define hwloc_fls32 HWLOC_NAME(fls32) -#define hwloc_weight_long HWLOC_NAME(weight_long) - -/* private/cpuid.h */ - -#define hwloc_have_cpuid HWLOC_NAME(have_cpuid) -#define hwloc_cpuid HWLOC_NAME(cpuid) - -/* private/private.h */ - -#define hwloc_ignore_type_e HWLOC_NAME(ignore_type_e) - -#define HWLOC_IGNORE_TYPE_NEVER HWLOC_NAME_CAPS(IGNORE_TYPE_NEVER) -#define HWLOC_IGNORE_TYPE_KEEP_STRUCTURE HWLOC_NAME_CAPS(IGNORE_TYPE_KEEP_STRUCTURE) -#define HWLOC_IGNORE_TYPE_ALWAYS HWLOC_NAME_CAPS(IGNORE_TYPE_ALWAYS) - -#define hwloc_os_distances_s HWLOC_NAME(os_distances_s) -#define hwloc_backend_e HWLOC_NAME(backend_e) -#define hwloc_backend_t HWLOC_NAME(backend_t) - -#define HWLOC_BACKEND_NONE HWLOC_NAME_CAPS(BACKEND_NONE) -#define HWLOC_BACKEND_SYNTHETIC HWLOC_NAME_CAPS(BACKEND_SYNTHETIC) -#define HWLOC_BACKEND_LINUXFS HWLOC_NAME_CAPS(BACKEND_LINUXFS) -#define HWLOC_BACKEND_XML HWLOC_NAME_CAPS(BACKEND_XML) -#define HWLOC_BACKEND_MAX HWLOC_NAME_CAPS(BACKEND_MAX) - -#define hwloc_backend_params_u HWLOC_NAME(backend_params_u) -#define hwloc_backend_params_linuxfs_s HWLOC_NAME(backend_params_linuxfs_s) -#define hwloc_backend_params_osf HWLOC_NAME(backend_params_osf) -#define hwloc_backend_params_xml_s HWLOC_NAME(backend_params_xml_s) -#define hwloc_backend_params_synthetic_s HWLOC_NAME(backend_params_synthetic_s) - -#define hwloc_xml_imported_distances_s HWLOC_NAME(xml_imported_distances_s) - -#define hwloc_setup_pu_level HWLOC_NAME(setup_pu_level) -#define hwloc_get_sysctlbyname HWLOC_NAME(get_sysctlbyname) -#define hwloc_get_sysctl HWLOC_NAME(get_sysctl) -#define hwloc_fallback_nbprocessors HWLOC_NAME(fallback_nbprocessors) -#define hwloc_connect_children HWLOC_NAME(connect_children) -#define hwloc_connect_levels HWLOC_NAME(connect_levels) - -#define hwloc_look_linuxfs HWLOC_NAME(look_linuxfs) -#define hwloc_set_linuxfs_hooks HWLOC_NAME(set_linuxfs_hooks) -#define hwloc_backend_linuxfs_init HWLOC_NAME(backend_linuxfs_init) -#define hwloc_backend_linuxfs_exit HWLOC_NAME(backend_linuxfs_exit) - -#define hwloc_backend_xml_init HWLOC_NAME(backend_xml_init) -#define hwloc_look_xml HWLOC_NAME(look_xml) -#define hwloc_backend_xml_exit HWLOC_NAME(backend_xml_exit) - -#define hwloc_look_solaris HWLOC_NAME(look_solaris) -#define hwloc_set_solaris_hooks HWLOC_NAME(set_solaris_hooks) - -#define hwloc_look_aix HWLOC_NAME(look_aix) -#define hwloc_set_aix_hooks HWLOC_NAME(set_aix_hooks) - -#define hwloc_look_osf HWLOC_NAME(look_osf) -#define hwloc_set_osf_hooks HWLOC_NAME(set_osf_hooks) - -#define hwloc_look_windows HWLOC_NAME(look_windows) -#define hwloc_set_windows_hooks HWLOC_NAME(set_windows_hooks) - -#define hwloc_look_darwin HWLOC_NAME(look_darwin) -#define hwloc_set_darwin_hooks HWLOC_NAME(set_darwin_hooks) - -#define hwloc_look_freebsd HWLOC_NAME(look_freebsd) -#define hwloc_set_freebsd_hooks HWLOC_NAME(set_freebsd_hooks) - -#define hwloc_look_hpux HWLOC_NAME(look_hpux) -#define hwloc_set_hpux_hooks HWLOC_NAME(set_hpux_hooks) - -#define hwloc_look_libpci HWLOC_NAME(look_libpci) - -#define hwloc_look_x86 HWLOC_NAME(look_x86) - -#define hwloc_backend_synthetic_init HWLOC_NAME(backend_synthetic_init) -#define hwloc_backend_synthetic_exit HWLOC_NAME(backend_synthetic_exit) -#define hwloc_look_synthetic HWLOC_NAME(look_synthetic ) - -#define hwloc_insert_object_by_cpuset HWLOC_NAME(insert_object_by_cpuset) -#define hwloc_report_error_t HWLOC_NAME(report_error_t) -#define hwloc_report_os_error HWLOC_NAME(report_os_error) -#define hwloc_hide_errors HWLOC_NAME(hide_errors) -#define hwloc__insert_object_by_cpuset HWLOC_NAME(_insert_object_by_cpuset) -#define hwloc_insert_object_by_parent HWLOC_NAME(insert_object_by_parent) -#define hwloc_add_uname_info HWLOC_NAME(add_uname_info) -#define hwloc_bitmap_printf_value HWLOC_NAME(bitmap_printf_value) -#define hwloc_alloc_setup_object HWLOC_NAME(alloc_setup_object) -#define hwloc_free_unlinked_object HWLOC_NAME(free_unlinked_object) -#define hwloc_setup_level HWLOC_NAME(setup_level) - -#define hwloc_alloc_heap HWLOC_NAME(alloc_heap) -#define hwloc_alloc_mmap HWLOC_NAME(alloc_mmap) -#define hwloc_free_heap HWLOC_NAME(free_heap) -#define hwloc_free_mmap HWLOC_NAME(free_mmap) -#define hwloc_alloc_or_fail HWLOC_NAME(alloc_or_fail) - -#define hwloc_distances_init HWLOC_NAME(distances_init) -#define hwloc_distances_clear HWLOC_NAME(distances_clear) -#define hwloc_distances_destroy HWLOC_NAME(distances_destroy) -#define hwloc_distances_set HWLOC_NAME(distances_set) -#define hwloc_distances_set_from_env HWLOC_NAME(distances_set_from_env) -#define hwloc_distances_restrict_os HWLOC_NAME(distances_restrict_os) -#define hwloc_distances_restrict HWLOC_NAME(distances_restrict) -#define hwloc_distances_finalize_os HWLOC_NAME(distances_finalize_os) -#define hwloc_distances_finalize_logical HWLOC_NAME(distances_finalize_logical) -#define hwloc_clear_object_distances HWLOC_NAME(clear_object_distances) -#define hwloc_clear_object_distances_one HWLOC_NAME(clear_object_distances_one) -#define hwloc_group_by_distances HWLOC_NAME(group_by_distances) - -#endif /* HWLOC_SYM_TRANSFORM */ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* HWLOC_RENAME_H */