HWLOC-PS(1) hwloc HWLOC-PS(1)
hwloc-ps - List currently-running processes or threads that are bound
-a list all processes, even those that are not bound to any specific part of the
report OS/physical indexes instead of logical indexes
report logical indexes instead of physical/OS indexes (default)
show process bindings as cpusets instead of objects.
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.
Do not consider administration limitations.
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 dis-
played, 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 pro-
cesses 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:
4759 Core:0 myprogram
If a process is not bound but 3 of his 4 threads are bound, it only appears in the thread-
$ utils/hwloc-ps -t
4759 Machine:0 myprogram
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
hwloc(7), lstopo(1), hwloc-calc(1), hwloc-distrib(1)
1.7 Apr 07, 2013 HWLOC-PS(1)