gmres - restart and Gauss-Seidel

Lukasz Kaczmarczyk lukasz at civil.gla.ac.uk
Fri Aug 15 02:36:47 CDT 2008


Barry Smith wrote:
> 
> On Aug 14, 2008, at 5:09 PM, Lukasz Kaczmarczyk wrote:
> 
>> Hello,
>> I have implementation of geometric multi-grid for heterogeneous
>> quasi-brittle materials for hybrid-trefftz finite elements (degrees of
>> freedom are on faces -> small number of neighbours). Multi-grid
>> algorithm need smoothing, for that I use Gauss-Seidel, however SOR
>> implemented in PETSc is not parallel. That is way, I implemented my own
>> parallel Gauss-Seidel with colouring of faces in order to reduce
>> communication. Everything seems to work prefect, except that that for
>> GMRES after restart algorithm is divergent.
>                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
>     What do you mean? It is converging fine until you hit the restart
> iteration and
> then get a totally different residual norm? And then each iteration gives
> worse residuals?

Thanks You all for response. No, algorithm is stable to next restart

> 
>    Please run with -ksp_monitor_true_residual and send the output.
> If the preconditioner is not actually a linear operator (i.e. it has a
> bug in
> smoother) then the residual norm computed  in GMRES may be wrong
> and so GMRES may look like it is working but actually is basically
> chugging on garbage. Also run with -ksp_type fgmres
> -ksp_monitor_true_residual
> and send the output.
> 

I hope that this helps, I send three outputs:
1) -ksp_type gmres -ksp_gmres_restart 10
2) -ksp_type fgmres -ksp_gmres_restart 100 -ksp_monitor_true_residual
3) -ksp_type fgmres -ksp_gmres_restart 10  -ksp_monitor_true_residual

1) ksp_type gmres -ksp_gmres_restart 10

  0 KSP Residual norm 2.604671539574e+02
  1 KSP Residual norm 8.673339524769e+00
  2 KSP Residual norm 1.854343060681e+00
  3 KSP Residual norm 4.635172307027e-01
  4 KSP Residual norm 1.824358407207e-01
  5 KSP Residual norm 9.823366032782e-02
  6 KSP Residual norm 5.859833143089e-02
  7 KSP Residual norm 2.929617664041e-02
  8 KSP Residual norm 1.184403532587e-02
  9 KSP Residual norm 3.942287795560e-03
 10 KSP Residual norm 4.611215310185e+00
 11 KSP Residual norm 3.557713305907e-01
 12 KSP Residual norm 1.911999331832e-01
 13 KSP Residual norm 1.048287519555e-01
 14 KSP Residual norm 5.745962963315e-02
 15 KSP Residual norm 5.238562834476e-02
 16 KSP Residual norm 5.046872351948e-02
 17 KSP Residual norm 5.041805668527e-02
 18 KSP Residual norm 4.952005417494e-02
 19 KSP Residual norm 4.950805199415e-02
 20 KSP Residual norm 8.581369434072e+00
 21 KSP Residual norm 8.168490133118e-01
 22 KSP Residual norm 1.416002910406e-01
 23 KSP Residual norm 6.679961898612e-02
 24 KSP Residual norm 5.031183883430e-02
 25 KSP Residual norm 4.670843908572e-02
 26 KSP Residual norm 4.662064456590e-02
 27 KSP Residual norm 4.652217965668e-02
 28 KSP Residual norm 4.611529866498e-02
 29 KSP Residual norm 4.610330586416e-02
 30 KSP Residual norm 9.139117000729e+00
 31 KSP Residual norm 1.170939505327e+00
 32 KSP Residual norm 1.783857007759e-01
 33 KSP Residual norm 1.413658128682e-01
 34 KSP Residual norm 1.411820201886e-01
 35 KSP Residual norm 1.372634877051e-01


2) -ksp_type fgmres -ksp_gmres_restart 100 -ksp_monitor_true_residual
  0 KSP Residual norm 8.770931682456e+05
  0 KSP preconditioned resid norm 8.770931682456e+05 true resid norm
