Usage: hwloc-distrib [options] number
Distribution options:
--ignore <type> Ignore objects of the given type
--from <type> Distribute starting from objects of the given type
--to <type> Distribute down to objects of the given type
--at <type> Distribute among objects of the given type
--reverse Distribute by starting from last objects
Input topology options:
--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
--input <XML file>
-i <XML file> Read topology from XML file <path>
--input <directory>
-i <directory> Read topology from chroot containing the /proc and /sys
of another system
--input <directory>
-i <directory> Read topology from directory containing a CPUID dump
--input "node:2 2"
-i "node:2 2" Simulate a fake hierarchy, here with 2 NUMA nodes of 2
processors
--input-format <format>
--if <format> Enforce input format among xml, fsroot, cpuid, synthetic
Formatting options:
--single Singlify each output to a single CPU
--taskset Show taskset-specific cpuset strings
--cpuset-output-format <hwloc|list|taskset>
--cof <hwloc|list|taskset>
Change the format of cpuset outputs
Miscellaneous options:
-v --verbose Show verbose messages
--version Report version and exit
-h --help Show this usage
Options (19)
| Option | Description | Source |
|---|
--ignore type | Ignore all objects of type <type> in the topology. | help + man |
--from type | Distribute starting from objects of the given type instead of from the top of the topology hierarchy, i.e. ignoring the structure given by objects above. | help + man |
--to type | Distribute down to objects of the given type instead of down to the bottom of the topology hierarchy, i.e. ignoring the structure given by objects below. | help + man |
--at type | Distribute among objects of the given type. | help + man |
--reverse | Distribute by starting with the last objects first, and singlify CPU sets by keeping the last bit (instead of the first bit). | 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 |
-i XML | Read the topology from <path> instead of discovering the topology of the local machine. | help + man |
--input directory | | help |
--input-format format | | help |
--if format | Enforce the input in the given format, among xml, fsroot, cpuid and synthetic. | help + man |
--single | Singlify each output to a single CPU. | help + man |
--taskset | Show taskset-specific cpuset strings | help |
--cpuset-output-format hwloc|list|taskset | Change the format of displayed CPU set strings. | help + man |
--cof hwloc|list|taskset | Change the format of cpuset outputs | help |
-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-distrib 4
0x0000000f
0x00000f00
0x000000f0
0x0000f000
If 4 processes have to be distributed across a machine, their CPU masks may be obtained with:hwloc-distrib --restrict $(hwloc-calc package:1) 4
0x00000010
0x00000020
0x00000040
0x00000080
To distribute only among the second package, the topology should be restricted:hwloc-distrib 4 --single
0x00000001
0x00000100
0x00000010
0x00001000
To get a single processor of each CPU masks (prevent migration in case of binding)hwloc-distrib 4 --single | hwloc-calc --oo -q -I pu
PU:0
PU:8
PU:4
PU:12
Each output line may be converted independently with hwloc-calc:hwloc-distrib 4 --single | xargs hwloc-calc -I pu
0,8,4,16
To convert the output into a list of processors that may be passed to dplace -c inside a mpirun command line:
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.