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

Easy to mismatch residual norm criteria and actual norm used by solver #1222

Open
MarcelKoch opened this issue Dec 2, 2022 · 1 comment
Open

Comments

@MarcelKoch
Copy link
Member

Some of our iterative solvers use the exact residual norm for their stopping criteria, while others use the implicit residual norm. For a user, it is not possible to know which one is actually used. This results in an extra reduction, or an exception. If an exception is thrown, it might be easy to fix, but the extra reduction will just happen silently.

We should make it easier for users to select the correct criteria. Some solution ideas:

  • add residual type (explicit, implicit, none) to solver traits
  • introduce new criteria which allows the solver to decide if ResidualNorm or ImplicitResidualNorm is used. (this should still allow users to explicitly specify either of them)

Here is a list of solvers and their used residual norm. Both Ir and Multigrid use neither.
Check exact residual norm:

  • [Cb_]Gmres
  • Idr

Check implicit residual norm:

  • Bicg
  • Bicgstab
  • Cg
  • Cgs
  • Fcg
@yhmtsai
Copy link
Member

yhmtsai commented Dec 2, 2022

Any solver can use the ResidualNorm as the stop criterion.
If the solver does not have it during solving, ResidualNorm will introduce an additional spmv and norm as requests.
Thus, solver does not always have this additional operation when they do not need residual norm during operation.

My concern about the automatic ResidualNorm/ImplicitResidualNorm is that it will introduce another confusion out of expectation.
When user use it on Gmres/CbGmres, they may think they get the actual residual reduction. However, when they use it on Cg, they do not get the actual residual norm from their expectation.

In the original settings, if they want to use ResidualNormReduction as stop criterion, they can use it for all solver.
When they use ImplicitResidualNormReduction, they should know it checks the implicit residual norm different from the residual norm.

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

No branches or pull requests

2 participants