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 parallel for #5

Open
linusmartensson opened this issue Dec 7, 2020 · 2 comments
Open

OpenMP parallel for #5

linusmartensson opened this issue Dec 7, 2020 · 2 comments

Comments

@linusmartensson
Copy link

I've been working with SimpleFFT for a while now in a project, and noticed some details I've modified in our local version.

Most importantly, the use of "#pragma omp parallel for" involves some overhead in setting up a multi-threaded context and passing value ranges to threads. I've never had good results with this in innermost loops, the way it's being used right now in SimpleFFT.

The alternative "#pragma omp simd" is more than likely a suitable alternative. Rather than setting up a multithreaded context, simd will use common vectorization constructs to optimize the loop, leaving the multithreading (and its overhead) to outer contexts instead.

With this change, I've had positive results enabling the flag in clang as well - noticed there was an ifdef disabling it for that environment.

@d1vanov
Copy link
Owner

d1vanov commented Dec 7, 2020

Thank you for the input. Maybe some day I get to look into this more closely but I won't promise that.

@linusmartensson
Copy link
Author

linusmartensson commented Dec 7, 2020 via email

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