-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Disable OpenMP by default #102
Conversation
I would prefer if we remove OpenMP completely. This does not really resolve the concerns I mentioned in #97. If we offer the option, we'll have packagers and users using OpenMP and have to support it, and it's a portability concern for Astropy core. Also we have to test it. Note that this PR leaves the option to use OpenMP, but as far as I can see it's completely untested in CI now. Also: it hasn't really been shown that this multi-threading gives good speed-ups. There have been some benchmarks posted in the PRs adding OpenMP that show a factor 2 speed-up for large arrays (and slow-down for small arrays), but not that our HEALPix C lib is not efficient yet, it can be improved by a factor of a few (see e.g. #34 (comment) and #34 (comment) ) and once it's optimised it's not clear if using many cores helps a lot. So @astrofrog - If you want to keep the OpenMP, then I agree this is an improvement and we should merge. |
Removing it is fine by me as long as you are happy with the performance. I only added it originally because there were concerns that without, things were slower than healpy. |
+10 from me to remove OpenMP. @lpsinger - Acceptable for you? @astrofrog - Can you update this PR, or should prepare a new one to do it? |
👍 |
Ok, then I'm closing this PR. I did open #108 which removes OpenMP. |
@cdeil Check out astropy/astropy-helpers#410. You might want to use the following pattern in your root setup.py: ...
# The current default is to NOT build with OpenMP support, i.e. ``disable_openmp = True``
disable_openmp = os.environ.get('ASTROPY_HEALPIX_USE_OPENMP', '0') == '0'
generate_openmp_enabled_py(NAME, disable_openmp=disable_openmp)
... You won't then need the conditional around the |
This implements one of my suggestions in #97
Basically this makes OpenMP opt-in. We can still decide to opt in by default for conda packages if the OpenMP environment there is more predictable.