# GMRES residual does not change with iteration

## GMRES residual does not change with iteration

Hi all

I am trying to solve a sparse system of linear equations using GMRES (7600 x 7600). I have not done any preconditioning yet. THe procedure of calling the subroutines follows the example for unsymmetric matrices given in the help files.

The problem I am facing is that after a certain number of iterations, the residual between two consecutive steps does not change. Well, it does change but very very slowly. I am talking about 1d-12 or smaller per iteration.

The system of equations solved nicely with PARDISO. As I need to solve a large system later on, I really need to get GMRES to work. Does anyone know any remedy to this problem? Another thing I should mention is that the iterative solver does not stop even when the maximum number of iterations specified has been exceeded. It just kept on iterating. Why is this so? The condition number of the matrix is about 5e6.

One final thing, does the arrangement of the system of equations affect the convergence of the solver? I have tried arranging it two ways and both of them gave the same outcome. Just to point out, I failed also to obtain a solution for the same matrix using the GMRES solver in Matlab.

Thank you.

Best wishes,

EH

15 posts / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,I don't think that idea to use GMRES without any precondition is pretty good. The number of GMRES iterations to achieve some accuracyproportional to condition number of matrix and nobody know coefficient of this proportional. So try to use some preconditioner (for example ilu0 or ilut or your own preconditioner) with GMRES to get good result.With best regards,Alexander Kalinkin

Hi Alex,
I have tried a simple diagonal preconditioner but it does not appear to be helping. I have not tried ilut or ilu0 yet because I am having troubles trying to get it to run properly.

By the way, when using ilut or ilu0, do you know what the parameter maxfil is for? The help menus says:

"maxfil --INTEGER. Maximum fill-in, half of the preconditioner bandwidth. The number of non-zero elements in the rows of the preconditioner can not exceed (2*maxfil+1)."

What is the appropriate value of maxfil, may I know?

Thank you so much.

Best wishes,
EH

Hi,It's a really hard question. If you set maxfil really huge then time of multiplication of your preconditioner on vector will be huge.. If you set maxfil really small then preconditioner will be bad and number of GMRES iterations will be huge...With best regards,Alexander Kalinkin

Hi Alex,
I tried a simple diagonal preconditioning but still face the same problem. Then I tried the ilu0 preconditioner in FORTRAN but somehow after the second iteration the Euclidean residual norm becomes NaN. I couldn't figure out what is going wrong. What problem do you thinkwould lead to the residual norm becoming NaN?

Thank you.

Best wishes,
EH

Hi,Such situation is typical when ilu0 preconditioner calculated incorrectly (number of rows in preconditioner is not equal number of row of stiffness matrix, element of preconditioner was modified etc...). Could you provide test case to reproduce your results on our side?With best regards,Alexander Kalinkin

Hi,

I've reproduced your issue the problem comes from your matrix. There are a
lot of string in initial matrix that have all elements before and on diagonal
are equal to zero. That's why ILU0 preconditioner return almost zero elements
on diagonal and several NAN appeared during solution process. Are you checks

With best regards,

Hi,
The condition number of the matrix is approximately 5e+06. This problem that you mentioned, will it also cause GMRES to iterate such that residual norm does not change?

If this is the matrix problem, does it mean that GMRES cannot solve this problem at all? Iterative sovlers would seem to be very limited.

EH

Hi,The iterative solvers are really useful if they are used with preconditioner. There is a huge number of different preconditioner, for example Jacobi, Gauss-Zeidel, preconditioners based on incomplete Cholesky decomposition, based on decomposition approach, and so on. But problem is that the best preconditioner based on initial differential equation that produced your system of linear equation. That's why it's hard to find the best combination of iterative solver + preconditioner without any knowledge about problem, domain of problem, elements that discretized the problem and etc. When you use direct solvers like PARDISO such problem doesn't exist but if you want to use iterative solver I need to know details I mentioned before to advice sufficiently good preconditioner. Could you provide such data here? If it is kind of secret you could provide it using private answer.With best regards,Alexander Kalinkin

Hi,
Sorry for the late reply. May I know what kind of information or details that you need? I am a little curious about thedetails that you need.

EH

Hi,

Any details will be useful, first of all: how you constructed this matrix?
Does it comes from some differential equation or not? If yes then could you
provide this differential equation, domain of problem and way of developing
discrete problem (FEM, finite difference).

With best regards,

Hi,
Well, the matrix comes from setting up a system of equations from thepartial differentialHelmholtz equation in 2D define over the square domain of [-0.5 0.5; -0.5 0.5]. The matrix was constructed using a meshless method based on the integral equation approach with radial basis function approximation. Each node has a local subdomain where the unknowns are approximated by the unknown values of the surrounding node. As such, the matrix generated is block banded and sparse. In this case, most of the values populate the diagonal of the matrix. It is unsymmetric though.

Thank you.

EH

Hi,What kind of your grid? Is it triangular orrectangular? I've asked it because there is direct solver of Helmoltz equation on uniform rectangular grid in MKL and if it's possible to use it as preconditioner then condition number of such system could be pretty good.With best regards,Alexander Kalinkin

The meshless nodes are placed in a uniform grid. The nodes used for the function approximation has no regular setting. They depend on various criteria such as the distance and the placement of nodes. What I mentioned earlier was for a 2D Helmholtz problem that I tried for after the main problem that I wanted couldn't work.

My objective is to solve a 3D fluid flow problem and the same problem with GMRES occurred, i.e. the iteration number increases but the residual does not change.

Best regards,
EH

Hi,Sorry for late reply. As I wrote before, it's really difficult to choose one perfect preconditioner to all variants of initial problem. You could use Gauss-Zeidel (D-L)^-1 of Jacobi (D)^-1 preconditioner (where A = -L +D -R, L-lower triangular, R-upper triangular and D-diagonal matrix), but I'm not sure that condition number of your problem will be good enough.With best regards,Alexander Kalinkin