SHTK_HW_CPUS(3)

NAME
shtk_hw_ncpus - Queries the number of CPUs (threads) in the machine

LIBRARY
shtk_import hw

SYNOPSIS
shtk_hw_ncpus

DESCRIPTION
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.

RETURN VALUES
shtk_hw_ncpus returns 0.

EXAMPLES

    make -j"$(shtk_hw_ncpus)" all

ENVIRONMENT

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.

SEE ALSO
shtk(3), shtk_hw(3)

HISTORY
shtk_hw_ncpus first appeared in shtk 1.7.