On Wed, 1 Jul 2020 21:03:09 -0600
Jerry James <loganjerry(a)gmail.com> wrote:
On Wed, Jul 1, 2020 at 12:06 PM Susi Lehtola
<jussilehtola(a)fedoraproject.org> wrote:
> On Wed, 1 Jul 2020 10:54:16 -0600
> Jerry James <loganjerry(a)gmail.com> wrote:
> > openblas-serial: use if the application is multithreaded
> > openblas-threads: use if the application is single-threaded
>
> No, this is exactly the wrong way around. You should use the serial
> library for code that you want to be running in serial (this way you
> can get several instances of the program running efficiently), and
> the pthreads version if you want to run the BLAS/LAPACK regions in
> parallel (but are somehow opposed to OpenMP!)..
Okay, I think the wiki's wording is hard to understand
(
https://github.com/xianyi/OpenBLAS/wiki/faq#multi-threaded), at least
for me. Let me see if I've got this straight.
1. openblas-opemp computes on subranges in parallel using OpenMP
2. openblas-threads computes on subranges in parallel using pthreads
3. openblas-serial uses a single thread for the entire computation
Right?
Exactly. But the key bit here is that if openblas-openmp is called
within a code segment that is already OpenMP parallel, then OpenBLAS
does not parallellize further: if you have 8 cores, and the program is
running on 8 threads, further parallellism (going to 8*8=64 threads)
would just ruin the performance.
What I'm looking for is a set of rules I can apply when I've
got a
package that uses BLAS, but upstream has given no guidance on what
kind of BLAS library is suitable. I've got several of those, so I
want to check that they're linking with the best version of the
library. How should I make that determination? Also, how do I know
whether to use, say, openblas-openmp vs. openblas-openmp64 vs.
openblas-openmp64_?
openblas-openmp is generally the safe choice. As for the latter
question, it depends on whether you compile your code with 4-bit or
8-bit integers.
--
Susi Lehtola
Fedora Project Contributor
jussilehtola(a)fedoraproject.org