getHW3threads() returns the current thread count.
setHW3threads() sets it and returns the new value.
Details
The default is 50 percent of available cores, which can be overridden by the
environment variable R_HEATWAVE3_NUM_THREADS. Without that variable,
the default is at most 2 when _R_CHECK_LIMIT_CORES_ is set (as by
R CMD check --as-cran) and at most OMP_THREAD_LIMIT when that
is set. The per-function
n_threads parameter, when greater than zero, takes precedence
over the package-level setting for that call.
