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

Enable by default the _sync version of atomic operations on OS X. #633

Merged
merged 3 commits into from
Sep 28, 2015

Conversation

bosilca
Copy link
Member

@bosilca bosilca commented Jun 10, 2015

As most compilers gain support for builtin atomics I propose to switch the default Open MPI behavior with regard to atomics. Instead of relying on our own atomics, we should leverage what the compiler, or the OS, is supporting. This patch change the default behavior for builds on OSX or with a compiler supporting gcc-type atomic builtins.

This is a replacement for the now defunct #288.

@goodell and @hjelmn please review.

@bosilca bosilca added this to the Open MPI v2.0.0 milestone Jun 10, 2015
@bosilca bosilca mentioned this pull request Jun 10, 2015
@lanl-ompi
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins.open-mpi.org/job/ompi_master_pr_distcheck/35/

Build Log
last 20 lines

[...truncated 1006 lines...]
*** Java OSHMEM bindings
checking if want Java bindings... no

*** OpenSHMEM profiling
checking if pshmem will be enabled... yes (weak symbols supported)

*** Assembler
checking dependency style of gcc -std=gnu99... gcc3
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking for fgrep... /bin/grep -F
checking for OSX atomic support... checking libkern/OSAtomic.h usability... no
checking libkern/OSAtomic.h presence... no
checking for libkern/OSAtomic.h... no
no
checking for libkern/OSAtomic.h... (cached) no
configure: error: OSX builtin atomics requested but not found.
Build step 'Execute shell' marked build as failure
Setting status of 0392ef74da68a5e6143a0bf554b8f4ad733e0902 to FAILURE with url http://jenkins.open-mpi.org/job/ompi_master_pr_distcheck/35/ and message: Build finished.

Test FAILed.

@lanl-ompi
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins.open-mpi.org/job/ompi_master_pr_cle5.2up02/125/

Build Log
last 20 lines

[...truncated 1006 lines...]
*** Java OSHMEM bindings
checking if want Java bindings... no

*** OpenSHMEM profiling
checking if pshmem will be enabled... yes (weak symbols supported)

*** Assembler
checking dependency style of gcc -std=gnu99... gcc3
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking for fgrep... /usr/bin/grep -F
checking for OSX atomic support... checking libkern/OSAtomic.h usability... no
checking libkern/OSAtomic.h presence... no
checking for libkern/OSAtomic.h... no
no
checking for libkern/OSAtomic.h... (cached) no
configure: error: OSX builtin atomics requested but not found.
Build step 'Execute shell' marked build as failure
Setting status of 0392ef74da68a5e6143a0bf554b8f4ad733e0902 to FAILURE with url http://jenkins.open-mpi.org/job/ompi_master_pr_cle5.2up02/125/ and message: Build finished.

Test FAILed.

@mellanox-github
Copy link

Refer to this link for build results (access rights to CI server needed):
http://bgate.mellanox.com/job/gh-ompi-master-pr/616/

Build Log
last 50 lines

[...truncated 1652 lines...]
checking for __attribute__(weak_alias)... yes
checking for __attribute__(destructor)... yes
checking for compiler familyid... 1
checking for compiler familyname... GNU
checking for compiler version... 263175
checking for compiler version_str... 4.4.7

*** Java compiler
checking OSX locations... not found
checking Linux locations... found (/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/include)
checking --with-jdk-bindir value... sanity check ok (/usr/bin)
checking --with-jdk-headers value... sanity check ok (/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/include)
checking for javac... /usr/bin/javac
checking for javah... /usr/bin/javah
checking for jar... /usr/bin/jar
checking jni.h usability... yes
checking jni.h presence... yes
checking for jni.h... yes
checking Java support available... yes

*** Java MPI bindings
checking if want Java bindings... no

*** Java OSHMEM bindings
checking if want Java bindings... no

*** OpenSHMEM profiling
checking if pshmem will be enabled... yes (weak symbols supported)

