Skip to content

Support unpreconditioned GMRES - #480

Open
kakeueda wants to merge 5 commits into
developfrom
kakeru/unpreconditioned-gmres
Open

kakeueda wants to merge 5 commits into
developfrom
kakeru/unpreconditioned-gmres

Conversation

@kakeueda

@kakeueda kakeueda commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Description

GMRES previously failed during solve() when the preconditioner was set to "none". This adds an identity preconditioner (M = I) to support unpreconditioned GMRES.

Coses #467

Proposed changes

  • Added an identity preconditioner derived from the preconditioner interface.
  • Updated SystemSolver to instantiate the identity preconditioner when "none" is selected.
  • Added unit tests.

GMRES iterations: 19 (none) → 8 (ILU0).

ku@kakeru:~/dev/ReSolve$ ./build/examples/sysGmres.exe \
  -b cuda -i fgmres -x no -g cgs2 -c none \
  -m tests/functionality/data/A_asymmetric01.mtx \
  -r tests/functionality/data/b_asymmetric01.mtx
Matrix file: tests/functionality/data/A_asymmetric01.mtx
RHS file: tests/functionality/data/b_asymmetric01.mtx
Preconditioner: none (identity)
sysGmres with CUDA backend
solver.setMatrix returned status: 0
solver.solve returned status: 0
         Initial relative residual norm ||b-A*x||/||b|| : 1.0000000000000000e+00
         Final relative residual norm   ||b-A*x||/||b|| : 4.6914933872622074e-13
         Number of iterations                           : 19
ku@kakeru:~/dev/ReSolve$ ./build/examples/sysGmres.exe \
  -b cuda -i fgmres -x no -g cgs2 -c ilu0 \
  -m tests/functionality/data/A_asymmetric01.mtx \
  -r tests/functionality/data/b_asymmetric01.mtx
Matrix file: tests/functionality/data/A_asymmetric01.mtx
RHS file: tests/functionality/data/b_asymmetric01.mtx
Preconditioner: ILU0
sysGmres with CUDA backend
solver.setMatrix returned status: 0
solver.preconditionerSetup returned status: 0
solver.solve returned status: 0
         Initial relative residual norm ||b-A*x||/||b|| : 1.0000000000000000e+00
         Final relative residual norm   ||b-A*x||/||b|| : 3.7609434128388183e-14
         Number of iterations                           : 8

Checklist

  • All tests pass (make test and make test_install per testing instructions). Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • I have manually run the non-experimental examples and verified that residuals are close to machine precision. (In your build directory run: ./examples/<your_example>.exe -h to get instructions how to run examples). Code tested on:
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • [N/A] The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

@kakeueda
kakeueda requested review from pelesh and shakedregev October 8, 2026 13:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant