Skip to content

Could you elaborate on the combination of OpenBLAS with multi-threading? #2543

Open
@nh2

Description

@nh2

https://github.com/xianyi/OpenBLAS/wiki/Faq/4bded95e8dc8aadc70ce65267d1093ca7bdefc4c#multi-threaded says:

If your application is already multi-threaded, it will conflict with OpenBLAS multi-threading. Thus, you must set OpenBLAS to use single thread as following ...

That is good to know, but it is very unspecific.

To aid people debugging problems, could you elaborate a bit on that? What does "will conflict" mean exactly here? How do things break? What are the fundamental technical reasons?


Also, many Linux distributions ship OpenBLAS with OpenMP enabled. And then bindings from other, programming languages that have their own built-in threading which is not based on OpenMP (Haskell, Go, etc) use the distribution-provided packages, often without setting OPENBLAS_NUM_THREADS=1 or openblas_set_num_threads(1).

In my understanding, this violates what's stated in https://github.com/xianyi/OpenBLAS/wiki/faq#multi-threaded and is thus unsafe. Can you, as a general guideline, confirm whether languages with built-in threading must address this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions