1
1
This commit was SVN r25088.
Этот коммит содержится в:
Jeff Squyres 2011-08-26 13:14:26 +00:00
родитель f46ef05c6e
Коммит 495ceef60d
14 изменённых файлов: 176 добавлений и 66 удалений

Просмотреть файл

@ -17,6 +17,28 @@ bug fixes (and other actions) for each version of hwloc since version
in v0.9.1).
Version 1.2.1
-------------
* Improve support of AMD Bulldozer "Compute-Unit" modules by detecting
logical processors with different core IDs on Linux.
* Fix hwloc-ps crash when listing processes from another Linux cpuset.
Thanks to Carl Smith for reporting the problem.
* Fix build on AIX and Solaris. Thanks to Carl Smith and Andreas Kupries
for reporting the problems.
* Fix cache size detection on Darwin. Thanks to Erkcan Özcan for reporting
the problem.
* Make configure fail if --enable-xml or --enable-cairo is given and
proper support cannot be found. Thanks to Andreas Kupries for reporting
the XML problem.
* Fix spurious L1 cache detection on AIX. Thanks to Hendryk Bockelmann
for reporting the problem.
* Fix hwloc_get_last_cpu_location(THREAD) on Linux. Thanks to Gabriele
Fatigati for reporting the problem.
* Fix object distance detection on Solaris.
* Add pthread_self weak symbol to ease static linking.
* Minor documentation fixes.
Version 1.2.0
-------------
* Major features

Просмотреть файл

@ -89,7 +89,7 @@ CLI Examples
On a 4-socket 2-core machine with hyperthreading, the lstopo tool may show the
following graphical output:
dudley.png
dudley.png
Here's the equivalent output in textual form:
@ -193,7 +193,7 @@ line), and only socket #0 is shown for brevity:
On a 4-socket 2-core Opteron NUMA machine, the lstopo tool may show the
following graphical output:
hagrid.png
hagrid.png
Here's the equivalent output in textual form:
@ -263,7 +263,7 @@ added and only PU #0 is shown for brevity:
On a 2-socket quad-core Xeon (pre-Nehalem, with 2 dual-core dies into each
socket):
emmett.png
emmett.png
Here's the same output in textual form:
@ -381,12 +381,12 @@ interfaces for them are usually available on the supported Operating Systems.
Here's the graphical output from lstopo on this platform when Simultaneous
Multi-Threading (SMT) is enabled:
ppc64-with-smt.png
ppc64-with-smt.png
And here's the graphical output from lstopo on this platform when SMT is
disabled:
ppc64-without-smt.png
ppc64-without-smt.png
Notice that hwloc only sees half the PUs when SMT is disabled. PU #15, for
example, seems to change location from NUMA node #0 to #1. In reality, no PUs
@ -403,7 +403,7 @@ Note that upgrading the Linux kernel on the same PPC64 system mentioned above
to 2.6.34, hwloc is able to discover all the topology information. The
following picture shows the entire topology layout when SMT is enabled:
ppc64-full-with-smt.png
ppc64-full-with-smt.png
Developers using the hwloc API or XML output for portable applications should
therefore be extremely careful to not make any assumptions about the structure
@ -684,5 +684,5 @@ Make sure to have had a look at those too!
-------------------------------------------------------------------------------
Generated on Thu Apr 14 2011 22:34:49 for Hardware Locality (hwloc) by doxygen
1.7.3
Generated on Tue Aug 16 2011 19:37:04 for Hardware Locality (hwloc) by doxygen
1.7.4

Просмотреть файл

@ -7,7 +7,7 @@
major=1
minor=2
release=0
release=1
# greek is used for alpha or beta release tags. If it is non-empty,
# it will be appended to the version number. It does not have to be
@ -41,11 +41,11 @@ want_repo_rev=0
# from an SVN checkout, if repo_rev=-1, then its value is replaced
# with the output of "svnversion".
repo_rev=r3454
repo_rev=r3619
# The date when this release was created
date="Apr 14, 2011"
date="Aug 16, 2011"
# The shared library version of hwloc's public library. This version
# is maintained in accordance with the "Library Interface Versions"
@ -58,4 +58,4 @@ date="Apr 14, 2011"
# 2. Version numbers are described in the Libtool current:revision:age
# format.
libhwloc_so_version=3:0:3
libhwloc_so_version=3:1:3

Просмотреть файл

