Monotonic convergence in FGMRES.
Hi all, I am running a linear problem discretized with FEM on a diffusion reaction system, with discontinuous source distribution. When I run FGMRes with geometric multigrid as its preconditioner, I notice that every time after the restart in fgmres, the new residual is orders of magnitude higher than the previous iteration. I might be wrong on this but should the restart not preserve monotonicity in convergence ? Or am I thinking of a different variant of Gmres here. Here's the residual norm as a function of iteration with number of restarts=50. 40 KSP Residual norm 2.489810374358e-06 41 KSP Residual norm 1.585813670005e-06 42 KSP Residual norm 1.059211836025e-06 43 KSP Residual norm 6.701461059247e-07 44 KSP Residual norm 4.127634824940e-07 45 KSP Residual norm 2.511364148934e-07 46 KSP Residual norm 1.307034672896e-07 47 KSP Residual norm 7.105770015635e-08 48 KSP Residual norm 4.098578230710e-08 49 KSP Residual norm 2.426160176080e-08 ------------------------------------------------------------------------- 50 KSP Residual norm 1.864914790828e+02 51 KSP Residual norm 6.741080961009e+01 52 KSP Residual norm 5.191621875736e+01 53 KSP Residual norm 4.513782866249e+01 54 KSP Residual norm 3.320195603375e+01 55 KSP Residual norm 2.699941296855e+01 56 KSP Residual norm 1.707998091297e+01 57 KSP Residual norm 1.219599670348e+01 Any suggestions to obtain a more smoother convergence would be much appreciated. Thank you, Vijay
On Tue, Dec 21, 2010 at 19:53, Vijay S. Mahadevan <[email protected]> wrote:
I am running a linear problem discretized with FEM on a diffusion reaction system, with discontinuous source distribution. When I run FGMRes with geometric multigrid as its preconditioner, I notice that every time after the restart in fgmres, the new residual is orders of magnitude higher than the previous iteration. I might be wrong on this but should the restart not preserve monotonicity in convergence ? Or am I thinking of a different variant of Gmres here.
It is not possible to guarantee monotonicity for nonsymmetric matrices without storing the full subspace. There is no variant of GMRES, or any Krylov method for that matter, that can do what you want. You are seeing a particularly large jump, if you actually have a linear preconditioner (if you don't use Krylov cycles inside your smoothers) then you might try using bcgs or some variant thereof which would avoid the high cost of restart. Or you could stop using restarts, it looks like you were getting close to an adequate tolerance. Or find a way to make the preconditioner strong enough to converge in a reasonable number of iterations.
Jed, I ask because after the restart, the residual changes 10 orders of magnitude and a-priori, it is quite hard to decide the restart number. Yes in the test case I presented, the residual gets close enough to the tolerance and I can afford few more vector storage but for a much refined problem, this might not be the case and so it worries me. My initial tests with bcgs were not satisfactory (very bad convergence as compared to gmres) but I tried GCR just now and it seems to converge correctly to the right solution, monotonically for the same problem. Alternatively, yes, I could make my preconditioner stronger (add more levels, more smoothing steps etc..) to converge within the restart limit. Barry, the matrix is not nearly singular although I have not yet looked at the effectiveness of the preconditoner thoroughly yet. It is possible that the preconditioned operator might have some undesired properties. Just to compare, the same linear system without any preconditioning takes about 2400 iterations and maybe that gives some ball park metric on the efficiency of the preconditioner.. Let me know if you want to know some other specific information to better understand the system. Vijay On Tue, Dec 21, 2010 at 1:10 PM, Jed Brown <[email protected]> wrote:
On Tue, Dec 21, 2010 at 19:53, Vijay S. Mahadevan <[email protected]> wrote:
I am running a linear problem discretized with FEM on a diffusion reaction system, with discontinuous source distribution. When I run FGMRes with geometric multigrid as its preconditioner, I notice that every time after the restart in fgmres, the new residual is orders of magnitude higher than the previous iteration. I might be wrong on this but should the restart not preserve monotonicity in convergence ? Or am I thinking of a different variant of Gmres here.
It is not possible to guarantee monotonicity for nonsymmetric matrices without storing the full subspace. There is no variant of GMRES, or any Krylov method for that matter, that can do what you want. You are seeing a particularly large jump, if you actually have a linear preconditioner (if you don't use Krylov cycles inside your smoothers) then you might try using bcgs or some variant thereof which would avoid the high cost of restart. Or you could stop using restarts, it looks like you were getting close to an adequate tolerance. Or find a way to make the preconditioner strong enough to converge in a reasonable number of iterations.
On Tue, Dec 21, 2010 at 21:16, Vijay S. Mahadevan <[email protected]> wrote:
Jed, I ask because after the restart, the residual changes 10 orders of magnitude and a-priori, it is quite hard to decide the restart number. Yes in the test case I presented, the residual gets close enough to the tolerance and I can afford few more vector storage but for a much refined problem, this might not be the case and so it worries me.
What happens if you run with -ksp_gmres_modifiedgramschmidt? This is slow in parallel, but provides insight into what is causing the problem. My initial tests with bcgs were not satisfactory (very bad convergence
as compared to gmres) but I tried GCR just now and it seems to converge correctly to the right solution, monotonically for the same problem.
GCR provides a cheap way to access the solution, see what it does with monitor_true_residual.
This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine. Barry On Dec 21, 2010, at 12:53 PM, Vijay S. Mahadevan wrote:
Hi all,
I am running a linear problem discretized with FEM on a diffusion reaction system, with discontinuous source distribution. When I run FGMRes with geometric multigrid as its preconditioner, I notice that every time after the restart in fgmres, the new residual is orders of magnitude higher than the previous iteration. I might be wrong on this but should the restart not preserve monotonicity in convergence ? Or am I thinking of a different variant of Gmres here. Here's the residual norm as a function of iteration with number of restarts=50.
40 KSP Residual norm 2.489810374358e-06 41 KSP Residual norm 1.585813670005e-06 42 KSP Residual norm 1.059211836025e-06 43 KSP Residual norm 6.701461059247e-07 44 KSP Residual norm 4.127634824940e-07 45 KSP Residual norm 2.511364148934e-07 46 KSP Residual norm 1.307034672896e-07 47 KSP Residual norm 7.105770015635e-08 48 KSP Residual norm 4.098578230710e-08 49 KSP Residual norm 2.426160176080e-08 ------------------------------------------------------------------------- 50 KSP Residual norm 1.864914790828e+02 51 KSP Residual norm 6.741080961009e+01 52 KSP Residual norm 5.191621875736e+01 53 KSP Residual norm 4.513782866249e+01 54 KSP Residual norm 3.320195603375e+01 55 KSP Residual norm 2.699941296855e+01 56 KSP Residual norm 1.707998091297e+01 57 KSP Residual norm 1.219599670348e+01
Any suggestions to obtain a more smoother convergence would be much appreciated. Thank you,
Vijay
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote:
This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
On Dec 21, 2010, at 2:08 PM, Jed Brown wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote: This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
No because it uses a recursive formula for "computing" the residual norm it does not compute it explicitly. So in extreme circumstances the recursively compute one generates "garbage". Barry
Barry, I tried with the true_residual_norm option and it gives me the exact same convergence as the one I have shown before. 45 KSP Residual norm 2.511364148934e-07 45 KSP preconditioned resid norm 2.511364148934e-07 true resid norm 1.865039278877e+02 ||Ae||/||Ax|| 2.699481989705e+02 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 46 KSP Residual norm 1.307034672896e-07 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 47 KSP Residual norm 7.105770015635e-08 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 48 KSP Residual norm 4.098578230710e-08 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 52 KSP Residual norm 5.191621875736e+01 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 53 KSP Residual norm 4.513782866249e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 54 KSP preconditioned resid norm 3.320195603375e+01 true resid norm 3.297361634749e+01 ||Ae||/||Ax|| 5.285029509147e+01 Vijay On Tue, Dec 21, 2010 at 2:23 PM, Barry Smith <[email protected]> wrote:
On Dec 21, 2010, at 2:08 PM, Jed Brown wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote: This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
No because it uses a recursive formula for "computing" the residual norm it does not compute it explicitly. So in extreme circumstances the recursively compute one generates "garbage".
Barry
On Tue, Dec 21, 2010 at 21:26, Vijay S. Mahadevan <[email protected]> wrote:
45 KSP preconditioned resid norm 2.511364148934e-07 true resid norm 1.865039278877e+02 ||Ae||/||Ax|| 2.699481989705e+02
The true residual is huge, this is not converging. You probably have a singular preconditioner. What are you using (-ksp_view) and what system are you solving with what discretization.
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small. Barry On Dec 21, 2010, at 2:26 PM, Vijay S. Mahadevan wrote:
Barry, I tried with the true_residual_norm option and it gives me the exact same convergence as the one I have shown before.
45 KSP Residual norm 2.511364148934e-07 45 KSP preconditioned resid norm 2.511364148934e-07 true resid norm 1.865039278877e+02 ||Ae||/||Ax|| 2.699481989705e+02 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 46 KSP Residual norm 1.307034672896e-07 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 47 KSP Residual norm 7.105770015635e-08 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 48 KSP Residual norm 4.098578230710e-08 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 52 KSP Residual norm 5.191621875736e+01 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 53 KSP Residual norm 4.513782866249e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 54 KSP preconditioned resid norm 3.320195603375e+01 true resid norm 3.297361634749e+01 ||Ae||/||Ax|| 5.285029509147e+01
Vijay
On Tue, Dec 21, 2010 at 2:23 PM, Barry Smith <[email protected]> wrote:
On Dec 21, 2010, at 2:08 PM, Jed Brown wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote: This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
No because it uses a recursive formula for "computing" the residual norm it does not compute it explicitly. So in extreme circumstances the recursively compute one generates "garbage".
Barry
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small. Ah yes. I was reading the output wrongly. Thanks for pointing that out. So then it is quite possible that my preconditioner is terrible for this problem.
Curiously with GCR, the true residual does converge. 62 KSP Residual norm 6.845396874593e-10 62 KSP preconditioned resid norm 6.845396874593e-10 true resid norm 6.845396874593e-10 ||Ae||/||Ax|| 1.063128003731e+00 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 63 KSP Residual norm 4.617426258215e-10 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 64 KSP Residual norm 3.659090331422e-10 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 65 KSP Residual norm 2.457005532004e-10 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01 66 KSP Residual norm 1.765446010945e-10 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01 Jed, with modified gram schmidt procedure, fgmres yields the following, which looks like the same as before: 49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 But I generally see that the true residual of GCR seems to converge to desired tolerance but for GMRES, the convergence stagnates with different options on my MG preconditioner. This is puzzling to me since I spent enough time making sure that the preconditioner was working correctly but I will look more into this now. Thanks for all the helpful comments guys ! I will post here if I find any other curious behavior. Vijay On Tue, Dec 21, 2010 at 2:30 PM, Barry Smith <[email protected]> wrote:
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small.
Barry
On Dec 21, 2010, at 2:26 PM, Vijay S. Mahadevan wrote:
Barry, I tried with the true_residual_norm option and it gives me the exact same convergence as the one I have shown before.
45 KSP Residual norm 2.511364148934e-07 45 KSP preconditioned resid norm 2.511364148934e-07 true resid norm 1.865039278877e+02 ||Ae||/||Ax|| 2.699481989705e+02 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 46 KSP Residual norm 1.307034672896e-07 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 47 KSP Residual norm 7.105770015635e-08 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 48 KSP Residual norm 4.098578230710e-08 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 52 KSP Residual norm 5.191621875736e+01 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 53 KSP Residual norm 4.513782866249e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 54 KSP preconditioned resid norm 3.320195603375e+01 true resid norm 3.297361634749e+01 ||Ae||/||Ax|| 5.285029509147e+01
Vijay
On Tue, Dec 21, 2010 at 2:23 PM, Barry Smith <[email protected]> wrote:
On Dec 21, 2010, at 2:08 PM, Jed Brown wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote: This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
No because it uses a recursive formula for "computing" the residual norm it does not compute it explicitly. So in extreme circumstances the recursively compute one generates "garbage".
Barry
The GCR algorithm computes the residual and hence the residual norm EXPLICITLY as part of the solution process, it does not use the recursive formula that FGMES uses. I "think" the use of the recursive formula is why FGMRES is cheaper than GCR (and hence much more commonly used). Barry On Dec 21, 2010, at 2:46 PM, Vijay S. Mahadevan wrote:
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small. Ah yes. I was reading the output wrongly. Thanks for pointing that out. So then it is quite possible that my preconditioner is terrible for this problem.
Curiously with GCR, the true residual does converge.
62 KSP Residual norm 6.845396874593e-10 62 KSP preconditioned resid norm 6.845396874593e-10 true resid norm 6.845396874593e-10 ||Ae||/||Ax|| 1.063128003731e+00 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 63 KSP Residual norm 4.617426258215e-10 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 64 KSP Residual norm 3.659090331422e-10 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 65 KSP Residual norm 2.457005532004e-10 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01 66 KSP Residual norm 1.765446010945e-10 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01
Jed, with modified gram schmidt procedure, fgmres yields the following, which looks like the same as before:
49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01
But I generally see that the true residual of GCR seems to converge to desired tolerance but for GMRES, the convergence stagnates with different options on my MG preconditioner. This is puzzling to me since I spent enough time making sure that the preconditioner was working correctly but I will look more into this now. Thanks for all the helpful comments guys ! I will post here if I find any other curious behavior.
Vijay
On Tue, Dec 21, 2010 at 2:30 PM, Barry Smith <[email protected]> wrote:
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small.
Barry
On Dec 21, 2010, at 2:26 PM, Vijay S. Mahadevan wrote:
Barry, I tried with the true_residual_norm option and it gives me the exact same convergence as the one I have shown before.
45 KSP Residual norm 2.511364148934e-07 45 KSP preconditioned resid norm 2.511364148934e-07 true resid norm 1.865039278877e+02 ||Ae||/||Ax|| 2.699481989705e+02 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 46 KSP Residual norm 1.307034672896e-07 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 47 KSP Residual norm 7.105770015635e-08 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 48 KSP Residual norm 4.098578230710e-08 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 52 KSP Residual norm 5.191621875736e+01 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 53 KSP Residual norm 4.513782866249e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 54 KSP preconditioned resid norm 3.320195603375e+01 true resid norm 3.297361634749e+01 ||Ae||/||Ax|| 5.285029509147e+01
Vijay
On Tue, Dec 21, 2010 at 2:23 PM, Barry Smith <[email protected]> wrote:
On Dec 21, 2010, at 2:08 PM, Jed Brown wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote: This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
No because it uses a recursive formula for "computing" the residual norm it does not compute it explicitly. So in extreme circumstances the recursively compute one generates "garbage".
Barry
Also GCR seems to use and allocate comparatively more vectors, translating to lot more memory. This does make FGMRES more attractive. I will look at the preconditioner and try to find the true cause of the issue. Cheers, Vijay On Tue, Dec 21, 2010 at 2:52 PM, Barry Smith <[email protected]> wrote:
The GCR algorithm computes the residual and hence the residual norm EXPLICITLY as part of the solution process, it does not use the recursive formula that FGMES uses. I "think" the use of the recursive formula is why FGMRES is cheaper than GCR (and hence much more commonly used).
Barry
On Dec 21, 2010, at 2:46 PM, Vijay S. Mahadevan wrote:
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small. Ah yes. I was reading the output wrongly. Thanks for pointing that out. So then it is quite possible that my preconditioner is terrible for this problem.
Curiously with GCR, the true residual does converge.
62 KSP Residual norm 6.845396874593e-10 62 KSP preconditioned resid norm 6.845396874593e-10 true resid norm 6.845396874593e-10 ||Ae||/||Ax|| 1.063128003731e+00 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 63 KSP Residual norm 4.617426258215e-10 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 64 KSP Residual norm 3.659090331422e-10 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 65 KSP Residual norm 2.457005532004e-10 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01 66 KSP Residual norm 1.765446010945e-10 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01
Jed, with modified gram schmidt procedure, fgmres yields the following, which looks like the same as before:
49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01
But I generally see that the true residual of GCR seems to converge to desired tolerance but for GMRES, the convergence stagnates with different options on my MG preconditioner. This is puzzling to me since I spent enough time making sure that the preconditioner was working correctly but I will look more into this now. Thanks for all the helpful comments guys ! I will post here if I find any other curious behavior.
Vijay
On Tue, Dec 21, 2010 at 2:30 PM, Barry Smith <[email protected]> wrote:
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small.
Barry
On Dec 21, 2010, at 2:26 PM, Vijay S. Mahadevan wrote:
Barry, I tried with the true_residual_norm option and it gives me the exact same convergence as the one I have shown before.
45 KSP Residual norm 2.511364148934e-07 45 KSP preconditioned resid norm 2.511364148934e-07 true resid norm 1.865039278877e+02 ||Ae||/||Ax|| 2.699481989705e+02 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 46 KSP Residual norm 1.307034672896e-07 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 47 KSP Residual norm 7.105770015635e-08 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 48 KSP Residual norm 4.098578230710e-08 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 52 KSP Residual norm 5.191621875736e+01 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 53 KSP Residual norm 4.513782866249e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 54 KSP preconditioned resid norm 3.320195603375e+01 true resid norm 3.297361634749e+01 ||Ae||/||Ax|| 5.285029509147e+01
Vijay
On Tue, Dec 21, 2010 at 2:23 PM, Barry Smith <[email protected]> wrote:
On Dec 21, 2010, at 2:08 PM, Jed Brown wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote: This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
No because it uses a recursive formula for "computing" the residual norm it does not compute it explicitly. So in extreme circumstances the recursively compute one generates "garbage".
Barry
On Dec 21, 2010, at 3:16 PM, Vijay S. Mahadevan wrote:
Also GCR seems to use and allocate comparatively more vectors, translating to lot more memory.
Yes
This does make FGMRES more attractive. I will look at the preconditioner and try to find the true cause of the issue.
Cheers, Vijay
On Tue, Dec 21, 2010 at 2:52 PM, Barry Smith <[email protected]> wrote:
The GCR algorithm computes the residual and hence the residual norm EXPLICITLY as part of the solution process, it does not use the recursive formula that FGMES uses. I "think" the use of the recursive formula is why FGMRES is cheaper than GCR (and hence much more commonly used).
Barry
On Dec 21, 2010, at 2:46 PM, Vijay S. Mahadevan wrote:
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small. Ah yes. I was reading the output wrongly. Thanks for pointing that out. So then it is quite possible that my preconditioner is terrible for this problem.
Curiously with GCR, the true residual does converge.
62 KSP Residual norm 6.845396874593e-10 62 KSP preconditioned resid norm 6.845396874593e-10 true resid norm 6.845396874593e-10 ||Ae||/||Ax|| 1.063128003731e+00 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 63 KSP Residual norm 4.617426258215e-10 63 KSP preconditioned resid norm 4.617426258215e-10 true resid norm 4.617426258215e-10 ||Ae||/||Ax|| 9.425403350509e-01 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 64 KSP Residual norm 3.659090331422e-10 64 KSP preconditioned resid norm 3.659090331422e-10 true resid norm 3.659090331422e-10 ||Ae||/||Ax|| 1.044433624917e+00 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 65 KSP Residual norm 2.457005532004e-10 65 KSP preconditioned resid norm 2.457005532004e-10 true resid norm 2.457005532004e-10 ||Ae||/||Ax|| 9.250757590415e-01 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01 66 KSP Residual norm 1.765446010945e-10 66 KSP preconditioned resid norm 1.765446010945e-10 true resid norm 1.765446010945e-10 ||Ae||/||Ax|| 9.880804659179e-01
Jed, with modified gram schmidt procedure, fgmres yields the following, which looks like the same as before:
49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01
But I generally see that the true residual of GCR seems to converge to desired tolerance but for GMRES, the convergence stagnates with different options on my MG preconditioner. This is puzzling to me since I spent enough time making sure that the preconditioner was working correctly but I will look more into this now. Thanks for all the helpful comments guys ! I will post here if I find any other curious behavior.
Vijay
On Tue, Dec 21, 2010 at 2:30 PM, Barry Smith <[email protected]> wrote:
Yes but look at the true residual norm it is huge and indicates the residual is not really getting small.
Barry
On Dec 21, 2010, at 2:26 PM, Vijay S. Mahadevan wrote:
Barry, I tried with the true_residual_norm option and it gives me the exact same convergence as the one I have shown before.
45 KSP Residual norm 2.511364148934e-07 45 KSP preconditioned resid norm 2.511364148934e-07 true resid norm 1.865039278877e+02 ||Ae||/||Ax|| 2.699481989705e+02 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 46 KSP Residual norm 1.307034672896e-07 46 KSP preconditioned resid norm 1.307034672896e-07 true resid norm 1.864478183180e+02 ||Ae||/||Ax|| 2.724877015479e+02 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 47 KSP Residual norm 7.105770015635e-08 47 KSP preconditioned resid norm 7.105770015635e-08 true resid norm 1.864563163311e+02 ||Ae||/||Ax|| 2.722662760395e+02 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 48 KSP Residual norm 4.098578230710e-08 48 KSP preconditioned resid norm 4.098578230710e-08 true resid norm 1.864560351328e+02 ||Ae||/||Ax|| 2.690284539995e+02 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 49 KSP Residual norm 2.426160176080e-08 49 KSP preconditioned resid norm 2.426160176080e-08 true resid norm 1.864897210364e+02 ||Ae||/||Ax|| 2.696456942624e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 50 KSP Residual norm 1.864914790828e+02 50 KSP preconditioned resid norm 1.864914790828e+02 true resid norm 1.864914790828e+02 ||Ae||/||Ax|| 2.798875072987e+02 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 51 KSP Residual norm 6.741080961009e+01 51 KSP preconditioned resid norm 6.741080961009e+01 true resid norm 6.759768469363e+01 ||Ae||/||Ax|| 1.666964983874e+02 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 52 KSP Residual norm 5.191621875736e+01 52 KSP preconditioned resid norm 5.191621875736e+01 true resid norm 5.146342142561e+01 ||Ae||/||Ax|| 7.225409161988e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 53 KSP Residual norm 4.513782866249e+01 53 KSP preconditioned resid norm 4.513782866249e+01 true resid norm 4.546883708687e+01 ||Ae||/||Ax|| 7.426476446334e+01 54 KSP preconditioned resid norm 3.320195603375e+01 true resid norm 3.297361634749e+01 ||Ae||/||Ax|| 5.285029509147e+01
Vijay
On Tue, Dec 21, 2010 at 2:23 PM, Barry Smith <[email protected]> wrote:
On Dec 21, 2010, at 2:08 PM, Jed Brown wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote: This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
No because it uses a recursive formula for "computing" the residual norm it does not compute it explicitly. So in extreme circumstances the recursively compute one generates "garbage".
Barry
Vijay, You should definitely follow Barry's suggestion and monitor the true residual (using -ksp_monitor_true_residual). Jed, I know this may sound odd given FGMRES uses right preconditioning, but I've seen that when the system is badly scaled, the preconditioned residual and the true residual reported by -ksp_monitor_true_residual can drift from one another. In such situations with the reported numbers are initially the same, but after a number of iterations, the preconditioned residual may continue to decrease but the true residual actually stagnates. Cheers, Dave On 21 December 2010 12:08, Jed Brown <[email protected]> wrote:
On Tue, Dec 21, 2010 at 21:04, Barry Smith <[email protected]> wrote:
This is a sign that the preconditioner is seriously messed up and should not be used in its current form. It can happen if the matrix is nearly singular and for example you use an incomplete factorization for a preconditioner that just screws up the scaling like totally. Run with -ksp_monitor_true_residual and you'll see that the solver is not really solving the problem even though it thinks it is converging fine.
FGMRES only does right preconditioning so it should be showing the true residual.
participants (4)
-
Barry Smith -
Dave May -
Jed Brown -
Vijay S. Mahadevan