We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57d5a6f commit 17481c6Copy full SHA for 17481c6
R/hooks.R
@@ -26,7 +26,12 @@ mallocDllInfo <- NULL
26
library.dynam("RcppParallel", pkgname, libname)
27
28
# set default thread options
29
- setThreadOptions()
+ numThreads <- "auto"
30
+ numThreadsEnv <- Sys.getenv("RCPP_PARALLEL_NUM_THREADS", unset = NA)
31
+ if (!is.na(numThreadsEnv))
32
+ setThreadOptions(numThreads = as.integer(numThreadsEnv))
33
+ else
34
+ setThreadOptions(numThreads = "auto")
35
}
36
37
.onUnload <- function(libpath) {
0 commit comments