@ -524,15 +524,21 @@ EOF])
)
# XML support
hwloc_xml_happy=
if test "x$enable_xml" != "xno"; then
HWLOC_PKG_CHECK_MODULES([XML], [libxml-2.0], [xmlNewDoc], [:], [enable_xml="no"])
HWLOC_PKG_CHECK_MODULES([XML], [libxml-2.0], [xmlNewDoc],
[hwloc_xml_happy=yes],
[hwloc_xml_happy=no])
fi
if test "x$enable_xml" != "xno"; then
if test "x$hwloc_xml_happy" = "xyes"; then
HWLOC_REQUIRES="libxml-2.0 $HWLOC_REQUIRES"
AC_DEFINE([HWLOC_HAVE_XML], [1], [Define to 1 if you have the `xml' library.])
AC_SUBST([HWLOC_HAVE_XML], [1])
else
AC_SUBST([HWLOC_HAVE_XML], [0])
AS_IF([test "$enable_xml" = "yes"],
[AC_MSG_WARN([--enable-xml requested, but XML support was not found])
AC_MSG_ERROR([Cannot continue])])
fi
HWLOC_CFLAGS="$HWLOC_CFLAGS $HWLOC_XML_CFLAGS"
@ -623,7 +629,7 @@ AC_DEFUN([HWLOC_DO_AM_CONDITIONALS],[
AM_CONDITIONAL([HWLOC_HAVE_CUDART],
[test "x$hwloc_have_cudart" = "xyes"])
AM_CONDITIONAL([HWLOC_HAVE_CAIRO], [test "x$enable_cairo" != "xno"])
AM_CONDITIONAL([HWLOC_HAVE_XML], [test "x$enable_xml" != "xno"])
AM_CONDITIONAL([HWLOC_HAVE_XML], [test "$hwloc_xml_happy" = "yes"])
AM_CONDITIONAL([HWLOC_HAVE_SET_MEMPOLICY], [test "x$enable_set_mempolicy" != "xno"])
AM_CONDITIONAL([HWLOC_HAVE_MBIND], [test "x$enable_mbind" != "xno"])
AM_CONDITIONAL([HWLOC_HAVE_BUNZIPP], [test "x$BUNZIPP" != "xfalse"])

Просмотреть файл

@ -1,7 +1,7 @@
dnl -*- Autoconf -*-
dnl
dnl Copyright (c) 2009 INRIA. All rights reserved.
dnl Copyright (c) 2009 Université Bordeaux 1
dnl Copyright (c) 2009, 2011 Université Bordeaux 1
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
@ -211,9 +211,12 @@ EOF
hwloc_build_utils=yes
# Cairo support
hwloc_cairo_happy=
if test "x$enable_cairo" != "xno"; then
HWLOC_PKG_CHECK_MODULES([CAIRO], [cairo], [cairo_fill], [:], [enable_cairo=no])
if test "x$enable_cairo" != "xno"; then
HWLOC_PKG_CHECK_MODULES([CAIRO], [cairo], [cairo_fill],
[hwloc_cairo_happy=yes],
[hwloc_cairo_happy=no])
if test "x$hwloc_cairo_happy" = "xyes"; then
AC_PATH_XTRA
CFLAGS_save=$CFLAGS
LIBS_save=$LIBS
@ -232,6 +235,7 @@ EOF
)
if test "x$enable_X11" != "xyes"; then
AC_MSG_WARN([X11 headers not found, Cairo/X11 back-end disabled])
hwloc_cairo_happy=no
fi
CFLAGS=$CFLAGS_save
@ -239,8 +243,12 @@ EOF
fi
fi
if test "x$enable_cairo" != "xno"; then
if test "x$hwloc_cairo_happy" = "xyes"; then
AC_DEFINE([HWLOC_HAVE_CAIRO], [1], [Define to 1 if you have the `cairo' library.])
else
AS_IF([test "$enable_cairo" = "yes"],
[AC_MSG_WARN([--enable-cairo requested, but Cairo/X11 support was not found])
AC_MSG_ERROR([Cannot continue])])
fi
AC_CHECK_TYPES([wchar_t], [
@ -254,16 +262,33 @@ EOF
AC_CHECK_FUNCS([nl_langinfo])
])
hwloc_old_LIBS="$LIBS"
LIBS=
AC_CHECK_HEADERS([curses.h], [
AC_CHECK_HEADERS([term.h], [
AC_SEARCH_LIBS([tparm], [termcap ncursesw ncurses curses], [
AC_SUBST([HWLOC_TERMCAP_LIBS], ["$LIBS"])
AC_DEFINE([HWLOC_HAVE_LIBTERMCAP], [1],
[Define to 1 if you have a library providing the termcap interface])
])
], [], [[#include <curses.h>]])
])
chosen_curses=""
for curses in ncurses curses
do
for lib in "" -ltermcap -l${curses}w -l$curses
do
AC_MSG_CHECKING(termcap support using $curses and $lib)
LIBS="$hwloc_old_LIBS $lib"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <$curses.h>
#include <term.h>
]], [[tparm(NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0)]])], [
AC_MSG_RESULT(yes)
AC_SUBST([HWLOC_TERMCAP_LIBS], ["$LIBS"])
AC_DEFINE([HWLOC_HAVE_LIBTERMCAP], [1],
[Define to 1 if you have a library providing the termcap interface])
chosen_curses=$curses
], [
AC_MSG_RESULT(no)
])
test "x$chosen_curses" != "x" && break
done
test "x$chosen_curses" != "x" && break
done
if test "$chosen_curses" = ncurses
then
AC_DEFINE([HWLOC_USE_NCURSES], [1], [Define to 1 if ncurses works, preferred over curses])
fi
LIBS="$hwloc_old_LIBS"
unset hwloc_old_LIBS
@ -357,9 +382,10 @@ EOF
hwloc_config_prefix[tests/linux/gather/test-gather-topology.sh]
hwloc_config_prefix[tests/linux/test-topology.sh]
hwloc_config_prefix[tests/xml/test-topology.sh]
hwloc_config_prefix[utils/test-hwloc-calc.sh]
hwloc_config_prefix[utils/test-hwloc-distrib.sh])
AC_CONFIG_COMMANDS([chmoding-scripts], [chmod +x ]hwloc_config_prefix[tests/linux/test-topology.sh ]hwloc_config_prefix[tests/xml/test-topology.sh ]hwloc_config_prefix[tests/linux/hwloc-gather-topology ]hwloc_config_prefix[tests/linux/gather/test-gather-topology.sh ]hwloc_config_prefix[utils/test-hwloc-distrib.sh])
AC_CONFIG_COMMANDS([chmoding-scripts], [chmod +x ]hwloc_config_prefix[tests/linux/test-topology.sh ]hwloc_config_prefix[tests/xml/test-topology.sh ]hwloc_config_prefix[tests/linux/hwloc-gather-topology ]hwloc_config_prefix[tests/linux/gather/test-gather-topology.sh ]hwloc_config_prefix[utils/test-hwloc-calc.sh ]hwloc_config_prefix[utils/test-hwloc-distrib.sh])
# These links are only needed in standalone mode. It would
# be nice to m4 foreach this somehow, but whenever I tried

