revdepcheck
revdepcheck copied to clipboard
Set OMP_THREAD_LIMIT to 1 in check workers
Otherwise packages such as xgboost will happily use all CPUs available.
https://www.ibm.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.aix.doc/compiler_ref/omp_thread_limit.html
Yeah, although shouldn't the package itself set this?
... or possibly set it to OMP_THREAD_LIMIT=2
to make sure to test multi-threading actually works. Two parallel tasks is what the CRAN policy allows. It could be conditionally set based on _R_CHECK_LIMIT_CORES_=true
set by R CMD check
.
PS. I agree that the packages should do this themselves, and one could argue that R CMD check
c/should do it automatically (as I think it should also do with MC_CORES
) to prevent damage, but having revdepcheck
add this protection by default would be helpful.
You can also just set this before starting the check, env vars are inherited.
I think this would be reasonable to set in revdep_env_vars()