A thin wrapper around
parallel::detectCores(all.tests = TRUE, logical = TRUE)
which falls back
to 1
when the number of CPU cores cannot be detected, or when the system
does not support pthreads
. Consider using parallely::availableCores()
in place of n_cpus()
for more advanced interrogation of system resources.