Changeset 5707
- Timestamp:
- 11/05/09 11:58:43 (3 weeks ago)
- Location:
- mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc
- Files:
-
- 32 modified
-
NEWS (modified) (2 diffs)
-
README (modified) (2 diffs)
-
VERSION (modified) (2 diffs)
-
autogen.sh (modified) (1 diff)
-
configure.ac (modified) (8 diffs)
-
doc/doxygen.cfg (modified) (1 diff)
-
doc/hwloc-hello.c (modified) (1 diff)
-
doc/hwloc.doxy (modified) (9 diffs)
-
doc/www.open-mpi.org-header.inc (modified) (1 diff)
-
doc/www.open-mpi.org.cfg (modified) (1 diff)
-
include/hwloc.h (modified) (5 diffs)
-
include/hwloc/config.h.in (modified) (2 diffs)
-
include/hwloc/glibc-sched.h (modified) (1 diff)
-
include/hwloc/linux-libnuma.h (modified) (1 diff)
-
include/hwloc/openfabrics-verbs.h (modified) (2 diffs)
-
include/private/cpuset.h (modified) (5 diffs)
-
include/private/private.h (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/cpuset.c (modified) (1 diff)
-
src/topology-linux.c (modified) (18 diffs)
-
src/topology-osf.c (modified) (1 diff)
-
src/topology-solaris.c (modified) (2 diffs)
-
src/topology-synthetic.c (modified) (1 diff)
-
src/topology.c (modified) (20 diffs)
-
tests/linux-libnuma.c (modified) (1 diff)
-
tests/openfabrics-verbs.c (modified) (1 diff)
-
tests/ports/include/sys/lgrp_user.h (modified) (1 diff)
-
tests/ports/include/windows.h (modified) (1 diff)
-
utils/Makefile.am (modified) (2 diffs)
-
utils/hwloc-mask.h (modified) (1 diff)
-
utils/lstopo-draw.c (modified) (2 diffs)
-
utils/lstopo-text.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/NEWS
r5480 r5707 14 14 0.9 (as initially released as "libtopology", then re-branded to "hwloc" 15 15 in v0.9.1). 16 17 18 Version 0.9.2 19 ------------- 20 21 * Trivial documentation changes. 16 22 17 23 … … 34 40 * Extend topobind to support multiple cpusets or objects on the command 35 41 line as topomask does. 36 * Add an Infiniband-specific helper hwloc/ ibverbs.h to retrieve the physical37 location of IB devices.42 * Add an Infiniband-specific helper hwloc/openfabrics-verbs.h to retrieve 43 the physical location of IB devices. 38 44 39 45 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/README
r5530 r5707 166 166 available in hwloc/linux.h , and hwloc/linux-libnuma.h if using libnuma. On 167 167 glibc-based systems, additional helpers are available in hwloc/glibc-sched.h . 168 For systems with the Infiniband Verbs library, some dedicated helpers are 169 provided in hwloc/ibverbs.h . 168 For Linux systems with the OpenFabrics verbs library, some dedicated helpers 169 are provided in hwloc/openfabrics-verbs.h (this helper file is not yet useful 170 on non-Linux systems with the OpenFabrics verbs library). 170 171 171 172 To precisely define the vocabulary used by hwloc, a Glossary is available and … … 308 309 ------------------------------------------------------------------------------- 309 310 310 Generated on Fri Oct 16 14:19:12 2009 for Hardware Locality (hwloc) by doxygen311 Generated on Mon Oct 26 15:22:12 2009 for Hardware Locality (hwloc) by doxygen 311 312 1.6.1 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/VERSION
r5530 r5707 8 8 major=0 9 9 minor=9 10 release= 110 release=2 11 11 12 12 # greek is used for alpha or beta release tags. If it is non-empty, … … 17 17 # and have no white space. 18 18 19 greek=rc 219 greek=rc1 20 20 21 21 # If want_svn=1, then the SVN r number will be included in the overall -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/autogen.sh
r5490 r5707 1 1 : 2 autoreconf -ivf 2 autoreconf -ivf -I m4 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/configure.ac
r5530 r5707 158 158 # 159 159 160 AC_MSG_CHECKING([which OS support to include]) 160 161 case ${target} in 161 162 *-*-linux*) 162 AC_DEFINE(LINUX_SYS, 1, Define to 1 on Linux) 163 AC_DEFINE(LINUX_SYS, 1, [Define to 1 on Linux]) 164 AC_DEFINE(HWLOC_LINUX_SYS, 1, [Define to 1 on Linux]) 163 165 linux=yes 166 AC_MSG_RESULT([Linux]) 164 167 ;; 165 168 *-*-irix*) 166 AC_DEFINE(IRIX_SYS, 1, Define to 1 on Irix)169 AC_DEFINE(IRIX_SYS, 1, [Define to 1 on Irix]) 167 170 irix=yes 171 AC_MSG_RESULT([IRIX]) 168 172 ;; 169 173 *-*-darwin*) 170 AC_DEFINE(DARWIN_SYS, 1, Define to 1 on Darwin)174 AC_DEFINE(DARWIN_SYS, 1, [Define to 1 on Darwin]) 171 175 darwin=yes 176 AC_MSG_RESULT([Darwin]) 172 177 ;; 173 178 *-*-solaris*) 174 AC_DEFINE(SOLARIS_SYS, 1, Define to 1 on Solaris)179 AC_DEFINE(SOLARIS_SYS, 1, [Define to 1 on Solaris]) 175 180 solaris=yes 181 AC_MSG_RESULT([Solaris]) 176 182 ;; 177 183 *-*-aix*) 178 AC_DEFINE(AIX_SYS, 1, Define to 1 on AIX)184 AC_DEFINE(AIX_SYS, 1, [Define to 1 on AIX]) 179 185 aix=yes 186 AC_MSG_RESULT([AIX]) 180 187 ;; 181 188 *-*-osf*) 182 AC_DEFINE(OSF_SYS, 1, Define to 1 on OSF)189 AC_DEFINE(OSF_SYS, 1, [Define to 1 on OSF]) 183 190 osf=yes 191 AC_MSG_RESULT([OSF]) 184 192 ;; 185 193 *-*-hpux*) 186 AC_DEFINE(HPUX_SYS, 1, Define to 1 on HP-UX)194 AC_DEFINE(HPUX_SYS, 1, [Define to 1 on HP-UX]) 187 195 hpux=yes 196 AC_MSG_RESULT([HP-UX]) 188 197 ;; 189 198 *-*-mingw*|*-*-cygwin*) 190 AC_DEFINE(WIN_SYS, 1, Define to 1 on WINDOWS)199 AC_DEFINE(WIN_SYS, 1, [Define to 1 on WINDOWS]) 191 200 windows=yes 201 AC_MSG_RESULT([Windows]) 192 202 ;; 193 203 *) 194 echo Warning: Host type \"${target}\" not yet supported. 204 AC_MSG_RESULT([Unsupported! ($target)]) 205 AC_MSG_WARN([***********************************************************]) 206 AC_MSG_WARN([*** hwloc does not support this system.]) 207 AC_MSG_WARN([*** hwloc will *attempt* to build (but it may not work).]) 208 AC_MSG_WARN([*** hwloc's run-time results may be reduced to showing just one processor.]) 209 AC_MSG_WARN([*** You have been warned.]) 210 AC_MSG_WARN([*** Pausing to give you time to read this message...]) 211 AC_MSG_WARN([***********************************************************]) 212 sleep 10 195 213 ;; 196 214 esac … … 243 261 hwloc_strncasecmp=strncmp 244 262 AC_CHECK_FUNCS([strncasecmp], [ 245 AC_CHECK_DECL([strncasecmp], [263 HWLOC_CHECK_DECL([strncasecmp], [ 246 264 hwloc_strncasecmp=strncasecmp 247 265 ]) … … 322 340 fi 323 341 324 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ 325 #define _GNU_SOURCE 326 #include <sched.h> 327 static unsigned long mask; 328 ]], [[ sched_setaffinity(0, (void*) &mask); 329 ]]), AC_DEFINE([HAVE_OLD_SCHED_SETAFFINITY], [1], [Define to 1 if glibc provides the old prototype of sched_setaffinity()])) 342 AC_MSG_CHECKING([for old prototype of sched_setaffinity]) 343 AC_COMPILE_IFELSE( 344 AC_LANG_PROGRAM([[ 345 #define _GNU_SOURCE 346 #include <sched.h> 347 static unsigned long mask; 348 ]], [[ sched_setaffinity(0, (void*) &mask); 349 ]]), 350 AC_DEFINE([HAVE_OLD_SCHED_SETAFFINITY], [1], [Define to 1 if glibc provides the old prototype of sched_setaffinity()]) 351 AC_MSG_RESULT([yes]), 352 AC_MSG_RESULT([no]) 353 ) 354 355 AC_MSG_CHECKING([for working CPU_SET]) 356 AC_LINK_IFELSE( 357 AC_LANG_PROGRAM([[ 358 #include <sched.h> 359 cpu_set_t set; 360 ]], [[ CPU_ZERO(&set); CPU_SET(0, &set); 361 ]]), 362 AC_DEFINE([HWLOC_HAVE_CPU_SET], [1], [Define to 1 if the CPU_SET macro works]) 363 AC_MSG_RESULT([yes]), 364 AC_MSG_RESULT([no]) 365 ) 330 366 331 367 AC_ARG_ENABLE([cairo], … … 352 388 AC_DEFINE([HAVE_CAIRO], [1], [Define to 1 if you have the `cairo' library.]) 353 389 fi 390 AM_CONDITIONAL([HAVE_CAIRO], [test "x$enable_cairo" = "xyes"]) 354 391 355 392 AC_ARG_ENABLE([xml], … … 400 437 401 438 AC_CHECK_FUNCS([ffs], [ 402 AC_CHECK_DECL([ffs],[439 HWLOC_CHECK_DECL([ffs],[ 403 440 AC_DEFINE([HWLOC_HAVE_DECL_FFS], [1], [Define to 1 if function `ffs' is declared by system headers]) 404 441 ]) … … 406 443 ]) 407 444 AC_CHECK_FUNCS([ffsl], [ 445 HWLOC_CHECK_DECL([ffsl],[ 446 AC_DEFINE([HWLOC_HAVE_DECL_FFSL], [1], [Define to 1 if function `ffsl' is declared by system headers]) 447 ]) 408 448 AC_DEFINE([HWLOC_HAVE_FFSL], [1], [Define to 1 if you have the `ffsl' function.]) 409 449 ]) 410 450 411 451 AC_CHECK_FUNCS([fls], [ 412 AC_CHECK_DECL([fls],[452 HWLOC_CHECK_DECL([fls],[ 413 453 AC_DEFINE([HWLOC_HAVE_DECL_FLS], [1], [Define to 1 if function `fls' is declared by system headers]) 414 454 ]) … … 416 456 ]) 417 457 AC_CHECK_FUNCS([flsl], [ 458 HWLOC_CHECK_DECL([flsl],[ 459 AC_DEFINE([HWLOC_HAVE_DECL_FLSL], [1], [Define to 1 if function `flsl' is declared by system headers]) 460 ]) 418 461 AC_DEFINE([HWLOC_HAVE_FLSL], [1], [Define to 1 if you have the `flsl' function.]) 419 462 ]) 420 463 421 464 AC_CHECK_FUNCS([clz], [ 422 AC_CHECK_DECL([clz],[465 HWLOC_CHECK_DECL([clz],[ 423 466 AC_DEFINE([HWLOC_HAVE_DECL_CLZ], [1], [Define to 1 if function `clz' is declared by system headers]) 424 467 ]) … … 426 469 ]) 427 470 AC_CHECK_FUNCS([clzl], [ 471 HWLOC_CHECK_DECL([clzl],[ 472 AC_DEFINE([HWLOC_HAVE_DECL_CLZL], [1], [Define to 1 if function `clzl' is declared by system headers]) 473 ]) 428 474 AC_DEFINE([HWLOC_HAVE_CLZL], [1], [Define to 1 if you have the `clzl' function.]) 429 475 ]) -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/doxygen.cfg
r5480 r5707 1268 1268 # instead of the = operator. 1269 1269 1270 PREDEFINED = hwloc_thread_t=pthread_t CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=11270 PREDEFINED = hwloc_thread_t=pthread_t HWLOC_HAVE_CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=1 1271 1271 1272 1272 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/hwloc-hello.c
r5480 r5707 1 /* topo-hello.c */ 1 /* Example hwloc API program. 2 * 3 * Copyright © 2009 INRIA, Université Bordeaux 1 4 * 5 * topo-hello.c 6 */ 7 2 8 #include <hwloc.h> 3 9 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/hwloc.doxy
r5530 r5707 16 16 \section Introduction 17 17 18 hwloc provides a portable abstraction (across OS, versions, architectures, 19 ...) of the hierarchical topology of modern architectures. It primarily aims at 20 helping high-performance computing applications with gathering information about 21 the hardware so as to exploit it accordingly and efficiently. 22 23 hwloc provides a hierarchical view of the machine, NUMA memory nodes, 24 sockets, shared caches, cores and simultaneous multithreading. It also gathers 25 various attributes such as cache and memory information. 18 hwloc provides command line tools and a C API to obtain the 19 hierarchical map of key computing elements, such as: NUMA memory 20 nodes, shared caches, processor sockets, processor cores, and 21 processor "threads". hwloc also gathers various attributes such as 22 cache and memory information, and is portable across a variety of 23 different operating systems and platforms. 24 25 hwloc primarily aims at helping high-performance computing (HPC) 26 applications, but is also applicable to any project seeking to exploit 27 code and/or data locality on modern computing platforms. 28 29 *** Note that the hwloc project represents the merger of the 30 libtopology project from INRIA and the Portable Linux Processor 31 Affinity (PLPA) sub-project from Open MPI. <em>Both of these prior 32 projects are now deprecated.</em> The first hwloc release is essentially a 33 "re-branding" of the libtopology code base, but with both a few 34 genuinely new features and a few PLPA-like features added in. More 35 new features and more PLPA-like features will be added to hwloc over 36 time. 26 37 27 38 hwloc supports the following operating systems: 28 39 29 40 <ul> 30 <li> Linux (including old kernels not having sysfs topology information, with 31 knowledge of cpusets, offline cpus, and Kerrighed support) 32 <li> Solaris 33 <li> AIX 34 <li> Darwin 35 <li> OSF/1 (aka. Tru64) 36 <li> HP-UX 37 <li> Windows 38 <li> For other OSes, only the number of processors is available for now. 41 <li>Linux (including old kernels not having sysfs topology 42 information, with knowledge of cpusets, offline cpus, and Kerrighed 43 support)</li> 44 <li>Solaris</li> 45 <li>AIX</li> 46 <li>Darwin / OS X</li> 47 <li>OSF/1 (a.k.a., Tru64)</li> 48 <li>HP-UX</li> 49 <li>Microsoft Windows</li> 39 50 </ul> 40 51 52 hwloc only reports the number of processors on unsupported operating 53 systems; no topology information is available. 54 41 55 For development and debugging purposes, hwloc also offers the ability to 42 work on faketopologies:56 work on "fake" topologies: 43 57 44 58 <ul> 45 <li> Symmetrical tree of resources generated from a list of level arities 46 <li> Remote machine simulation through the gathering of Linux sysfs topology files 59 <li> Symmetrical tree of resources generated from a list of level arities</li> 60 <li> Remote machine simulation through the gathering of Linux sysfs topology files</li> 47 61 </ul> 48 62 49 hwloc may also display the topology in a convenient format, either in 50 graphical mode, or by exporting in PDF, PNG, FIG, ... format, or in text mode 51 (see Examples below). 63 hwloc can display the topology in a human-readable format, either in 64 graphical mode (X11), or by exporting in one of several different 65 formats, including: plain text, PDF, PNG, and FIG (see Examples 66 below). Note that some of the export formats require additional 67 support libraries. 52 68 53 69 hwloc offers a programming interface for manipulating topologies and 54 objects. It also brings a powerful cpu bitmap API that is used to describe 55 topology objects location on physical/logical processors. See the \ref interface 56 below. It may also be used to binding applications onto certain cores or 57 memory nodes. Several utility programs are also provided to ease command-line 58 manipulation of topology objects, binding of processes, ... 70 objects. It also brings a powerful CPU bitmap API that is used to 71 describe topology objects location on physical/logical processors. See 72 the \ref interface below. It may also be used to binding applications 73 onto certain cores or memory nodes. Several utility programs are also 74 provided to ease command-line manipulation of topology objects, 75 binding of processes, and so on. 59 76 60 77 \htmlonly … … 63 80 \section installation Installation 64 81 65 hwloc (http://www.open-mpi.org/projects/hwloc/) is available under the BSD license. 66 It is hosted by Open MPI (http://www.open-mpi.org/). 67 The current SVN snapshot can be fetched with: 68 69 <ul> 70 <li>svn checkout http://svn.open-mpi.org/svn/hwloc/trunk hwloc-trunk 71 <li>cd hwloc-trunk 72 <li>./autogen.sh 73 </ul> 74 75 Note that autoconf >=2.60, automake >=1.10 and libtool >=2.2.6 are required in that case. 76 77 Installation by itself is as usual: 78 79 <ul> 80 <li>./configure --prefix=... 81 <li>make 82 <li>make install 83 </ul> 84 85 Lstopo's fig support is always available. To get support for pdf, ps and png 86 support, cairo is needed. To get support for xml, libxml2 is needed. 82 hwloc (http://www.open-mpi.org/projects/hwloc/) is available under the 83 BSD license. It is hosted as a sub-project of the overall Open MPI 84 project (http://www.open-mpi.org/). Note that hwloc does not require 85 any functionality from Open MPI -- it is a wholly separate (and much 86 smaller!) project and code base. It just happens to be hosted as part 87 of the overall Open MPI project. 88 89 Nightly development snapshots are available on the web site. 90 Additionally, the code can be directly checked out of Subversion: 91 92 \code 93 shell$ svn checkout http://svn.open-mpi.org/svn/hwloc/trunk hwloc-trunk 94 shell$ cd hwloc-trunk 95 shell$ ./autogen.sh 96 \endcode 97 98 Note that GNU Autoconf >=2.60, Automake >=1.10 and Libtool >=2.2.6 are 99 required when building from a Subversion checkout. 100 101 Installation by itself is the fairly common GNU-based process: 102 103 \code 104 shell$ ./configure --prefix=... 105 shell$ make 106 shell$ make install 107 \endcode 108 109 The hwloc command-line tool "lstopo" produces human-readable topology 110 maps, as mentioned above. It can also export maps to the "fig" file 111 format. Support for PDF, Postscript, and PNG exporting is provided if 112 the "Cairo" development package can be found when hwloc is configured 113 and build. Similarly, lstopo's XML support requires the libxml2 114 development package. 87 115 88 116 \htmlonly … … 91 119 \section examples Examples 92 120 93 On a 4-socket 2-core machine with hyperthreading, the \c lstopo tool may 94 show the following outputs:121 On a 4-socket 2-core machine with hyperthreading, the \c lstopo tool 122 may show the following outputs: 95 123 96 124 \image html dudley.png … … 163 191 \endcode 164 192 165 On a 2-socket quad-core Xeon (pre-Nehalem ones assembling 2 dual-core dies into each socket): 193 On a 2-socket quad-core Xeon (pre-Nehalem, with 2 dual-core dies into 194 each socket): 166 195 167 196 \image html emmett.png 168 \image latex emmett.png width=\textwidth197 \image latex emmett.png "" width=8cm 169 198 170 199 \code … … 192 221 \section interface Programming interface 193 222 194 The basic interface is available in hwloc.h . It mostly offers low-level 195 routines for advanced programmers that want to manually manipulate objects 196 and follow links between them. Most users should look at hwloc/helper.h 197 which provides a lot of interesting higher-level traversal examples. 198 199 Each object contains a cpuset which describes the list of processors 200 that it contains. These cpusets may be used for \ref hwlocality_binding. 201 hwloc offers an extensive cpuset manipulation interface in hwloc/cpuset.h . 223 The basic interface is available in hwloc.h. It mostly offers 224 low-level routines for advanced programmers that want to manually 225 manipulate objects and follow links between them. Developers should 226 look at hwloc/helper.h, which provides good higher-level topology 227 traversal examples. 228 229 Each object contains a cpuset describing the list of processors that 230 it contains. These cpusets may be used for \ref hwlocality_binding. 231 hwloc offers an extensive cpuset manipulation interface in 232 hwloc/cpuset.h. 202 233 203 234 Moreover, hwloc also comes with additional helpers for 204 235 interoperability with several commonly used environments. For Linux, 205 some specific helpers are available in hwloc/linux.h , and236 some specific helpers are available in hwloc/linux.h, and 206 237 hwloc/linux-libnuma.h if using libnuma. On glibc-based systems, 207 additional helpers are available in hwloc/glibc-sched.h . For Linux238 additional helpers are available in hwloc/glibc-sched.h. For Linux 208 239 systems with the OpenFabrics verbs library, some dedicated helpers are 209 240 provided in hwloc/openfabrics-verbs.h (this helper file is not yet … … 213 244 available and should probably be read first. 214 245 215 Further documentation is available in html, manual pages, and pdf format 216 in the source tarball in doc/doxygen-doc/ (after doxygen compilation 217 for svn checkouts) and are installed in $prefix/share/doc/hwloc/ and 218 the usual manual repository. 246 Further documentation is available in a full set of HTML pages, man 247 pages, and self-contained PDF files (formatted for both both US letter 248 and A4 formats) in the source tarball in doc/doxygen-doc/. If you are 249 building from a Subversion checkout, you will need to have Doxygen and 250 pdflatex installed -- the documentation will be built during the 251 normal "make" process. The documentation is installed during "make 252 install" to $prefix/share/doc/hwloc/ and your systems default man page 253 tree (under $prefix, of course). 219 254 220 255 The following section presents an example of API usage. … … 226 261 second core of the machine. 227 262 228 Hardware Location provides a pkg-config object, so compiling the example boils down to 263 Hardware Location provides a pkg-config object, so compiling the 264 example boils down to 229 265 230 266 \verbatim 231 CFLAGS +=$(pkg-config --cflags hwloc)232 LDLIBS +=$(pkg-config --libs hwloc)267 CFLAGS += $(pkg-config --cflags hwloc) 268 LDLIBS += $(pkg-config --libs hwloc) 233 269 cc hwloc-hello.c $(CFLAGS) -o hwloc-hello $(LDLIBS) 234 270 \endverbatim … … 260 296 libtopology was initially developed by the INRIA Runtime Team-Project 261 297 (http://runtime.bordeaux.inria.fr/) (headed by Raymond Namyst 262 (http://dept-info.labri.fr/~namyst/) ). PLPA was initially developed by298 (http://dept-info.labri.fr/~namyst/). PLPA was initially developed by 263 299 the Open MPI development team as a sub-project. Both are now deprecated 264 300 in favor of hwloc, which is distributed as an Open MPI sub-project. … … 329 365 \image latex diagram.eps width=\textwidth 330 366 331 It can be noticed that for Processor objects, the logical index, computed367 It should be noted that for Processor objects, the logical index, computed 332 368 linearly by hwloc, is not the same as the OS index. 333 369 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/www.open-mpi.org-header.inc
r5490 r5707 1 1 <?php 2 $topdir = "../../.. ";2 $topdir = "../../../.."; 3 3 # Note that we must use the PHP "$$" indirection to assign to the 4 4 # "title" variable, because if we list "$ title" (without the space) 5 5 # in this file, Doxygen will replace it with a string title. 6 $ver = basename(getcwd()); 6 7 $thwarting_doxygen_preprocessor = "title"; 7 $$thwarting_doxygen_preprocessor = "Portable Hardware Locality (hwloc) Documentation ";8 $header_include_file = "$topdir/projects/hwloc/doc/ www.open-mpi.org-css.inc";8 $$thwarting_doxygen_preprocessor = "Portable Hardware Locality (hwloc) Documentation: $ver"; 9 $header_include_file = "$topdir/projects/hwloc/doc/$ver/www.open-mpi.org-css.inc"; 9 10 10 11 include_once("$topdir/projects/hwloc/nav.inc"); -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/www.open-mpi.org.cfg
r5480 r5707 1270 1270 # instead of the = operator. 1271 1271 1272 PREDEFINED = topo_thread_t=pthread_t CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=11272 PREDEFINED = topo_thread_t=pthread_t HWLOC_HAVE_CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=1 1273 1273 1274 1274 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc.h
r5530 r5707 247 247 * machine that the caller is allowed to access. 248 248 * 249 * This default behavior may also be modified through environment variables 250 * if the application did not modify it already. 251 * Setting HWLOC_XMLFILE in the environment enforces the discovery from a XML 252 * file as if hwloc_topology_set_xml() had been called. 253 * HWLOC_FSROOT switches to reading the topology from the specified Linux 254 * filesystem root as if hwloc_topology_set_fsroot() had been called. 255 * Finally, HWLOC_THISSYSTEM enforces the value of the is_thissystem field. 256 * 249 257 * @{ 250 258 */ … … 296 304 * provide empty hooks just returning success. 297 305 * 306 * Setting the environment variable HWLOC_THISSYSTEM may also result in the 307 * same behavior. 308 * 298 309 * This can be used for efficiency reasons to first detect the topology once, 299 310 * save it to an XML file, and quickly reload it later through the XML … … 312 323 * 313 324 * On Linux system, use sysfs and procfs files as if they were mounted on the given 314 * \p fsroot_path instead of the main file-system root. 325 * \p fsroot_path instead of the main file-system root. Setting the environment 326 * variable HWLOC_FSROOT may also result in this behavior. 315 327 * Not using the main file-system root causes hwloc_topology_is_thissystem field 316 328 * to return 0. … … 339 351 * 340 352 * Gather topology information the XML file given at \p xmlpath. 353 * Setting the environment variable HWLOC_XMLFILE may also result in this behavior. 341 354 * This file may have been generated earlier with lstopo file.xml. 342 355 * … … 514 527 * in a non-strict way. This is the most portable way to bind as all OSes 515 528 * usually provide it. 516 *517 * \note Depending on OSes and implementations, strict binding (i.e. the518 * thread/process will really never be scheduled outside of the cpuset) may not519 * be possible, not be allowed, only used as a hint when no load balancing is520 * needed, etc. If strict binding is required, the strict flag should be set,521 * and the function will fail if strict binding is not possible or allowed.522 *523 529 */ 524 530 typedef enum { 525 HWLOC_CPUBIND_PROCESS = (1<<0), /**< \brief Bind all threads of the current multithreaded process. 526 * This may not be supported by some OSes (e.g. Linux). */ 527 HWLOC_CPUBIND_THREAD = (1<<1), /**< \brief Bind current thread of current process */ 528 HWLOC_CPUBIND_STRICT = (1<<2), /**< \brief Request for strict binding from the OS 529 * Note that strict binding may not be 530 * allowed for administrative reasons, 531 * and the binding function will fail 532 * in that case. 533 */ 531 HWLOC_CPUBIND_PROCESS = (1<<0), /**< \brief Bind all threads of the current multithreaded process. 532 * This may not be supported by some OSes (e.g. Linux). */ 533 HWLOC_CPUBIND_THREAD = (1<<1), /**< \brief Bind current thread of current process */ 534 HWLOC_CPUBIND_STRICT = (1<<2), /**< \brief Request for strict binding from the OS 535 * 536 * By default, when the designated CPUs are 537 * all busy while other CPUs are idle, OSes 538 * may execute the thread/process on those 539 * other CPUs instead of the designated CPUs, 540 * to let them progress anyway. Strict 541 * binding means that the thread/process will 542 * _never_ execute on other cpus than the 543 * designated CPUs, even when those are busy 544 * with other tasks and other CPUs are idle. 545 * 546 * \note Depending on OSes and 547 * implementations, strict binding may not be 548 * possible (implementation reason) or not 549 * allowed (administrative reasons), and the 550 * function will fail in that case. 551 */ 534 552 } hwloc_cpubind_policy_t; 535 553 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/config.h.in
r5480 r5707 19 19 #endif 20 20 21 /* Define to 1 on Linux */ 22 #undef HWLOC_LINUX_SYS 23 21 24 #undef HWLOC_HAVE_FFS 22 25 … … 24 27 25 28 #undef HWLOC_HAVE_FFSL 29 30 /* Define to 1 if the CPU_SET macro works */ 31 #undef HWLOC_HAVE_CPU_SET 26 32 27 33 #define HWLOC_NBMAXCPUS 1024 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/glibc-sched.h
r5480 r5707 22 22 #endif 23 23 24 #ifdef CPU_SET24 #ifdef HWLOC_HAVE_CPU_SET 25 25 26 26 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/linux-libnuma.h
r5480 r5707 47 47 48 48 if (nbnodes) { 49 while ((node = hwloc_get_next_obj_covering_cpuset_by_ depth(topology, cpuset, HWLOC_OBJ_NODE, node)) != NULL) {49 while ((node = hwloc_get_next_obj_covering_cpuset_by_type(topology, cpuset, HWLOC_OBJ_NODE, node)) != NULL) { 50 50 if (node->os_index >= *maxnode) 51 51 break; -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/openfabrics-verbs.h
r5531 r5707 19 19 20 20 #include <hwloc.h> 21 #include <hwloc/config.h> 21 22 #include <hwloc/linux.h> 22 23 … … 38 39 hwloc_ibv_get_device_cpuset(struct ibv_device *ibdev) 39 40 { 40 #if defined( LINUX_SYS)41 #if defined(HWLOC_LINUX_SYS) 41 42 /* If we're on Linux, use the verbs-provided sysfs mechanism to 42 43 get the local cpus */ -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/private/cpuset.h
r5480 r5707 56 56 57 57 /** 58 * ffs helpers.58 * ffsl helpers. 59 59 */ 60 60 … … 71 71 #elif defined(HWLOC_HAVE_FFSL) 72 72 73 # ifndef HWLOC_HAVE_DECL_FFSL 74 extern int ffsl(long); 75 # endif 76 73 77 # define hwloc_ffsl(x) ffsl(x) 74 78 … … 170 174 171 175 /** 172 * fls helpers.176 * flsl helpers. 173 177 */ 174 178 #ifdef __GNUC_____ … … 183 187 #elif defined(HWLOC_HAVE_FLSL) 184 188 189 # ifndef HWLOC_HAVE_DECL_FLSL 190 extern int flsl(long); 191 # endif 192 185 193 # define hwloc_flsl(x) flsl(x) 186 194 187 195 #elif defined(HWLOC_HAVE_CLZL) 188 196 197 # ifndef HWLOC_HAVE_DECL_CLZL 198 extern int clzl(long); 199 # endif 200 189 201 # define hwloc_flsl(x) (x ? 8*sizeof(long) - clzl(x) : 0) 190 202 … … 192 204 193 205 # ifndef HWLOC_HAVE_DECL_FLS 194 extern int f sl(int);206 extern int fls(int); 195 207 # endif 196 208 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/private/private.h
r5530 r5707 89 89 90 90 extern void hwloc_setup_proc_level(struct hwloc_topology *topology, unsigned nb_processors, hwloc_cpuset_t online_cpuset); 91 extern void hwloc_setup_misc_level_from_distances(struct hwloc_topology *topology, unsigned nbobjs, struct hwloc_obj * objs[nbobjs], unsigned distances[nbobjs][nbobjs]);91 extern void hwloc_setup_misc_level_from_distances(struct hwloc_topology *topology, unsigned nbobjs, struct hwloc_obj **objs, unsigned *_distances/*[nbnobjs][nbobjs]*/); 92 92 extern unsigned hwloc_fallback_nbprocessors(void); 93 93 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/Makefile.am
r5530 r5707 9 9 EXTRA_DIST = dolib.c 10 10 11 libhwloc_la_SOURCES = topology.c traversal.c topology-synthetic.c topology-xml.cbind.c cpuset.c11 libhwloc_la_SOURCES = topology.c traversal.c topology-synthetic.c bind.c cpuset.c 12 12 libhwloc_la_LDFLAGS = -version-number $(libhwloc_so_version) $(XML_LIBS) 13 13 … … 32 32 endif 33 33 endif 34 35 if HAVE_XML 36 libhwloc_la_SOURCES += topology-xml.c 37 else !HAVE_XML 38 EXTRA_DIST += topology-xml.c 39 endif !HAVE_XML 34 40 35 41 if HAVE_SOLARIS -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/cpuset.c
r5530 r5707 5 5 */ 6 6 7 #include <private/config.h> 7 8 #include <private/cpuset.h> 8 9 #include <private/private.h> -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-linux.c
r5530 r5707 22 22 #include <pthread.h> 23 23 24 # ifndefCPU_SET24 #ifndef HWLOC_HAVE_CPU_SET 25 25 /* libc doesn't have support for sched_setaffinity, build system call 26 26 * ourselves: */ … … 33 33 # elif defined(__ia64__) 34 34 # define __NR_sched_setaffinity 1231 35 # elif defined(__hppa__) 36 # define __NR_sched_setaffinity 211 37 # elif defined(__alpha__) 38 # define __NR_sched_setaffinity 395 39 # elif defined(__s390__) 40 # define __NR_sched_setaffinity 239 41 # elif defined(__sparc__) 42 # define __NR_sched_setaffinity 261 43 # elif defined(__m68k__) 44 # define __NR_sched_setaffinity 311 45 # elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || defined(__powerpc64__) || defined(__ppc64__) 46 # define __NR_sched_setaffinity 222 47 # elif defined(__arm__) 48 # define __NR_sched_setaffinity 241 49 # elif defined(__cris__) 50 # define __NR_sched_setaffinity 241 51 /*# elif defined(__mips__) 52 # define __NR_sched_setaffinity TODO (32/64/nabi) */ 35 53 # else 36 # error "don't know the syscall number for sched_setaffinity on this architecture" 54 # warning "don't know the syscall number for sched_setaffinity on this architecture, will not support binding" 55 # define sched_setaffinity(pid, lg, mask) (errno = ENOSYS, -1) 37 56 # endif 38 _syscall3(int, sched_setaffinity, pid_t, pid, unsigned int, lg, unsigned long *, mask); 57 # ifndef sched_setaffinity 58 _syscall3(int, sched_setaffinity, pid_t, pid, unsigned int, lg, unsigned long *, mask); 59 # endif 39 60 # endif 40 # endif61 #endif 41 62 42 63 #ifdef HAVE_OPENAT … … 113 134 114 135 /* TODO: use dynamic size cpusets */ 115 #ifdef CPU_SET136 #ifdef HWLOC_HAVE_CPU_SET 116 137 cpu_set_t linux_set; 117 138 unsigned cpu; … … 131 152 132 153 #ifdef HAVE_OLD_SCHED_SETAFFINITY 133 return sched_setaffinity(tid, &mask);154 return sched_setaffinity(tid, (void*) &mask); 134 155 #else /* HAVE_OLD_SCHED_SETAFFINITY */ 135 return sched_setaffinity(tid, sizeof(mask), &mask);156 return sched_setaffinity(tid, sizeof(mask), (void*) &mask); 136 157 #endif /* HAVE_OLD_SCHED_SETAFFINITY */ 137 158 #endif /* CPU_SET */ … … 167 188 */ 168 189 169 #ifdef CPU_SET190 #ifdef HWLOC_HAVE_CPU_SET 170 191 cpu_set_t linux_set; 171 192 unsigned cpu; … … 185 206 186 207 #ifdef HAVE_OLD_SCHED_SETAFFINITY 187 return pthread_setaffinity_np(tid, &mask);208 return pthread_setaffinity_np(tid, (void*) &mask); 188 209 #else /* HAVE_OLD_SCHED_SETAFFINITY */ 189 return pthread_setaffinity_np(tid, sizeof(mask), &mask);210 return pthread_setaffinity_np(tid, sizeof(mask), (void*) &mask); 190 211 #endif /* HAVE_OLD_SCHED_SETAFFINITY */ 191 212 #endif /* CPU_SET */ … … 236 257 237 258 fd = hwloc_fopen(mappath, "r", fsroot_fd); 238 if (!fd) 259 if (!fd) { 260 *value = -1; 239 261 return -1; 240 241 fgets(string, 11, fd); 262 } 263 264 if (!fgets(string, 11, fd)) { 265 *value = -1; 266 return -1; 267 } 242 268 *value = strtoul(string, NULL, 10); 243 269 … … 324 350 return 0; 325 351 326 fgets(cpuset_name, sizeof(cpuset_name), fd);352 tmp = fgets(cpuset_name, sizeof(cpuset_name), fd); 327 353 fclose(fd); 354 if (!tmp) 355 return 0; 328 356 329 357 tmp = strchr(cpuset_name, '\n'); … … 344 372 return 0; 345 373 346 fgets(info, infomax, fd);374 tmp = fgets(info, infomax, fd); 347 375 fclose(fd); 376 if (!tmp) 377 return 0; 348 378 349 379 tmp = strchr(info, '\n'); … … 466 496 467 497 static void 468 hwloc_parse_node_distance(const char *distancepath, unsigned nbnodes, unsigned distances[nbnodes], int fsroot_fd)498 hwloc_parse_node_distance(const char *distancepath, unsigned nbnodes, unsigned *distances, int fsroot_fd) 469 499 { 470 500 char string[4096]; /* enough for hundreds of nodes */ … … 564 594 } 565 595 566 hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, distances);596 hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, (unsigned*) distances); 567 597 } 568 598 } … … 780 810 char str[strlen(PHYSID)+1+9+1+1]; 781 811 char *endptr; 782 unsigned proc_physids[] = { [0 ... HWLOC_NBMAXCPUS-1] = -1 }; 783 unsigned osphysids[] = { [0 ... HWLOC_NBMAXCPUS-1] = -1 }; 784 unsigned proc_coreids[] = { [0 ... HWLOC_NBMAXCPUS-1] = -1 }; 785 unsigned oscoreids[] = { [0 ... HWLOC_NBMAXCPUS-1] = -1 }; 786 unsigned proc_osphysids[] = { [0 ... HWLOC_NBMAXCPUS-1] = -1 }; 787 unsigned proc_oscoreids[] = { [0 ... HWLOC_NBMAXCPUS-1] = -1 }; 788 unsigned core_osphysids[] = { [0 ... HWLOC_NBMAXCPUS-1] = -1 }; 812 unsigned proc_physids[HWLOC_NBMAXCPUS]; 813 unsigned osphysids[HWLOC_NBMAXCPUS]; 814 unsigned proc_coreids[HWLOC_NBMAXCPUS]; 815 unsigned oscoreids[HWLOC_NBMAXCPUS]; 816 unsigned proc_osphysids[HWLOC_NBMAXCPUS]; 817 unsigned core_osphysids[HWLOC_NBMAXCPUS]; 789 818 unsigned procid_max=0; 790 819 unsigned numprocs=0; … … 795 824 long processor = -1; 796 825 int i; 826 827 for (i = 0; i < HWLOC_NBMAXCPUS; i++) { 828 proc_physids[i] = -1; 829 osphysids[i] = -1; 830 proc_coreids[i] = -1; 831 oscoreids[i] = -1; 832 proc_osphysids[i] = -1; 833 core_osphysids[i] = -1; 834 } 797 835 798 836 hwloc_cpuset_zero(online_cpuset); … … 846 884 getprocnb_end() else 847 885 getprocnb_begin(COREID,coreid); 848 proc_oscoreids[processor]=coreid;849 886 for (i=0; i<numcores; i++) 850 887 if (coreid == oscoreids[i] && proc_osphysids[processor] == core_osphysids[i]) … … 861 898 if (str[strlen(str)-1]!='\n') 862 899 { 863 fscanf(fd,"%*[^\n]"); 900 /* ignore end of line */ 901 if (fscanf(fd,"%*[^\n]") == EOF) 902 break; 864 903 getc(fd); 865 904 } … … 877 916 proc_osphysids[i] = -1; 878 917 proc_physids[i] = -1; 879 proc_oscoreids[i] = -1;880 918 proc_coreids[i] = -1; 881 919 } … … 915 953 fd = hwloc_fopen("/sys/class/dmi/id/board_vendor", "r", topology->backend_params.sysfs.root_fd); 916 954 if (fd) { 917 fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd);955 tmp = fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd); 918 956 fclose (fd); 919 if ( dmi_line[0] != '\0') {957 if (tmp && dmi_line[0] != '\0') { 920 958 tmp = strchr(dmi_line, '\n'); 921 959 if (tmp) … … 929 967 fd = hwloc_fopen("/sys/class/dmi/id/board_name", "r", topology->backend_params.sysfs.root_fd); 930 968 if (fd) { 931 fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd);969 tmp = fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd); 932 970 fclose (fd); 933 if ( dmi_line[0] != '\0') {971 if (tmp && dmi_line[0] != '\0') { 934 972 tmp = strchr(dmi_line, '\n'); 935 973 if (tmp) -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-osf.c
r5530 r5707 221 221 } 222 222 } 223 hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, distances);223 hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, (unsigned*) distances); 224 224 } 225 225 radsetdestroy(&radset2); -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-solaris.c
r5480 r5707 149 149 for (j = 0; j < curlgrp; j++) 150 150 distances[i][j] = lgrp_latency_cookie(cookie, glob_lgrps[i]->os_index, glob_lgrps[j]->os_index, LGRP_LAT_CPU_TO_MEM); 151 hwloc_setup_misc_level_from_distances(topology, curlgrp, glob_lgrps, distances);151 hwloc_setup_misc_level_from_distances(topology, curlgrp, glob_lgrps, (unsigned*) distances); 152 152 } 153 153 } … … 197 197 if (cpuid > HWLOC_NBMAXCPUS) 198 198 { 199 fprintf(stderr,"CPU id too big: % d\n", cpuid);199 fprintf(stderr,"CPU id too big: %u\n", cpuid); 200 200 continue; 201 201 } -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-synthetic.c
r5530 r5707 12 12 #include <limits.h> 13 13 #include <assert.h> 14 #include <strings.h> 14 15 15 16 /* Read from DESCRIPTION a series of integers describing a symmetrical -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology.c
r5530 r5707 72 72 static unsigned 73 73 hwloc_setup_group_from_min_distance_clique(unsigned nbobjs, 74 struct hwloc_obj *objs[nbobjs], 75 unsigned distances[nbobjs][nbobjs], 76 unsigned groupids[nbobjs]) 77 { 74 struct hwloc_obj **objs, 75 unsigned *_distances, 76 unsigned *groupids) 77 { 78 unsigned (*distances)[nbobjs][nbobjs] = (unsigned (*)[nbobjs][nbobjs])_distances; 78 79 unsigned groupid = 0; 79 80 unsigned i,j,k; … … 93 94 /* find closest nodes */ 94 95 for(j=i+1; j<nbobjs; j++) { 95 if ( distances[i][j] < min_distance) {96 if ((*distances)[i][j] < min_distance) { 96 97 /* reset the closest set and use new min_distance */ 97 98 hwloc_cpuset_cpu(closest_objs_set, j); 98 min_distance = distances[i][j];99 min_distance = (*distances)[i][j]; 99 100 size = 2; /* current objects i and j */ 100 } else if ( distances[i][j] == min_distance) {101 } else if ((*distances)[i][j] == min_distance) { 101 102 /* add object to current closest set */ 102 103 hwloc_cpuset_set(closest_objs_set, j); … … 109 110 if (hwloc_cpuset_isset(closest_objs_set, j) && 110 111 hwloc_cpuset_isset(closest_objs_set, k) && 111 distances[j][k] != min_distance) {112 (*distances)[j][k] != min_distance) { 112 113 /* the minimal-distance graph is not complete. abort */ 113 114 hwloc_debug("found incomplete minimal-distance graph, aborting\n"); … … 136 137 static unsigned 137 138 hwloc_setup_group_from_min_distance_transitivity(unsigned nbobjs, 138 struct hwloc_obj *objs[nbobjs], 139 unsigned distances[nbobjs][nbobjs], 140 unsigned groupids[nbobjs]) 141 { 139 struct hwloc_obj **objs, 140 unsigned *_distances, 141 unsigned *groupids) 142 { 143 unsigned (*distances)[nbobjs][nbobjs] = (unsigned (*)[nbobjs][nbobjs])_distances; 142 144 unsigned groupid = 0; 143 145 unsigned i,j,k; … … 159 161 /* find closest nodes */ 160 162 for(j=i+1; j<nbobjs; j++) { 161 if ( distances[i][j] < min_distance) {163 if ((*distances)[i][j] < min_distance) { 162 164 /* reset the closest set and use new min_distance */ 163 165 hwloc_cpuset_cpu(closest_objs_set, j); 164 min_distance = distances[i][j];166 min_distance = (*distances)[i][j]; 165 167 size = 2; /* current objects i and j */ 166 } else if ( distances[i][j] == min_distance) {168 } else if ((*distances)[i][j] == min_distance) { 167 169 /* add object to current closest set */ 168 170 hwloc_cpuset_set(closest_objs_set, j); … … 175 177 for(j=i+1; j<nbobjs; j++) 176 178 for(k=j+1; k<nbobjs; k++) 177 if ( distances[j][k] <= min_distance179 if ((*distances)[j][k] <= min_distance 178 180 && hwloc_cpuset_isset(closest_objs_set, j) 179 181 && !hwloc_cpuset_isset(closest_objs_set, k)) { … … 208 210 hwloc__setup_misc_level_from_distances(struct hwloc_topology *topology, 209 211 unsigned nbobjs, 210 struct hwloc_obj * objs[nbobjs],211 unsigned distances[nbobjs][nbobjs],212 struct hwloc_obj **objs, 213 unsigned *_distances, 212 214 int depth) 213 215 { 216 unsigned (*distances)[nbobjs][nbobjs] = (unsigned (*)[nbobjs][nbobjs])_distances; 214 217 unsigned groupids[nbobjs]; 215 218 int nbgroups; … … 222 225 return; 223 226 224 nbgroups = hwloc_setup_group_from_min_distance_clique(nbobjs, objs, distances, groupids);227 nbgroups = hwloc_setup_group_from_min_distance_clique(nbobjs, objs, _distances, groupids); 225 228 if (!nbgroups) { 226 nbgroups = hwloc_setup_group_from_min_distance_transitivity(nbobjs, objs, distances, groupids);229 nbgroups = hwloc_setup_group_from_min_distance_transitivity(nbobjs, objs, _distances, groupids); 227 230 if (!nbgroups) 228 231 return; … … 264 267 for(i=0; i<nbobjs; i++) 265 268 for(j=0; j<nbobjs; j++) 266 groupdistances[groupids[i]-1][groupids[j]-1] += distances[i][j];269 groupdistances[groupids[i]-1][groupids[j]-1] += (*distances)[i][j]; 267 270 for(i=0; i<nbgroups; i++) 268 271 for(j=0; j<nbgroups; j++) … … 277 280 #endif 278 281 279 hwloc__setup_misc_level_from_distances(topology, nbgroups, groupobjs, groupdistances, depth + 1);282 hwloc__setup_misc_level_from_distances(topology, nbgroups, groupobjs, (unsigned*) groupdistances, depth + 1); 280 283 } 281 284 } … … 287 290 hwloc_setup_misc_level_from_distances(struct hwloc_topology *topology, 288 291 unsigned nbobjs, 289 struct hwloc_obj *objs[nbobjs], 290 unsigned distances[nbobjs][nbobjs]) 291 { 292 struct hwloc_obj **objs, 293 unsigned *_distances) 294 { 295 unsigned (*distances)[nbobjs][nbobjs] = (unsigned (*)[nbobjs][nbobjs])_distances; 292 296 unsigned i,j; 293 297 … … 305 309 hwloc_debug("%3d", i); 306 310 for(j=0; j<nbobjs; j++) 307 hwloc_debug(" %3d", distances[i][j]);311 hwloc_debug(" %3d", (*distances)[i][j]); 308 312 hwloc_debug("\n"); 309 313 } … … 314 318 for(j=i+1; j<nbobjs; j++) { 315 319 /* should be symmetric */ 316 if ( distances[i][j] != distances[j][i]) {320 if ((*distances)[i][j] != (*distances)[j][i]) { 317 321 hwloc_debug("distance matrix asymmetric ([%u,%u]=%u != [%u,%u]=%u), aborting\n", 318 i, j, distances[i][j], j, i, distances[j][i]);322 i, j, (*distances)[i][j], j, i, (*distances)[j][i]); 319 323 return; 320 324 } 321 325 /* diagonal is smaller than everything else */ 322 if ( distances[i][j] <= distances[i][i]) {326 if ((*distances)[i][j] <= (*distances)[i][i]) { 323 327 hwloc_debug("distance to self not strictly minimal ([%u,%u]=%u <= [%u,%u]=%u), aborting\n", 324 i, j, distances[i][j], i, i, distances[i][i]);328 i, j, (*distances)[i][j], i, i, (*distances)[i][i]); 325 329 return; 326 330 } … … 328 332 } 329 333 330 hwloc__setup_misc_level_from_distances(topology, nbobjs, objs, distances, 0);334 hwloc__setup_misc_level_from_distances(topology, nbobjs, objs, _distances, 0); 331 335 } 332 336 … … 625 629 626 630 /* Iteration with prefetching to be completely safe against CHILD removal. */ 627 for (child = cur->first_child, child ? next_child = child->next_sibling : 0;631 for (child = cur->first_child, child ? next_child = child->next_sibling : NULL; 628 632 child; 629 child = next_child, child ? next_child = child->next_sibling : 0) {633 child = next_child, child ? next_child = child->next_sibling : NULL) { 630 634 631 635 switch (hwloc_obj_cmp(obj, child)) { … … 710 714 obj; 711 715 /* Check whether the current obj was dropped. */ 712 (*pobj == obj ? pobj = &(*pobj)->next_sibling : 0),716 (*pobj == obj ? pobj = &(*pobj)->next_sibling : NULL), 713 717 /* Get pointer to next object. */ 714 718 obj = *pobj) … … 1317 1321 } 1318 1322 1323 /* enforce backend anyway if a FORCE variable was given */ 1319 1324 #ifdef LINUX_SYS 1320 1325 { 1321 char *fsroot_path_env = getenv("HWLOC_F SROOT");1326 char *fsroot_path_env = getenv("HWLOC_FORCE_FSROOT"); 1322 1327 if (fsroot_path_env) { 1323 1328 hwloc_backend_exit(topology); … … 1328 1333 #ifdef HAVE_XML 1329 1334 { 1330 char *xmlpath_env = getenv("HWLOC_ XMLFILE");1335 char *xmlpath_env = getenv("HWLOC_FORCE_XMLFILE"); 1331 1336 if (xmlpath_env) { 1332 1337 hwloc_backend_exit(topology); … … 1336 1341 #endif 1337 1342 1343 /* only apply non-FORCE variables if we have not changed the backend yet */ 1344 #ifdef LINUX_SYS 1338 1345 if (topology->backend_type == HWLOC_BACKEND_NONE) { 1339 /* if we haven't chosen the backend, set the OS-specific one if needed */ 1346 char *fsroot_path_env = getenv("HWLOC_FSROOT"); 1347 if (fsroot_path_env) 1348 hwloc_backend_sysfs_init(topology, fsroot_path_env); 1349 } 1350 #endif 1351 #ifdef HAVE_XML 1352 if (topology->backend_type == HWLOC_BACKEND_NONE) { 1353 char *xmlpath_env = getenv("HWLOC_FORCE_XMLFILE"); 1354 if (xmlpath_env) 1355 hwloc_backend_xml_init(topology, xmlpath_env); 1356 } 1357 #endif 1358 if (topology->backend_type == HWLOC_BACKEND_NONE) { 1359 local_env = getenv("HWLOC_THISSYSTEM"); 1360 if (local_env) 1361 topology->is_thissystem = atoi(local_env); 1362 } 1363 1364 /* if we haven't chosen the backend, set the OS-specific one if needed */ 1365 if (topology->backend_type == HWLOC_BACKEND_NONE) { 1340 1366 #ifdef LINUX_SYS 1341 1367 if (hwloc_backend_sysfs_init(topology, "/") < 0) … … 1344 1370 } 1345 1371 1372 /* actual topology discovery */ 1346 1373 hwloc_discover(topology); 1347 1374 1348 local_env = getenv("HWLOC_THISSYSTEM"); 1375 /* enforce THISSYSTEM if given in a FORCE variable */ 1376 local_env = getenv("HWLOC_FORCE_THISSYSTEM"); 1349 1377 if (local_env) 1350 1378 topology->is_thissystem = atoi(local_env); -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/linux-libnuma.c
r5480 r5707 93 93 94 94 95 /* convert last node nodemask/bitmask from/to cpuset */95 /* convert first node nodemask/bitmask from/to cpuset */ 96 96 node = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NODE, NULL); 97 97 if (node) { -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/openfabrics-verbs.c
r5531 r5707 9 9 #include <infiniband/verbs.h> 10 10 #include <hwloc.h> 11 #include <private/config.h>12 11 #include <hwloc/openfabrics-verbs.h> 13 12 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/ports/include/sys/lgrp_user.h
r5480 r5707 43 43 int lgrp_latency_cookie(lgrp_cookie_t cookie, lgrp_id_t from, lgrp_id_t to, lgrp_lat_between_t between); 44 44 45 int lgrp_fini( );45 int lgrp_fini(lgrp_cookie_t cookie); 46 46 47 47 #endif /* HWLOC_PORT_SYS_LGRP_USER_H */ -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/ports/include/windows.h
r5480 r5707 42 42 43 43 WINAPI HINSTANCE LoadLibrary(LPCSTR); 44 WINAPI FARPROCGetProcAddress(HINSTANCE, LPCSTR);44 WINAPI void *GetProcAddress(HINSTANCE, LPCSTR); 45 45 WINAPI DWORD GetLastError(void); 46 46 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/Makefile.am
r5530 r5707 5 5 include $(top_srcdir)/Makefile.man-page-rules 6 6 7 EXTRA_DIST = lstopo.h hwloc-mask.h test-hwloc-distrib.output 7 LIBS = $(top_builddir)/src/libhwloc.la 8 9 EXTRA_DIST = test-hwloc-distrib.output 8 10 9 11 bin_PROGRAMS = lstopo hwloc-mask hwloc-bind hwloc-distrib 10 12 11 lstopo_SOURCES = lstopo.c lstopo-color.c lstopo-text.c lstopo-draw.c lstopo-fig.c lstopo-cairo.c lstopo-xml.c 13 lstopo_SOURCES = lstopo.h lstopo.c lstopo-color.c lstopo-text.c lstopo-draw.c lstopo-fig.c 14 if HAVE_CAIRO 15 lstopo_SOURCES += lstopo-cairo.c 16 endif 17 if HAVE_XML 18 lstopo_SOURCES += lstopo-xml.c 19 endif 12 20 if HAVE_WINDOWS 13 21 lstopo_SOURCES += lstopo-windows.c … … 16 24 lstopo_LDADD = $(CAIRO_LIBS) $(XML_LIBS) -lm 17 25 18 LIBS = $(top_builddir)/src/libhwloc.la 26 hwloc_mask_SOURCES = hwloc-mask.c hwloc-mask.h 19 27 20 28 if HAVE_MINGW32 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-mask.h
r5480 r5707 8 8 9 9 #include <hwloc.h> 10 #include <private/config.h> 10 11 #include <private/private.h> 11 12 -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/lstopo-draw.c
r5530 r5707 55 55 56 56 /* preferred width/height compromise */ 57 #define RATIO (4. /3.)57 #define RATIO (4.f/3.f) 58 58 59 59 /* do we prefer ratio1 over ratio2? */ … … 204 204 area = (obj_maxwidth + (separator)) * (obj_maxheight + (separator)) * numsubobjs; \ 205 205 /* Ideal total height for spreading that area with RATIO */ \ 206 idealtotheight = sqrt (area/RATIO); \206 idealtotheight = sqrtf(area/RATIO); \ 207 207 /* Underestimated number of rows */ \ 208 208 rows = idealtotheight / (obj_maxheight + (separator)); \ -
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/lstopo-text.c
r5480 r5707 32 32 33 33 #define indent(output, i) \ 34 fprintf (output, "%*s", i, "");34 fprintf (output, "%*s", (int) i, ""); 35 35 36 36 /* … … 98 98 unsigned nbobjs = hwloc_get_nbobjs_by_depth (topology, depth); 99 99 indent(output, depth); 100 fprintf (output, "depth % d:\t%u %s%s (type #%u)\n",100 fprintf (output, "depth %u:\t%u %s%s (type #%u)\n", 101 101 depth, nbobjs, hwloc_obj_type_string (type), nbobjs>1?"s":"", type); 102 102 }
