hwloc/linux: failed to find sysfs cpu topology directory, aborting linux discovery.
Usage: hwloc-bind [topology options] [options] <location> -- command ...
<location> may be a space-separated list of cpusets or objects
as supported by the hwloc-calc utility, e.g:
core:2-3 for the third and fourth cores
node:1.pu:2 the third PU of the second NUMA node
0x12345678 a CPU set given a bitmask string
os=eth0 the operating system device named eth0
pci=0000:01:02.0 the PCI device with the given bus ID
with prefix ~ to remove, ^ for xor and x for intersection
(see Location Specification in hwloc(7) for details).
Input topology options (must be at the beginning):
--no-smt Only keep a single PU per core
--restrict [nodeset=]<bitmap>
Restrict the topology to some processors or NUMA nodes.
--restrict-flags <n> Set the flags to be used during restrict
--disallowed Include objects disallowed by administrative limitations
--hbm Only consider high bandwidth memory nodes
--no-hbm Ignore high-bandwidth memory nodes
Options:
--cpubind Use following arguments for cpu binding (default)
--membind Use following arguments for memory binding
--mempolicy <default|firsttouch|bind|interleave|weighted|nexttouch>
Change policy that --membind applies (default is bind)
--best-memattr <attr>
Select the best target node in the given memory binding
--default-nodes
Keep default memory nodes only
-l --logical Take logical object indexes (default)
-p --physical Take physical object indexes
--single Bind on a single CPU to prevent migration
--strict Require strict binding
--get Retrieve current process binding
-e --get-last-cpu-location
Retrieve the last processors where the current process ran
--nodeset Display (and parse) cpusets as nodesets
--pid <pid> Operate on process <pid>
--tid <tid> Operate on thread <tid>
--cpuset-output-format <hwloc|list|taskset>
--cof <hwloc|list|taskset>
Change the format of cpuset outputs
Miscellaneous options:
-f --force Launch the command even if binding failed
-q --quiet Hide non-fatal error messages
-v --verbose Show verbose messages
--version Report version and exit
-h --help Show this usage
Options (27)
| Option | Description | Source |
|---|---|---|
--no-smt N | Only keep the first PU per core before binding. | help + man |
--restrict nodeset=]<bitmap | Restrict the topology to some processors or NUMA nodes. | help + man |
--restrict-flags n | Enforce flags when restricting the topology. | help + man |
--disallowed | Include objects disallowed by administrative limitations. | help + man |
--hbm | Only take high bandwidth memory nodes (marked with "HBM" subtype, or "MCDRAM" on Intel Xeon Phi) in account when looking for NUMA nodes in the input locations. | help + man |
--no-hbm | Ignore high bandwidth memory nodes (marked with "HBM" subtype, or "MCDRAM" on Intel Xeon Phi MCDRAM) when looking for NUMA nodes in the input locations. | help + man |
--cpubind | Use following arguments for CPU binding (default). | help + man |
--membind | Use following arguments for memory binding. | help + man |
--mempolicy policy | Change policy that --membind applies (default is bind) | help + man |
--best-memattr attr | Select the best NUMA node(s) among the given memory binding set by looking at the memory attribute given by <name> (or as an index). | help + man |
--default-nodes | Keep default memory nodes only | help |
-l --logical | Interpret input locations with logical indexes instead of physical/OS indexes (default). | help + man |
-p --physical | Interpret input locations with OS/physical indexes instead of logical indexes. | help + man |
--single | Bind on a single CPU to prevent migration. | help + man |
--strict | Require strict binding. | help + man |
--get | Retrieve current process binding | help + man |
-e --get-last-cpu-location | Retrieve the last processors where the current process ran | help + man |
--nodeset | Report binding as a NUMA memory node set instead of a CPU set if --get was given. | help + man |
--pid pid | Operate on process <pid> | help + man |
--tid tid | Operate on thread <tid> instead of on an entire process. | help + man |
--cpuset-output-format hwloc|list|taskset | Change the format of CPUset or nodeset strings displayed by --get, -e, etc. | help + man |
--cof hwloc|list|taskset | Change the format of cpuset outputs | help |
-f --force | Launch the executable even if binding failed. | help + man |
-q --quiet | Hide non-fatal error messages. | help + man |
-v --verbose | Show verbose messages | help + man |
--version | Report version and exit. | help + man |
-h --help | Display help message and exit. | help + man |
Examples (5) from the manual page, untested
hwloc-bind package:1.pu:0 -- echo hello
To run the echo command on the first logical processor of the second package:hwloc-bind package:1.pu:0 echo hello
which is exactly equivalent to the following line as long as there is no ambiguity between hwloc-bind option names and the executed command name:hwloc-bind package:1.core:0 package:0.core:1 -- echo hello
To bind the "echo" command to the first core of the second package and the second core of the first package:hwloc-bind package:0.core:all.pu:0 -- echo hello $ hwloc-bind --no-smt package:0 -- echo hello
To bind on the first PU of all cores of the first package:hwloc-bind node:1.package:2 -- hwloc-bind --get 0x00004444,0x44000000
The --get option can report current bindings.