nc: nc: Function to check the number of available cores

View source: R/nc.R

ncR Documentation

nc: Function to check the number of available cores

Description

nc is a helper function to check if the number of cores required to run a parallel process is less or equal to the total number of cores of the system.

Usage

nc(ncores)

Arguments

ncores

Number of cores for the parallel process.

Details

If ncores is bigger than the system's number of cores the function will return the system's number of cores. The functions that use this helper are mop and pROC.

Value

Returns an integer representing the number of cores that will be used to run a parallel process.

Examples

# Print the number of cores
print(nc(ncores=8))

luismurao/ntbox documentation built on Nov. 22, 2024, 4 a.m.