Skip to content

Mixing OpenMP with other threading paradigms #4332

Answered by martin-frbg
gkaf89 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes this can/should both be enabled and USE_THREAD is on by default when you have more than one core in the build system. On many/most platforms, OpenMP is implemented on top of pthreads anyway.
Only use USE_THREAD=0 (on its own) when you want an OpenBLAS that does not use any form of multithreading at all (which can make sense if you have a big multithreaded program that makes many parallel calls to BLAS functions).
The directive you quoted is basically "if we are using multithreading, or expect to be called by multiple threads from outside, and we do not have OpenMP manage the locking for thread-safe concurrent accesses"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gkaf89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants