Skip to content

Commit

Permalink
Increase tolerance for one continuation test
Browse files Browse the repository at this point in the history
The conserved energy quantity for the largest system for
the mdrun continuation test, alanine_vacuo, already had
a higher tolerance for single precision. Now a uniform
increase is used. This needs a higher tolerance because
the conserved energy is relatively small due to the sum
of (negative) potential energy and (positive) kinetic energy.

Fixes #4725
  • Loading branch information
berkhess authored and lundborgmagnus committed Nov 9, 2023
1 parent 1df1017 commit f4c99a1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/programs/mdrun/tests/exactcontinuation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,13 @@ TEST_P(MdrunNoAppendContinuationIsExact, WithinTolerances)
if (simulationName == "alanine_vacuo")
{
// This is slightly less reproducible
energyTermsToCompare.insert({ interaction_function[F_ECONSERVED].longname,
relativeToleranceAsPrecisionDependentUlp(
10.0, ulpToleranceInMixed * 2, ulpToleranceInDouble) });
// Wider tolerance is needed because of sum of negative PE
// with positive KE producing small conserved energy.
const int factor = 4;
energyTermsToCompare.insert(
{ interaction_function[F_ECONSERVED].longname,
relativeToleranceAsPrecisionDependentUlp(
10.0, factor * ulpToleranceInMixed, factor * ulpToleranceInDouble) });
}
else
{
Expand Down

0 comments on commit f4c99a1

Please sign in to comment.