[Rd] Multiple cores are used in simple for loop

Henrik Bengtsson henrik.bengtsson at gmail.com
Fri Jan 15 20:38:44 CET 2016


On Fri, Jan 15, 2016 at 10:15 AM, Daniel Kaschek
<daniel.kaschek at physik.uni-freiburg.de> wrote:
> Dear Martyn,
>
>
> On Fr, Jan 15, 2016 at 4:01 , Martyn Plummer <plummerm at iarc.fr> wrote:
>>
>>
>> Alternatively, you may be able to control the maximum number of threads
>> by setting and exporting an appropriate environment variable depending
>> on what backend you are using, e.g. OPENBLAS_NUM_THREADS or
>> MKL_NUM_THREADS.
>
>
>
> Thanks a lot. Running
>
> export OPENBLAS_NUM_THREADS = 1
>
> in the bash before starting R solves both problems!

I don't have builds so I can try myself, but as an alternative, is it
possible to set this environment variable in ~/.Renviron, or is that
too late in the R startup process?  What about
Sys.setenv(OPENBLAS_NUM_THREADS=1) in ~/.Rprofile?

/Henrik

>
>
>
> Cheers,
> Daniel
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list