ANTsX / ANTsR

R interface to the ANTs biomedical image processing library
https://antsx.github.io/ANTsR
Apache License 2.0
127 stars 35 forks source link

number of threads on cluster #289

Closed ntustison closed 4 years ago

ntustison commented 4 years ago

Hi all,

I'm running an Rscript within a for loop in a bash script. Although I've set the environmental variable export ITK_DEFAULT_GLOBAL_NUMBER_OF_THREADS=1 at the top of the bash script, it appears that the Rscript is invoking all the available threads. Does anybody know if this environmental constraint is something that I also need to include within the Rscript (e.g., via Sys.setenv(...))?

Thanks, Nick

stnava commented 4 years ago

maybe try .Renviron eg this:

> cat ~/.Renviron 
ANTS_RANDOM_SEED=1234
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=8
TMPDIR='/tmp/'
PATH="/usr/lib/rstudio/bin/pandoc:${PATH}"
RETICULATE_PYTHON="/usr/local/bin/python3"
PYTHONPATH="/usr/local/bin/python3"
ntustison commented 4 years ago

Perfect. Thanks.