Skip to content
Prev 2588 / 3656 Next

R, OpenBLAS and OMP_NUM_THREADS

On 04/08/16 06:39, Ei-ji Nakama wrote:
Yes, that looks a bit better, allowing it to be overridden by
environment variables.

The other thing that occurred to me was whether this setting would be
inherited by child R processes (otherwise you'd get a massive thread
explosion when running something intentionally parallel), but it looks
like at least the builtin `parallel` library does retain the BLAS
settings of the parent (presumably since it uses `fork()`).

It is maybe still worth setting `Sys.setenv(OPENBLAS_NUM_THREADS=1)`
along with the `blas_set_num_threads(1)` call in case there are any
multicore libraries for which this doesn't apply.


(Also, it hadn't occurred to me earlier but I realise you're the author
of RhpcBLASctl - appreciate it)


Gordon