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

Testsuite: tests should not output and compare initial and final residuals #15395

Open
tamiko opened this issue Jun 20, 2023 · 0 comments
Open
Labels
Milestone

Comments

@tamiko
Copy link
Member

tamiko commented Jun 20, 2023

We have a number of tests that output inital and final residuals and iteration count. Exemplarily,

DEAL::  Solving linear system
DEAL::Starting value 1.67096
DEAL::Convergence step 9 value 2.69526e-13
DEAL::   Solved in 9 iterations.

This is an issue because the exact floating point number for the initial and final residual, as well as the number of iterations typically depends on library versions, operating system, hardware and processor architecture, and what optimization have been chosen. We should avoid printing these numbers

(As a side note: the final residual in above output isn't critical - we ignore it thanks to our numdiff settings. Typically a test fails because the initial residual or the number of convergence steps differ.)

Instead one possiblity is to use the check_solver_within_range macro that can be invoked for example as follows:

check_solver_within_range(solver.solve(A, u, f, preconditioner),
                              control.last_step(), 40, 44);

and will output success if the solve() converged within 40 to 44 steps and otherwise outputs a failure condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant