Learn R Programming

R2sample (version 5.0.0)

use_parallel: Determine whether parallel processing should be used

Description

Determines whether a computation is expected to take long enough to benefit from parallel processing. If the estimated computation time is below the specified threshold, a single processor is returned. Otherwise, the requested number of processors is returned.

Usage

use_parallel(tm, nparam, B, maxProcessor, threshold = 20)

Value

An integer giving the number of processors to use.

Arguments

tm

Estimated time, in seconds, for one computation.

nparam

Number of parameter values to be processed.

B

Number of simulation runs.

maxProcessor

Maximum number of processors requested.

threshold

Minimum estimated computation time, in seconds, for parallel processing to be used. The default is 20.