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

Fix some reduction race conditions and thread-safety issues #745

Merged
merged 1 commit into from
Jan 25, 2020

Conversation

maximumcats
Copy link
Member

PR summary

Thread-safe reductions in the CUDA build have two requirements: (1) we must use the corresponding function in reduction.F90, such as reduce_add, otherwise there will be a race condition among CUDA threads; (2) we cannot call functions like reduce_add in a conditional branch that is true for some threads but not others (otherwise there could be a code hang).

Fixes #728

PR checklist

  • test suite needs to be run on this PR
  • this PR will change answers in the test suite
  • all functions have docstrings as per the coding conventions
  • the CHANGES file has been updated
  • if appropriate, this change is described in the docs

@zingale
Copy link
Member

zingale commented Jan 25, 2020

tests pass

@zingale zingale merged commit 5163fb6 into development Jan 25, 2020
@maximumcats maximumcats deleted the reduction_fix branch January 25, 2020 20:41
@maximumcats maximumcats mentioned this pull request Feb 3, 2020
5 tasks
zingale pushed a commit that referenced this pull request Feb 4, 2020
Extension of #745. I missed that the Fortran cycle statements result in some threads failing to execute the reduction, so the reduction was sometimes generate NaNs.
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