Changeset 5707

Show
Ignore:
Timestamp:
11/05/09 11:58:43 (3 weeks ago)
Author:
balaji
Message:

Updated hwloc to the 0.9.2 release.

Location:
mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc
Files:
32 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/NEWS

    r5480 r5707  
    14140.9 (as initially released as "libtopology", then re-branded to "hwloc" 
    1515in v0.9.1). 
     16 
     17 
     18Version 0.9.2 
     19------------- 
     20 
     21* Trivial documentation changes. 
    1622 
    1723 
     
    3440* Extend topobind to support multiple cpusets or objects on the command 
    3541  line as topomask does. 
    36 * Add an Infiniband-specific helper hwloc/ibverbs.h to retrieve the physical 
    37   location of IB devices. 
     42* Add an Infiniband-specific helper hwloc/openfabrics-verbs.h to retrieve 
     43  the physical location of IB devices. 
    3844 
    3945 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/README

    r5530 r5707  
    166166available in hwloc/linux.h , and hwloc/linux-libnuma.h if using libnuma. On 
    167167glibc-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 . 
     168For Linux systems with the OpenFabrics verbs library, some dedicated helpers 
     169are provided in hwloc/openfabrics-verbs.h (this helper file is not yet useful 
     170on non-Linux systems with the OpenFabrics verbs library). 
    170171 
    171172To precisely define the vocabulary used by hwloc, a Glossary is available and 
     
    308309------------------------------------------------------------------------------- 
    309310 
    310 Generated on Fri Oct 16 14:19:12 2009 for Hardware Locality (hwloc) by  doxygen 
     311Generated on Mon Oct 26 15:22:12 2009 for Hardware Locality (hwloc) by  doxygen 
    3113121.6.1 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/VERSION

    r5530 r5707  
    88major=0 
    99minor=9 
    10 release=1 
     10release=2 
    1111 
    1212# greek is used for alpha or beta release tags.  If it is non-empty, 
     
    1717# and have no white space. 
    1818 
    19 greek=rc2 
     19greek=rc1 
    2020 
    2121# 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  
    11: 
    2 autoreconf -ivf 
     2autoreconf -ivf -I m4 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/configure.ac

    r5530 r5707  
    158158# 
    159159 
     160AC_MSG_CHECKING([which OS support to include]) 
    160161case ${target} in 
    161162  *-*-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]) 
    163165    linux=yes 
     166    AC_MSG_RESULT([Linux]) 
    164167    ;; 
    165168  *-*-irix*) 
    166     AC_DEFINE(IRIX_SYS, 1, Define to 1 on Irix) 
     169    AC_DEFINE(IRIX_SYS, 1, [Define to 1 on Irix]) 
    167170    irix=yes 
     171    AC_MSG_RESULT([IRIX]) 
    168172    ;; 
    169173  *-*-darwin*) 
    170     AC_DEFINE(DARWIN_SYS, 1, Define to 1 on Darwin) 
     174    AC_DEFINE(DARWIN_SYS, 1, [Define to 1 on Darwin]) 
    171175    darwin=yes 
     176    AC_MSG_RESULT([Darwin]) 
    172177    ;; 
    173178  *-*-solaris*) 
    174     AC_DEFINE(SOLARIS_SYS, 1, Define to 1 on Solaris) 
     179    AC_DEFINE(SOLARIS_SYS, 1, [Define to 1 on Solaris]) 
    175180    solaris=yes 
     181    AC_MSG_RESULT([Solaris]) 
    176182    ;; 
    177183  *-*-aix*) 
    178     AC_DEFINE(AIX_SYS, 1, Define to 1 on AIX) 
     184    AC_DEFINE(AIX_SYS, 1, [Define to 1 on AIX]) 
    179185    aix=yes 
     186    AC_MSG_RESULT([AIX]) 
    180187    ;; 
    181188  *-*-osf*) 
    182     AC_DEFINE(OSF_SYS, 1, Define to 1 on OSF) 
     189    AC_DEFINE(OSF_SYS, 1, [Define to 1 on OSF]) 
    183190    osf=yes 
     191    AC_MSG_RESULT([OSF]) 
    184192    ;; 
    185193  *-*-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]) 
    187195    hpux=yes 
     196    AC_MSG_RESULT([HP-UX]) 
    188197    ;; 
    189198  *-*-mingw*|*-*-cygwin*) 
    190     AC_DEFINE(WIN_SYS, 1, Define to 1 on WINDOWS) 
     199    AC_DEFINE(WIN_SYS, 1, [Define to 1 on WINDOWS]) 
    191200    windows=yes 
     201    AC_MSG_RESULT([Windows]) 
    192202    ;; 
    193203  *) 
    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 
    195213    ;; 
    196214esac 
     
    243261hwloc_strncasecmp=strncmp 
    244262AC_CHECK_FUNCS([strncasecmp], [ 
    245   AC_CHECK_DECL([strncasecmp], [ 
     263  HWLOC_CHECK_DECL([strncasecmp], [ 
    246264    hwloc_strncasecmp=strncasecmp 
    247265  ]) 
     
    322340fi 
    323341 
    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()])) 
     342AC_MSG_CHECKING([for old prototype of sched_setaffinity]) 
     343AC_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 
     355AC_MSG_CHECKING([for working CPU_SET]) 
     356AC_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) 
    330366 
    331367AC_ARG_ENABLE([cairo], 
     
    352388  AC_DEFINE([HAVE_CAIRO], [1], [Define to 1 if you have the `cairo' library.]) 
    353389fi 
     390AM_CONDITIONAL([HAVE_CAIRO], [test "x$enable_cairo" = "xyes"]) 
    354391 
    355392AC_ARG_ENABLE([xml], 
     
    400437 
    401438AC_CHECK_FUNCS([ffs], [ 
    402   AC_CHECK_DECL([ffs],[ 
     439  HWLOC_CHECK_DECL([ffs],[ 
    403440    AC_DEFINE([HWLOC_HAVE_DECL_FFS], [1], [Define to 1 if function `ffs' is declared by system headers]) 
    404441  ]) 
     
    406443]) 
    407444AC_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  ]) 
    408448  AC_DEFINE([HWLOC_HAVE_FFSL], [1], [Define to 1 if you have the `ffsl' function.]) 
    409449]) 
    410450 
    411451AC_CHECK_FUNCS([fls], [ 
    412   AC_CHECK_DECL([fls],[ 
     452  HWLOC_CHECK_DECL([fls],[ 
    413453    AC_DEFINE([HWLOC_HAVE_DECL_FLS], [1], [Define to 1 if function `fls' is declared by system headers]) 
    414454  ]) 
     
    416456]) 
    417457AC_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  ]) 
    418461  AC_DEFINE([HWLOC_HAVE_FLSL], [1], [Define to 1 if you have the `flsl' function.]) 
    419462]) 
    420463 
    421464AC_CHECK_FUNCS([clz], [ 
    422   AC_CHECK_DECL([clz],[ 
     465  HWLOC_CHECK_DECL([clz],[ 
    423466    AC_DEFINE([HWLOC_HAVE_DECL_CLZ], [1], [Define to 1 if function `clz' is declared by system headers]) 
    424467  ]) 
     
    426469]) 
    427470AC_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  ]) 
    428474  AC_DEFINE([HWLOC_HAVE_CLZL], [1], [Define to 1 if you have the `clzl' function.]) 
    429475]) 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/doxygen.cfg

    r5480 r5707  
    12681268# instead of the = operator. 
    12691269 
    1270 PREDEFINED             = hwloc_thread_t=pthread_t CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=1 
     1270PREDEFINED             = hwloc_thread_t=pthread_t HWLOC_HAVE_CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=1 
    12711271 
    12721272# 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 
    28#include <hwloc.h> 
    39 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/hwloc.doxy

    r5530 r5707  
    1616\section Introduction 
    1717 
    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. 
     18hwloc provides command line tools and a C API to obtain the 
     19hierarchical map of key computing elements, such as: NUMA memory 
     20nodes, shared caches, processor sockets, processor cores, and 
     21processor "threads".  hwloc also gathers various attributes such as 
     22cache and memory information, and is portable across a variety of 
     23different operating systems and platforms. 
     24 
     25hwloc primarily aims at helping high-performance computing (HPC) 
     26applications, but is also applicable to any project seeking to exploit 
     27code and/or data locality on modern computing platforms. 
     28 
     29*** Note that the hwloc project represents the merger of the 
     30libtopology project from INRIA and the Portable Linux Processor 
     31Affinity (PLPA) sub-project from Open MPI.  <em>Both of these prior 
     32projects are now deprecated.</em> The first hwloc release is essentially a 
     33"re-branding" of the libtopology code base, but with both a few 
     34genuinely new features and a few PLPA-like features added in.  More 
     35new features and more PLPA-like features will be added to hwloc over 
     36time. 
    2637 
    2738hwloc supports the following operating systems: 
    2839 
    2940<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 
     42information, with knowledge of cpusets, offline cpus, and Kerrighed 
     43support)</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> 
    3950</ul> 
    4051 
     52hwloc only reports the number of processors on unsupported operating 
     53systems; no topology information is available. 
     54 
    4155For development and debugging purposes, hwloc also offers the ability to 
    42 work on fake topologies: 
     56work on "fake" topologies: 
    4357 
    4458<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> 
    4761</ul> 
    4862 
    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). 
     63hwloc can display the topology in a human-readable format, either in 
     64graphical mode (X11), or by exporting in one of several different 
     65formats, including: plain text, PDF, PNG, and FIG (see Examples 
     66below).  Note that some of the export formats require additional 
     67support libraries. 
    5268 
    5369hwloc 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, ... 
     70objects. It also brings a powerful CPU bitmap API that is used to 
     71describe topology objects location on physical/logical processors. See 
     72the \ref interface below. It may also be used to binding applications 
     73onto certain cores or memory nodes. Several utility programs are also 
     74provided to ease command-line manipulation of topology objects, 
     75binding of processes, and so on. 
    5976 
    6077\htmlonly 
     
    6380\section installation Installation 
    6481 
    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. 
     82hwloc (http://www.open-mpi.org/projects/hwloc/) is available under the 
     83BSD license.  It is hosted as a sub-project of the overall Open MPI 
     84project (http://www.open-mpi.org/).  Note that hwloc does not require 
     85any functionality from Open MPI -- it is a wholly separate (and much 
     86smaller!) project and code base.  It just happens to be hosted as part 
     87of the overall Open MPI project. 
     88 
     89Nightly development snapshots are available on the web site. 
     90Additionally, the code can be directly checked out of Subversion: 
     91 
     92\code 
     93shell$ svn checkout http://svn.open-mpi.org/svn/hwloc/trunk hwloc-trunk 
     94shell$ cd hwloc-trunk 
     95shell$ ./autogen.sh 
     96\endcode 
     97 
     98Note that GNU Autoconf >=2.60, Automake >=1.10 and Libtool >=2.2.6 are 
     99required when building from a Subversion checkout. 
     100 
     101Installation by itself is the fairly common GNU-based process: 
     102 
     103\code 
     104shell$ ./configure --prefix=... 
     105shell$ make 
     106shell$ make install 
     107\endcode 
     108 
     109The hwloc command-line tool "lstopo" produces human-readable topology 
     110maps, as mentioned above.  It can also export maps to the "fig" file 
     111format.  Support for PDF, Postscript, and PNG exporting is provided if 
     112the "Cairo" development package can be found when hwloc is configured 
     113and build.  Similarly, lstopo's XML support requires the libxml2 
     114development package. 
    87115 
    88116\htmlonly 
     
    91119\section examples Examples 
    92120 
    93  On a 4-socket 2-core machine with hyperthreading, the \c lstopo tool may 
    94  show the following outputs: 
     121On a 4-socket 2-core machine with hyperthreading, the \c lstopo tool 
     122may show the following outputs: 
    95123 
    96124\image html dudley.png 
     
    163191\endcode 
    164192 
    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): 
    166195 
    167196\image html emmett.png 
    168 \image latex emmett.png width=\textwidth 
     197\image latex emmett.png "" width=8cm 
    169198 
    170199\code 
     
    192221\section interface Programming interface 
    193222 
    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 . 
     223The basic interface is available in hwloc.h. It mostly offers 
     224low-level routines for advanced programmers that want to manually 
     225manipulate objects and follow links between them.  Developers should 
     226look at hwloc/helper.h, which provides good higher-level topology 
     227traversal examples. 
     228 
     229Each object contains a cpuset describing the list of processors that 
     230it contains.  These cpusets may be used for \ref hwlocality_binding. 
     231hwloc offers an extensive cpuset manipulation interface in 
     232hwloc/cpuset.h. 
    202233 
    203234Moreover, hwloc also comes with additional helpers for 
    204235interoperability with several commonly used environments.  For Linux, 
    205 some specific helpers are available in hwloc/linux.h , and 
     236some specific helpers are available in hwloc/linux.h, and 
    206237hwloc/linux-libnuma.h if using libnuma.  On glibc-based systems, 
    207 additional helpers are available in hwloc/glibc-sched.h .  For Linux 
     238additional helpers are available in hwloc/glibc-sched.h.  For Linux 
    208239systems with the OpenFabrics verbs library, some dedicated helpers are 
    209240provided in hwloc/openfabrics-verbs.h (this helper file is not yet 
     
    213244available and should probably be read first. 
    214245 
    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. 
     246Further documentation is available in a full set of HTML pages, man 
     247pages, and self-contained PDF files (formatted for both both US letter 
     248and A4 formats) in the source tarball in doc/doxygen-doc/.  If you are 
     249building from a Subversion checkout, you will need to have Doxygen and 
     250pdflatex installed -- the documentation will be built during the 
     251normal "make" process.  The documentation is installed during "make 
     252install" to $prefix/share/doc/hwloc/ and your systems default man page 
     253tree (under $prefix, of course). 
    219254 
    220255The following section presents an example of API usage. 
     
    226261second core of the machine. 
    227262 
    228 Hardware Location provides a pkg-config object, so compiling the example boils down to 
     263Hardware Location provides a pkg-config object, so compiling the 
     264example boils down to 
    229265 
    230266\verbatim 
    231 CFLAGS+=$(pkg-config --cflags hwloc) 
    232 LDLIBS+=$(pkg-config --libs hwloc) 
     267CFLAGS += $(pkg-config --cflags hwloc) 
     268LDLIBS += $(pkg-config --libs hwloc) 
    233269cc hwloc-hello.c $(CFLAGS) -o hwloc-hello $(LDLIBS) 
    234270\endverbatim 
     
    260296libtopology was initially developed by the INRIA Runtime Team-Project 
    261297(http://runtime.bordeaux.inria.fr/) (headed by Raymond Namyst 
    262 (http://dept-info.labri.fr/~namyst/)). PLPA was initially developed by 
     298(http://dept-info.labri.fr/~namyst/). PLPA was initially developed by 
    263299the Open MPI development team as a sub-project. Both are now deprecated 
    264300in favor of hwloc, which is distributed as an Open MPI sub-project. 
     
    329365\image latex diagram.eps width=\textwidth 
    330366 
    331 It can be noticed that for Processor objects, the logical index, computed 
     367It should be noted that for Processor objects, the logical index, computed 
    332368linearly by hwloc, is not the same as the OS index. 
    333369 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/www.open-mpi.org-header.inc

    r5490 r5707  
    11<?php 
    2 $topdir = "../../.."; 
     2$topdir = "../../../.."; 
    33# Note that we must use the PHP "$$" indirection to assign to the 
    44# "title" variable, because if we list "$ title" (without the space) 
    55# in this file, Doxygen will replace it with a string title. 
     6$ver = basename(getcwd()); 
    67$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"; 
    910 
    1011include_once("$topdir/projects/hwloc/nav.inc"); 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/doc/www.open-mpi.org.cfg

    r5480 r5707  
    12701270# instead of the = operator. 
    12711271 
    1272 PREDEFINED             = topo_thread_t=pthread_t CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=1 
     1272PREDEFINED             = topo_thread_t=pthread_t HWLOC_HAVE_CPU_SET=1 NUMA_VERSION1_COMPATIBILITY=1 __GNUC__=1 
    12731273 
    12741274# 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  
    247247 * machine that the caller is allowed to access. 
    248248 * 
     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 * 
    249257 * @{ 
    250258 */ 
     
    296304   * provide empty hooks just returning success. 
    297305   * 
     306   * Setting the environment variable HWLOC_THISSYSTEM may also result in the 
     307   * same behavior. 
     308   * 
    298309   * This can be used for efficiency reasons to first detect the topology once, 
    299310   * save it to an XML file, and quickly reload it later through the XML 
     
    312323 * 
    313324 * 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. 
    315327 * Not using the main file-system root causes hwloc_topology_is_thissystem field 
    316328 * to return 0. 
     
    339351 * 
    340352 * Gather topology information the XML file given at \p xmlpath. 
     353 * Setting the environment variable HWLOC_XMLFILE may also result in this behavior. 
    341354 * This file may have been generated earlier with lstopo file.xml. 
    342355 * 
     
    514527 * in a non-strict way.  This is the most portable way to bind as all OSes 
    515528 * usually provide it. 
    516  * 
    517  * \note Depending on OSes and implementations, strict binding (i.e. the 
    518  * thread/process will really never be scheduled outside of the cpuset) may not 
    519  * be possible, not be allowed, only used as a hint when no load balancing is 
    520  * 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  * 
    523529 */ 
    524530typedef 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                                   */ 
    534552} hwloc_cpubind_policy_t; 
    535553 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/config.h.in

    r5480 r5707  
    1919#endif 
    2020 
     21/* Define to 1 on Linux */ 
     22#undef HWLOC_LINUX_SYS 
     23 
    2124#undef HWLOC_HAVE_FFS 
    2225 
     
    2427 
    2528#undef HWLOC_HAVE_FFSL 
     29 
     30/* Define to 1 if the CPU_SET macro works */ 
     31#undef HWLOC_HAVE_CPU_SET 
    2632 
    2733#define HWLOC_NBMAXCPUS 1024 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/glibc-sched.h

    r5480 r5707  
    2222#endif 
    2323 
    24 #ifdef CPU_SET 
     24#ifdef HWLOC_HAVE_CPU_SET 
    2525 
    2626 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/linux-libnuma.h

    r5480 r5707  
    4747 
    4848  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) { 
    5050      if (node->os_index >= *maxnode) 
    5151        break; 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/hwloc/openfabrics-verbs.h

    r5531 r5707  
    1919 
    2020#include <hwloc.h> 
     21#include <hwloc/config.h> 
    2122#include <hwloc/linux.h> 
    2223 
     
    3839hwloc_ibv_get_device_cpuset(struct ibv_device *ibdev) 
    3940{ 
    40 #if defined(LINUX_SYS) 
     41#if defined(HWLOC_LINUX_SYS) 
    4142  /* If we're on Linux, use the verbs-provided sysfs mechanism to 
    4243     get the local cpus */ 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/private/cpuset.h

    r5480 r5707  
    5656 
    5757/** 
    58  * ffs helpers. 
     58 * ffsl helpers. 
    5959 */ 
    6060 
     
    7171#elif defined(HWLOC_HAVE_FFSL) 
    7272 
     73#  ifndef HWLOC_HAVE_DECL_FFSL 
     74extern int ffsl(long); 
     75#  endif 
     76 
    7377#  define hwloc_ffsl(x) ffsl(x) 
    7478 
     
    170174 
    171175/** 
    172  * fls helpers. 
     176 * flsl helpers. 
    173177 */ 
    174178#ifdef __GNUC_____ 
     
    183187#elif defined(HWLOC_HAVE_FLSL) 
    184188 
     189#  ifndef HWLOC_HAVE_DECL_FLSL 
     190extern int flsl(long); 
     191#  endif 
     192 
    185193#  define hwloc_flsl(x) flsl(x) 
    186194 
    187195#elif defined(HWLOC_HAVE_CLZL) 
    188196 
     197#  ifndef HWLOC_HAVE_DECL_CLZL 
     198extern int clzl(long); 
     199#  endif 
     200 
    189201#  define hwloc_flsl(x) (x ? 8*sizeof(long) - clzl(x) : 0) 
    190202 
     
    192204 
    193205#  ifndef HWLOC_HAVE_DECL_FLS 
    194 extern int fsl(int); 
     206extern int fls(int); 
    195207#  endif 
    196208 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/include/private/private.h

    r5530 r5707  
    8989 
    9090extern 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]); 
     91extern void hwloc_setup_misc_level_from_distances(struct hwloc_topology *topology, unsigned nbobjs, struct hwloc_obj **objs, unsigned *_distances/*[nbnobjs][nbobjs]*/); 
    9292extern unsigned hwloc_fallback_nbprocessors(void); 
    9393 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/Makefile.am

    r5530 r5707  
    99EXTRA_DIST = dolib.c 
    1010 
    11 libhwloc_la_SOURCES = topology.c traversal.c topology-synthetic.c topology-xml.c bind.c cpuset.c 
     11libhwloc_la_SOURCES = topology.c traversal.c topology-synthetic.c bind.c cpuset.c 
    1212libhwloc_la_LDFLAGS = -version-number $(libhwloc_so_version) $(XML_LIBS) 
    1313 
     
    3232endif 
    3333endif 
     34 
     35if HAVE_XML 
     36libhwloc_la_SOURCES += topology-xml.c 
     37else !HAVE_XML 
     38EXTRA_DIST += topology-xml.c 
     39endif !HAVE_XML 
    3440 
    3541if HAVE_SOLARIS 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/cpuset.c

    r5530 r5707  
    55 */ 
    66 
     7#include <private/config.h> 
    78#include <private/cpuset.h> 
    89#include <private/private.h> 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-linux.c

    r5530 r5707  
    2222#include <pthread.h> 
    2323 
    24 #  ifndef CPU_SET 
     24#ifndef HWLOC_HAVE_CPU_SET 
    2525/* libc doesn't have support for sched_setaffinity, build system call 
    2626 * ourselves: */ 
     
    3333#       elif defined(__ia64__) 
    3434#         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) */ 
    3553#       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) 
    3756#       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 
    3960#    endif 
    40 #  endif 
     61#endif 
    4162 
    4263#ifdef HAVE_OPENAT 
     
    113134 
    114135/* TODO: use dynamic size cpusets */ 
    115 #ifdef CPU_SET 
     136#ifdef HWLOC_HAVE_CPU_SET 
    116137  cpu_set_t linux_set; 
    117138  unsigned cpu; 
     
    131152 
    132153#ifdef HAVE_OLD_SCHED_SETAFFINITY 
    133   return sched_setaffinity(tid, &mask); 
     154  return sched_setaffinity(tid, (void*) &mask); 
    134155#else /* HAVE_OLD_SCHED_SETAFFINITY */ 
    135   return sched_setaffinity(tid, sizeof(mask), &mask); 
     156  return sched_setaffinity(tid, sizeof(mask), (void*) &mask); 
    136157#endif /* HAVE_OLD_SCHED_SETAFFINITY */ 
    137158#endif /* CPU_SET */ 
     
    167188   */ 
    168189 
    169 #ifdef CPU_SET 
     190#ifdef HWLOC_HAVE_CPU_SET 
    170191  cpu_set_t linux_set; 
    171192  unsigned cpu; 
     
    185206 
    186207#ifdef HAVE_OLD_SCHED_SETAFFINITY 
    187   return pthread_setaffinity_np(tid, &mask); 
     208  return pthread_setaffinity_np(tid, (void*) &mask); 
    188209#else /* HAVE_OLD_SCHED_SETAFFINITY */ 
    189   return pthread_setaffinity_np(tid, sizeof(mask), &mask); 
     210  return pthread_setaffinity_np(tid, sizeof(mask), (void*) &mask); 
    190211#endif /* HAVE_OLD_SCHED_SETAFFINITY */ 
    191212#endif /* CPU_SET */ 
     
    236257 
    237258  fd = hwloc_fopen(mappath, "r", fsroot_fd); 
    238   if (!fd) 
     259  if (!fd) { 
     260    *value = -1; 
    239261    return -1; 
    240  
    241   fgets(string, 11, fd); 
     262  } 
     263 
     264  if (!fgets(string, 11, fd)) { 
     265    *value = -1; 
     266    return -1; 
     267  } 
    242268  *value = strtoul(string, NULL, 10); 
    243269 
     
    324350    return 0; 
    325351 
    326   fgets(cpuset_name, sizeof(cpuset_name), fd); 
     352  tmp = fgets(cpuset_name, sizeof(cpuset_name), fd); 
    327353  fclose(fd); 
     354  if (!tmp) 
     355    return 0; 
    328356 
    329357  tmp = strchr(cpuset_name, '\n'); 
     
    344372    return 0; 
    345373 
    346   fgets(info, infomax, fd); 
     374  tmp = fgets(info, infomax, fd); 
    347375  fclose(fd); 
     376  if (!tmp) 
     377    return 0; 
    348378 
    349379  tmp = strchr(info, '\n'); 
     
    466496 
    467497static void 
    468 hwloc_parse_node_distance(const char *distancepath, unsigned nbnodes, unsigned distances[nbnodes], int fsroot_fd) 
     498hwloc_parse_node_distance(const char *distancepath, unsigned nbnodes, unsigned *distances, int fsroot_fd) 
    469499{ 
    470500  char string[4096]; /* enough for hundreds of nodes */ 
     
    564594      } 
    565595       
    566       hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, distances); 
     596      hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, (unsigned*) distances); 
    567597  } 
    568598} 
     
    780810  char str[strlen(PHYSID)+1+9+1+1]; 
    781811  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]; 
    789818  unsigned procid_max=0; 
    790819  unsigned numprocs=0; 
     
    795824  long processor = -1; 
    796825  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  } 
    797835 
    798836  hwloc_cpuset_zero(online_cpuset); 
     
    846884      getprocnb_end() else 
    847885      getprocnb_begin(COREID,coreid); 
    848       proc_oscoreids[processor]=coreid; 
    849886      for (i=0; i<numcores; i++) 
    850887        if (coreid == oscoreids[i] && proc_osphysids[processor] == core_osphysids[i]) 
     
    861898        if (str[strlen(str)-1]!='\n') 
    862899          { 
    863             fscanf(fd,"%*[^\n]"); 
     900            /* ignore end of line */ 
     901            if (fscanf(fd,"%*[^\n]") == EOF) 
     902              break; 
    864903            getc(fd); 
    865904          } 
     
    877916      proc_osphysids[i] = -1; 
    878917      proc_physids[i] = -1; 
    879       proc_oscoreids[i] = -1; 
    880918      proc_coreids[i] = -1; 
    881919    } 
     
    915953  fd = hwloc_fopen("/sys/class/dmi/id/board_vendor", "r", topology->backend_params.sysfs.root_fd); 
    916954  if (fd) { 
    917     fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd); 
     955    tmp = fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd); 
    918956    fclose (fd); 
    919     if (dmi_line[0] != '\0') { 
     957    if (tmp && dmi_line[0] != '\0') { 
    920958      tmp = strchr(dmi_line, '\n'); 
    921959      if (tmp) 
     
    929967  fd = hwloc_fopen("/sys/class/dmi/id/board_name", "r", topology->backend_params.sysfs.root_fd); 
    930968  if (fd) { 
    931     fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd); 
     969    tmp = fgets(dmi_line, DMI_BOARD_STRINGS_LEN, fd); 
    932970    fclose (fd); 
    933     if (dmi_line[0] != '\0') { 
     971    if (tmp && dmi_line[0] != '\0') { 
    934972      tmp = strchr(dmi_line, '\n'); 
    935973      if (tmp) 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-osf.c

    r5530 r5707  
    221221      } 
    222222    } 
    223     hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, distances); 
     223    hwloc_setup_misc_level_from_distances(topology, nbnodes, nodes, (unsigned*) distances); 
    224224  } 
    225225  radsetdestroy(&radset2); 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-solaris.c

    r5480 r5707  
    149149        for (j = 0; j < curlgrp; j++) 
    150150          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); 
    152152    } 
    153153  } 
     
    197197      if (cpuid > HWLOC_NBMAXCPUS) 
    198198        { 
    199           fprintf(stderr,"CPU id too big: %d\n", cpuid); 
     199          fprintf(stderr,"CPU id too big: %u\n", cpuid); 
    200200          continue; 
    201201        } 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology-synthetic.c

    r5530 r5707  
    1212#include <limits.h> 
    1313#include <assert.h> 
     14#include <strings.h> 
    1415 
    1516/* Read from DESCRIPTION a series of integers describing a symmetrical 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/src/topology.c

    r5530 r5707  
    7272static unsigned 
    7373hwloc_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; 
    7879  unsigned groupid = 0; 
    7980  unsigned i,j,k; 
     
    9394    /* find closest nodes */ 
    9495    for(j=i+1; j<nbobjs; j++) { 
    95       if (distances[i][j] < min_distance) { 
     96      if ((*distances)[i][j] < min_distance) { 
    9697        /* reset the closest set and use new min_distance */ 
    9798        hwloc_cpuset_cpu(closest_objs_set, j); 
    98         min_distance = distances[i][j]; 
     99        min_distance = (*distances)[i][j]; 
    99100        size = 2; /* current objects i and j */ 
    100       } else if (distances[i][j] == min_distance) { 
     101      } else if ((*distances)[i][j] == min_distance) { 
    101102        /* add object to current closest set */ 
    102103        hwloc_cpuset_set(closest_objs_set, j); 
     
    109110        if (hwloc_cpuset_isset(closest_objs_set, j) && 
    110111            hwloc_cpuset_isset(closest_objs_set, k) && 
    111             distances[j][k] != min_distance) { 
     112            (*distances)[j][k] != min_distance) { 
    112113          /* the minimal-distance graph is not complete. abort */ 
    113114          hwloc_debug("found incomplete minimal-distance graph, aborting\n"); 
     
    136137static unsigned 
    137138hwloc_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; 
    142144  unsigned groupid = 0; 
    143145  unsigned i,j,k; 
     
    159161    /* find closest nodes */ 
    160162    for(j=i+1; j<nbobjs; j++) { 
    161       if (distances[i][j] < min_distance) { 
     163      if ((*distances)[i][j] < min_distance) { 
    162164        /* reset the closest set and use new min_distance */ 
    163165        hwloc_cpuset_cpu(closest_objs_set, j); 
    164         min_distance = distances[i][j]; 
     166        min_distance = (*distances)[i][j]; 
    165167        size = 2; /* current objects i and j */ 
    166       } else if (distances[i][j] == min_distance) { 
     168      } else if ((*distances)[i][j] == min_distance) { 
    167169        /* add object to current closest set */ 
    168170        hwloc_cpuset_set(closest_objs_set, j); 
     
    175177      for(j=i+1; j<nbobjs; j++) 
    176178        for(k=j+1; k<nbobjs; k++) 
    177           if (distances[j][k] <= min_distance 
     179          if ((*distances)[j][k] <= min_distance 
    178180              && hwloc_cpuset_isset(closest_objs_set, j) 
    179181              && !hwloc_cpuset_isset(closest_objs_set, k)) { 
     
    208210hwloc__setup_misc_level_from_distances(struct hwloc_topology *topology, 
    209211                                      unsigned nbobjs, 
    210                                       struct hwloc_obj *objs[nbobjs], 
    211                                       unsigned distances[nbobjs][nbobjs], 
     212                                      struct hwloc_obj **objs, 
     213                                      unsigned *_distances, 
    212214                                      int depth) 
    213215{ 
     216  unsigned (*distances)[nbobjs][nbobjs] = (unsigned (*)[nbobjs][nbobjs])_distances; 
    214217  unsigned groupids[nbobjs]; 
    215218  int nbgroups; 
     
    222225    return; 
    223226 
    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); 
    225228  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); 
    227230    if (!nbgroups) 
    228231      return; 
     
    264267      for(i=0; i<nbobjs; i++) 
    265268          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]; 
    267270      for(i=0; i<nbgroups; i++) 
    268271          for(j=0; j<nbgroups; j++) 
     
    277280#endif 
    278281       
    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); 
    280283  } 
    281284} 
     
    287290hwloc_setup_misc_level_from_distances(struct hwloc_topology *topology, 
    288291                                     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; 
    292296  unsigned i,j; 
    293297 
     
    305309    hwloc_debug("%3d", i); 
    306310    for(j=0; j<nbobjs; j++) 
    307       hwloc_debug(" %3d", distances[i][j]); 
     311      hwloc_debug(" %3d", (*distances)[i][j]); 
    308312    hwloc_debug("\n"); 
    309313  } 
     
    314318    for(j=i+1; j<nbobjs; j++) { 
    315319      /* should be symmetric */ 
    316       if (distances[i][j] != distances[j][i]) { 
     320      if ((*distances)[i][j] != (*distances)[j][i]) { 
    317321        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]); 
    319323        return; 
    320324      } 
    321325      /* diagonal is smaller than everything else */ 
    322       if (distances[i][j] <= distances[i][i]) { 
     326      if ((*distances)[i][j] <= (*distances)[i][i]) { 
    323327        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]); 
    325329        return; 
    326330      } 
     
    328332  } 
    329333 
    330   hwloc__setup_misc_level_from_distances(topology, nbobjs, objs, distances, 0); 
     334  hwloc__setup_misc_level_from_distances(topology, nbobjs, objs, _distances, 0); 
    331335} 
    332336 
     
    625629 
    626630  /* 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; 
    628632       child; 
    629        child = next_child, child ? next_child = child->next_sibling : 0) { 
     633       child = next_child, child ? next_child = child->next_sibling : NULL) { 
    630634 
    631635    switch (hwloc_obj_cmp(obj, child)) { 
     
    710714       obj; 
    711715       /* Check whether the current obj was dropped.  */ 
    712        (*pobj == obj ? pobj = &(*pobj)->next_sibling : 0), 
     716       (*pobj == obj ? pobj = &(*pobj)->next_sibling : NULL), 
    713717       /* Get pointer to next object.  */ 
    714718        obj = *pobj) 
     
    13171321  } 
    13181322 
     1323  /* enforce backend anyway if a FORCE variable was given */ 
    13191324#ifdef LINUX_SYS 
    13201325  { 
    1321     char *fsroot_path_env = getenv("HWLOC_FSROOT"); 
     1326    char *fsroot_path_env = getenv("HWLOC_FORCE_FSROOT"); 
    13221327    if (fsroot_path_env) { 
    13231328      hwloc_backend_exit(topology); 
     
    13281333#ifdef HAVE_XML 
    13291334  { 
    1330     char *xmlpath_env = getenv("HWLOC_XMLFILE"); 
     1335    char *xmlpath_env = getenv("HWLOC_FORCE_XMLFILE"); 
    13311336    if (xmlpath_env) { 
    13321337      hwloc_backend_exit(topology); 
     
    13361341#endif 
    13371342 
     1343  /* only apply non-FORCE variables if we have not changed the backend yet */ 
     1344#ifdef LINUX_SYS 
    13381345  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) { 
    13401366#ifdef LINUX_SYS 
    13411367    if (hwloc_backend_sysfs_init(topology, "/") < 0) 
     
    13441370  } 
    13451371 
     1372  /* actual topology discovery */ 
    13461373  hwloc_discover(topology); 
    13471374 
    1348   local_env = getenv("HWLOC_THISSYSTEM"); 
     1375  /* enforce THISSYSTEM if given in a FORCE variable */ 
     1376  local_env = getenv("HWLOC_FORCE_THISSYSTEM"); 
    13491377  if (local_env) 
    13501378    topology->is_thissystem = atoi(local_env); 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/linux-libnuma.c

    r5480 r5707  
    9393 
    9494 
    95   /* convert last node nodemask/bitmask from/to cpuset */ 
     95  /* convert first node nodemask/bitmask from/to cpuset */ 
    9696  node = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NODE, NULL); 
    9797  if (node) { 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/openfabrics-verbs.c

    r5531 r5707  
    99#include <infiniband/verbs.h> 
    1010#include <hwloc.h> 
    11 #include <private/config.h> 
    1211#include <hwloc/openfabrics-verbs.h> 
    1312 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/ports/include/sys/lgrp_user.h

    r5480 r5707  
    4343int lgrp_latency_cookie(lgrp_cookie_t cookie, lgrp_id_t from, lgrp_id_t to, lgrp_lat_between_t between); 
    4444 
    45 int lgrp_fini(); 
     45int lgrp_fini(lgrp_cookie_t cookie); 
    4646 
    4747#endif /* HWLOC_PORT_SYS_LGRP_USER_H */ 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/tests/ports/include/windows.h

    r5480 r5707  
    4242 
    4343WINAPI HINSTANCE LoadLibrary(LPCSTR); 
    44 WINAPI FARPROC GetProcAddress(HINSTANCE, LPCSTR); 
     44WINAPI void *GetProcAddress(HINSTANCE, LPCSTR); 
    4545WINAPI DWORD GetLastError(void); 
    4646 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/Makefile.am

    r5530 r5707  
    55include $(top_srcdir)/Makefile.man-page-rules 
    66 
    7 EXTRA_DIST = lstopo.h hwloc-mask.h test-hwloc-distrib.output 
     7LIBS = $(top_builddir)/src/libhwloc.la 
     8 
     9EXTRA_DIST = test-hwloc-distrib.output 
    810 
    911bin_PROGRAMS = lstopo hwloc-mask hwloc-bind hwloc-distrib 
    1012 
    11 lstopo_SOURCES = lstopo.c lstopo-color.c lstopo-text.c lstopo-draw.c lstopo-fig.c lstopo-cairo.c lstopo-xml.c 
     13lstopo_SOURCES = lstopo.h lstopo.c lstopo-color.c lstopo-text.c lstopo-draw.c lstopo-fig.c 
     14if HAVE_CAIRO 
     15lstopo_SOURCES += lstopo-cairo.c 
     16endif 
     17if HAVE_XML 
     18lstopo_SOURCES += lstopo-xml.c 
     19endif 
    1220if HAVE_WINDOWS 
    1321lstopo_SOURCES += lstopo-windows.c 
     
    1624lstopo_LDADD = $(CAIRO_LIBS) $(XML_LIBS) -lm 
    1725 
    18 LIBS = $(top_builddir)/src/libhwloc.la 
     26hwloc_mask_SOURCES = hwloc-mask.c hwloc-mask.h 
    1927 
    2028if HAVE_MINGW32 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/hwloc-mask.h

    r5480 r5707  
    88 
    99#include <hwloc.h> 
     10#include <private/config.h> 
    1011#include <private/private.h> 
    1112 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/lstopo-draw.c

    r5530 r5707  
    5555 
    5656/* preferred width/height compromise */ 
    57 #define RATIO (4./3.) 
     57#define RATIO (4.f/3.f) 
    5858 
    5959/* do we prefer ratio1 over ratio2? */ 
     
    204204    area = (obj_maxwidth + (separator)) * (obj_maxheight + (separator)) * numsubobjs; \ 
    205205    /* Ideal total height for spreading that area with RATIO */ \ 
    206     idealtotheight = sqrt(area/RATIO); \ 
     206    idealtotheight = sqrtf(area/RATIO); \ 
    207207    /* Underestimated number of rows */ \ 
    208208    rows = idealtotheight / (obj_maxheight + (separator)); \ 
  • mpich2/trunk/src/pm/hydra/tools/bind/hwloc/hwloc/utils/lstopo-text.c

    r5480 r5707  
    3232 
    3333#define indent(output, i) \ 
    34   fprintf (output, "%*s", i, ""); 
     34  fprintf (output, "%*s", (int) i, ""); 
    3535 
    3636/* 
     
    9898      unsigned nbobjs = hwloc_get_nbobjs_by_depth (topology, depth); 
    9999      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", 
    101101               depth, nbobjs, hwloc_obj_type_string (type), nbobjs>1?"s":"", type); 
    102102    }