Просмотреть файл

@ -894,10 +894,10 @@ HWLOC_DECLSPEC int hwloc_topology_is_thissystem(hwloc_topology_t __hwloc_restri
* @{
*/
/** \brief Returns the topology object at index \p index from depth \p depth */
/** \brief Returns the topology object at logical index \p idx from depth \p depth */
HWLOC_DECLSPEC hwloc_obj_t hwloc_get_obj_by_depth (hwloc_topology_t topology, unsigned depth, unsigned idx) __hwloc_attribute_pure;
/** \brief Returns the topology object at index \p index with type \p type
/** \brief Returns the topology object at logical index \p idx with type \p type
*
* If no object for that type exists, \c NULL is returned.
* If there are several levels with objects of that type, \c NULL is returned
@ -1044,6 +1044,9 @@ hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name)
*
* \note On some operating systems, CPU binding may have effects on memory binding, see
* ::HWLOC_CPUBIND_NOMEMBIND
*
* Running lstopo --top can be a very convenient tool to check how binding
* actually happened.
* @{
*/
@ -1117,6 +1120,9 @@ typedef enum {
HWLOC_DECLSPEC int hwloc_set_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int flags);
/** \brief Get current process or thread binding
*
* Writes into \p set the cpuset which the process or thread (according to \e
* flags) was last bound to.
*/
HWLOC_DECLSPEC int hwloc_get_cpubind(hwloc_topology_t topology, hwloc_cpuset_t set, int flags);
@ -1139,14 +1145,14 @@ HWLOC_DECLSPEC int hwloc_set_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t
HWLOC_DECLSPEC int hwloc_get_proc_cpubind(hwloc_topology_t topology, hwloc_pid_t pid, hwloc_cpuset_t set, int flags);
#ifdef hwloc_thread_t
/** \brief Bind a thread \p tid on cpus given in bitmap \p set
/** \brief Bind a thread \p thread on cpus given in bitmap \p set
*
* \note hwloc_thread_t is pthread_t on unix platforms, and HANDLE on native
* Windows platforms
*
* \note HWLOC_CPUBIND_PROCESS can not be used in \p flags.
*/
HWLOC_DECLSPEC int hwloc_set_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t tid, hwloc_const_cpuset_t set, int flags);
HWLOC_DECLSPEC int hwloc_set_thread_cpubind(hwloc_topology_t topology, hwloc_thread_t thread, hwloc_const_cpuset_t set, int flags);
#endif
#ifdef hwloc_thread_t

Просмотреть файл

@ -1,7 +1,7 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2011 INRIA. All rights reserved.
* Copyright © 2009-2010 Université Bordeaux 1
* Copyright © 2009-2011 Université Bordeaux 1
* Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
@ -292,7 +292,7 @@ hwloc_get_next_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const
return hwloc_get_next_obj_inside_cpuset_by_depth(topology, set, depth, prev);
}
/** \brief Return the \p index -th object at depth \p depth included in CPU set \p set.
/** \brief Return the (logically) \p idx -th object at depth \p depth included in CPU set \p set.
*/
static __hwloc_inline hwloc_obj_t __hwloc_attribute_pure
hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set,
@ -529,8 +529,8 @@ HWLOC_DECLSPEC unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc
/** \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 index \p idx1. Then look below this object and find another
* object of type \p type2 and index \p idx2. Indexes are specified
* 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
@ -557,7 +557,7 @@ hwloc_get_obj_below_by_type (hwloc_topology_t topology,
* 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 index couple in the arrays, look under the previously found
* 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.
*

Просмотреть файл

@ -1,7 +1,7 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA. All rights reserved.
* Copyright © 2009-2010 Université Bordeaux 1
* Copyright © 2009-2011 Université Bordeaux 1
* See COPYING in top-level directory.
*/
@ -48,7 +48,7 @@ HWLOC_DECLSPEC int hwloc_linux_set_tid_cpubind(hwloc_topology_t topology, pid_t
/** \brief Get the current binding of thread \p tid
*
* The behavior is exactly the same as the Linux sched_setaffinity system call,
* 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);

Просмотреть файл

@ -42,9 +42,6 @@
/* Define to 1 if you have the <cuda_runtime_api.h> header file. */
#undef HAVE_CUDA_RUNTIME_API_H
/* Define to 1 if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
/* Define to 1 if you have the declaration of `CTL_HW', and to 0 if you don't.
*/
#undef HAVE_DECL_CTL_HW
@ -261,9 +258,6 @@
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
/* Define to 1 if you have the <term.h> header file. */
#undef HAVE_TERM_H
/* Define to 1 if you have the `uname' function. */
#undef HAVE_UNAME
@ -477,6 +471,9 @@
/* Define to 1 on unsupported systems */
#undef HWLOC_UNSUPPORTED_SYS
/* Define to 1 if ncurses works, preferred over curses */
#undef HWLOC_USE_NCURSES
/* Define to 1 on WINDOWS */
#undef HWLOC_WIN_SYS

Просмотреть файл

@ -165,9 +165,11 @@ static void hwloc_get_type_distances_from_string(struct hwloc_topology *topology
} else {
/* parse a comma separated list of distances */
for(i=0; i<nbobjs*nbobjs; i++) {
distances[i] = strtof(tmp, &next);
tmp = next+1;
if (!*next && i!=nbobjs*nbobjs-1) {
distances[i] = atof(tmp);
next = strchr(tmp, ',');
if (next) {
tmp = next+1;
} else if (i!=nbobjs*nbobjs-1) {
fprintf(stderr, "Ignoring %s distances from environment variable, not enough values (%u out of %u)\n",
hwloc_obj_type_string(type), i+1, nbobjs*nbobjs);
free(indexes);

Просмотреть файл

@ -475,6 +475,7 @@ look_rset(int sdl, hwloc_obj_type_t type, struct hwloc_topology *topology, int l
break;
case HWLOC_OBJ_GROUP:
obj->attr->group.depth = level;
break;
case HWLOC_OBJ_CORE:
{
hwloc_obj_t obj2 = hwloc_alloc_setup_object(HWLOC_OBJ_CACHE, i);
@ -505,6 +506,8 @@ hwloc_look_aix(struct hwloc_topology *topology)
int i;
/* TODO: R_LGPGDEF/R_LGPGFREE for large pages */
hwloc_debug("Note: SMPSDL is at %d\n", rs_getinfo(NULL, R_SMPSDL, 0));
for (i=0; i<=rs_getinfo(NULL, R_MAXSDL, 0); i++)
{
int known = 0;

Просмотреть файл

@ -133,8 +133,8 @@ hwloc_look_darwin(struct hwloc_topology *topology)
cacheconfig[i] = cacheconfig32[i];
}
memset(cachesize, 0, sizeof(cachesize));
size = sizeof(cachesize);
memset(cachesize, 0, sizeof(uint64_t) * n);
size = sizeof(uint64_t) * n;
if (sysctlbyname("hw.cachesize", cachesize, &size, NULL, 0)) {
if (n > 0)
cachesize[0] = memsize;

Просмотреть файл

@ -27,6 +27,7 @@
#include <sched.h>
#include <pthread.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#if defined HWLOC_HAVE_SET_MEMPOLICY || defined HWLOC_HAVE_MBIND
#define migratepages migrate_pages /* workaround broken migratepages prototype in numaif.h before libnuma 2.0.2 */
#include <numaif.h>
@ -641,6 +642,7 @@ hwloc_linux_get_thisthread_cpubind(hwloc_topology_t topology, hwloc_bitmap_t hwl
#if HAVE_DECL_PTHREAD_SETAFFINITY_NP
#pragma weak pthread_setaffinity_np
#pragma weak pthread_self
static int
hwloc_linux_set_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_const_bitmap_t hwloc_set, int flags __hwloc_attribute_unused)
@ -652,11 +654,15 @@ hwloc_linux_set_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_c
return -1;
}
if (!pthread_self) {
/* ?! Application uses set_thread_cpubind, but doesn't link against libpthread ?! */
errno = ENOSYS;
return -1;
}
if (tid == pthread_self())
return hwloc_linux_set_tid_cpubind(topology, 0, hwloc_set);
if (!pthread_setaffinity_np) {
/* ?! Application uses set_thread_cpubind, but doesn't link against libpthread ?! */
errno = ENOSYS;
return -1;
}
@ -735,6 +741,7 @@ hwloc_linux_set_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_c
#if HAVE_DECL_PTHREAD_GETAFFINITY_NP
#pragma weak pthread_getaffinity_np
#pragma weak pthread_self
static int
hwloc_linux_get_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_bitmap_t hwloc_set, int flags __hwloc_attribute_unused)
@ -746,11 +753,15 @@ hwloc_linux_get_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_b
return -1;
}
if (!pthread_self) {
/* ?! Application uses set_thread_cpubind, but doesn't link against libpthread ?! */
errno = ENOSYS;
return -1;
}
if (tid == pthread_self())
return hwloc_linux_get_tid_cpubind(topology, 0, hwloc_set);
if (!pthread_getaffinity_np) {
/* ?! Application uses get_thread_cpubind, but doesn't link against libpthread ?! */
errno = ENOSYS;
return -1;
}
@ -845,17 +856,27 @@ hwloc_linux_get_tid_last_cpu_location(hwloc_topology_t topology __hwloc_attribut
FILE *file;
int i;
if (!tid)
strcpy(name, "/proc/self/stat");
else
snprintf(name, sizeof(name), "/proc/%lu/stat", (unsigned long) tid);
if (!tid) {
#ifdef SYS_gettid
tid = syscall(SYS_gettid);
#else
errno = ENOSYS;
return -1;
#endif
}
snprintf(name, sizeof(name), "/proc/%lu/stat", (unsigned long) tid);
file = fopen(name, "r");
if (!file) {
errno = ENOSYS;
return -1;
}
fgets(buf, sizeof(buf), file);
tmp = fgets(buf, sizeof(buf), file);
fclose(file);
if (!tmp) {
errno = ENOSYS;
return -1;
}
tmp = strrchr(buf, ')');
if (!tmp) {
@ -940,7 +961,11 @@ hwloc_linux_get_thisproc_last_cpu_location(hwloc_topology_t topology, hwloc_bitm
static int
hwloc_linux_get_thisthread_last_cpu_location(hwloc_topology_t topology, hwloc_bitmap_t hwloc_set, int flags __hwloc_attribute_unused)
{
return hwloc_linux_get_tid_last_cpu_location(topology, topology->pid, hwloc_set);
if (topology->pid) {
errno = ENOSYS;
return -1;
}
return hwloc_linux_get_tid_last_cpu_location(topology, 0, hwloc_set);
}
@ -2397,6 +2422,7 @@ look_sysfscpu(struct hwloc_topology *topology, const char *path)
struct hwloc_obj *sock, *core, *thread;
hwloc_bitmap_t socketset, coreset, threadset, savedcoreset;
unsigned mysocketid, mycoreid;
int threadwithcoreid = 0;
/* look at the socket */
mysocketid = 0; /* shut-up the compiler */
@ -2424,9 +2450,31 @@ look_sysfscpu(struct hwloc_topology *topology, const char *path)
sprintf(str, "%s/cpu%d/topology/thread_siblings", path, i);
coreset = hwloc_parse_cpumap(str, topology->backend_params.sysfs.root_fd);
savedcoreset = coreset; /* store it for later work-arounds */
if (coreset && hwloc_bitmap_first(coreset) == i) {
if (coreset && hwloc_bitmap_weight(coreset) > 1) {
/* check if this is hyperthreading or different coreids */
unsigned siblingid, siblingcoreid;
hwloc_bitmap_t set = hwloc_bitmap_dup(coreset);
hwloc_bitmap_clr(set, i);
siblingid = hwloc_bitmap_first(set);
siblingcoreid = mycoreid;
sprintf(str, "%s/cpu%d/topology/core_id", path, siblingid);
hwloc_parse_sysfs_unsigned(str, &siblingcoreid, topology->backend_params.sysfs.root_fd);
threadwithcoreid = (siblingcoreid != mycoreid);
hwloc_bitmap_free(set);
}
if (coreset && (hwloc_bitmap_first(coreset) == i || threadwithcoreid)) {
/* regular core */
core = hwloc_alloc_setup_object(HWLOC_OBJ_CORE, mycoreid);
core->cpuset = coreset;
if (threadwithcoreid) {
/* amd multicore compute-unit, create one core per thread */
core->cpuset = hwloc_bitmap_alloc();
hwloc_bitmap_set(core->cpuset, i);
} else {
core->cpuset = coreset;
}
hwloc_debug_1arg_bitmap("os core %u has cpuset %s\n",
mycoreid, coreset);
hwloc_insert_object_by_cpuset(topology, core);

Просмотреть файл

@ -419,7 +419,7 @@ hwloc_look_lgrp(struct hwloc_topology *topology)
#ifdef HAVE_LGRP_LATENCY_COOKIE
{
float *distances = calloc(curlgrp*curlgrp, sizeof(float));
unsigned *indexes;
unsigned *indexes = calloc(curlgrp,sizeof(unsigned));
unsigned i, j;
for (i = 0; i < curlgrp; i++) {
indexes[i] = glob_lgrps[i]->os_index;
@ -650,15 +650,15 @@ hwloc_set_solaris_hooks(struct hwloc_topology *topology)
topology->get_proc_cpubind = hwloc_solaris_get_proc_cpubind;
topology->get_thisproc_cpubind = hwloc_solaris_get_thisproc_cpubind;
topology->get_thisthread_cpubind = hwloc_solaris_get_thisthread_cpubind;
#endif /* HAVE_LIBLGRP */
#ifdef MADV_ACCESS_LWP
topology->set_area_membind = hwloc_solaris_set_area_membind;
topology->set_proc_membind = hwloc_solaris_set_proc_membind;
topology->set_thisproc_membind = hwloc_solaris_set_thisproc_membind;
topology->set_thisthread_membind = hwloc_solaris_set_thisthread_membind;
topology->get_proc_membind = hwloc_solaris_get_proc_membind;
topology->get_thisproc_membind = hwloc_solaris_get_thisproc_membind;
topology->get_thisthread_membind = hwloc_solaris_get_thisthread_membind;
#endif /* HAVE_LIBLGRP */
#ifdef MADV_ACCESS_LWP
topology->set_area_membind = hwloc_solaris_set_area_membind;
topology->support.membind->firsttouch_membind = 1;
topology->support.membind->bind_membind = 1;
topology->support.membind->interleave_membind = 1;