-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force single-threaded RcppParallel processing in forked parallelization #482
Comments
Forcing single-threaded processing in nested parallel workers is the most conservative approach. We could relax this a bit by looking at the number of threads per core the CPU supports, cf. futureverse/parallelly#47 |
Can also just set environment variable
> RcppParallel::setThreadOptions
function (numThreads = "auto", stackSize = "auto")
{
if (identical(numThreads, "auto"))
numThreads <- -1L
else if (!is.numeric(numThreads))
stop("numThreads must be an integer")
else numThreads <- as.integer(numThreads)
if (identical(stackSize, "auto"))
stackSize <- 0L
else if (!is.numeric(stackSize))
stop("stackSize must be an integer")
else stackSize <- as.integer(stackSize)
if (!is.null(dllInfo) && isUsingTbb())
setTbbThreadOptions(numThreads, stackSize)
if (numThreads == -1L)
Sys.unsetenv("RCPP_PARALLEL_NUM_THREADS")
else Sys.setenv(RCPP_PARALLEL_NUM_THREADS = numThreads)
}
<environment: namespace:RcppParallel> |
Starting by doing it in forked parallel processing when option |
variable 'RCPP_PARALLEL_NUM_THREADS' to 1 if using multicore futures [#482]
https://rcppcore.github.io/RcppParallel/
The text was updated successfully, but these errors were encountered: