Skip to contents

[Deprecated] use parallelly::availableCores(omit = 1) instead

Usage

free_cores()

Value

The approximate number of free cores, which is an integer between 1 and one less than the total cores.

Details

  • This uses the maximum load average at 1, 5 and 15 minutes on Linux and Mac machines to approximate the number of busy cores. For Windows, the load percentage is multiplied with the total number of cores.

  • We then subtract this from the number of all detected cores. One additional core is not used for extra safety.

Note

If executed during a unit test and on CRAN then always returns 1 to avoid any parallelization.