On Thu, 28 May 2020 at 10:04, Susi Lehtola jussilehtola@fedoraproject.org wrote:
The correct case is to use the OpenMP flavor of OpenBLAS to avoid these issues. If you use the OpenMP library in a sequential program, the BLAS runs in parallel, and if you use the OpenMP library in an OpenMP parallel program the BLAS runs either sequentally (within already-parallel regions) or in parallel (within sequential regions).
The problem arised in a threaded algorithm. Reference BLAS, as well as serial MKL and Atlas are thread-safe. I did recommend openblas-openmp to the user that reported the issue with an R package, but not everybody knows or understands why there are so many versions.
So it's clear that things are failing out there, and USE_LOCKING=1 is a sensible default that we should apply. I didn't find though what's the performance penalty of setting such a flag.
I've toggled USE_LOCKING=1 in openblas-0.3.9-3.
Great, thanks!
But if that's noticeable, then this is another argument in favour of providing a proper mechanism for the user to switch the implementation, as e.g. Debian does.
Debian's mechanism for switching the implementations is improper, due to reasons already discussed on this list.
I'm not proposing Debian's mechanism. I just say that Debian has *a* mechanism, and for that reason some people prefer Debian. But there may be a better way: see [1].
[1] https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/...