[petsc-users] GAMG failure
Mark Adams
mfadams at lbl.gov
Mon Mar 27 20:11:57 CDT 2023
Yes, the eigen estimates are converging slowly.
BTW, have you tried hypre? It is a good solver (lots lots more woman years)
These eigen estimates are conceptually simple, but they can lead to
problems like this (hypre and an eigen estimate free smoother).
But try this (good to have options anyway):
-pc_gamg_esteig_ksp_max_it 20
Chevy will scale the estimate that we give by, I think, 5% by default.
Maybe 10.
You can set that with:
-mg_levels_ksp_chebyshev_esteig 0,0.2,0,*1.05*
0.2 is the scaling of the high eigen estimate for the low eigen value in
Chebyshev.
On Mon, Mar 27, 2023 at 5:06 PM Blaise Bourdin <bourdin at mcmaster.ca> wrote:
>
>
> On Mar 24, 2023, at 3:21 PM, Mark Adams <mfadams at lbl.gov> wrote:
>
> * Do you set:
>
> PetscCall(MatSetOption(Amat, MAT_SPD, PETSC_TRUE));
>
> PetscCall(MatSetOption(Amat, MAT_SPD_ETERNAL, PETSC_TRUE));
>
>
> Yes
>
>
> Do that to get CG Eigen estimates. Outright failure is usually caused by a
> bad Eigen estimate.
> -pc_gamg_esteig_ksp_monitor_singular_value
> Will print out the estimates as its iterating. You can look at that to
> check that the max has converged.
>
>
> I just did, and something is off:
> I do multiple calls to SNESSolve (staggered scheme for phase-field
> fracture), but only get informations on the first solve (which is not the
> one failing, of course)
> Here is what I get:
> Residual norms for Displacement_pc_gamg_esteig_ solve.
> 0 KSP Residual norm 7.636421712860e+01 % max 1.000000000000e+00 min
> 1.000000000000e+00 max/min 1.000000000000e+00
> 1 KSP Residual norm 3.402024867977e+01 % max 1.114319928921e+00 min
> 1.114319928921e+00 max/min 1.000000000000e+00
> 2 KSP Residual norm 2.124815079671e+01 % max 1.501143586520e+00 min
> 5.739351119078e-01 max/min 2.615528402732e+00
> 3 KSP Residual norm 1.581785698912e+01 % max 1.644351137983e+00 min
> 3.263683482596e-01 max/min 5.038329074347e+00
> 4 KSP Residual norm 1.254871990315e+01 % max 1.714668863819e+00 min
> 2.044075812142e-01 max/min 8.388479789416e+00
> 5 KSP Residual norm 1.051198229090e+01 % max 1.760078533063e+00 min
> 1.409327403114e-01 max/min 1.248878386367e+01
> 6 KSP Residual norm 9.061658306086e+00 % max 1.792995287686e+00 min
> 1.023484740555e-01 max/min 1.751853463603e+01
> 7 KSP Residual norm 8.015529297567e+00 % max 1.821497535985e+00 min
> 7.818018001928e-02 max/min 2.329871248104e+01
> 8 KSP Residual norm 7.201063258957e+00 % max 1.855140071935e+00 min
> 6.178572472468e-02 max/min 3.002538337458e+01
> 9 KSP Residual norm 6.548491711695e+00 % max 1.903578294573e+00 min
> 5.008612895206e-02 max/min 3.800609738466e+01
> 10 KSP Residual norm 6.002109992255e+00 % max 1.961356890125e+00 min
> 4.130572033722e-02 max/min 4.748390475004e+01
> Residual norms for Displacement_pc_gamg_esteig_ solve.
> 0 KSP Residual norm 2.373573910237e+02 % max 1.000000000000e+00 min
> 1.000000000000e+00 max/min 1.000000000000e+00
> 1 KSP Residual norm 8.845061415709e+01 % max 1.081192207576e+00 min
> 1.081192207576e+00 max/min 1.000000000000e+00
> 2 KSP Residual norm 5.607525485152e+01 % max 1.345947059840e+00 min
> 5.768825326129e-01 max/min 2.333138869267e+00
> 3 KSP Residual norm 4.123522550864e+01 % max 1.481153523075e+00 min
> 3.070603564913e-01 max/min 4.823655974348e+00
> 4 KSP Residual norm 3.345765664017e+01 % max 1.551374710727e+00 min
> 1.953487694959e-01 max/min 7.941563771968e+00
> 5 KSP Residual norm 2.859712984893e+01 % max 1.604588395452e+00 min
> 1.313871480574e-01 max/min 1.221267391199e+01
> 6 KSP Residual norm 2.525636054248e+01 % max 1.650487481750e+00 min
> 9.322735730688e-02 max/min 1.770389646804e+01
> 7 KSP Residual norm 2.270711391451e+01 % max 1.697243639599e+00 min
> 6.945419058256e-02 max/min 2.443687883140e+01
> 8 KSP Residual norm 2.074739485241e+01 % max 1.737293728907e+00 min
> 5.319942519758e-02 max/min 3.265624999621e+01
> 9 KSP Residual norm 1.912808268870e+01 % max 1.771708608618e+00 min
> 4.229776586667e-02 max/min 4.188657656771e+01
> 10 KSP Residual norm 1.787394414641e+01 % max 1.802834420843e+00 min
> 3.460455235448e-02 max/min 5.209818645753e+01
> Residual norms for Displacement_pc_gamg_esteig_ solve.
> 0 KSP Residual norm 1.361990679391e+03 % max 1.000000000000e+00 min
> 1.000000000000e+00 max/min 1.000000000000e+00
> 1 KSP Residual norm 5.377188333825e+02 % max 1.086812916769e+00 min
> 1.086812916769e+00 max/min 1.000000000000e+00
> 2 KSP Residual norm 2.819790765047e+02 % max 1.474233179517e+00 min
> 6.475176340551e-01 max/min 2.276745994212e+00
> 3 KSP Residual norm 1.856720658591e+02 % max 1.646049713883e+00 min
> 4.391851040105e-01 max/min 3.747963441500e+00
> 4 KSP Residual norm 1.446507859917e+02 % max 1.760403013135e+00 min
> 2.972886103795e-01 max/min 5.921528614526e+00
> 5 KSP Residual norm 1.212491636433e+02 % max 1.839250080524e+00 min
> 1.921591413785e-01 max/min 9.571494061277e+00
> 6 KSP Residual norm 1.052783637696e+02 % max 1.887062042760e+00 min
> 1.275920366984e-01 max/min 1.478981048966e+01
> 7 KSP Residual norm 9.230292625762e+01 % max 1.917891358356e+00 min
> 8.853577120467e-02 max/min 2.166233300122e+01
> 8 KSP Residual norm 8.262607594297e+01 % max 1.935857204308e+00 min
> 6.706949937710e-02 max/min 2.886345093206e+01
> 9 KSP Residual norm 7.616474911000e+01 % max 1.946323901431e+00 min
> 5.354310733090e-02 max/min 3.635059671458e+01
> 10 KSP Residual norm 7.138356892221e+01 % max 1.954382723686e+00 min
> 4.367661484659e-02 max/min 4.474666204216e+01
> Residual norms for Displacement_pc_gamg_esteig_ solve.
> 0 KSP Residual norm 3.702300162209e+03 % max 1.000000000000e+00 min
> 1.000000000000e+00 max/min 1.000000000000e+00
> 1 KSP Residual norm 1.255008322497e+03 % max 9.938792139169e-01 min
> 9.938792139169e-01 max/min 1.000000000000e+00
> 2 KSP Residual norm 6.727201181977e+02 % max 1.297844907149e+00 min
> 6.478406586220e-01 max/min 2.003339694532e+00
> 3 KSP Residual norm 5.218419298230e+02 % max 1.435817121668e+00 min
> 3.868381643086e-01 max/min 3.711673909512e+00
> 4 KSP Residual norm 4.562548407646e+02 % max 1.507841675332e+00 min
> 1.835807205925e-01 max/min 8.213507771759e+00
> 5 KSP Residual norm 3.829651184063e+02 % max 1.544809112105e+00 min
> 9.645201420491e-02 max/min 1.601634890510e+01
> 6 KSP Residual norm 2.858162778588e+02 % max 1.571662611009e+00 min
> 6.326714268751e-02 max/min 2.484168786904e+01
> 7 KSP Residual norm 2.074805889949e+02 % max 1.587767457742e+00 min
> 5.145942909400e-02 max/min 3.085474296347e+01
> 8 KSP Residual norm 1.566220417755e+02 % max 1.597548616381e+00 min
> 4.650092979233e-02 max/min 3.435519727274e+01
> 9 KSP Residual norm 1.157894309297e+02 % max 1.603863600136e+00 min
> 4.344076378399e-02 max/min 3.692070443585e+01
> 10 KSP Residual norm 8.447209442299e+01 % max 1.608204129656e+00 min
> 4.123402730882e-02 max/min 3.900186895670e+01
> Linear Displacement_ solve converged due to CONVERGED_RTOL iterations 14
>
>
>
>
>
> * -pc_gamg_aggressive_coarsening 0
>
> will slow coarsening as well as threshold.
>
> That did not help
>
>
> * you can run with '-info :pc' and send me the output (grep on GAMG)
>
> Let’s try to figure out if the fact
> that -pc_gamg_esteig_ksp_monitor_singular_value is an indication of a
> problem first.
>
> Blaise
>
> —
> Canada Research Chair in Mathematical and Computational Aspects of Solid
> Mechanics (Tier 1)
> Professor, Department of Mathematics & Statistics
> Hamilton Hall room 409A, McMaster University
> 1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada
> https://www.math.mcmaster.ca/bourdin | +1 (905) 525 9140 ext. 27243
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230327/79becd0f/attachment-0001.html>
More information about the petsc-users
mailing list