Bug: GMRES uses inconsistent convergence criteria in the outer and inner loops
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 84
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Description how to reproduce the bug
The current GMRES implementation uses inconsistent convergence criteria in the outer and inner loops. The outer loop uses the criterion conv_cond while the inner loop always uses tol * ||r_0||.
Run a simple test using LinSolverIterativeFGMRES on the CPU with an identity right preconditioner implemented only for this test and the following parameters:
conv_cond = 0tol = 0.9restart = 2maxit = 10- non-flexible GMRES
With conv_cond = 0 convergence should require the residual norm to be no greater than machine epsilon but the inner loop uses
tol_rel = tol * ||r_0|| ≈ 1.27279.
The inner loop terminates after one iteration because the estimated residual (~0.44721) is less than tol_rel.
$ ./gmres_convergence_test
=== inner criterion terminates conv_cond=0 ===
conv_cond=0 tol=0.9 restart=2 ||b||=1.41421
[MESSAGE] it 0: norm of residual 1.4142135623730951e+00 Norm of rhs: 1.4142135623730951e+00
[MESSAGE] it: 1 --> norm of the residual 4.4721359549995804e-01
[MESSAGE] End of cycle, ESTIMATED norm of residual 4.4721359549995804e-01
[MESSAGE] End of cycle, COMPUTED norm of residual 4.4721359549995793e-01
Re::Solve version
develop: 6038206
System and environment details
- Operating system: Ubuntu 24.04.4
- Compiler: GCC 13.3.0
- Backend: CPU
- Build configuration:
- CUDA: enabled (CUDA 12.9), not used for this
- KLU: enabled
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the LinSolverIterativeFGMRES implementation and reproduce the issue with the gmres_convergence_test parameters described in the report. Trace how conv_cond and tol_rel are used in the outer and inner loops; done means both loops apply the intended convergence criterion and the test no longer terminates early when conv_cond=0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100