Fix Roundoff Domain#3247
Merged
WeiqunZhang merged 1 commit intoAMReX-Codes:developmentfrom Apr 10, 2023
Merged
Conversation
38d3a0a to
eeaf026
Compare
Member
Author
|
A test is here. https://github.com/WeiqunZhang/amrex-devtests/blob/main/roundoff_domain/main.cpp It takes up to 53 iterations. Need to test with different compiler optimization flags and fp model flags. Also need to test single precision and mixed precision. |
a060252 to
fb3b6d4
Compare
Member
Author
|
Using |
fb3b6d4 to
0d740b2
Compare
aefa307 to
3d89977
Compare
There was a flaw in amrex::Geometry::computeRoundoffDomain. If probhi is close to zero, std::nextafter towards negative infinity will be a very small number (e.g., 1.e-300). So the function will be able to find the lowest value of roundoff_hi that's outside the domain within a reasonable number of iterations. In the new implementation, we use bisection to find the lowest value of roundoff_lo that's inside the domain and the highest value fo roundoff_hi that's inside the domain, up to a tolerance.
3d89977 to
5a1ca61
Compare
atmyers
approved these changes
Apr 10, 2023
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 10, 2023
Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 10, 2023
Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 10, 2023
Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 11, 2023
Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 11, 2023
Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 11, 2023
Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 11, 2023
Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Apr 11, 2023
The new test exposes an issue with Intel compiler. So we have to rewrite the computeRoundoffDomain slightly. Also fix an assertion issue in AMReX-Codes#3247.
ax3l
pushed a commit
that referenced
this pull request
Apr 11, 2023
The new test exposes an issue with Intel compiler. So we have to rewrite the computeRoundofDomain function in a slightly different way to avoid roundoff difference between `auto r = f(x-y)` and `z = x-y; auto r = f(z)`. Also fix an assertion issue in #3247.
guj
pushed a commit
to guj/amrex
that referenced
this pull request
Jul 13, 2023
There was a flaw in amrex::Geometry::computeRoundoffDomain. If probhi is close to zero, std::nextafter towards negative infinity will be a very small number (e.g., 1.e-300). So the function will be able to find the lowest value of roundoff_hi that's outside the domain within a reasonable number of iterations. In the new implementation, we use bisection to find the lowest value of roundoff_lo that's inside the domain and the highest value fo roundoff_hi that's inside the domain, up to a tolerance. X-ref: - AMReX-Codes#3243 - AMReX-Codes#3199
guj
pushed a commit
to guj/amrex
that referenced
this pull request
Jul 13, 2023
The new test exposes an issue with Intel compiler. So we have to rewrite the computeRoundofDomain function in a slightly different way to avoid roundoff difference between `auto r = f(x-y)` and `z = x-y; auto r = f(z)`. Also fix an assertion issue in AMReX-Codes#3247.
WeiqunZhang
pushed a commit
to WeiqunZhang/amrex
that referenced
this pull request
Sep 28, 2023
* Rework handling of roundoff domain extent (AMReX-Codes#3199) * Fix periodic boundary bug in AMReX-Codes#3199 (AMReX-Codes#3243) * Fix Roundoff Domain (AMReX-Codes#3247) * Add Tests/RoundoffDomain (AMReX-Codes#3248) * Roundoff errors in computeRoundoffDomain (AMReX-Codes#3255)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a flaw in amrex::Geometry::computeRoundoffDomain. If probhi is close to zero, std::nextafter towards negative infinity will be a very small number (e.g., 1.e-300). So the function will be able to find the lowest value of roundoff_hi that's outside the domain within a reasonable number of iterations.
In the new implementation, we use bisection to find the lowest value of roundoff_lo that's inside the domain and the highest value fo roundoff_hi that's inside the domain, up to a tolerance.
X-ref: