question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convergence issue of GMRES

See original GitHub issue

My issue is about a convergence issue when using scipy.sparse.linalg.gmres routine. When using GMRES with a preconditioner, it seems that the convergence is tested by looking at the residual not the preconditioned residual. So, although the preconditioned residual is smaller than the absolute tolerance I ask, the iterations do no stop if the (not preconditioned) residual is greater than the tolerance. In order to fix this, I need to go into iterative.py and add the following lines (under the if conditional elif(ijob==3): if presid < atol and np.linalg.norm(x) > 0: resid = 0.0 break

This kind of hard coding is not something I prefer. I will appreciate if you can take a look at this issue and inform me about it.

Thanks!

Reproducing code example:

Sample code to reproduce the problem

Error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ...

Scipy/Numpy/Python version information:

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
zhaog6commented, Feb 23, 2022

@rgommers Yes, I am rewriting the restarted GMRES. The original GMRES did use the residual instead of the preconditioned residual. @gokberkkabacaoglu you can trace the PR #15149

0reactions
zhaog6commented, Mar 24, 2022

Edit: I found your repo and used the fastgmres branch. The GMRES iterations are indeed much faster (though partly from improvements to numpy).

Yes, there are also some improvements of data storage way based on Python and other mathematical optimizations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The rate of convergence of the GMRES method - CiteSeerX
The main problem in obtaining a similar relation for GMRES is that the Ritz values are not the zeros of the iteration polynomial...
Read more >
Generalized minimal residual method - Wikipedia
In mathematics, the generalized minimal residual method (GMRES) is an iterative method for the numerical solution of an indefinite nonsymmetric system of ...
Read more >
Spectral information and GMRES convergence - Cerfacs
We will show that GMRES residual norm convergence depends on. - the eigenvalues and eigenvectors of A when the matrix is normal.
Read more >
Convergence Problem of GMRES method - COMSOL
The problem is that when I reduce the mesh size the GMRES solver doesn't converge! Actually it converges to almost a constant number...
Read more >
HOW DESCRIPTIVE ARE GMRES CONVERGENCE BOUNDS?
convergence for a highly non-normal matrix from a convection{di usion problem. Non-normality is closely related to eigenvalue instability 40], which can compli-.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found