Hi all,

While we're on the topic of BLAS thread handling, there's also the matter of OpenBLAS's two threading implementations. Depending on how the library is built, it can either use OpenMP or it can use POSIX threading.

This can cause issues in packages that call into BLAS functions in an OpenMP block as the POSIX threading variant will attempt to spawn N threads for each OpenMP thread (where N is the system-configured OpenBLAS thread count). This explosion of threads causes a pretty severe performance degradation. In my (pending) package, I currently have a compile-time check for POSIX-threaded OpenBLAS which calls openblas_set_num_threads before and after OpenMP blocks to stop this behavior from occurring. If R were to implement some kind of internal FlexiBLAS, this would need to be taken into account.


Best,

--
Andrew Robbins
Systems Analyst, Welch Lab<https://welch-lab.github.io>
University of Michigan
Department of Computational Medicine and Bioinformatics

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to