OnWorks favicon

hwloc-ps - Online in the Cloud

Run hwloc-ps in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command hwloc-ps that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator



hwloc-ps - List currently-running processes or threads that are bound


hwloc-ps [options]


-a list all processes, even those that are not bound to any specific part of the

-p --physical
report OS/physical indexes instead of logical indexes

-l --logical
report logical indexes instead of physical/OS indexes (default)

-c --cpuset
show process bindings as cpusets instead of objects.

-t --threads
show threads inside processes. If -a is given as well, list all threads within
each process. Otherwise, show all threads inside each process where at least
one thread is bound.

-e --get-last-cpu-location
Report the last processors where the process/thread ran. Note that the result
may already be outdated when reported since the operating system may move the
tasks to other processors at any time according to the binding.

Do not consider administration limitations.

--pid-cmd <cmd>
Append the output of the given command to each PID line. For each displayed
process ID, execute the command <cmd> <pid> and append the first line of its
output to the regular hwloc-ps line.


By default, hwloc-ps lists only those currently-running processes that are bound. If -t is
given, processes that are not bound but contain at least one bound thread are also
displayed, as well as all their threads.

hwloc-ps displays process identifier, command-line and binding. The binding may be
reported as objects or cpusets.

By default, process bindings are restricted to the currently available topology. If some
processes are bound to processors that are not available to the current process, they are
ignored unless --whole-system is given.

The output is a plain list. If you wish to annotate the hierarchical topology with
processes so as to see how they are actual distributed on the machine, you might want to
use lstopo --ps instead (which also only shows processes that are bound).

The -a switch can be used to show all processes, if desired.


If a process is bound, it appears in the default output:

$ utils/hwloc-ps
4759 Core:0 myprogram

If a process is not bound but 3 of his 4 threads are bound, it only appears in the thread-
aware output:

$ utils/hwloc-ps

$ utils/hwloc-ps -t
4759 Machine:0 myprogram
4759 Machine:0
4761 PU:0
4762 PU:2
4765 PU:1

To display the binding of already running MPI processes (launched by Open MPI) and append
their MPI rank (in MPI_COMM_WORLD) to each line:

$ utils/hwloc-ps --pid-cmd myscript
29093 L1dCache:0 myprogram OMPI_COMM_WORLD_RANK=0
29094 L1dCache:2 myprogram OMPI_COMM_WORLD_RANK=1
29095 L1dCache:1 myprogram OMPI_COMM_WORLD_RANK=2
29096 L1dCache:3 myprogram OMPI_COMM_WORLD_RANK=3

where myscript is a bash script doing:

cat /proc/$1/environ 2>/dev/null | xargs --null --max-args=1 echo | grep

Use hwloc-ps online using onworks.net services

Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Code::Blocks is a free, open-source,
    cross-platform C, C++ and Fortran IDE
    built to meet the most demanding needs
    of its users. It is designed to be very
    Download Code::Blocks
  • 2
    Amidst or Advanced Minecraft Interface
    and Data/Structure Tracking is a tool to
    display an overview of a Minecraft
    world, without actually creating it. It
    can ...
    Download Amidst
  • 3
    MSYS2 is a collection of tools and
    libraries providing you with an
    easy-to-use environment for building,
    installing and running native Windows
    software. It con...
    Download MSYS2
  • 4
    libjpeg-turbo is a JPEG image codec
    that uses SIMD instructions (MMX, SSE2,
    NEON, AltiVec) to accelerate baseline
    JPEG compression and decompression on
    x86, x8...
    Download libjpeg-turbo
  • 5
    Xtreme Download Manager
    Xtreme Download Manager
    The project has a new home now:
    https://xtremedownloadmanager.com/ For
    https://github.com/subhra74/xdm Xtreme
    Download Manager is a powerful tool t...
    Download Xtreme Download Manager
  • 6
    TTGO VGA32 Lite
    TTGO VGA32 Lite
    Features:4:3 and 16:9 low resolution
    VGA outputPS/2 keyboard and mouse
    inputText-based user interface (TUI)
    with dialog managerPartial Unicode
    supportSlave dis...
    Download TTGO VGA32 Lite
  • More »

Linux commands