Skip to contents

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.

Usage

n_cpus()

Value

A scalar integer, guaranteed to be at least 1.

Examples

    n_cpus()
#> [1] 4