8.770931682456e+05 ||Ae||/||Ax|| 2.025559907164e+06
  1 KSP Residual norm 1.466659768959e+00
  1 KSP preconditioned resid norm 1.466659768959e+00 true resid norm
1.466659768959e+00 ||Ae||/||Ax|| 3.387105649673e+00
  2 KSP Residual norm 2.135783619677e-01
  2 KSP preconditioned resid norm 2.135783619677e-01 true resid norm
2.135783619678e-01 ||Ae||/||Ax|| 4.932380991006e-01
  3 KSP Residual norm 1.342354228152e-01
  3 KSP preconditioned resid norm 1.342354228152e-01 true resid norm
1.342354228151e-01 ||Ae||/||Ax|| 3.100034299884e-01
  4 KSP Residual norm 7.872906297489e-02
  4 KSP preconditioned resid norm 7.872906297489e-02 true resid norm
7.872906297491e-02 ||Ae||/||Ax|| 1.818169828064e-01
  5 KSP Residual norm 3.414496482864e-02
  5 KSP preconditioned resid norm 3.414496482864e-02 true resid norm
3.414496482865e-02 ||Ae||/||Ax|| 7.885441854116e-02
  6 KSP Residual norm 2.025183908090e-02
  6 KSP preconditioned resid norm 2.025183908090e-02 true resid norm
2.025183908092e-02 ||Ae||/||Ax|| 4.676961897981e-02
  7 KSP Residual norm 1.023707179274e-02
  7 KSP preconditioned resid norm 1.023707179274e-02 true resid norm
1.023707179279e-02 ||Ae||/||Ax|| 2.364150462111e-02
  8 KSP Residual norm 4.938281368004e-03
  8 KSP preconditioned resid norm 4.938281368004e-03 true resid norm
4.938281368031e-03 ||Ae||/||Ax|| 1.140447230867e-02
  9 KSP Residual norm 2.373276511281e-03
  9 KSP preconditioned resid norm 2.373276511281e-03 true resid norm
2.373276511245e-03 ||Ae||/||Ax|| 5.480847330515e-03
 10 KSP Residual norm 1.180493643594e-03
 10 KSP preconditioned resid norm 1.180493643594e-03 true resid norm
1.180493643635e-03 ||Ae||/||Ax|| 2.726233291716e-03
 11 KSP Residual norm 7.142592937639e-04
 11 KSP preconditioned resid norm 7.142592937639e-04 true resid norm
7.142592936809e-04 ||Ae||/||Ax|| 1.649511181911e-03
 12 KSP Residual norm 4.226036746778e-04
 12 KSP preconditioned resid norm 4.226036746778e-04 true resid norm
4.226036746206e-04 ||Ae||/||Ax|| 9.759613812110e-04
 13 KSP Residual norm 2.572539106719e-04
 13 KSP preconditioned resid norm 2.572539106719e-04 true resid norm
2.572539106261e-04 ||Ae||/||Ax|| 5.941024582002e-04
 14 KSP Residual norm 1.444791718863e-04
 14 KSP preconditioned resid norm 1.444791718863e-04 true resid norm
1.444791718510e-04 ||Ae||/||Ax|| 3.336603550419e-04
 15 KSP Residual norm 8.492790274639e-05
 15 KSP preconditioned resid norm 8.492790274639e-05 true resid norm
8.492790267409e-05 ||Ae||/||Ax|| 1.961325898824e-04
 16 KSP Residual norm 4.707269600494e-05
 16 KSP preconditioned resid norm 4.707269600494e-05 true resid norm
4.707269601177e-05 ||Ae||/||Ax|| 1.087097348555e-04
 17 KSP Residual norm 2.692621130650e-05
 17 KSP preconditioned resid norm 2.692621130650e-05 true resid norm
