Learn R Programming

population (version 0.3)

get_cores: Get number of available cores

Description

Get number of available cores for parallel simulations. Non-Windows systems only.

Usage

get_cores(runs)

Arguments

runs

Number of times (or Monte Carlo runs) to repeat the simulation.

Value

get_cores()

Details

This function detects the number of cores (see 'detectCores' in package 'parallel') available and returns the largest possible number of cores being an integer divider of the number of runs. On multi-core machines at least one core is not used for the simulation.

Examples

Run this code
# NOT RUN {
get_cores(2)
get_cores(1000)
# }

Run the code above in your browser using DataLab