shtk_hw_ncpus
—
Queries the number of CPUs (threads) in the
machine
The shtk_hw_ncpus
function queries the
number of CPU threads in the machine and prints the total number to
stdout.
If the query fails, or if the function does not know how to get
the number from the current operating system, prints 1.
make -j"$(shtk_hw_ncpus)" all
- SHTK_HW_NCPUS
- If set to a number greater than zero, overrides the return value of
shtk_hw_ncpus
. Generally useful for testing
purposes, but can also be useful to inject greater numbers of parallelism
in applications that do not expose a mechanism to tune such number.
shtk_hw_ncpus
first appeared in
shtk
1.7.