ORNL / ORNL/ReSolve

Bug: GMRES uses inconsistent convergence criteria in the outer and inner loops

Open
#465 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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 = 0
  • tol = 0.9
  • restart = 2
  • maxit = 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.