I'm running RStudio in a cluster environment (Linux) and have a question about RStudio's threading behaviour. R itself has the number of threads limited to one by default, but RStudio appears to launch several and I haven't yet found a way to control / limit this. I have tried the following commands so far:
export OMP_NUM_THREADS=1 # in the terminal before launching Sys.setenv(OMP_NUM_THREADS="1") # inside RStudio
And the same commands using
None of these affect the number of threads that are running, based on what I see when running
top -H -p (plus the process ID for RStudio). Is there a way to either to define the exact number of threads or to set an upper limit to these?