We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 57d5a6f + 17481c6 commit 3bf1b0dCopy full SHA for 3bf1b0d
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