Calling setThreadOptions() (i.e. with numThreads = "auto") should call Sys.unsetenv("RCPP_PARALLEL_NUM_THREADS"), otherwise, the following happens:
Sys.getenv("RCPP_PARALLEL_NUM_THREADS")
[1] ""
setThreadOptions(2)
Sys.getenv("RCPP_PARALLEL_NUM_THREADS")
[1] "2"
setThreadOptions()
Sys.getenv("RCPP_PARALLEL_NUM_THREADS")
[1] "2"
If the internal code always reads this variable, "auto" will not have the intended effect after reset.
Calling
setThreadOptions()(i.e. withnumThreads = "auto") should callSys.unsetenv("RCPP_PARALLEL_NUM_THREADS"), otherwise, the following happens:If the internal code always reads this variable,
"auto"will not have the intended effect after reset.