2.692621130585e-05 ||Ae||/||Ax|| 6.218342138276e-05
 18 KSP Residual norm 1.339283607815e-05
 18 KSP preconditioned resid norm 1.339283607815e-05 true resid norm
1.339283617815e-05 ||Ae||/||Ax|| 3.092943029068e-05
 19 KSP Residual norm 8.006569523728e-06
 19 KSP preconditioned resid norm 8.006569523728e-06 true resid norm
8.006569546889e-06 ||Ae||/||Ax|| 1.849038033273e-05
 20 KSP Residual norm 5.048620120372e-06
 20 KSP preconditioned resid norm 5.048620120372e-06 true resid norm
5.048620165524e-06 ||Ae||/||Ax|| 1.165928884641e-05
 21 KSP Residual norm 3.079047055409e-06
 21 KSP preconditioned resid norm 3.079047055409e-06 true resid norm
3.079047092852e-06 ||Ae||/||Ax|| 7.110754671622e-06
 22 KSP Residual norm 1.837917124370e-06
 22 KSP preconditioned resid norm 1.837917124370e-06 true resid norm
1.837917088425e-06 ||Ae||/||Ax|| 4.244487703000e-06
 23 KSP Residual norm 8.755715968227e-07
 23 KSP preconditioned resid norm 8.755715968227e-07 true resid norm
8.755715746951e-07 ||Ae||/||Ax|| 2.022045937380e-06
 24 KSP Residual norm 4.460215115186e-07
 24 KSP preconditioned resid norm 4.460215115186e-07 true resid norm
4.460215473811e-07 ||Ae||/||Ax|| 1.030042641779e-06
 25 KSP Residual norm 2.074601204717e-07
 25 KSP preconditioned resid norm 2.074601204717e-07 true resid norm
2.074601610498e-07 ||Ae||/||Ax|| 4.791087193129e-07
 26 KSP Residual norm 1.078594582430e-07
 26 KSP preconditioned resid norm 1.078594582430e-07 true resid norm
1.078594313079e-07 ||Ae||/||Ax|| 2.490906868011e-07
 27 KSP Residual norm 5.595789534852e-08
 27 KSP preconditioned resid norm 5.595789534852e-08 true resid norm
5.595808793116e-08 ||Ae||/||Ax|| 1.292296685216e-07
 28 KSP Residual norm 2.866350154035e-08
 28 KSP preconditioned resid norm 2.866350154035e-08 true resid norm
2.866379598785e-08 ||Ae||/||Ax|| 6.619620131833e-08
 29 KSP Residual norm 1.602353949308e-08
 29 KSP preconditioned resid norm 1.602353949308e-08 true resid norm
1.602386060096e-08 ||Ae||/||Ax|| 3.700552092568e-08
 30 KSP Residual norm 8.795011075741e-09
 30 KSP preconditioned resid norm 8.795011075741e-09 true resid norm
8.795292666765e-09 ||Ae||/||Ax|| 2.031185835503e-08
 31 KSP Residual norm 4.077129947799e-09
 31 KSP preconditioned resid norm 4.077129947799e-09 true resid norm
4.079852425518e-09 ||Ae||/||Ax|| 9.422015584506e-09
 32 KSP Residual norm 1.739123114987e-09
 32 KSP preconditioned resid norm 1.739123114987e-09 true resid norm
1.743717145343e-09 ||Ae||/||Ax|| 4.026942253017e-09
 33 KSP Residual norm 8.452345380894e-10
 33 KSP preconditioned resid norm 8.452345380894e-10 true resid norm
8.816532993133e-10 ||Ae||/||Ax|| 2.036091078762e-09
 34 KSP Residual norm 3.861058363559e-10
 34 KSP preconditioned resid norm 3.861058363559e-10 true resid norm
3.853896597046e-10 ||Ae||/||Ax|| 8.900192950935e-10
 35 KSP Residual norm 1.986142320978e-10

