In Rstudio, at R prompt,
system("env | grep SLURM") should get a list of env variables (if launched as a slurm job others as appropriate) from the host. I am running this in a Singularity container on a Centos Linux machine based off the Rocker Rstudio images. I have tested this in R 3.5.1 up to 4.0.0 using whatever Rstudio tracks with each of these images.
singularity exec container.sif R (or hit bash prompt) and then look for the env variables, all show up. If however, I fire up Rstudio,
singularity exec container.sif rserver ...auth stuff and then do above command, no env variables are seen. Same thing with the Rstudio terminal, the terminal does not see the env variables.
Using any of the math libraries such as LAPACK, OpenBLAS, MKL, etc should pick up settings from the host. Same thing for the parallel libraries, they should get settings for cores assigned, etc.
Is there a way to change this behavior?