Skip to content

Commit cd7b6af

Browse files
authored
Linear Solver Tests: Loosen convergence tolerance for single precision (#5319)
This should solve the HPSF GitLab CI failures. The tests started to fail after #5305, not because that PR introduced a bug, but because that PR fixed a CMake bug that prevented the tests from running. A similar CMake bug is also fixed in this PR.
1 parent 3d73202 commit cd7b6af

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Tests/LinearSolvers/ABecLaplacian_C/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
foreach(D IN LISTS AMReX_SPACEDIM)
22
if (D EQUAL 1)
3-
return()
3+
continue()
44
endif ()
55

66
set(_sources

Tests/LinearSolvers/ABecLaplacian_C/MyTest.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ MyTest::solvePoisson ()
5656
info.setDeterministic(deterministic);
5757
info.setMaxCoarseningLevel(max_coarsening_level);
5858

59-
const auto tol_rel = Real(1.e-10);
59+
Real tol_rel;
60+
if constexpr (std::is_same_v<double,Real>) {
61+
tol_rel = Real(1.0e-10);
62+
} else {
63+
tol_rel = Real(1.0e-4);
64+
}
6065
const auto tol_abs = Real(0.0);
6166

6267
const auto nlevels = static_cast<int>(geom.size());
@@ -157,7 +162,12 @@ MyTest::solveABecLaplacian ()
157162
info.setMaxCoarseningLevel(max_coarsening_level);
158163
info.setMaxSemicoarseningLevel(max_semicoarsening_level);
159164

160-
const auto tol_rel = Real(1.e-10);
165+
Real tol_rel;
166+
if constexpr (std::is_same_v<double,Real>) {
167+
tol_rel = Real(1.0e-10);
168+
} else {
169+
tol_rel = Real(1.0e-4);
170+
}
161171
const auto tol_abs = Real(0.0);
162172

163173
const auto nlevels = static_cast<int>(geom.size());

Tests/LinearSolvers/CurlCurl/MyTest.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ MyTest::solve ()
5757
mf.setVal(Real(0));
5858
}
5959

60-
auto tol_rel = Real(1.0e-10);
60+
Real tol_rel;
61+
if constexpr (std::is_same_v<double,Real>) {
62+
tol_rel = Real(1.0e-10);
63+
} else {
64+
tol_rel = Real(1.0e-4);
65+
}
6166
auto tol_abs = Real(0.0);
6267

6368
if (use_gmres)

0 commit comments

Comments
 (0)