n_cpus: Number of CPU Cores

n_cpusR Documentation

Number of CPU Cores

Description

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()


ecodive documentation built on Aug. 23, 2025, 1:13 a.m.