Skip to content

About locking when use OpenBLAS with OpenMP #5152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
KashpurovichYuri opened this issue Feb 25, 2025 · 0 comments
Open

About locking when use OpenBLAS with OpenMP #5152

KashpurovichYuri opened this issue Feb 25, 2025 · 0 comments

Comments

@KashpurovichYuri
Copy link

Implementing an algorithm I ran into a problem how to better use OpenBLAS. So I have several matrix multiplications in omp parallel section. Resulting matrices should be summed up. So it is just $C = C + A * B$ (e.g., usual dgemm routine with shared $C$ and private $A$ and $B$ in omp parallel section), but might you clarify does OpenBLAS optimally deal with synchronization here when library was built with USE_OPENMP=1 USE_LOCKING=1? I mean something like summing in $C = C + A * B$ expression should be done after block of $A * B$ is calculated (so obviously elements of $C$ shouldn't be updated very often). Could you please tell if I have a correct idea about the implementation in OpenBLAS or do I need to take into account described remarks on my own? And if it would be better to study your code instead of asking such questions directly, just say so!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant