[petsc-users] Problem running ex54f with GAMG

Fabio Durastante fabio.durastante at unipi.it
Mon Mar 21 02:56:38 CDT 2022


Thank you very much for the fast answers and for the insight.

Indeed, I tried changing Richardson with Chebyshev (while keeping fixed all the rest), and the  method did converge in 39 iterations.

Richards and GMRES instead has a very slow convergence as you were expecting (around one thousand iterations for a four digit relative residual, at that point I terminated it), even if it had come to convergence it would have been a waste for an SPD system.

Best,

Fabio


Il 18/03/22 23:14, Mark Adams ha scritto:
> MG is not stable with richardson/jacobi, or at least it is almost not stable.
> Yea I would guess gmres will go forever because it does not care.
> I think CG exists when it gets a negative number for beta or whatever and it was probably -eps.
> That is my guess.
>
> On Fri, Mar 18, 2022 at 3:17 PM Barry Smith <bsmith at petsc.dev> wrote:
>
>
>       The GAMG produced an indefinite operator. I don't know if there is a way to detect why this happened or how to stop it.
>
>       You can try -ksp_type gmres and see how that goes since it can handle an indefinite preconditioner.
>
>
>
>     > On Mar 18, 2022, at 11:53 AM, Fabio Durastante <fabio.durastante at unipi.it> wrote:
>     >
>     > For the default case:
>     >
>     > Linear solve converged due to CONVERGED_ATOL iterations 14
>     >
>     > for the other it tells
>     >
>     > Linear solve did not converge due to DIVERGED_INDEFINITE_PC iterations 2
>     >
>     > that again seems a bit strange to me, since this should be a symmetric V-cycle built on smoothed aggregation that should be definite (and symmetric).
>     >
>     > Fabio
>     >
>     > Il 18/03/22 16:47, Barry Smith ha scritto:
>     >>   Run with -ksp_converged_reason to have it print why it has stopped the iteration.
>     >>
>     >>
>     >>> On Mar 18, 2022, at 11:44 AM, Fabio Durastante <fabio.durastante at unipi.it> wrote:
>     >>>
>     >>> Hi everybody,
>     >>>
>     >>> I'm trying to run the rotated anisotropy example ex54f using CG and GAMG as preconditioner, I run it with the command:
>     >>>
>     >>> mpirun -np 2 ./ex54f -ne 1011 \
>     >>> -theta 18.0 \
>     >>> -epsilon 100.0 \
>     >>> -pc_type gamg \
>     >>> -pc_gamg_type agg \
>     >>> -log_view \
>     >>> -log_trace \
>     >>> -ksp_view \
>     >>> -ksp_monitor \
>     >>> -ksp_type cg \
>     >>> -mg_levels_pc_type jacobi \
>     >>> -mg_levels_ksp_type richardson \
>     >>> -mg_levels_ksp_max_it 4 \
>     >>> -ksp_atol 1e-9 \
>     >>> -ksp_rtol 1e-12
>     >>>
>     >>> But the KSP CG seems to stop just after two iterations:
>     >>>
>     >>>   0 KSP Residual norm 6.666655711717e-02
>     >>>   1 KSP Residual norm 9.859661350927e-03
>     >>>
>     >>> I'm attaching the full log, the problem seems to appear when I modify the value of epsilon, if I leave it to the default (1.0) it prints
>     >>>
>     >>>   0 KSP Residual norm 5.862074869050e+00
>     >>>   1 KSP Residual norm 5.132711016122e-01
>     >>>   2 KSP Residual norm 1.198566629717e-01
>     >>>   3 KSP Residual norm 1.992885901625e-02
>     >>>   4 KSP Residual norm 4.919780086064e-03
>     >>>   5 KSP Residual norm 1.417045143681e-03
>     >>>   6 KSP Residual norm 3.559622318760e-04
>     >>>   7 KSP Residual norm 9.270786187701e-05
>     >>>   8 KSP Residual norm 1.886403709163e-05
>     >>>   9 KSP Residual norm 2.940634415714e-06
>     >>>  10 KSP Residual norm 5.015043022637e-07
>     >>>  11 KSP Residual norm 9.760219712757e-08
>     >>>  12 KSP Residual norm 2.320857464659e-08
>     >>>  13 KSP Residual norm 4.563772507631e-09
>     >>>  14 KSP Residual norm 8.896675476997e-10
>     >>>
>     >>> that is very strange because the case with epsilon 1 should be easier.
>     >>>
>     >>> Any help with this would be great.
>     >>>
>     >>> Thank you very much,
>     >>>
>     >>> Fabio Durastante
>     >>> <log_ex54f.txt>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220321/a1f6980e/attachment.html>


More information about the petsc-users mailing list