Detect the number of CPU cores
Arguments
- cores
Requested number of workers. Only used when
num_sessionis supplied; invalid values fall back to1.- num_session
Number of tasks that can be scheduled concurrently. When supplied, the result is the usable worker count: the detected cores minus one reserved for the parent, capped by
coresandnum_session.- max_threads
Optional upper bound for the detected core count, e.g. the largest worker count a kernel can use.
NULLleaves the detected value as is.- logical
Whether to report logical (hyper-threaded) cores, as
parallel::detectCores()does.