Set or report the number of cores to be used for multi-threaded operations. A wrapper for the RcppParallel function setThreadOptions (Allaire et al. 2019).
integer number of threads to use
other arguments passed to
ncores is NULL then the current value of the environment variable RCPP_PARALLEL_NUM_THREADS is used. RCPP_PARALLEL_NUM_THREADS defaults to 2 at the start of a session (assuming at least 2 logical cores available).
setNumThreads() with no arguments is a handy way to check how many threads are in use.
The value of RCPP_PARALLEL_NUM_THREADS is also reset when a multi-threaded function such as
secr.fit is called with a non-NULL value of the ncores argument. This value applies in later calls of
ncores = NULL until changed.
The new value of the environment variable RCPP_PARALLEL_NUM_THREADS.
The mechanism for setting the number of threads changed between versions 4.1.0 and 4.2.0. The default number of cores is now capped at 2 to meet CRAN requirements. Setting
ncores = NULL previously specified one less than the number of available cores.
Allaire, J. J., Francois, R., Ushey, K., Vandenbrouck, G., Geelnard, M. and Intel (2019) RcppParallel: Parallel Programming Tools for 'Rcpp'. R package version 4.4.4. https://CRAN.R-project.org/package=RcppParallel.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.