![]() |
![]()
| ![]() |
![]()
NAMEhwloc-calc - Operate on cpu mask strings and objects SYNOPSIShwloc-calc [options] <location1> [<location2> [...] ] Note that hwloc(7) provides a detailed explanation of the hwloc system and of valid <location> formats; it should be read before reading this man page. OPTIONS
DESCRIPTIONhwloc-calc generates and manipulates CPU mask strings or objects. Both input and output may be either objects (with physical or logical indexes), CPU lists (with physical or logical indexes), or CPU mask strings (always physically indexed). If objects or CPU mask strings are given on the command-line, they are combined and a single output is printed. If no object or CPU mask strings are given on the command-line, the program will read the standard input. It will combine multiple objects or CPU mask strings that are given on the same line of the standard input line with spaces as separators. Different input lines will be processed separately. Command-line arguments and options are processed in order. For instance, it means that changing the type of input indexes with --li or changing the input topology with -i only affects the processing the following arguments. NOTE: hwloc-calc cannot manipulate NUMA memory node sets. It only manipulates CPU sets, which means it cannot do much about CPU-less NUMA nodes. NOTE: It is highly recommended that you read the hwloc(7) overview page before reading this man page. Most of the concepts described in hwloc(7) directly apply to the hwloc-calc utility. EXAMPLEShwloc-calc's operation is best described through several examples. To display the (physical) CPU mask corresponding to the second package:
To display the (physical) CPU mask corresponding to the third pacakge, excluding its even numbered logical processors:
To combine two (physical) CPU masks:
To display the list of logical numbers of processors included in the second package:
To bind GNU OpenMP threads logically over the whole machine, we need to use physical number output instead:
To display the list of NUMA nodes, by physical indexes, that intersect a given (physical) CPU mask:
To display the physical index of a processor given by its logical index:
To display the set of CPUs near network interface eth0:
To display the indexes of packages near PCI device whose bus ID is 0000:01:02.0:
To display the list of per-package cores that intersect the input:
To display the (physical) CPU mask of the entire topology except the third package:
To combine both physical and logical indexes as input:
To synthetize a set of cores into largest objects on a 2-node 2-package 2-core machine:
To get the set of first threads of all cores:
This can also be very useful in order to make GNU OpenMP use exactly one thread per core, and in logical core order:
RETURN VALUEUpon successful execution, hwloc-calc displays the (physical) CPU mask string, (physical or logical) object list, or (physical or logical) object number list. The return value is 0. hwloc-calc will return nonzero if any kind of error occurs, such as (but not limited to): failure to parse the command line. SEE ALSOhwloc(7), lstopo(1), hwloc-info(1), hwloc-gather-topology(1)
|