unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* R, openBlas and max thread?
@ 2019-02-18 15:12 zimoun
  2019-02-20  4:18 ` Eric Bavier
  0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2019-02-18 15:12 UTC (permalink / raw)
  To: help-guix

Dear,

I am not sure to understand if it is expected or not.

Let install R, guix package -i r, and then run the small script:

> N <- 9000;A <- array(0.1, dim=c(N,N));B <- array(0.1, dim=c(N,N))
> dim(B %*% A)

Monitoring with htop, only 8 of my 16 cores are used. Why ?
And if I have more, then again only 8 cores will be used.

Is it from OpenBlas?
I miss the compilation option forcing this behaviour. I expect that R
will use as many core as available. Right?


Thank you for any insight.

All the best,
simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: R, openBlas and max thread?
  2019-02-18 15:12 R, openBlas and max thread? zimoun
@ 2019-02-20  4:18 ` Eric Bavier
  2019-02-22 15:11   ` zimoun
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Bavier @ 2019-02-20  4:18 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

On Mon, 18 Feb 2019 16:12:41 +0100
zimoun <zimon.toutoune@gmail.com> wrote:

> Dear,
> 
> I am not sure to understand if it is expected or not.
> 
> Let install R, guix package -i r, and then run the small script:
> 
> > N <- 9000;A <- array(0.1, dim=c(N,N));B <- array(0.1, dim=c(N,N))
> > dim(B %*% A)  
> 
> Monitoring with htop, only 8 of my 16 cores are used. Why ?
> And if I have more, then again only 8 cores will be used.

OpenBLAS will use as many threads as the OpenMP runtime will give it,
which is by default one per CPU.  I think this default does not take
into account hyperthreads, which htop shows as a separate "cpu".

You can set the "OMP_NUM_THREADS" environment variable and OpenBLAS
should pick it up.  I don't know whether R does anything for setting
OpenMP runtime settings.

Hope that helps,
`~Eric

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: R, openBlas and max thread?
  2019-02-20  4:18 ` Eric Bavier
@ 2019-02-22 15:11   ` zimoun
  0 siblings, 0 replies; 3+ messages in thread
From: zimoun @ 2019-02-22 15:11 UTC (permalink / raw)
  To: Eric Bavier; +Cc: help-guix

Dear Eric,

Thank you for your answer.


On Wed, 20 Feb 2019 at 05:19, Eric Bavier <ericbavier@centurylink.net> wrote:

> OpenBLAS will use as many threads as the OpenMP runtime will give it,
> which is by default one per CPU.  I think this default does not take
> into account hyperthreads, which htop shows as a separate "cpu".

Yes for sure, htop shows hyperthreads number of CPU. :-)
Maybe I have wrong, but if hyperthread is activated, then why not use
it by default.
In other words, OpenMP should be set by default at "hyperthread CPU"
and not "physical CPU". I think Debian is doing that for example.

What do you think ?


> You can set the "OMP_NUM_THREADS" environment variable and OpenBLAS
> should pick it up.  I don't know whether R does anything for setting
> OpenMP runtime settings.

I do not know neither.
Hum? R does not seems to use OMP_NUM_THREADS. I do not know.


All the best,
simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-22 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-18 15:12 R, openBlas and max thread? zimoun
2019-02-20  4:18 ` Eric Bavier
2019-02-22 15:11   ` zimoun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).