3) -ksp_type fgmres -ksp_gmres_restart 10  -ksp_monitor_true_residual
  0 KSP Residual norm 8.770931682456e+05
  0 KSP preconditioned resid norm 8.770931682456e+05 true resid norm
8.770931682456e+05 ||Ae||/||Ax|| 2.025559907164e+06
  1 KSP Residual norm 1.466659768959e+00
  1 KSP preconditioned resid norm 1.466659768959e+00 true resid norm
1.466659768959e+00 ||Ae||/||Ax|| 3.387105649673e+00
  2 KSP Residual norm 2.135783619677e-01
  2 KSP preconditioned resid norm 2.135783619677e-01 true resid norm
2.135783619678e-01 ||Ae||/||Ax|| 4.932380991006e-01
  3 KSP Residual norm 1.342354228152e-01
  3 KSP preconditioned resid norm 1.342354228152e-01 true resid norm
1.342354228151e-01 ||Ae||/||Ax|| 3.100034299884e-01
  4 KSP Residual norm 7.872906297489e-02
  4 KSP preconditioned resid norm 7.872906297489e-02 true resid norm
7.872906297491e-02 ||Ae||/||Ax|| 1.818169828064e-01
  5 KSP Residual norm 3.414496482864e-02
  5 KSP preconditioned resid norm 3.414496482864e-02 true resid norm
3.414496482865e-02 ||Ae||/||Ax|| 7.885441854116e-02
  6 KSP Residual norm 2.025183908090e-02
  6 KSP preconditioned resid norm 2.025183908090e-02 true resid norm
2.025183908092e-02 ||Ae||/||Ax|| 4.676961897981e-02
  7 KSP Residual norm 1.023707179274e-02
  7 KSP preconditioned resid norm 1.023707179274e-02 true resid norm
1.023707179279e-02 ||Ae||/||Ax|| 2.364150462111e-02
  8 KSP Residual norm 4.938281368004e-03
  8 KSP preconditioned resid norm 4.938281368004e-03 true resid norm
4.938281368031e-03 ||Ae||/||Ax|| 1.140447230867e-02
  9 KSP Residual norm 2.373276511281e-03
  9 KSP preconditioned resid norm 2.373276511281e-03 true resid norm
2.373276511245e-03 ||Ae||/||Ax|| 5.480847330515e-03
 10 KSP Residual norm 1.180493643635e-03
 10 KSP preconditioned resid norm 1.180493643635e-03 true resid norm
1.180493643635e-03 ||Ae||/||Ax|| 2.726233291716e-03
 11 KSP Residual norm 8.973593571160e-04
 11 KSP preconditioned resid norm 8.973593571160e-04 true resid norm
8.973593570913e-04 ||Ae||/||Ax|| 2.072362665506e-03
 12 KSP Residual norm 8.954054180580e-04
 12 KSP preconditioned resid norm 8.954054180580e-04 true resid norm
8.954054180762e-04 ||Ae||/||Ax|| 2.067850236641e-03
 13 KSP Residual norm 8.509609619524e-04
 13 KSP preconditioned resid norm 8.509609619524e-04 true resid norm
8.509609619593e-04 ||Ae||/||Ax|| 1.965210161828e-03
 14 KSP Residual norm 8.458566359370e-04
 14 KSP preconditioned resid norm 8.458566359370e-04 true resid norm
8.458566359291e-04 ||Ae||/||Ax|| 1.953422225798e-03
 15 KSP Residual norm 8.372984660266e-04
 15 KSP preconditioned resid norm 8.372984660266e-04 true resid norm
8.372984660471e-04 ||Ae||/||Ax|| 1.933657979058e-03
 16 KSP Residual norm 7.279198160941e-04
 16 KSP preconditioned resid norm 7.279198160941e-04 true resid norm
7.279198160961e-04 ||Ae||/||Ax|| 1.681058807086e-03
 17 KSP Residual norm 7.254072398644e-04
 17 KSP preconditioned resid norm 7.254072398644e-04 true resid norm
