Skip to content

atomic: add support for __atomic builtins #1735

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

Merged
merged 2 commits into from
Jun 2, 2016

Conversation

hjelmn
Copy link
Member

@hjelmn hjelmn commented May 31, 2016

This commit adds support for the gcc __atomic builtins. The __sync
builtins are deprecated and have been replaced by these atomics. In
addition, the new atomics support atomic exchange which was not
supported by __sync.

Signed-off-by: Nathan Hjelm [email protected]

@hjelmn
Copy link
Member Author

hjelmn commented May 31, 2016

@bosilca This is a work in progress. Might make it part of a larger change to the atomics that adds C11 support.

@hjelmn
Copy link
Member Author

hjelmn commented May 31, 2016

@bosilca Can you double-check the memory-model arguments? I am pretty sure they match the intended semantics of the opal_atomic_* functions.

This commit adds support for the gcc __atomic builtins. The __sync
builtins are deprecated and have been replaced by these atomics. In
addition, the new atomics support atomic exchange which was not
supported by __sync.

Signed-off-by: Nathan Hjelm <[email protected]>
@bosilca
Copy link
Member

bosilca commented Jun 2, 2016

I think our code assume that opal_atomic_cmpset_32 uses the ACQUIRE memory model and not the RELAXED. IF we want to change this we should audit the code to make sure we are not assuming a stricter memory model (based on the semantic of the sync_* atomic intrinsics).

This commit adds support for using transactional memory when using
opal atomic locks. This feature is enabled if the __HLE__ feature is
available and the gcc builtin atomics are in use.

Signed-off-by: Nathan Hjelm <[email protected]>
@hjelmn
Copy link
Member Author

hjelmn commented Jun 2, 2016

I think you are correct. I updated the PR to use acquire for opal_cmpset_*.

@bosilca
Copy link
Member

bosilca commented Jun 2, 2016

Looks good. 👍

@bosilca bosilca merged commit f33bbfd into open-mpi:master Jun 2, 2016
bosilca pushed a commit to bosilca/ompi that referenced this pull request Oct 3, 2016
* atomic: add support for __atomic builtins

This commit adds support for the gcc __atomic builtins. The __sync
builtins are deprecated and have been replaced by these atomics. In
addition, the new atomics support atomic exchange which was not
supported by __sync.

Signed-off-by: Nathan Hjelm <[email protected]>

* atomic: add support for transactional memory

This commit adds support for using transactional memory when using
opal atomic locks. This feature is enabled if the __HLE__ feature is
available and the gcc builtin atomics are in use.

Signed-off-by: Nathan Hjelm <[email protected]>
hjelmn added a commit to hjelmn/ompi that referenced this pull request Oct 5, 2016
* atomic: add support for __atomic builtins

This commit adds support for the gcc __atomic builtins. The __sync
builtins are deprecated and have been replaced by these atomics. In
addition, the new atomics support atomic exchange which was not
supported by __sync.

Signed-off-by: Nathan Hjelm <[email protected]>

* atomic: add support for transactional memory

This commit adds support for using transactional memory when using
opal atomic locks. This feature is enabled if the __HLE__ feature is
available and the gcc builtin atomics are in use.

Signed-off-by: Nathan Hjelm <[email protected]>

(cherry picked from commit f33bbfd)
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

Successfully merging this pull request may close these issues.

2 participants