From henrik.bengtsson at gmail.com  Fri Jan 15 20:38:44 2016
From: henrik.bengtsson at gmail.com (Henrik Bengtsson)
Date: Fri, 15 Jan 2016 11:38:44 -0800
Subject: [Rd] Multiple cores are used in simple for loop
In-Reply-To: <1452881746.6790.5@physik.uni-freiburg.de>
References: <1452866620.6790.3@physik.uni-freiburg.de>
	<1452870046.30832.109.camel@iarc.fr>
	<1452881746.6790.5@physik.uni-freiburg.de>
Message-ID: <CAFDcVCRLjHzopwjVBP8=ye1e1B1M0eqLB5tn0JM_d7QGvb8njA@mail.gmail.com>

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



[Rd] Multiple cores are used in simple for loop
Henrik Bengtsson