7.254072398528e-04 ||Ae||/||Ax|| 1.675256260804e-03
 18 KSP Residual norm 6.813582761007e-04
 18 KSP preconditioned resid norm 6.813582761007e-04 true resid norm
6.813582760932e-04 ||Ae||/||Ax|| 1.573529536468e-03
 19 KSP Residual norm 5.556242867367e-04
 19 KSP preconditioned resid norm 5.556242867367e-04 true resid norm
5.556242867546e-04 ||Ae||/||Ax|| 1.283159326104e-03
 20 KSP Residual norm 4.379413135337e-04
 20 KSP preconditioned resid norm 4.379413135337e-04 true resid norm
4.379413135337e-04 ||Ae||/||Ax|| 1.011382141032e-03
 21 KSP Residual norm 4.159789873039e-04
 21 KSP preconditioned resid norm 4.159789873039e-04 true resid norm
4.159789873292e-04 ||Ae||/||Ax|| 9.606623212470e-04
 22 KSP Residual norm 3.988218089618e-04
 22 KSP preconditioned resid norm 3.988218089618e-04 true resid norm
3.988218089773e-04 ||Ae||/||Ax|| 9.210395150869e-04
 23 KSP Residual norm 3.981102611370e-04
 23 KSP preconditioned resid norm 3.981102611370e-04 true resid norm
3.981102611544e-04 ||Ae||/||Ax|| 9.193962657785e-04
 24 KSP Residual norm 3.619785012910e-04
 24 KSP preconditioned resid norm 3.619785012910e-04 true resid norm
3.619785013142e-04 ||Ae||/||Ax|| 8.359535406984e-04
 25 KSP Residual norm 3.351791646576e-04
 25 KSP preconditioned resid norm 3.351791646576e-04 true resid norm
3.351791646837e-04 ||Ae||/||Ax|| 7.740631238275e-04
 26 KSP Residual norm 3.051027323014e-04
 26 KSP preconditioned resid norm 3.051027323014e-04 true resid norm
3.051027323283e-04 ||Ae||/||Ax|| 7.046045785610e-04
 27 KSP Residual norm 2.977852161346e-04
 27 KSP preconditioned resid norm 2.977852161346e-04 true resid norm
2.977852161482e-04 ||Ae||/||Ax|| 6.877054988155e-04
 28 KSP Residual norm 2.507200839706e-04
 28 KSP preconditioned resid norm 2.507200839706e-04 true resid norm
2.507200839354e-04 ||Ae||/||Ax|| 5.790132318055e-04
 29 KSP Residual norm 1.792952379074e-04
 29 KSP preconditioned resid norm 1.792952379074e-04 true resid norm
1.792952379357e-04 ||Ae||/||Ax|| 4.140646155464e-04
 30 KSP Residual norm 1.539920471163e-04
 30 KSP preconditioned resid norm 1.539920471163e-04 true resid norm
1.539920471163e-04 ||Ae||/||Ax|| 3.556293994227e-04
 31 KSP Residual norm 1.538529289011e-04
 31 KSP preconditioned resid norm 1.538529289011e-04 true resid norm
1.538529288671e-04 ||Ae||/||Ax|| 3.553081195881e-04
 32 KSP Residual norm 1.504592268331e-04
 32 KSP preconditioned resid norm 1.504592268331e-04 true resid norm
1.504592268204e-04 ||Ae||/||Ax|| 3.474707004273e-04
 33 KSP Residual norm 1.504404986449e-04
 33 KSP preconditioned resid norm 1.504404986449e-04 true resid norm
1.504404986576e-04 ||Ae||/||Ax|| 3.474274495880e-04
 34 KSP Residual norm 1.411298358801e-04
 34 KSP preconditioned resid norm 1.411298358801e-04 true resid norm
1.411298358680e-04 ||Ae||/||Ax|| 3.259253949163e-04
 35 KSP Residual norm 1.128668990420e-04






More information about the petsc-users mailing list