*** Assembler
checking dependency style of gcc -std=gnu99... gcc3
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking for fgrep... /bin/grep -F
checking for OSX atomic support... checking libkern/OSAtomic.h usability... no
checking libkern/OSAtomic.h presence... no
checking for libkern/OSAtomic.h... no
no
checking for libkern/OSAtomic.h... (cached) no
configure: error: OSX builtin atomics requested but not found.
Build step 'Execute shell' marked build as failure
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level /var/lib/jenkins/jobs/gh-ompi-master-pr/workspace/cov_build to /var/lib/jenkins/jobs/gh-ompi-master-pr/builds/616/htmlreports/Coverity_Report
Setting commit status on GitHub for https://github.com/open-mpi/ompi/commit/f129f658b22b9e9915b5b251a9b95a757b804c6d
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Setting status of 0392ef74da68a5e6143a0bf554b8f4ad733e0902 to FAILURE with url http://bgate.mellanox.com:8888/jenkins/job/gh-ompi-master-pr/616/ and message: 'Build finished.'
Using conext: Mellanox

@lanl-ompi
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins.open-mpi.org/job/ompi_master_pr_distcheck/36/
Test PASSed.

@lanl-ompi
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins.open-mpi.org/job/ompi_master_pr_cle5.2up02/126/
Test PASSed.

@mellanox-github
Copy link

@mellanox-github
Copy link

Refer to this link for build results (access rights to CI server needed):
http://bgate.mellanox.com/job/gh-ompi-master-pr/617/

AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1],
[Whether C compiler supports GCC style inline assembly])
opal_cv_asm_builtin="BUILTIN_NO"
if test "$opal_cv_asm_builtin" = "BUILTIN_NO" -a "$enable_builtin_atomics" = "yes" ; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the first part of this test trivially true because of the line above? Is this just to match the style of the other if checks below so that the if block could be more easily moved around later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes the first part is trivial but as you noticed it keeps all the if blocks similar.

@goodell
Copy link
Member

goodell commented Jun 12, 2015

Two issues:

  1. The individual commits don't really make sense on their own. They should all be squashed down into a single commit.
  2. While the __sync_ builtin atomics are more likely to be implemented correctly than our own inline assembly, they all carry a full memory barrier semantic with them. This is no imposition on x86, since x86 atomics are always full barriers. But performance on other platforms (POWER, ARM, etc.) might suffer. We could probably do better if we were using the C11 atomics (they should be used in seq_cst mode), but I don't think we have a current implementation in OPAL for that.

@goodell
Copy link
Member

goodell commented Jun 15, 2015

@bosilca It looks like you made a bad rebase + push since I last commented. The PR now shows ~15 commits, most of which are not yours. What's going on here?

@jsquyres
Copy link
Member

I helped @bosilca fix his rebasing problems today. Looks like alles gut now with this PR.

Merge?

@jsquyres
Copy link
Member

@bosilca Looks like this PR also had a bad rebase (after our session that fixed the problems in SJC...). Can you fix? Do you want to webex where we can fix this together?

@jsquyres
Copy link
Member

@bosilca Thanks for fixing / rebasing.

We talked about this on the call today; @hjelmn is going to re-review this one. He'll do some testing to see if the lack of a swap atomic is problematic, performance-wise.

@bosilca
Copy link
Member Author

bosilca commented Sep 27, 2015

@hjelmn did you had the time to investigate the potential impact of the atomic swap?

@hjelmn
Copy link
Member

hjelmn commented Sep 28, 2015

Will check performance numbers tomorrow.

@hjelmn
Copy link
Member

hjelmn commented Sep 28, 2015

See no noticeable difference in performance with the builtins vs asm.

@bosilca
Copy link
Member Author

bosilca commented Sep 28, 2015

I'll merge it then. Thanks.

bosilca added a commit that referenced this pull request Sep 28, 2015
Enable by default the _sync version of atomic operations on OS X.
@bosilca bosilca merged commit 984b35b into open-mpi:master Sep 28, 2015
@bosilca bosilca deleted the topic/enable_atomics branch September 28, 2015 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants