Bump up to 1.0rc6 from the vendor branch.
This commit was SVN r23117.
Этот коммит содержится в:
родитель
614a5cb4cc
Коммит
bf7954c1de
@ -23,6 +23,7 @@ Version 1.0.0
|
|||||||
+ Add x86 cpuid based backend.
|
+ Add x86 cpuid based backend.
|
||||||
+ Add Linux cgroup support to the Linux cpuset code.
|
+ Add Linux cgroup support to the Linux cpuset code.
|
||||||
+ Support binding of entire multithreaded process on Linux.
|
+ Support binding of entire multithreaded process on Linux.
|
||||||
|
+ Fix and enable Group support in Windows.
|
||||||
+ Cleanup XML export/import.
|
+ Cleanup XML export/import.
|
||||||
* Objects
|
* Objects
|
||||||
+ HWLOC_OBJ_PROC is renamed into HWLOC_OBJ_PU for "Processing Unit",
|
+ HWLOC_OBJ_PROC is renamed into HWLOC_OBJ_PU for "Processing Unit",
|
||||||
|
@ -308,7 +308,7 @@ int main(void)
|
|||||||
levels++;
|
levels++;
|
||||||
size += obj->attr->cache.size;
|
size += obj->attr->cache.size;
|
||||||
}
|
}
|
||||||
printf("*** Logical processor 0 has %u caches totaling %luKB\n",
|
printf("*** Logical processor 0 has %d caches totaling %luKB\n",
|
||||||
levels, size / 1024);
|
levels, size / 1024);
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
@ -398,6 +398,16 @@ Questions should be sent to the devel mailing list (http://www.open-mpi.org/
|
|||||||
community/lists/hwloc.php). Bug reports should be reported in the tracker (
|
community/lists/hwloc.php). Bug reports should be reported in the tracker (
|
||||||
https://svn.open-mpi.org/trac/hwloc/).
|
https://svn.open-mpi.org/trac/hwloc/).
|
||||||
|
|
||||||
|
If hwloc discovers an incorrect topology for your machine, the very first thing
|
||||||
|
you should check is to ensure that you have the most recent updates installed
|
||||||
|
for your operating system. Indeed, most of hwloc topology discovery relies on
|
||||||
|
hardware information retrieved through the operation system (e.g., via the /sys
|
||||||
|
virtual filesystem of the Linux kernel). If upgrading your OS or Linux kernel
|
||||||
|
does not solve your problem, you may also want to ensure that you are running
|
||||||
|
the most recent version of the BIOS for your machine.
|
||||||
|
|
||||||
|
If those things fail, contact us on the mailing list for additional help.
|
||||||
|
|
||||||
History / credits
|
History / credits
|
||||||
|
|
||||||
hwloc is the evolution and merger of the libtopology (http://
|
hwloc is the evolution and merger of the libtopology (http://
|
||||||
|
@ -16,7 +16,7 @@ release=0
|
|||||||
# requirement is that it must be entirely printable ASCII characters
|
# requirement is that it must be entirely printable ASCII characters
|
||||||
# and have no white space.
|
# and have no white space.
|
||||||
|
|
||||||
greek=rc3
|
greek=rc6
|
||||||
|
|
||||||
# If want_svn=1, then the SVN r number will be included in the overall
|
# If want_svn=1, then the SVN r number will be included in the overall
|
||||||
# hwloc version number in some form.
|
# hwloc version number in some form.
|
||||||
@ -33,11 +33,11 @@ want_svn=0
|
|||||||
# distribution tarball is being made from an SVN checkout, the value
|
# distribution tarball is being made from an SVN checkout, the value
|
||||||
# of svn_r in this file is replaced with the output of "svnversion".
|
# of svn_r in this file is replaced with the output of "svnversion".
|
||||||
|
|
||||||
svn_r=r2013
|
svn_r=r2092
|
||||||
|
|
||||||
# The date when this release was created
|
# The date when this release was created
|
||||||
|
|
||||||
date="Apr 29, 2010"
|
date="May 12, 2010"
|
||||||
|
|
||||||
# The shared library version of hwloc's public library. This version
|
# The shared library version of hwloc's public library. This version
|
||||||
# is maintained in accordance with the "Library Interface Versions"
|
# is maintained in accordance with the "Library Interface Versions"
|
||||||
|
@ -224,7 +224,15 @@ EOF])
|
|||||||
hwloc_CC_save=$CC
|
hwloc_CC_save=$CC
|
||||||
hwloc_CFLAGS_save=$CFLAGS
|
hwloc_CFLAGS_save=$CFLAGS
|
||||||
AC_PROG_CC_C99
|
AC_PROG_CC_C99
|
||||||
hwloc_CC_c99_flags=`echo $CC | sed -e s/^$hwloc_CC_save//`
|
AS_IF([test x"$ac_cv_prog_cc_c99" = xno],
|
||||||
|
[AC_WARN([C99 support is required by hwloc])
|
||||||
|
$3],
|
||||||
|
[HWLOC_SETUP_CORE_AFTER_C99($1, $2, $3, $4)])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl Same order of parameters form HWLOC-SETUP-CORE
|
||||||
|
AC_DEFUN([HWLOC_SETUP_CORE_AFTER_C99],[
|
||||||
|
hwloc_CC_c99_flags=`echo $CC | sed -e "s/^$hwloc_CC_save//"`
|
||||||
CC=$hwloc_CC_save
|
CC=$hwloc_CC_save
|
||||||
CFLAGS=$hwloc_CFLAGS_save
|
CFLAGS=$hwloc_CFLAGS_save
|
||||||
|
|
||||||
@ -546,7 +554,6 @@ EOF])
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
unset hwloc_config_happy
|
|
||||||
AC_LANG_POP
|
AC_LANG_POP
|
||||||
|
|
||||||
# Success
|
# Success
|
||||||
|
60
opal/mca/paffinity/hwloc/hwloc/configure
поставляемый
60
opal/mca/paffinity/hwloc/hwloc/configure
поставляемый
@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.65 for hwloc 1.0rc3.
|
# Generated by GNU Autoconf 2.65 for hwloc 1.0rc6.
|
||||||
#
|
#
|
||||||
# Report bugs to <http://www.open-mpi.org/community/help/>.
|
# Report bugs to <http://www.open-mpi.org/community/help/>.
|
||||||
#
|
#
|
||||||
@ -701,8 +701,8 @@ MAKEFLAGS=
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='hwloc'
|
PACKAGE_NAME='hwloc'
|
||||||
PACKAGE_TARNAME='hwloc'
|
PACKAGE_TARNAME='hwloc'
|
||||||
PACKAGE_VERSION='1.0rc3'
|
PACKAGE_VERSION='1.0rc6'
|
||||||
PACKAGE_STRING='hwloc 1.0rc3'
|
PACKAGE_STRING='hwloc 1.0rc6'
|
||||||
PACKAGE_BUGREPORT='http://www.open-mpi.org/community/help/'
|
PACKAGE_BUGREPORT='http://www.open-mpi.org/community/help/'
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL=''
|
||||||
|
|
||||||
@ -1541,7 +1541,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures hwloc 1.0rc3 to adapt to many kinds of systems.
|
\`configure' configures hwloc 1.0rc6 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@ -1616,7 +1616,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of hwloc 1.0rc3:";;
|
short | recursive ) echo "Configuration of hwloc 1.0rc6:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@ -1770,7 +1770,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
hwloc configure 1.0rc3
|
hwloc configure 1.0rc6
|
||||||
generated by GNU Autoconf 2.65
|
generated by GNU Autoconf 2.65
|
||||||
|
|
||||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
Copyright (C) 2009 Free Software Foundation, Inc.
|
||||||
@ -2412,7 +2412,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by hwloc $as_me 1.0rc3, which was
|
It was created by hwloc $as_me 1.0rc6, which was
|
||||||
generated by GNU Autoconf 2.65. Invocation command line was
|
generated by GNU Autoconf 2.65. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@ -3346,7 +3346,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='hwloc'
|
PACKAGE='hwloc'
|
||||||
VERSION='1.0rc3'
|
VERSION='1.0rc6'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@ -5764,7 +5764,13 @@ if test "x$ac_cv_prog_cc_c99" != xno; then :
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
hwloc_CC_c99_flags=`echo $CC | sed -e s/^$hwloc_CC_save//`
|
if test x"$ac_cv_prog_cc_c99" = xno; then :
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C99 support is required by hwloc" >&5
|
||||||
|
$as_echo "$as_me: WARNING: C99 support is required by hwloc" >&2;}
|
||||||
|
as_fn_error "Cannot continue" "$LINENO" 5
|
||||||
|
else
|
||||||
|
|
||||||
|
hwloc_CC_c99_flags=`echo $CC | sed -e "s/^$hwloc_CC_save//"`
|
||||||
CC=$hwloc_CC_save
|
CC=$hwloc_CC_save
|
||||||
CFLAGS=$hwloc_CFLAGS_save
|
CFLAGS=$hwloc_CFLAGS_save
|
||||||
|
|
||||||
@ -9967,7 +9973,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|||||||
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
unset hwloc_config_happy
|
|
||||||
ac_ext=c
|
ac_ext=c
|
||||||
ac_cpp='$CPP $CPPFLAGS'
|
ac_cpp='$CPP $CPPFLAGS'
|
||||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
@ -9978,10 +9983,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
|||||||
# Success
|
# Success
|
||||||
|
|
||||||
|
|
||||||
if test "$hwloc_setup" = "unhappy"; then :
|
|
||||||
as_fn_error "Cannot continue" "$LINENO" 5
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Setup hwloc's docs, utils, and tests
|
# Setup hwloc's docs, utils, and tests
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
|
||||||
$as_echo_n "checking for X... " >&6; }
|
$as_echo_n "checking for X... " >&6; }
|
||||||
@ -12523,13 +12527,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
|
|||||||
else
|
else
|
||||||
lt_cv_nm_interface="BSD nm"
|
lt_cv_nm_interface="BSD nm"
|
||||||
echo "int some_variable = 0;" > conftest.$ac_ext
|
echo "int some_variable = 0;" > conftest.$ac_ext
|
||||||
(eval echo "\"\$as_me:12526: $ac_compile\"" >&5)
|
(eval echo "\"\$as_me:12530: $ac_compile\"" >&5)
|
||||||
(eval "$ac_compile" 2>conftest.err)
|
(eval "$ac_compile" 2>conftest.err)
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
(eval echo "\"\$as_me:12529: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
|
(eval echo "\"\$as_me:12533: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
|
||||||
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
|
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
(eval echo "\"\$as_me:12532: output\"" >&5)
|
(eval echo "\"\$as_me:12536: output\"" >&5)
|
||||||
cat conftest.out >&5
|
cat conftest.out >&5
|
||||||
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
|
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
|
||||||
lt_cv_nm_interface="MS dumpbin"
|
lt_cv_nm_interface="MS dumpbin"
|
||||||
@ -13731,7 +13735,7 @@ ia64-*-hpux*)
|
|||||||
;;
|
;;
|
||||||
*-*-irix6*)
|
*-*-irix6*)
|
||||||
# Find out which ABI we are using.
|
# Find out which ABI we are using.
|
||||||
echo '#line 13734 "configure"' > conftest.$ac_ext
|
echo '#line 13738 "configure"' > conftest.$ac_ext
|
||||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
||||||
(eval $ac_compile) 2>&5
|
(eval $ac_compile) 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
@ -15231,11 +15235,11 @@ else
|
|||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:15234: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:15238: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>conftest.err)
|
(eval "$lt_compile" 2>conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
echo "$as_me:15238: \$? = $ac_status" >&5
|
echo "$as_me:15242: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
# So say no if there are warnings other than the usual output.
|
# So say no if there are warnings other than the usual output.
|
||||||
@ -15570,11 +15574,11 @@ else
|
|||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:15573: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:15577: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>conftest.err)
|
(eval "$lt_compile" 2>conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
echo "$as_me:15577: \$? = $ac_status" >&5
|
echo "$as_me:15581: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
# So say no if there are warnings other than the usual output.
|
# So say no if there are warnings other than the usual output.
|
||||||
@ -15675,11 +15679,11 @@ else
|
|||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:15678: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:15682: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>out/conftest.err)
|
(eval "$lt_compile" 2>out/conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat out/conftest.err >&5
|
cat out/conftest.err >&5
|
||||||
echo "$as_me:15682: \$? = $ac_status" >&5
|
echo "$as_me:15686: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||||
then
|
then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
@ -15730,11 +15734,11 @@ else
|
|||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:15733: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:15737: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>out/conftest.err)
|
(eval "$lt_compile" 2>out/conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat out/conftest.err >&5
|
cat out/conftest.err >&5
|
||||||
echo "$as_me:15737: \$? = $ac_status" >&5
|
echo "$as_me:15741: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||||
then
|
then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
@ -18097,7 +18101,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 18100 "configure"
|
#line 18104 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@ -18193,7 +18197,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 18196 "configure"
|
#line 18200 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@ -19056,7 +19060,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by hwloc $as_me 1.0rc3, which was
|
This file was extended by hwloc $as_me 1.0rc6, which was
|
||||||
generated by GNU Autoconf 2.65. Invocation command line was
|
generated by GNU Autoconf 2.65. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@ -19126,7 +19130,7 @@ _ACEOF
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
hwloc config.status 1.0rc3
|
hwloc config.status 1.0rc6
|
||||||
configured by $0, generated by GNU Autoconf 2.65,
|
configured by $0, generated by GNU Autoconf 2.65,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
@ -124,9 +124,7 @@ AS_IF([test "$enable_embedded_mode" != "yes"],
|
|||||||
[HWLOC_BUILD_STANDALONE])])
|
[HWLOC_BUILD_STANDALONE])])
|
||||||
|
|
||||||
# Setup the hwloc core
|
# Setup the hwloc core
|
||||||
HWLOC_SETUP_CORE([], [], [hwloc_setup=unhappy], [1])
|
HWLOC_SETUP_CORE([], [], [AC_MSG_ERROR([Cannot continue])], [1])
|
||||||
AS_IF([test "$hwloc_setup" = "unhappy"],
|
|
||||||
[AC_MSG_ERROR([Cannot continue])])
|
|
||||||
|
|
||||||
# Setup hwloc's docs, utils, and tests
|
# Setup hwloc's docs, utils, and tests
|
||||||
AS_IF([test "$hwloc_mode" = "standalone"],
|
AS_IF([test "$hwloc_mode" = "standalone"],
|
||||||
|
@ -408,7 +408,9 @@ endif
|
|||||||
|
|
||||||
if HWLOC_BUILD_DOXYGEN
|
if HWLOC_BUILD_DOXYGEN
|
||||||
$(man3_MANS): $(DOX_TAG)
|
$(man3_MANS): $(DOX_TAG)
|
||||||
$(DOX_A4PDF): $(DOX_TAG)
|
# Enforce some ordering so that "make -j X" works properly (i.e.,
|
||||||
|
# doesn't try to build both PDFs at the same time)
|
||||||
|
$(DOX_A4PDF): $(DOX_TAG) $(DOX_LETTERPDF)
|
||||||
$(DOX_LETTERPDF): $(DOX_TAG)
|
$(DOX_LETTERPDF): $(DOX_TAG)
|
||||||
$(DOX_HTML_DIR): $(DOX_TAG)
|
$(DOX_HTML_DIR): $(DOX_TAG)
|
||||||
$(DOX_LATEX_DIR): $(DOX_TAG)
|
$(DOX_LATEX_DIR): $(DOX_TAG)
|
||||||
|
@ -1148,7 +1148,9 @@ uninstall-man: uninstall-man3
|
|||||||
#
|
#
|
||||||
|
|
||||||
@HWLOC_BUILD_DOXYGEN_TRUE@$(man3_MANS): $(DOX_TAG)
|
@HWLOC_BUILD_DOXYGEN_TRUE@$(man3_MANS): $(DOX_TAG)
|
||||||
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_A4PDF): $(DOX_TAG)
|
# Enforce some ordering so that "make -j X" works properly (i.e.,
|
||||||
|
# doesn't try to build both PDFs at the same time)
|
||||||
|
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_A4PDF): $(DOX_TAG) $(DOX_LETTERPDF)
|
||||||
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_LETTERPDF): $(DOX_TAG)
|
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_LETTERPDF): $(DOX_TAG)
|
||||||
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_HTML_DIR): $(DOX_TAG)
|
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_HTML_DIR): $(DOX_TAG)
|
||||||
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_LATEX_DIR): $(DOX_TAG)
|
@HWLOC_BUILD_DOXYGEN_TRUE@$(DOX_LATEX_DIR): $(DOX_TAG)
|
||||||
|
@ -99,7 +99,7 @@ int main(void)
|
|||||||
levels++;
|
levels++;
|
||||||
size += obj->attr->cache.size;
|
size += obj->attr->cache.size;
|
||||||
}
|
}
|
||||||
printf("*** Logical processor 0 has %u caches totaling %luKB\n",
|
printf("*** Logical processor 0 has %d caches totaling %luKB\n",
|
||||||
levels, size / 1024);
|
levels, size / 1024);
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
|
@ -317,6 +317,18 @@ list (http://www.open-mpi.org/community/lists/hwloc.php).
|
|||||||
Bug reports should be reported in the tracker
|
Bug reports should be reported in the tracker
|
||||||
(https://svn.open-mpi.org/trac/hwloc/).
|
(https://svn.open-mpi.org/trac/hwloc/).
|
||||||
|
|
||||||
|
If hwloc discovers an incorrect topology for your machine, the very
|
||||||
|
first thing you should check is to ensure that you have the most
|
||||||
|
recent updates installed for your operating system. Indeed, most of
|
||||||
|
hwloc topology discovery relies on hardware information retrieved
|
||||||
|
through the operation system (e.g., via the /sys virtual filesystem of
|
||||||
|
the Linux kernel). If upgrading your OS or Linux kernel does not
|
||||||
|
solve your problem, you may also want to ensure that you are running
|
||||||
|
the most recent version of the BIOS for your machine.
|
||||||
|
|
||||||
|
If those things fail, contact us on the mailing list for additional
|
||||||
|
help.
|
||||||
|
|
||||||
\htmlonly
|
\htmlonly
|
||||||
</div><div class="section" id="credits">
|
</div><div class="section" id="credits">
|
||||||
\endhtmlonly
|
\endhtmlonly
|
||||||
|
@ -691,7 +691,8 @@ HWLOC_DECLSPEC hwloc_obj_type_t hwloc_obj_type_of_string (const char * string) _
|
|||||||
* It differs from hwloc_obj_type_string() because it prints type attributes such
|
* It differs from hwloc_obj_type_string() because it prints type attributes such
|
||||||
* as cache depth.
|
* as cache depth.
|
||||||
*
|
*
|
||||||
* \return how many characters were actually written (not including the ending \\0).
|
* \return how many characters were actually written (not including the ending
|
||||||
|
* \\0), or -1 on error.
|
||||||
*/
|
*/
|
||||||
HWLOC_DECLSPEC int hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_t size, hwloc_obj_t obj,
|
HWLOC_DECLSPEC int hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_t size, hwloc_obj_t obj,
|
||||||
int verbose);
|
int verbose);
|
||||||
@ -702,7 +703,8 @@ HWLOC_DECLSPEC int hwloc_obj_type_snprintf(char * __hwloc_restrict string, size_
|
|||||||
*
|
*
|
||||||
* Only the major attributes are printed in non-verbose mode.
|
* Only the major attributes are printed in non-verbose mode.
|
||||||
*
|
*
|
||||||
* \return how many characters were actually written (not including the ending \\0).
|
* \return how many characters were actually written (not including the ending
|
||||||
|
* \\0), or -1 on error.
|
||||||
*/
|
*/
|
||||||
HWLOC_DECLSPEC int hwloc_obj_attr_snprintf(char * __hwloc_restrict string, size_t size, hwloc_obj_t obj, const char * __hwloc_restrict separator,
|
HWLOC_DECLSPEC int hwloc_obj_attr_snprintf(char * __hwloc_restrict string, size_t size, hwloc_obj_t obj, const char * __hwloc_restrict separator,
|
||||||
int verbose);
|
int verbose);
|
||||||
@ -722,7 +724,8 @@ HWLOC_DECLSPEC int hwloc_obj_attr_snprintf(char * __hwloc_restrict string, size_
|
|||||||
* \p indexprefix is used to prefix the \p os_index attribute number of
|
* \p indexprefix is used to prefix the \p os_index attribute number of
|
||||||
* the object in the description. If \c NULL, the \c # character is used.
|
* the object in the description. If \c NULL, the \c # character is used.
|
||||||
*
|
*
|
||||||
* \return how many characters were actually written (not including the ending \\0).
|
* \return how many characters were actually written (not including the ending
|
||||||
|
* \\0), or -1 on error.
|
||||||
*/
|
*/
|
||||||
HWLOC_DECLSPEC int hwloc_obj_snprintf(char * __hwloc_restrict string, size_t size,
|
HWLOC_DECLSPEC int hwloc_obj_snprintf(char * __hwloc_restrict string, size_t size,
|
||||||
hwloc_topology_t topology, hwloc_obj_t obj,
|
hwloc_topology_t topology, hwloc_obj_t obj,
|
||||||
|
@ -31,14 +31,14 @@ static inline int hwloc_have_cpuid(void)
|
|||||||
"pushfl \n\t" \
|
"pushfl \n\t" \
|
||||||
"pop %1 \n\t" \
|
"pop %1 \n\t" \
|
||||||
"cmp %1,%2\n\t" /* Compare with expected value */ \
|
"cmp %1,%2\n\t" /* Compare with expected value */ \
|
||||||
"jnz L1 \n\t" /* Unexpected, failure */ \
|
"jnz Lhwloc1\n\t" /* Unexpected, failure */ \
|
||||||
|
|
||||||
TRY_TOGGLE /* Try to set/clear */
|
TRY_TOGGLE /* Try to set/clear */
|
||||||
TRY_TOGGLE /* Try to clear/set */
|
TRY_TOGGLE /* Try to clear/set */
|
||||||
|
|
||||||
"mov $1,%0\n\t" /* Passed the test! */
|
"mov $1,%0\n\t" /* Passed the test! */
|
||||||
|
|
||||||
"L1: \n\t"
|
"Lhwloc1: \n\t"
|
||||||
"popfl \n\t" /* Restore flags */
|
"popfl \n\t" /* Restore flags */
|
||||||
|
|
||||||
: "=r" (ret), "=&r" (tmp), "=&r" (tmp2));
|
: "=r" (ret), "=&r" (tmp), "=&r" (tmp2));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
|
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
|
||||||
* Copyright © 2009 Cisco Systems, Inc. All rights reserved.
|
* Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
* See COPYING in top-level directory.
|
* See COPYING in top-level directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -39,6 +39,8 @@ int hwloc_snprintf(char *str, size_t size, const char *format, ...)
|
|||||||
do {
|
do {
|
||||||
size *= 2;
|
size *= 2;
|
||||||
str = malloc(size);
|
str = malloc(size);
|
||||||
|
if (NULL == str)
|
||||||
|
return -1;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
ret = vsnprintf(str, size, format, ap);
|
ret = vsnprintf(str, size, format, ap);
|
||||||
|
@ -319,13 +319,24 @@ hwloc_linux_get_proc_tids(DIR *taskdir, unsigned *nr_tidsp, pid_t ** tidsp)
|
|||||||
max_tids = sb.st_nlink;
|
max_tids = sb.st_nlink;
|
||||||
|
|
||||||
tids = malloc(max_tids*sizeof(pid_t));
|
tids = malloc(max_tids*sizeof(pid_t));
|
||||||
|
if (!tids) {
|
||||||
|
errno = ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
rewinddir(taskdir);
|
rewinddir(taskdir);
|
||||||
|
|
||||||
while ((dirent = readdir(taskdir)) != NULL) {
|
while ((dirent = readdir(taskdir)) != NULL) {
|
||||||
if (nr_tids == max_tids) {
|
if (nr_tids == max_tids) {
|
||||||
|
pid_t *newtids;
|
||||||
max_tids += 8;
|
max_tids += 8;
|
||||||
tids = realloc(tids, max_tids*sizeof(pid_t));
|
newtids = realloc(tids, max_tids*sizeof(pid_t));
|
||||||
|
if (!newtids) {
|
||||||
|
free(tids);
|
||||||
|
errno = ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
tids = newtids;
|
||||||
}
|
}
|
||||||
if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
|
if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
|
||||||
continue;
|
continue;
|
||||||
@ -495,7 +506,7 @@ static int
|
|||||||
hwloc_linux_set_thisthread_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t hwloc_set, int policy __hwloc_attribute_unused)
|
hwloc_linux_set_thisthread_cpubind(hwloc_topology_t topology, hwloc_const_cpuset_t hwloc_set, int policy __hwloc_attribute_unused)
|
||||||
{
|
{
|
||||||
if (topology->pid) {
|
if (topology->pid) {
|
||||||
errno = -ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return hwloc_linux_set_tid_cpubind(topology, 0, hwloc_set);
|
return hwloc_linux_set_tid_cpubind(topology, 0, hwloc_set);
|
||||||
@ -505,7 +516,7 @@ static int
|
|||||||
hwloc_linux_get_thisthread_cpubind(hwloc_topology_t topology, hwloc_cpuset_t hwloc_set, int policy __hwloc_attribute_unused)
|
hwloc_linux_get_thisthread_cpubind(hwloc_topology_t topology, hwloc_cpuset_t hwloc_set, int policy __hwloc_attribute_unused)
|
||||||
{
|
{
|
||||||
if (topology->pid) {
|
if (topology->pid) {
|
||||||
errno = -ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return hwloc_linux_get_tid_cpubind(topology, 0, hwloc_set);
|
return hwloc_linux_get_tid_cpubind(topology, 0, hwloc_set);
|
||||||
@ -520,7 +531,7 @@ hwloc_linux_set_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_c
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (topology->pid) {
|
if (topology->pid) {
|
||||||
errno = -ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,7 +598,7 @@ hwloc_linux_get_thread_cpubind(hwloc_topology_t topology, pthread_t tid, hwloc_c
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (topology->pid) {
|
if (topology->pid) {
|
||||||
errno = -ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ hwloc_backend_synthetic_init(struct hwloc_topology *topology, const char *descri
|
|||||||
int cache_depth = 0, group_depth = 0;
|
int cache_depth = 0, group_depth = 0;
|
||||||
int nb_machine_levels = 0, nb_node_levels = 0;
|
int nb_machine_levels = 0, nb_node_levels = 0;
|
||||||
int nb_pu_levels = 0;
|
int nb_pu_levels = 0;
|
||||||
|
int nb_pu = 1;
|
||||||
|
|
||||||
assert(topology->backend_type == HWLOC_BACKEND_NONE);
|
assert(topology->backend_type == HWLOC_BACKEND_NONE);
|
||||||
|
|
||||||
@ -81,6 +82,12 @@ hwloc_backend_synthetic_init(struct hwloc_topology *topology, const char *descri
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nb_pu *= item;
|
||||||
|
if (nb_pu > HWLOC_NBMAXCPUS) {
|
||||||
|
fprintf(stderr, "To many PUs, max %d\n", HWLOC_NBMAXCPUS);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
topology->backend_params.synthetic.arity[count-1] = (unsigned)item;
|
topology->backend_params.synthetic.arity[count-1] = (unsigned)item;
|
||||||
topology->backend_params.synthetic.type[count] = type;
|
topology->backend_params.synthetic.type[count] = type;
|
||||||
topology->backend_params.synthetic.id[count] = 0;
|
topology->backend_params.synthetic.id[count] = 0;
|
||||||
|
@ -47,7 +47,7 @@ typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP {
|
|||||||
RelationCache,
|
RelationCache,
|
||||||
RelationProcessorPackage,
|
RelationProcessorPackage,
|
||||||
RelationGroup,
|
RelationGroup,
|
||||||
RelationAll = 0xffff,
|
RelationAll = 0xffff
|
||||||
} LOGICAL_PROCESSOR_RELATIONSHIP;
|
} LOGICAL_PROCESSOR_RELATIONSHIP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -82,15 +82,16 @@ typedef struct _GROUP_AFFINITY {
|
|||||||
#ifndef HAVE_PROCESSOR_RELATIONSHIP
|
#ifndef HAVE_PROCESSOR_RELATIONSHIP
|
||||||
typedef struct _PROCESSOR_RELATIONSHIP {
|
typedef struct _PROCESSOR_RELATIONSHIP {
|
||||||
BYTE Flags;
|
BYTE Flags;
|
||||||
ULONGLONG Reserved[2];
|
BYTE Reserved[21];
|
||||||
GROUP_AFFINITY GroupMask;
|
WORD GroupCount;
|
||||||
|
GROUP_AFFINITY GroupMask[ANYSIZE_ARRAY];
|
||||||
} PROCESSOR_RELATIONSHIP, *PPROCESSOR_RELATIONSHIP;
|
} PROCESSOR_RELATIONSHIP, *PPROCESSOR_RELATIONSHIP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_NUMA_NODE_RELATIONSHIP
|
#ifndef HAVE_NUMA_NODE_RELATIONSHIP
|
||||||
typedef struct _NUMA_NODE_RELATIONSHIP {
|
typedef struct _NUMA_NODE_RELATIONSHIP {
|
||||||
DWORD NodeNumber;
|
DWORD NodeNumber;
|
||||||
ULONGLONG Reserved[2];
|
BYTE Reserved[20];
|
||||||
GROUP_AFFINITY GroupMask;
|
GROUP_AFFINITY GroupMask;
|
||||||
} NUMA_NODE_RELATIONSHIP, *PNUMA_NODE_RELATIONSHIP;
|
} NUMA_NODE_RELATIONSHIP, *PNUMA_NODE_RELATIONSHIP;
|
||||||
#endif
|
#endif
|
||||||
@ -102,7 +103,7 @@ typedef struct _CACHE_RELATIONSHIP {
|
|||||||
WORD LineSize;
|
WORD LineSize;
|
||||||
DWORD CacheSize;
|
DWORD CacheSize;
|
||||||
PROCESSOR_CACHE_TYPE Type;
|
PROCESSOR_CACHE_TYPE Type;
|
||||||
ULONGLONG Reserved[2];
|
BYTE Reserved[20];
|
||||||
GROUP_AFFINITY GroupMask;
|
GROUP_AFFINITY GroupMask;
|
||||||
} CACHE_RELATIONSHIP, *PCACHE_RELATIONSHIP;
|
} CACHE_RELATIONSHIP, *PCACHE_RELATIONSHIP;
|
||||||
#endif
|
#endif
|
||||||
@ -111,8 +112,8 @@ typedef struct _CACHE_RELATIONSHIP {
|
|||||||
typedef struct _PROCESSOR_GROUP_INFO {
|
typedef struct _PROCESSOR_GROUP_INFO {
|
||||||
BYTE MaximumProcessorCount;
|
BYTE MaximumProcessorCount;
|
||||||
BYTE ActiveProcessorCount;
|
BYTE ActiveProcessorCount;
|
||||||
|
BYTE Reserved[38];
|
||||||
KAFFINITY ActiveProcessorMask;
|
KAFFINITY ActiveProcessorMask;
|
||||||
ULONGLONG Reserved[4];
|
|
||||||
} PROCESSOR_GROUP_INFO, *PPROCESSOR_GROUP_INFO;
|
} PROCESSOR_GROUP_INFO, *PPROCESSOR_GROUP_INFO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -199,6 +200,8 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
BOOL WINAPI (*GetLogicalProcessorInformationProc)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer, PDWORD ReturnLength);
|
BOOL WINAPI (*GetLogicalProcessorInformationProc)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer, PDWORD ReturnLength);
|
||||||
BOOL WINAPI (*GetLogicalProcessorInformationExProc)(LOGICAL_PROCESSOR_RELATIONSHIP relationship, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Buffer, PDWORD ReturnLength);
|
BOOL WINAPI (*GetLogicalProcessorInformationExProc)(LOGICAL_PROCESSOR_RELATIONSHIP relationship, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Buffer, PDWORD ReturnLength);
|
||||||
BOOL WINAPI (*GetNumaAvailableMemoryNodeProc)(UCHAR Node, PULONGLONG AvailableBytes);
|
BOOL WINAPI (*GetNumaAvailableMemoryNodeProc)(UCHAR Node, PULONGLONG AvailableBytes);
|
||||||
|
BOOL WINAPI (*GetNumaAvailableMemoryNodeExProc)(USHORT Node, PULONGLONG AvailableBytes);
|
||||||
|
|
||||||
DWORD length;
|
DWORD length;
|
||||||
|
|
||||||
HMODULE kernel32;
|
HMODULE kernel32;
|
||||||
@ -207,8 +210,10 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
if (kernel32) {
|
if (kernel32) {
|
||||||
GetLogicalProcessorInformationProc = GetProcAddress(kernel32, "GetLogicalProcessorInformation");
|
GetLogicalProcessorInformationProc = GetProcAddress(kernel32, "GetLogicalProcessorInformation");
|
||||||
GetNumaAvailableMemoryNodeProc = GetProcAddress(kernel32, "GetNumaAvailableMemoryNode");
|
GetNumaAvailableMemoryNodeProc = GetProcAddress(kernel32, "GetNumaAvailableMemoryNode");
|
||||||
|
GetNumaAvailableMemoryNodeExProc = GetProcAddress(kernel32, "GetNumaAvailableMemoryNodeEx");
|
||||||
|
GetLogicalProcessorInformationExProc = GetProcAddress(kernel32, "GetLogicalProcessorInformationEx");
|
||||||
|
|
||||||
if (GetLogicalProcessorInformationProc) {
|
if (!GetLogicalProcessorInformationExProc && GetLogicalProcessorInformationProc) {
|
||||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION procInfo;
|
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION procInfo;
|
||||||
unsigned id;
|
unsigned id;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@ -223,8 +228,7 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
break;
|
break;
|
||||||
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||||
return;
|
return;
|
||||||
free(procInfo);
|
procInfo = realloc(procInfo, length);
|
||||||
procInfo = malloc(length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < length / sizeof(*procInfo); i++) {
|
for (i = 0; i < length / sizeof(*procInfo); i++) {
|
||||||
@ -267,7 +271,8 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
ULONGLONG avail;
|
ULONGLONG avail;
|
||||||
obj->nodeset = hwloc_cpuset_alloc();
|
obj->nodeset = hwloc_cpuset_alloc();
|
||||||
hwloc_cpuset_set(obj->nodeset, id);
|
hwloc_cpuset_set(obj->nodeset, id);
|
||||||
if (GetNumaAvailableMemoryNodeProc && GetNumaAvailableMemoryNodeProc(id, &avail))
|
if ((GetNumaAvailableMemoryNodeExProc && GetNumaAvailableMemoryNodeExProc(id, &avail))
|
||||||
|
|| (GetNumaAvailableMemoryNodeProc && GetNumaAvailableMemoryNodeProc(id, &avail)))
|
||||||
obj->memory.local_memory = avail;
|
obj->memory.local_memory = avail;
|
||||||
obj->memory.page_types_len = 1;
|
obj->memory.page_types_len = 1;
|
||||||
obj->memory.page_types = malloc(sizeof(*obj->memory.page_types));
|
obj->memory.page_types = malloc(sizeof(*obj->memory.page_types));
|
||||||
@ -293,19 +298,12 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
free(procInfo);
|
free(procInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetLogicalProcessorInformationExProc = GetProcAddress(kernel32, "GetLogicalProcessorInformationEx");
|
if (GetLogicalProcessorInformationExProc) {
|
||||||
|
|
||||||
/* Disabled for now as it wasn't tested at all. */
|
|
||||||
if (0 && GetLogicalProcessorInformationExProc) {
|
|
||||||
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX procInfoTotal, procInfo;
|
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX procInfoTotal, procInfo;
|
||||||
|
|
||||||
signed id;
|
unsigned id;
|
||||||
struct hwloc_obj *obj;
|
struct hwloc_obj *obj;
|
||||||
hwloc_obj_type_t type;
|
hwloc_obj_type_t type;
|
||||||
KAFFINITY mask;
|
|
||||||
WORD group;
|
|
||||||
|
|
||||||
fprintf(stderr,"Note: GetLogicalProcessorInformationEx was never tested yet!\n");
|
|
||||||
|
|
||||||
length = 0;
|
length = 0;
|
||||||
procInfoTotal = NULL;
|
procInfoTotal = NULL;
|
||||||
@ -315,13 +313,14 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
break;
|
break;
|
||||||
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||||
return;
|
return;
|
||||||
free(procInfoTotal);
|
procInfoTotal = realloc(procInfoTotal, length);
|
||||||
procInfo = malloc(length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (procInfo = procInfoTotal;
|
for (procInfo = procInfoTotal;
|
||||||
(void*) procInfo < (void*) ((unsigned long) procInfoTotal + length);
|
(void*) procInfo < (void*) ((unsigned long) procInfoTotal + length);
|
||||||
procInfo = (void*) ((unsigned long) procInfo + procInfo->Size)) {
|
procInfo = (void*) ((unsigned long) procInfo + procInfo->Size)) {
|
||||||
|
unsigned num, i;
|
||||||
|
GROUP_AFFINITY *GroupMask;
|
||||||
|
|
||||||
/* Ignore non-data caches */
|
/* Ignore non-data caches */
|
||||||
if (procInfo->Relationship == RelationCache &&
|
if (procInfo->Relationship == RelationCache &&
|
||||||
@ -333,32 +332,34 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
switch (procInfo->Relationship) {
|
switch (procInfo->Relationship) {
|
||||||
case RelationNumaNode:
|
case RelationNumaNode:
|
||||||
type = HWLOC_OBJ_NODE;
|
type = HWLOC_OBJ_NODE;
|
||||||
mask = procInfo->NumaNode.GroupMask.Mask;
|
num = 1;
|
||||||
group = procInfo->NumaNode.GroupMask.Group;
|
GroupMask = &procInfo->NumaNode.GroupMask;
|
||||||
id = procInfo->NumaNode.NodeNumber;
|
id = procInfo->NumaNode.NodeNumber;
|
||||||
break;
|
break;
|
||||||
case RelationProcessorPackage:
|
case RelationProcessorPackage:
|
||||||
type = HWLOC_OBJ_SOCKET;
|
type = HWLOC_OBJ_SOCKET;
|
||||||
mask = procInfo->Processor.GroupMask.Mask;
|
num = procInfo->Processor.GroupCount;
|
||||||
group = procInfo->Processor.GroupMask.Group;
|
GroupMask = procInfo->Processor.GroupMask;
|
||||||
break;
|
break;
|
||||||
case RelationCache:
|
case RelationCache:
|
||||||
type = HWLOC_OBJ_CACHE;
|
type = HWLOC_OBJ_CACHE;
|
||||||
mask = procInfo->Cache.GroupMask.Mask;
|
num = 1;
|
||||||
group = procInfo->Cache.GroupMask.Group;
|
GroupMask = &procInfo->Cache.GroupMask;
|
||||||
break;
|
break;
|
||||||
case RelationProcessorCore:
|
case RelationProcessorCore:
|
||||||
type = HWLOC_OBJ_CORE;
|
type = HWLOC_OBJ_CORE;
|
||||||
mask = procInfo->Processor.GroupMask.Mask;
|
num = procInfo->Processor.GroupCount;
|
||||||
group = procInfo->Processor.GroupMask.Group;
|
GroupMask = procInfo->Processor.GroupMask;
|
||||||
break;
|
break;
|
||||||
case RelationGroup:
|
case RelationGroup:
|
||||||
/* So strange an interface... */
|
/* So strange an interface... */
|
||||||
for (id = 0; id < procInfo->Group.ActiveGroupCount; id++) {
|
for (id = 0; id < procInfo->Group.ActiveGroupCount; id++) {
|
||||||
|
KAFFINITY mask;
|
||||||
obj = hwloc_alloc_setup_object(HWLOC_OBJ_GROUP, id);
|
obj = hwloc_alloc_setup_object(HWLOC_OBJ_GROUP, id);
|
||||||
obj->cpuset = hwloc_cpuset_alloc();
|
obj->cpuset = hwloc_cpuset_alloc();
|
||||||
mask = procInfo->Group.GroupInfo[id].ActiveProcessorMask;
|
mask = procInfo->Group.GroupInfo[id].ActiveProcessorMask;
|
||||||
hwloc_debug("group %d mask %lx\n", id, mask);
|
hwloc_debug("group %u %d cpus mask %lx\n", id,
|
||||||
|
procInfo->Group.GroupInfo[id].ActiveProcessorCount, mask);
|
||||||
hwloc_cpuset_from_ith_ulong(obj->cpuset, id, mask);
|
hwloc_cpuset_from_ith_ulong(obj->cpuset, id, mask);
|
||||||
hwloc_insert_object_by_cpuset(topology, obj);
|
hwloc_insert_object_by_cpuset(topology, obj);
|
||||||
}
|
}
|
||||||
@ -370,21 +371,28 @@ hwloc_look_windows(struct hwloc_topology *topology)
|
|||||||
|
|
||||||
obj = hwloc_alloc_setup_object(type, id);
|
obj = hwloc_alloc_setup_object(type, id);
|
||||||
obj->cpuset = hwloc_cpuset_alloc();
|
obj->cpuset = hwloc_cpuset_alloc();
|
||||||
hwloc_debug("%s#%d mask %d:%lx\n", hwloc_obj_type_string(type), id, group, mask);
|
for (i = 0; i < num; i++) {
|
||||||
hwloc_cpuset_from_ith_ulong(obj->cpuset, group, mask);
|
hwloc_debug("%s#%u %d: mask %d:%lx\n", hwloc_obj_type_string(type), id, i, GroupMask[i].Group, GroupMask[i].Mask);
|
||||||
|
hwloc_cpuset_from_ith_ulong(obj->cpuset, GroupMask[i].Group, GroupMask[i].Mask);
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case HWLOC_OBJ_NODE:
|
case HWLOC_OBJ_NODE:
|
||||||
obj->nodeset = hwloc_cpuset_alloc();
|
{
|
||||||
hwloc_cpuset_set(obj->nodeset, id);
|
ULONGLONG avail;
|
||||||
obj->memory.local_memory = 0; /* TODO GetNumaAvailableMemoryNodeEx */
|
obj->nodeset = hwloc_cpuset_alloc();
|
||||||
obj->memory.page_types_len = 1;
|
hwloc_cpuset_set(obj->nodeset, id);
|
||||||
obj->memory.page_types = malloc(sizeof(*obj->memory.page_types));
|
if ((GetNumaAvailableMemoryNodeExProc && GetNumaAvailableMemoryNodeExProc(id, &avail))
|
||||||
memset(obj->memory.page_types, 0, sizeof(*obj->memory.page_types));
|
|| (GetNumaAvailableMemoryNodeProc && GetNumaAvailableMemoryNodeProc(id, &avail)))
|
||||||
|
obj->memory.local_memory = avail;
|
||||||
|
obj->memory.page_types_len = 1;
|
||||||
|
obj->memory.page_types = malloc(sizeof(*obj->memory.page_types));
|
||||||
|
memset(obj->memory.page_types, 0, sizeof(*obj->memory.page_types));
|
||||||
#ifdef HAVE__SC_LARGE_PAGESIZE
|
#ifdef HAVE__SC_LARGE_PAGESIZE
|
||||||
obj->memory.page_types[0].size = sysconf(_SC_LARGE_PAGESIZE);
|
obj->memory.page_types[0].size = sysconf(_SC_LARGE_PAGESIZE);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case HWLOC_OBJ_CACHE:
|
case HWLOC_OBJ_CACHE:
|
||||||
obj->attr->cache.size = procInfo->Cache.CacheSize;
|
obj->attr->cache.size = procInfo->Cache.CacheSize;
|
||||||
obj->attr->cache.depth = procInfo->Cache.Level;
|
obj->attr->cache.depth = procInfo->Cache.Level;
|
||||||
|
@ -41,6 +41,9 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
hwloc_topology_clear (struct hwloc_topology *topology);
|
||||||
|
|
||||||
#if defined(HAVE_SYSCTLBYNAME)
|
#if defined(HAVE_SYSCTLBYNAME)
|
||||||
int hwloc_get_sysctlbyname(const char *name, int *ret)
|
int hwloc_get_sysctlbyname(const char *name, int *ret)
|
||||||
{
|
{
|
||||||
@ -698,13 +701,14 @@ hwloc__insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t cur,
|
|||||||
/* if both objects have a page_types array, just keep the biggest one for now */
|
/* if both objects have a page_types array, just keep the biggest one for now */
|
||||||
if (obj->memory.page_types_len && child->memory.page_types_len)
|
if (obj->memory.page_types_len && child->memory.page_types_len)
|
||||||
hwloc_debug("%s", "merging page_types by keeping the biggest one only\n");
|
hwloc_debug("%s", "merging page_types by keeping the biggest one only\n");
|
||||||
if (obj->memory.page_types_len > child->memory.page_types_len) {
|
if (obj->memory.page_types_len < child->memory.page_types_len) {
|
||||||
free(child->memory.page_types);
|
|
||||||
} else {
|
|
||||||
free(obj->memory.page_types);
|
free(obj->memory.page_types);
|
||||||
obj->memory.page_types_len = child->memory.page_types_len;
|
} else {
|
||||||
obj->memory.page_types = child->memory.page_types;
|
free(child->memory.page_types);
|
||||||
child->memory.page_types = NULL;
|
child->memory.page_types_len = obj->memory.page_types_len;
|
||||||
|
child->memory.page_types = obj->memory.page_types;
|
||||||
|
obj->memory.page_types = NULL;
|
||||||
|
obj->memory.page_types_len = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HWLOC_OBJ_CACHE:
|
case HWLOC_OBJ_CACHE:
|
||||||
@ -1376,7 +1380,7 @@ static void alloc_cpusets(hwloc_obj_t obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Main discovery loop */
|
/* Main discovery loop */
|
||||||
static void
|
static int
|
||||||
hwloc_discover(struct hwloc_topology *topology)
|
hwloc_discover(struct hwloc_topology *topology)
|
||||||
{
|
{
|
||||||
unsigned l, i=0, taken_i, new_i, j;
|
unsigned l, i=0, taken_i, new_i, j;
|
||||||
@ -1514,7 +1518,7 @@ hwloc_discover(struct hwloc_topology *topology)
|
|||||||
|
|
||||||
print_objects(topology, 0, topology->levels[0][0]);
|
print_objects(topology, 0, topology->levels[0][0]);
|
||||||
|
|
||||||
if (!topology->flags & HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM) {
|
if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM)) {
|
||||||
hwloc_debug("%s", "\nRemoving unauthorized and offline cpusets from all cpusets\n");
|
hwloc_debug("%s", "\nRemoving unauthorized and offline cpusets from all cpusets\n");
|
||||||
remove_unused_cpusets(topology->levels[0][0]);
|
remove_unused_cpusets(topology->levels[0][0]);
|
||||||
|
|
||||||
@ -1558,6 +1562,11 @@ hwloc_discover(struct hwloc_topology *topology)
|
|||||||
l = 0;
|
l = 0;
|
||||||
n_objs = topology->levels[0][0]->arity;
|
n_objs = topology->levels[0][0]->arity;
|
||||||
objs = malloc(n_objs * sizeof(objs[0]));
|
objs = malloc(n_objs * sizeof(objs[0]));
|
||||||
|
if (!objs) {
|
||||||
|
errno = ENOMEM;
|
||||||
|
hwloc_topology_clear(topology);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
memcpy(objs, topology->levels[0][0]->children, n_objs * sizeof(objs[0]));
|
memcpy(objs, topology->levels[0][0]->children, n_objs * sizeof(objs[0]));
|
||||||
|
|
||||||
/* Keep building levels while there are objects left in OBJS. */
|
/* Keep building levels while there are objects left in OBJS. */
|
||||||
@ -1722,6 +1731,8 @@ hwloc_discover(struct hwloc_topology *topology)
|
|||||||
DO(set_thread_cpubind);
|
DO(set_thread_cpubind);
|
||||||
DO(get_thread_cpubind);
|
DO(get_thread_cpubind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* To be before discovery is actually launched,
|
/* To be before discovery is actually launched,
|
||||||
@ -1958,6 +1969,7 @@ int
|
|||||||
hwloc_topology_load (struct hwloc_topology *topology)
|
hwloc_topology_load (struct hwloc_topology *topology)
|
||||||
{
|
{
|
||||||
char *local_env;
|
char *local_env;
|
||||||
|
int err;
|
||||||
|
|
||||||
if (topology->is_loaded) {
|
if (topology->is_loaded) {
|
||||||
hwloc_topology_clear(topology);
|
hwloc_topology_clear(topology);
|
||||||
@ -2015,7 +2027,9 @@ hwloc_topology_load (struct hwloc_topology *topology)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* actual topology discovery */
|
/* actual topology discovery */
|
||||||
hwloc_discover(topology);
|
err = hwloc_discover(topology);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
/* enforce THISSYSTEM if given in a FORCE variable */
|
/* enforce THISSYSTEM if given in a FORCE variable */
|
||||||
local_env = getenv("HWLOC_FORCE_THISSYSTEM");
|
local_env = getenv("HWLOC_FORCE_THISSYSTEM");
|
||||||
|
@ -265,7 +265,7 @@ hwloc_obj_snprintf(char *string, size_t size,
|
|||||||
hwloc_obj_type_snprintf(type, sizeof(type), l, verbose);
|
hwloc_obj_type_snprintf(type, sizeof(type), l, verbose);
|
||||||
attrlen = hwloc_obj_attr_snprintf(attr, sizeof(attr), l, " ", verbose);
|
attrlen = hwloc_obj_attr_snprintf(attr, sizeof(attr), l, " ", verbose);
|
||||||
|
|
||||||
if (attrlen)
|
if (attrlen > 0)
|
||||||
return hwloc_snprintf(string, size, "%s%s(%s)", type, os_index, attr);
|
return hwloc_snprintf(string, size, "%s%s(%s)", type, os_index, attr);
|
||||||
else
|
else
|
||||||
return hwloc_snprintf(string, size, "%s%s", type, os_index);
|
return hwloc_snprintf(string, size, "%s%s", type, os_index);
|
||||||
|
@ -39,8 +39,10 @@ endif HWLOC_BUILD_TESTS
|
|||||||
|
|
||||||
# Only install man pages if we're building in standalone mode
|
# Only install man pages if we're building in standalone mode
|
||||||
if HWLOC_BUILD_UTILS
|
if HWLOC_BUILD_UTILS
|
||||||
man_pages = hwloc.7 lstopo.1 hwloc-bind.1 hwloc-distrib.1 hwloc-calc.1
|
man1_pages = lstopo.1 hwloc-bind.1 hwloc-distrib.1 hwloc-calc.1
|
||||||
EXTRA_DIST += $(man_pages:.1=.1in)
|
man7_pages = hwloc.7
|
||||||
|
man_pages = $(man7_pages) $(man1_pages)
|
||||||
|
EXTRA_DIST += $(man1_pages:.1=.1in) $(man7_pages:.7=.7in)
|
||||||
nodist_man_MANS = $(man_pages)
|
nodist_man_MANS = $(man_pages)
|
||||||
|
|
||||||
.1in.1:
|
.1in.1:
|
||||||
|
@ -45,7 +45,7 @@ target_triplet = @target@
|
|||||||
@HWLOC_HAVE_CAIRO_TRUE@am__append_1 = lstopo-cairo.c
|
@HWLOC_HAVE_CAIRO_TRUE@am__append_1 = lstopo-cairo.c
|
||||||
@HWLOC_HAVE_XML_TRUE@am__append_2 = lstopo-xml.c
|
@HWLOC_HAVE_XML_TRUE@am__append_2 = lstopo-xml.c
|
||||||
@HWLOC_HAVE_WINDOWS_TRUE@am__append_3 = lstopo-windows.c
|
@HWLOC_HAVE_WINDOWS_TRUE@am__append_3 = lstopo-windows.c
|
||||||
@HWLOC_BUILD_UTILS_TRUE@am__append_4 = $(man_pages:.1=.1in)
|
@HWLOC_BUILD_UTILS_TRUE@am__append_4 = $(man1_pages:.1=.1in) $(man7_pages:.7=.7in)
|
||||||
subdir = utils
|
subdir = utils
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||||
$(srcdir)/test-hwloc-distrib.sh.in
|
$(srcdir)/test-hwloc-distrib.sh.in
|
||||||
@ -334,7 +334,9 @@ hwloc_calc_SOURCES = hwloc-calc.c hwloc-calc.h
|
|||||||
@HWLOC_BUILD_TESTS_TRUE@@HWLOC_HAVE_MINGW32_FALSE@TESTS = test-hwloc-distrib.sh
|
@HWLOC_BUILD_TESTS_TRUE@@HWLOC_HAVE_MINGW32_FALSE@TESTS = test-hwloc-distrib.sh
|
||||||
|
|
||||||
# Only install man pages if we're building in standalone mode
|
# Only install man pages if we're building in standalone mode
|
||||||
@HWLOC_BUILD_UTILS_TRUE@man_pages = hwloc.7 lstopo.1 hwloc-bind.1 hwloc-distrib.1 hwloc-calc.1
|
@HWLOC_BUILD_UTILS_TRUE@man1_pages = lstopo.1 hwloc-bind.1 hwloc-distrib.1 hwloc-calc.1
|
||||||
|
@HWLOC_BUILD_UTILS_TRUE@man7_pages = hwloc.7
|
||||||
|
@HWLOC_BUILD_UTILS_TRUE@man_pages = $(man7_pages) $(man1_pages)
|
||||||
@HWLOC_BUILD_UTILS_TRUE@nodist_man_MANS = $(man_pages)
|
@HWLOC_BUILD_UTILS_TRUE@nodist_man_MANS = $(man_pages)
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.\" -*- nroff -*-
|
.\" -*- nroff -*-
|
||||||
.\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
|
.\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
.TH HWLOC "1" "Apr 16, 2010" "1.0rc1" "hwloc"
|
.TH HWLOC "1" "#HWLOC_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
hwloc - General information about hwloc ("hardware locality").
|
hwloc - General information about hwloc ("hardware locality").
|
||||||
.
|
.
|
@ -32,12 +32,14 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
#include <X11/cursorfont.h>
|
||||||
#endif /* CAIRO_HAS_XLIB_SURFACE */
|
#endif /* CAIRO_HAS_XLIB_SURFACE */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "lstopo.h"
|
#include "lstopo.h"
|
||||||
|
|
||||||
@ -109,6 +111,7 @@ struct display {
|
|||||||
Display *dpy;
|
Display *dpy;
|
||||||
cairo_surface_t *cs;
|
cairo_surface_t *cs;
|
||||||
Window win;
|
Window win;
|
||||||
|
Cursor hand;
|
||||||
int screen_width, screen_height; /** visible part size */
|
int screen_width, screen_height; /** visible part size */
|
||||||
int width, height; /** total size */
|
int width, height; /** total size */
|
||||||
int x, y; /** top left corner of the visible part */
|
int x, y; /** top left corner of the visible part */
|
||||||
@ -124,6 +127,7 @@ x11_start(void *output __hwloc_attribute_unused, int width, int height)
|
|||||||
Screen *screen;
|
Screen *screen;
|
||||||
int screen_width = width, screen_height = height;
|
int screen_width = width, screen_height = height;
|
||||||
struct display *disp;
|
struct display *disp;
|
||||||
|
Cursor hand;
|
||||||
|
|
||||||
if (!(dpy = XOpenDisplay(NULL))) {
|
if (!(dpy = XOpenDisplay(NULL))) {
|
||||||
fprintf(stderr, "couldn't connect to X\n");
|
fprintf(stderr, "couldn't connect to X\n");
|
||||||
@ -138,6 +142,8 @@ x11_start(void *output __hwloc_attribute_unused, int width, int height)
|
|||||||
root = RootWindow(dpy, scr);
|
root = RootWindow(dpy, scr);
|
||||||
top = XCreateSimpleWindow(dpy, root, 0, 0, screen_width, screen_height, 0, WhitePixel(dpy, scr), WhitePixel(dpy, scr));
|
top = XCreateSimpleWindow(dpy, root, 0, 0, screen_width, screen_height, 0, WhitePixel(dpy, scr), WhitePixel(dpy, scr));
|
||||||
win = XCreateSimpleWindow(dpy, top, 0, 0, width, height, 0, WhitePixel(dpy, scr), WhitePixel(dpy, scr));
|
win = XCreateSimpleWindow(dpy, top, 0, 0, width, height, 0, WhitePixel(dpy, scr), WhitePixel(dpy, scr));
|
||||||
|
hand = XCreateFontCursor(dpy, XC_fleur);
|
||||||
|
XDefineCursor(dpy, win, hand);
|
||||||
|
|
||||||
XSelectInput(dpy, win,
|
XSelectInput(dpy, win,
|
||||||
KeyPressMask |
|
KeyPressMask |
|
||||||
@ -154,6 +160,7 @@ x11_start(void *output __hwloc_attribute_unused, int width, int height)
|
|||||||
disp->dpy = dpy;
|
disp->dpy = dpy;
|
||||||
disp->cs = cs;
|
disp->cs = cs;
|
||||||
disp->win = win;
|
disp->win = win;
|
||||||
|
disp->hand = hand;
|
||||||
disp->screen_width = screen_width;
|
disp->screen_width = screen_width;
|
||||||
disp->screen_height = screen_height;
|
disp->screen_height = screen_height;
|
||||||
disp->width = width;
|
disp->width = width;
|
||||||
@ -255,13 +262,63 @@ output_x11(hwloc_topology_t topology, const char *filename __hwloc_attribute_unu
|
|||||||
case KeyPress: {
|
case KeyPress: {
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
XLookupString(&e.xkey, NULL, 0, &keysym, NULL);
|
XLookupString(&e.xkey, NULL, 0, &keysym, NULL);
|
||||||
if (keysym == XK_q || keysym == XK_Q)
|
switch (keysym) {
|
||||||
finish = 1;
|
case XK_q:
|
||||||
|
case XK_Q:
|
||||||
|
case XK_Escape:
|
||||||
|
finish = 1;
|
||||||
|
break;
|
||||||
|
case XK_Left:
|
||||||
|
disp->x -= disp->screen_width/10;
|
||||||
|
move_x11(disp);
|
||||||
|
break;
|
||||||
|
case XK_Right:
|
||||||
|
disp->x += disp->screen_width/10;
|
||||||
|
move_x11(disp);
|
||||||
|
break;
|
||||||
|
case XK_Up:
|
||||||
|
disp->y -= disp->screen_height/10;
|
||||||
|
move_x11(disp);
|
||||||
|
break;
|
||||||
|
case XK_Down:
|
||||||
|
disp->y += disp->screen_height/10;
|
||||||
|
move_x11(disp);
|
||||||
|
break;
|
||||||
|
case XK_Page_Up:
|
||||||
|
if (e.xkey.state & ControlMask) {
|
||||||
|
disp->x -= disp->screen_width;
|
||||||
|
move_x11(disp);
|
||||||
|
} else {
|
||||||
|
disp->y -= disp->screen_height;
|
||||||
|
move_x11(disp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case XK_Page_Down:
|
||||||
|
if (e.xkey.state & ControlMask) {
|
||||||
|
disp->x += disp->screen_width;
|
||||||
|
move_x11(disp);
|
||||||
|
} else {
|
||||||
|
disp->y += disp->screen_height;
|
||||||
|
move_x11(disp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case XK_Home:
|
||||||
|
disp->x = 0;
|
||||||
|
disp->y = 0;
|
||||||
|
move_x11(disp);
|
||||||
|
break;
|
||||||
|
case XK_End:
|
||||||
|
disp->x = INT_MAX;
|
||||||
|
disp->y = INT_MAX;
|
||||||
|
move_x11(disp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cairo_surface_destroy(disp->cs);
|
cairo_surface_destroy(disp->cs);
|
||||||
|
XFreeCursor(disp->dpy, disp->hand);
|
||||||
XCloseDisplay(disp->dpy);
|
XCloseDisplay(disp->dpy);
|
||||||
free(disp);
|
free(disp);
|
||||||
}
|
}
|
||||||
|
@ -338,12 +338,12 @@ lstopo_obj_snprintf(char *text, size_t textlen, hwloc_obj_t obj, int logical)
|
|||||||
char typestr[32];
|
char typestr[32];
|
||||||
char indexstr[32]= "";
|
char indexstr[32]= "";
|
||||||
char attrstr[256];
|
char attrstr[256];
|
||||||
size_t attrlen;
|
int attrlen;
|
||||||
hwloc_obj_type_snprintf(typestr, sizeof(typestr), obj, 0);
|
hwloc_obj_type_snprintf(typestr, sizeof(typestr), obj, 0);
|
||||||
if (idx != (unsigned)-1 && obj->depth != 0)
|
if (idx != (unsigned)-1 && obj->depth != 0)
|
||||||
snprintf(indexstr, sizeof(indexstr), "%s%u", indexprefix, idx);
|
snprintf(indexstr, sizeof(indexstr), "%s%u", indexprefix, idx);
|
||||||
attrlen = hwloc_obj_attr_snprintf(attrstr, sizeof(attrstr), obj, " ", 0);
|
attrlen = hwloc_obj_attr_snprintf(attrstr, sizeof(attrstr), obj, " ", 0);
|
||||||
if (attrlen)
|
if (attrlen > 0)
|
||||||
return snprintf(text, textlen, "%s%s (%s)", typestr, indexstr, attrstr);
|
return snprintf(text, textlen, "%s%s (%s)", typestr, indexstr, attrstr);
|
||||||
else
|
else
|
||||||
return snprintf(text, textlen, "%s%s", typestr, indexstr);
|
return snprintf(text, textlen, "%s%s", typestr, indexstr);
|
||||||
@ -365,7 +365,7 @@ pu_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical, hw
|
|||||||
methods->box(output, FORBIDDEN_R_COLOR, FORBIDDEN_G_COLOR, FORBIDDEN_B_COLOR, depth, x, *retwidth, y, *retheight);
|
methods->box(output, FORBIDDEN_R_COLOR, FORBIDDEN_G_COLOR, FORBIDDEN_B_COLOR, depth, x, *retwidth, y, *retheight);
|
||||||
else {
|
else {
|
||||||
hwloc_cpuset_t bind = hwloc_cpuset_alloc();
|
hwloc_cpuset_t bind = hwloc_cpuset_alloc();
|
||||||
if (pid > 0)
|
if (pid != (hwloc_pid_t) -1 && pid != 0)
|
||||||
hwloc_get_proc_cpubind(topology, pid, bind, 0);
|
hwloc_get_proc_cpubind(topology, pid, bind, 0);
|
||||||
else if (pid == 0)
|
else if (pid == 0)
|
||||||
hwloc_get_cpubind(topology, bind, 0);
|
hwloc_get_cpubind(topology, bind, 0);
|
||||||
@ -398,12 +398,12 @@ cache_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical,
|
|||||||
unsigned myheight = gridsize + (fontsize ? (fontsize + gridsize) : 0) + gridsize, totheight;
|
unsigned myheight = gridsize + (fontsize ? (fontsize + gridsize) : 0) + gridsize, totheight;
|
||||||
unsigned mywidth = 0, totwidth;
|
unsigned mywidth = 0, totwidth;
|
||||||
unsigned textwidth = fontsize ? ((logical ? level->logical_index : level->os_index) == (unsigned) -1 ? 7*fontsize : 9*fontsize) : 0;
|
unsigned textwidth = fontsize ? ((logical ? level->logical_index : level->os_index) == (unsigned) -1 ? 7*fontsize : 9*fontsize) : 0;
|
||||||
|
/* Do not separate objects when in L1 (SMT) */
|
||||||
unsigned separator = level->attr->cache.depth > 1 ? gridsize : 0;
|
unsigned separator = level->attr->cache.depth > 1 ? gridsize : 0;
|
||||||
|
|
||||||
DYNA_CHECK();
|
DYNA_CHECK();
|
||||||
|
|
||||||
/* Do not separate objects when in L1 (SMT) */
|
RECURSE_RECT(level, &null_draw_methods, separator, 0);
|
||||||
RECURSE_HORIZ(level, &null_draw_methods, separator, 0);
|
|
||||||
|
|
||||||
methods->box(output, CACHE_R_COLOR, CACHE_G_COLOR, CACHE_B_COLOR, depth, x, totwidth, y, myheight - gridsize);
|
methods->box(output, CACHE_R_COLOR, CACHE_G_COLOR, CACHE_B_COLOR, depth, x, totwidth, y, myheight - gridsize);
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ cache_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical,
|
|||||||
methods->text(output, 0, 0, 0, fontsize, depth-1, x + gridsize, y + gridsize, text);
|
methods->text(output, 0, 0, 0, fontsize, depth-1, x + gridsize, y + gridsize, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
RECURSE_HORIZ(level, methods, separator, 0);
|
RECURSE_RECT(level, methods, separator, 0);
|
||||||
|
|
||||||
DYNA_SAVE();
|
DYNA_SAVE();
|
||||||
}
|
}
|
||||||
@ -428,7 +428,7 @@ core_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical,
|
|||||||
|
|
||||||
DYNA_CHECK();
|
DYNA_CHECK();
|
||||||
|
|
||||||
RECURSE_HORIZ(level, &null_draw_methods, 0, gridsize);
|
RECURSE_RECT(level, &null_draw_methods, 0, gridsize);
|
||||||
|
|
||||||
methods->box(output, CORE_R_COLOR, CORE_G_COLOR, CORE_B_COLOR, depth, x, totwidth, y, totheight);
|
methods->box(output, CORE_R_COLOR, CORE_G_COLOR, CORE_B_COLOR, depth, x, totwidth, y, totheight);
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ core_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical,
|
|||||||
methods->text(output, 0, 0, 0, fontsize, depth-1, x + gridsize, y + gridsize, text);
|
methods->text(output, 0, 0, 0, fontsize, depth-1, x + gridsize, y + gridsize, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
RECURSE_HORIZ(level, methods, 0, gridsize);
|
RECURSE_RECT(level, methods, 0, gridsize);
|
||||||
|
|
||||||
DYNA_SAVE();
|
DYNA_SAVE();
|
||||||
}
|
}
|
||||||
@ -485,7 +485,7 @@ node_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical,
|
|||||||
DYNA_CHECK();
|
DYNA_CHECK();
|
||||||
|
|
||||||
/* Compute the size needed by sublevels */
|
/* Compute the size needed by sublevels */
|
||||||
RECURSE_HORIZ(level, &null_draw_methods, gridsize, gridsize);
|
RECURSE_RECT(level, &null_draw_methods, gridsize, gridsize);
|
||||||
|
|
||||||
/* Draw the epoxy box */
|
/* Draw the epoxy box */
|
||||||
methods->box(output, NODE_R_COLOR, NODE_G_COLOR, NODE_B_COLOR, depth, x, totwidth, y, totheight);
|
methods->box(output, NODE_R_COLOR, NODE_G_COLOR, NODE_B_COLOR, depth, x, totwidth, y, totheight);
|
||||||
@ -500,7 +500,7 @@ node_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Restart, now really drawing sublevels */
|
/* Restart, now really drawing sublevels */
|
||||||
RECURSE_HORIZ(level, methods, gridsize, gridsize);
|
RECURSE_RECT(level, methods, gridsize, gridsize);
|
||||||
|
|
||||||
/* Save result for dynamic programming */
|
/* Save result for dynamic programming */
|
||||||
DYNA_SAVE();
|
DYNA_SAVE();
|
||||||
|
@ -341,7 +341,7 @@ set_color(int fr, int fg, int fb, int br, int bg, int bb)
|
|||||||
|
|
||||||
/* We we can, allocate rgb colors */
|
/* We we can, allocate rgb colors */
|
||||||
static void
|
static void
|
||||||
text_declare_color(void *output __hwloc_attribute_unused, int r, int g, int b)
|
text_declare_color(void *output __hwloc_attribute_unused, int r __hwloc_attribute_unused, int g __hwloc_attribute_unused, int b __hwloc_attribute_unused)
|
||||||
{
|
{
|
||||||
#ifdef HWLOC_HAVE_LIBTERMCAP
|
#ifdef HWLOC_HAVE_LIBTERMCAP
|
||||||
int color = declare_color(r, g, b);
|
int color = declare_color(r, g, b);
|
||||||
@ -363,7 +363,7 @@ text_declare_color(void *output __hwloc_attribute_unused, int r, int g, int b)
|
|||||||
|
|
||||||
/* output text, erasing any previous content */
|
/* output text, erasing any previous content */
|
||||||
static void
|
static void
|
||||||
put(struct display *disp, int x, int y, character c, int fr, int fg, int fb, int br, int bg, int bb)
|
put(struct display *disp, int x, int y, character c, int fr __hwloc_attribute_unused, int fg __hwloc_attribute_unused, int fb __hwloc_attribute_unused, int br __hwloc_attribute_unused, int bg __hwloc_attribute_unused, int bb __hwloc_attribute_unused)
|
||||||
{
|
{
|
||||||
if (x >= disp->width || y >= disp->height) {
|
if (x >= disp->width || y >= disp->height) {
|
||||||
/* fprintf(stderr, "%"PRIchar" overflowed to (%d,%d)\n", c, x, y); */
|
/* fprintf(stderr, "%"PRIchar" overflowed to (%d,%d)\n", c, x, y); */
|
||||||
@ -389,7 +389,7 @@ enum {
|
|||||||
up = (1<<0),
|
up = (1<<0),
|
||||||
down = (1<<1),
|
down = (1<<1),
|
||||||
left = (1<<2),
|
left = (1<<2),
|
||||||
right = (1<<3),
|
right = (1<<3)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Convert a bar character into its directions */
|
/* Convert a bar character into its directions */
|
||||||
@ -605,8 +605,8 @@ void output_text(hwloc_topology_t topology, const char *filename, int logical, i
|
|||||||
int lbr, lbg, lbb; /* Last background color */
|
int lbr, lbg, lbb; /* Last background color */
|
||||||
#ifdef HWLOC_HAVE_LIBTERMCAP
|
#ifdef HWLOC_HAVE_LIBTERMCAP
|
||||||
int term = 0;
|
int term = 0;
|
||||||
#endif
|
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!filename || !strcmp(filename, "-"))
|
if (!filename || !strcmp(filename, "-"))
|
||||||
output = stdout;
|
output = stdout;
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <windowsx.h>
|
||||||
|
|
||||||
#include "lstopo.h"
|
#include "lstopo.h"
|
||||||
|
|
||||||
@ -40,10 +41,16 @@ struct draw_methods windows_draw_methods;
|
|||||||
|
|
||||||
static hwloc_topology_t the_topology;
|
static hwloc_topology_t the_topology;
|
||||||
static int the_logical;
|
static int the_logical;
|
||||||
|
static int state, control;
|
||||||
|
static int x, y, x_delta, y_delta;
|
||||||
|
static int finish;
|
||||||
|
static int the_width, the_height;
|
||||||
|
static int win_width, win_height;
|
||||||
|
|
||||||
static LRESULT CALLBACK
|
static LRESULT CALLBACK
|
||||||
WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
|
WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
|
||||||
{
|
{
|
||||||
|
int redraw = 0;
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_PAINT: {
|
case WM_PAINT: {
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
@ -53,31 +60,141 @@ WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
|
|||||||
EndPaint(hwnd, &ps);
|
EndPaint(hwnd, &ps);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case WM_LBUTTONDOWN:
|
||||||
|
state = 1;
|
||||||
|
x = GET_X_LPARAM(lparam);
|
||||||
|
y = GET_Y_LPARAM(lparam);
|
||||||
|
break;
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
state = 0;
|
||||||
|
break;
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
if (!(wparam & MK_LBUTTON))
|
||||||
|
state = 0;
|
||||||
|
if (state) {
|
||||||
|
int new_x = GET_X_LPARAM(lparam);
|
||||||
|
int new_y = GET_Y_LPARAM(lparam);
|
||||||
|
x_delta -= new_x - x;
|
||||||
|
y_delta -= new_y - y;
|
||||||
|
x = new_x;
|
||||||
|
y = new_y;
|
||||||
|
redraw = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_KEYDOWN:
|
||||||
|
switch (wparam) {
|
||||||
|
case 'q':
|
||||||
|
case 'Q':
|
||||||
|
case VK_ESCAPE:
|
||||||
|
finish = 1;
|
||||||
|
break;
|
||||||
|
case VK_LEFT:
|
||||||
|
x_delta -= win_width/10;
|
||||||
|
redraw = 1;
|
||||||
|
break;
|
||||||
|
case VK_RIGHT:
|
||||||
|
x_delta += win_width/10;
|
||||||
|
redraw = 1;
|
||||||
|
break;
|
||||||
|
case VK_UP:
|
||||||
|
y_delta -= win_height/10;
|
||||||
|
redraw = 1;
|
||||||
|
break;
|
||||||
|
case VK_DOWN:
|
||||||
|
y_delta += win_height/10;
|
||||||
|
redraw = 1;
|
||||||
|
break;
|
||||||
|
case VK_PRIOR:
|
||||||
|
if (control) {
|
||||||
|
x_delta -= win_width;
|
||||||
|
redraw = 1;
|
||||||
|
} else {
|
||||||
|
y_delta -= win_height;
|
||||||
|
redraw = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VK_NEXT:
|
||||||
|
if (control) {
|
||||||
|
x_delta += win_width;
|
||||||
|
redraw = 1;
|
||||||
|
} else {
|
||||||
|
y_delta += win_height;
|
||||||
|
redraw = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VK_HOME:
|
||||||
|
x_delta = 0;
|
||||||
|
y_delta = 0;
|
||||||
|
redraw = 1;
|
||||||
|
break;
|
||||||
|
case VK_END:
|
||||||
|
x_delta = INT_MAX;
|
||||||
|
y_delta = INT_MAX;
|
||||||
|
redraw = 1;
|
||||||
|
break;
|
||||||
|
case VK_CONTROL:
|
||||||
|
control = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WM_KEYUP:
|
||||||
|
switch (wparam) {
|
||||||
|
case VK_CONTROL:
|
||||||
|
control = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
case WM_SIZE:
|
||||||
|
win_width = LOWORD(lparam);
|
||||||
|
win_height = HIWORD(lparam);
|
||||||
|
redraw = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (redraw) {
|
||||||
|
if (x_delta > the_width - win_width)
|
||||||
|
x_delta = the_width - win_width;
|
||||||
|
if (y_delta > the_height - win_height)
|
||||||
|
y_delta = the_height - win_height;
|
||||||
|
if (x_delta < 0)
|
||||||
|
x_delta = 0;
|
||||||
|
if (y_delta < 0)
|
||||||
|
y_delta = 0;
|
||||||
|
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
|
||||||
}
|
}
|
||||||
return DefWindowProc(hwnd, message, wparam, lparam);
|
return DefWindowProc(hwnd, message, wparam, lparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
windows_start(void *output_, int width, int height)
|
windows_start(void *output_ __hwloc_attribute_unused, int width, int height)
|
||||||
{
|
{
|
||||||
WNDCLASS wndclass = {
|
WNDCLASS wndclass = {
|
||||||
.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH),
|
.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH),
|
||||||
.hCursor = LoadCursor(NULL, IDC_ARROW),
|
.hCursor = LoadCursor(NULL, IDC_SIZEALL),
|
||||||
.hIcon = LoadIcon(NULL, IDI_APPLICATION),
|
.hIcon = LoadIcon(NULL, IDI_APPLICATION),
|
||||||
.lpfnWndProc = WndProc,
|
.lpfnWndProc = WndProc,
|
||||||
.lpszClassName = "lstopo",
|
.lpszClassName = "lstopo",
|
||||||
};
|
};
|
||||||
HWND toplevel;
|
HWND toplevel;
|
||||||
|
|
||||||
|
win_width = width + 2*GetSystemMetrics(SM_CXSIZEFRAME);
|
||||||
|
win_height = height + 2*GetSystemMetrics(SM_CYSIZEFRAME) + GetSystemMetrics(SM_CYCAPTION);
|
||||||
|
|
||||||
|
if (win_width > GetSystemMetrics(SM_CXFULLSCREEN))
|
||||||
|
win_width = GetSystemMetrics(SM_CXFULLSCREEN);
|
||||||
|
|
||||||
|
if (win_height > GetSystemMetrics(SM_CYFULLSCREEN))
|
||||||
|
win_height = GetSystemMetrics(SM_CYFULLSCREEN);
|
||||||
|
|
||||||
RegisterClass(&wndclass);
|
RegisterClass(&wndclass);
|
||||||
toplevel = CreateWindow("lstopo", "lstopo", WS_OVERLAPPEDWINDOW,
|
toplevel = CreateWindow("lstopo", "lstopo", WS_OVERLAPPEDWINDOW,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
width + 2*GetSystemMetrics(SM_CXSIZEFRAME),
|
win_width, win_height, NULL, NULL, NULL, NULL);
|
||||||
height + 2*GetSystemMetrics(SM_CYSIZEFRAME) + GetSystemMetrics(SM_CYSMCAPTION),
|
|
||||||
NULL, NULL, NULL, NULL);
|
the_width = width;
|
||||||
|
the_height = height;
|
||||||
|
|
||||||
ShowWindow(toplevel, SW_SHOWDEFAULT);
|
ShowWindow(toplevel, SW_SHOWDEFAULT);
|
||||||
|
|
||||||
@ -85,7 +202,7 @@ windows_start(void *output_, int width, int height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
windows_declare_color(void *output_, int r, int g, int b)
|
windows_declare_color(void *output_ __hwloc_attribute_unused, int r, int g, int b)
|
||||||
{
|
{
|
||||||
HBRUSH brush;
|
HBRUSH brush;
|
||||||
COLORREF color = RGB(r, g, b);
|
COLORREF color = RGB(r, g, b);
|
||||||
@ -105,32 +222,32 @@ windows_declare_color(void *output_, int r, int g, int b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
windows_box(void *output, int r, int g, int b, unsigned depth, unsigned x, unsigned width, unsigned y, unsigned height)
|
windows_box(void *output, int r, int g, int b, unsigned depth __hwloc_attribute_unused, unsigned x, unsigned width, unsigned y, unsigned height)
|
||||||
{
|
{
|
||||||
PAINTSTRUCT *ps = output;
|
PAINTSTRUCT *ps = output;
|
||||||
SelectObject(ps->hdc, rgb_to_brush(r, g, b));
|
SelectObject(ps->hdc, rgb_to_brush(r, g, b));
|
||||||
SetBkColor(ps->hdc, RGB(r, g, b));
|
SetBkColor(ps->hdc, RGB(r, g, b));
|
||||||
Rectangle(ps->hdc, x, y, x + width, y + height);
|
Rectangle(ps->hdc, x - x_delta, y - y_delta, x + width - x_delta, y + height - y_delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
windows_line(void *output, int r, int g, int b, unsigned depth, unsigned x1, unsigned y1, unsigned x2, unsigned y2)
|
windows_line(void *output, int r, int g, int b, unsigned depth __hwloc_attribute_unused, unsigned x1, unsigned y1, unsigned x2, unsigned y2)
|
||||||
{
|
{
|
||||||
PAINTSTRUCT *ps = output;
|
PAINTSTRUCT *ps = output;
|
||||||
SelectObject(ps->hdc, rgb_to_brush(r, g, b));
|
SelectObject(ps->hdc, rgb_to_brush(r, g, b));
|
||||||
MoveToEx(ps->hdc, x1, y1, NULL);
|
MoveToEx(ps->hdc, x1 - x_delta, y1 - y_delta, NULL);
|
||||||
LineTo(ps->hdc, x2, y2);
|
LineTo(ps->hdc, x2 - x_delta, y2 - y_delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
windows_text(void *output, int r, int g, int b, int size, unsigned depth, unsigned x, unsigned y, const char *text)
|
windows_text(void *output, int r, int g, int b, int size, unsigned depth __hwloc_attribute_unused, unsigned x, unsigned y, const char *text)
|
||||||
{
|
{
|
||||||
PAINTSTRUCT *ps = output;
|
PAINTSTRUCT *ps = output;
|
||||||
HFONT font;
|
HFONT font;
|
||||||
SetTextColor(ps->hdc, RGB(r, g, b));
|
SetTextColor(ps->hdc, RGB(r, g, b));
|
||||||
font = CreateFont(size, 0, 0, 0, 0, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, NULL);
|
font = CreateFont(size, 0, 0, 0, 0, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, NULL);
|
||||||
SelectObject(ps->hdc, (HGDIOBJ) font);
|
SelectObject(ps->hdc, (HGDIOBJ) font);
|
||||||
TextOut(ps->hdc, x, y, text, strlen(text));
|
TextOut(ps->hdc, x - x_delta, y - y_delta, text, strlen(text));
|
||||||
DeleteObject(font);
|
DeleteObject(font);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +260,7 @@ struct draw_methods windows_draw_methods = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
output_windows (hwloc_topology_t topology, const char *filename, int logical, int verbose_mode)
|
output_windows (hwloc_topology_t topology, const char *filename __hwloc_attribute_unused, int logical, int verbose_mode __hwloc_attribute_unused)
|
||||||
{
|
{
|
||||||
HWND toplevel;
|
HWND toplevel;
|
||||||
the_topology = topology;
|
the_topology = topology;
|
||||||
@ -151,7 +268,7 @@ output_windows (hwloc_topology_t topology, const char *filename, int logical, in
|
|||||||
toplevel = output_draw_start(&windows_draw_methods, logical, topology, NULL);
|
toplevel = output_draw_start(&windows_draw_methods, logical, topology, NULL);
|
||||||
UpdateWindow(toplevel);
|
UpdateWindow(toplevel);
|
||||||
MSG msg;
|
MSG msg;
|
||||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
while (!finish && GetMessage(&msg, NULL, 0, 0)) {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
|
@ -214,6 +214,16 @@ running lstopo in one context may show a specific CPU as red, but
|
|||||||
running lstopo in a different context may show the same CPU as white).
|
running lstopo in a different context may show the same CPU as white).
|
||||||
.
|
.
|
||||||
.\" **************************
|
.\" **************************
|
||||||
|
.\" Layout Section
|
||||||
|
.\" **************************
|
||||||
|
.SH LAYOUT
|
||||||
|
In its graphical output, lstopo uses simple rectangular heuristics
|
||||||
|
to try to achieve a 4/3 ratio between width and height. However,
|
||||||
|
in the particular case of NUMA nodes, the layout is always a flat
|
||||||
|
rectangle, to avoid letting the user believe any particular NUMA
|
||||||
|
topology (lstopo is not able to render that yet).
|
||||||
|
.
|
||||||
|
.\" **************************
|
||||||
.\" Examples Section
|
.\" Examples Section
|
||||||
.\" **************************
|
.\" **************************
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
|
@ -27,7 +27,7 @@ unsigned int gridsize = 10;
|
|||||||
unsigned int force_horiz = 0;
|
unsigned int force_horiz = 0;
|
||||||
unsigned int force_vert = 0;
|
unsigned int force_vert = 0;
|
||||||
unsigned int top = 0;
|
unsigned int top = 0;
|
||||||
hwloc_pid_t pid = -1;
|
hwloc_pid_t pid = (hwloc_pid_t) -1;
|
||||||
|
|
||||||
FILE *open_file(const char *filename, const char *mode)
|
FILE *open_file(const char *filename, const char *mode)
|
||||||
{
|
{
|
||||||
@ -341,7 +341,7 @@ main (int argc, char *argv[])
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pid > 0) {
|
if (pid != (hwloc_pid_t) -1 && pid != 0) {
|
||||||
if (hwloc_topology_set_pid(topology, pid)) {
|
if (hwloc_topology_set_pid(topology, pid)) {
|
||||||
perror("Setting target pid");
|
perror("Setting target pid");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user