[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: R, openBlas and max thread?
From: |
Eric Bavier |
Subject: |
Re: R, openBlas and max thread? |
Date: |
Tue, 19 Feb 2019 22:18:58 -0600 |
On Mon, 18 Feb 2019 16:12:41 +0100
zimoun <address@hidden> 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
pgpJxQISn0JDa.pgp
Description: OpenPGP digital signature