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

Add OpenMP #32

Open
henryiii opened this issue Nov 1, 2018 · 2 comments
Open

Add OpenMP #32

henryiii opened this issue Nov 1, 2018 · 2 comments

Comments

@henryiii
Copy link
Contributor

henryiii commented Nov 1, 2018

I think it should be possible to rewrite the loops to include OpenMP pragmas. The final update could be protected with #pragma omp atomic and you can use default(shared) private(tx ty ix iy) firstprivate(dataptr) or something similar. You'll need to redo the loops, however, you'll need for loops instead of the inner while (or maybe the outer do while), and the stride part might need to be precalculated in some way.

@astrofrog
Copy link
Owner

I agree it would be nice to have this, although based on previous experience with OpenMP in other Python packages, I think I'd want this to be opt-in (rather than trying to automatically determining whether OpenMP can be used). Compilers on MacOS X are a bit of a mess in that respect.

I personally don't have enough experience with OpenMP to be comfortable making those changes, but if you or anyone else reading this issue is happy to look in to it, I'd gladly review a PR.

@henryiii
Copy link
Contributor Author

henryiii commented Nov 1, 2018

I can do the OpenMP part, but I don't have enough experience in raw Numpy to know how to write the loops with for's instead of whiles.

I automatically try to use OpenMP on macOS in GooFit, and you are right, it is a mess on macOS. Right now I'm just curious to see it added to the code for comparison, even if it's not as easy to turn on.

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

No branches or pull requests

2 participants