setRcppMLthreads: Set the number of threads RcppML should use

Description Usage Arguments Details Author(s) See Also Examples

View source: R/threads.R

Description

The number of threads is 0 by default (corresponding to all available threads), but can be set manually using this function. If you clear environment variables or affect the "RcppMLthreads" environment variable specifically, you will need to set your number of preferred threads again.

Usage

1

Arguments

threads

number of threads to be used in RcppML functions that are parallelized with OpenMP.

Details

The number of threads set affects OpenMP parallelization only for functions in the RcppML package. It does not affect other R packages that use OpenMP. Parallelization is used for projection of linear factor models with rank > 2, calculation of mean squared error for linear factor models, and for divisive clustering.

Author(s)

Zach DeBruine

See Also

getRcppMLthreads

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# set serial configuration
setRcppMLthreads(1)
getRcppMLthreads()

# restore default parallel configuration, 
# letting OpenMP decide how many threads to use
setRcppMLthreads(0)
getRcppMLthreads()

## End(Not run)

RcppML documentation built on Sept. 22, 2021, 1:06 a.m.