Introduction

The Hardware Locality (hwloc) software project aims at easing the process of discovering hardware resources in parallel architectures. It offers command-line tools and a C API for consulting these resources, their locality, attributes, and interconnection. hwloc primarily aims at helping high-performance computing (HPC) applications, but is also applicable to any project seeking to exploit code and/or data locality on modern computing platforms. hwloc is actually made of two subprojects distributed together: * The original hwloc project for describing the internals of computing nodes. It is described in details between sections Hardware Locality (hwloc) Introduction and Network Locality (netloc) Introduction. * The network-oriented companion called netloc (Network Locality), described in details starting at section Network Locality (netloc) Introduction. Netloc may be disabled, but the original hwloc cannot. Both hwloc and netloc APIs are documented after these sections.

Installation

# yum install hwloc

======================================================================
 Package                     Arch       Version     Repository   Size
======================================================================
Installing:
 hwloc                       x86_64     1.7-5.el7    sl         115 k
Installing for dependencies:
 hwloc-libs                 x86_64     1.7-5.el7    sl         1.3 M

Transaction Summary
====================================================================
Install  1 Package (+1 Dependent package)

Total download size: 1.5 M
Installed size: 2.0 M
Is this ok [y/d/N]: y

Installed:
  hwloc.x86_64 0:1.7-5.el7

Dependency Installed:
  hwloc-libs.x86_64 0:1.7-5.el7

 Display hardware info

# lstopo-no-graphics 
Machine (32GB)
  NUMANode L#0 (P#0 16GB)
    Socket L#0 + L3 L#0 (6144KB)
      L2 L#0 (512KB) + L1d L#0 (64KB) + L1i L#0 (64KB) + Core L#0 + PU L#0 (P#0)
      L2 L#1 (512KB) + L1d L#1 (64KB) + L1i L#1 (64KB) + Core L#1 + PU L#1 (P#1)
      L2 L#2 (512KB) + L1d L#2 (64KB) + L1i L#2 (64KB) + Core L#2 + PU L#2 (P#2)
      L2 L#3 (512KB) + L1d L#3 (64KB) + L1i L#3 (64KB) + Core L#3 + PU L#3 (P#3)
      L2 L#4 (512KB) + L1d L#4 (64KB) + L1i L#4 (64KB) + Core L#4 + PU L#4 (P#4)
      L2 L#5 (512KB) + L1d L#5 (64KB) + L1i L#5 (64KB) + Core L#5 + PU L#5 (P#5)
    HostBridge L#0
      PCIBridge
        PCI 1a03:2000
          GPU L#0 "card0"
          GPU L#1 "controlD64"
      PCIBridge
        PCI 1000:0058
          Block L#2 "sda"
          Block L#3 "sdb"
          Block L#4 "sdc"
          Block L#5 "sdd"
          Block L#6 "sde"
          Block L#7 "sdf"
          Block L#8 "sdg"
          Block L#9 "sdh"
      PCIBridge
        PCI 1000:0058
          Block L#10 "sdi"
          Block L#11 "sdj"
          Block L#12 "sdk"
          Block L#13 "sdl"
          Block L#14 "sdm"
          Block L#15 "sdn"
          Block L#16 "sdo"
          Block L#17 "sdp"
      PCIBridge
        PCI 1000:0058
          Block L#18 "sdq"
          Block L#19 "sdr"
          Block L#20 "sds"
          Block L#21 "sdt"
          Block L#22 "sdv"
          Block L#23 "sdw"
          Block L#24 "sdx"
          Block L#25 "sdaw"
  NUMANode L#1 (P#1 16GB)
    Socket L#1 + L3 L#1 (6144KB)
      L2 L#6 (512KB) + L1d L#6 (64KB) + L1i L#6 (64KB) + Core L#6 + PU L#6 (P#6)
      L2 L#7 (512KB) + L1d L#7 (64KB) + L1i L#7 (64KB) + Core L#7 + PU L#7 (P#7)
      L2 L#8 (512KB) + L1d L#8 (64KB) + L1i L#8 (64KB) + Core L#8 + PU L#8 (P#8)
      L2 L#9 (512KB) + L1d L#9 (64KB) + L1i L#9 (64KB) + Core L#9 + PU L#9 (P#9)
      L2 L#10 (512KB) + L1d L#10 (64KB) + L1i L#10 (64KB) + Core L#10 + PU L#10 (P#10)
      L2 L#11 (512KB) + L1d L#11 (64KB) + L1i L#11 (64KB) + Core L#11 + PU L#11 (P#11)
    HostBridge L#5
      PCIBridge
        PCI 1000:0058
          Block L#26 "sdy"
          Block L#27 "sdz"
          Block L#28 "sdaa"
          Block L#29 "sdab"
          Block L#30 "sdac"
          Block L#31 "sdad"
          Block L#32 "sdae"
          Block L#33 "sdaf"
      PCIBridge
        PCI 1000:0058
          Block L#34 "sdag"
          Block L#35 "sdah"
          Block L#36 "sdai"
          Block L#37 "sdaj"
          Block L#38 "sdak"
          Block L#39 "sdal"
          Block L#40 "sdam"
          Block L#41 "sdan"
      PCIBridge
        PCI 1000:0058
          Block L#42 "sdao"
          Block L#43 "sdap"
          Block L#44 "sdaq"
          Block L#45 "sdar"
          Block L#46 "sdas"
          Block L#47 "sdat"
          Block L#48 "sdau"
          Block L#49 "sdav"

General hardware info

Show some information about some objects or about a topology

# /usr/bin/hwloc-info
depth 0:    1 Machine (type #1)
 depth 1:    2 NUMANode (type #2)
  depth 2:    2 Socket (type #3)
   depth 3:    2 L3Cache (type #4)
    depth 4:    12 L2Cache (type #4)
     depth 5:    12 L1dCache (type #4)
      depth 6:    12 L1iCache (type #4)
       depth 7:    12 Core (type #5)
        depth 8:    12 PU (type #6)
Special depth -3:    9 Bridge (type #9)
Special depth -4:    7 PCI Device (type #10)
Special depth -5:    50 OS Device (type #11)