Skip to content
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

OpenMP atomic support suggestion #156

Open
WalterZimmer314 opened this issue Feb 28, 2020 · 1 comment
Open

OpenMP atomic support suggestion #156

WalterZimmer314 opened this issue Feb 28, 2020 · 1 comment

Comments

@WalterZimmer314
Copy link

We noticed some time ago that OpenMP scaling is not too well, and found out it can be improved significantly by implementing the synchronization via OpenMP atomic instructions. There are several ways to implement locking inside Blitz and it was not clear to me how to implement the changes in a general way, so I can only provide a patch of what we did. It would be great if someone could have a look and (suggests how to) implement it in a more general way.

Having a derived class for read only data which doesn't need synchronisation is #another issue...

blitz-memblock.h-patch.txt

@slayoo
Copy link
Member

slayoo commented Feb 28, 2020

Thanks!

Probably, we should reuse the existing BZ_THREADSAFE_USE_OPENMP macro?

See ```blitz.hpp''':
https://github.com/blitzpp/blitz/blob/master/blitz/blitz.h#L158

 #elif defined (_OPENMP)
#define BZ_THREADSAFE_USE_OPENMP

which then would be used to conditionally declare something alike BZ_MUTEX_UNLOCK but for refcount increments/decrements?

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

2 participants