Skip to content

Fix atomics on macosX not working properly (missing header)#356

Merged
bosilca merged 4 commits intoICLDisco:masterfrom
abouteiller:bugfix/atomics-osx-ppc
Mar 28, 2022
Merged

Fix atomics on macosX not working properly (missing header)#356
bosilca merged 4 commits intoICLDisco:masterfrom
abouteiller:bugfix/atomics-osx-ppc

Conversation

@abouteiller
Copy link
Copy Markdown
Contributor

@abouteiller abouteiller commented Mar 22, 2022

  • Fix atomics on macosX not working properly (missing header): we now fallback to using gcc-builtins if we don't have c11; all modern OSX compilers have them, so we removed the macosx specific atomics altogether.

  • Removes the PARSEC_OSX parsec_config.h define and use __APPLE__ instead

  • Change bind thread logic so that we use the OSX specific thread binding by default (even when we have hwloc, because hwloc binding doesn't work on OSX), issue some warning messages if user tries to change default behavior, as the backend doesn't have these capabilities.

  • Also, the conditional for using 128bit atomics must be on the CAS128 capability, not the availability of int128_t (many platforms have the int128, but not the CAS128). Having a single downstream variable rather than an upstream conditional avoids making mistakes and configurations that are non-workable.

(this is not a fix for the error with c11 atomics on gcc-11.2 osx, I just stumbled upon this problem when forcing other atomic modes for testing)

@abouteiller abouteiller added the bug Something isn't working label Mar 22, 2022
@abouteiller abouteiller added this to the v4.0 milestone Mar 22, 2022
@abouteiller abouteiller requested a review from devreal March 22, 2022 20:14
@abouteiller abouteiller self-assigned this Mar 22, 2022
@abouteiller abouteiller requested a review from bosilca as a code owner March 22, 2022 20:14
Comment thread parsec/include/parsec/sys/atomic-macosx.h
Comment thread CMakeLists.txt Outdated
Comment thread parsec/include/parsec/sys/atomic.h
Also, the conditional for using 128bit atomics must be on the CAS128
capability, not the availability of int128_t (many platforms have the
int128, but not the CAS128)

Signed-off-by: Aurélien Bouteiller <bouteill@icl.utk.edu>
even when hwloc is available (as hwloc_bind doesn't work on OSX), this
restores capability of binding on OS-X (to some extent, default
configurations will work as expected, setting explicit vpmap params on
OSX will generate warnings about not respecting the binding)

Signed-off-by: Aurélien Bouteiller <bouteill@icl.utk.edu>
compilers of interest.

Signed-off-by: Aurélien Bouteiller <bouteill@icl.utk.edu>
Signed-off-by: Aurélien Bouteiller <bouteill@icl.utk.edu>
@abouteiller abouteiller force-pushed the bugfix/atomics-osx-ppc branch from 31a5dbf to f1ffb58 Compare March 24, 2022 23:11
@abouteiller abouteiller requested a review from bosilca March 24, 2022 23:50
Comment thread parsec/bindthread.c
@bosilca bosilca merged commit d93fe50 into ICLDisco:master Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants