[petsc-users] Behavior of KSP iterations when using Restart

Matthew Knepley knepley at gmail.com
Fri Jun 9 07:59:09 CDT 2023


On Fri, Jun 9, 2023 at 3:09 AM Nicolas Garcia Guzman <nicolas.garcia at tum.de>
wrote:

> Hi, sorry I will attach the logs of a run using 17 restart iterations and
> one using 19. Testing using other values like 100, the true residual norm
> does diverge. Is there any recommendation for this case? The linear system
> comes from a DGFEM discretization in FEniCS of a hyperbolic system of PDEs.
> The system is non-SPD, but the equations have been non-dimensionalized.
>
1) The problem is a breakdown in GMRES, indicated by DIVERGED_BREAKDOWN. We
can get specifics of the breakdown by adding the flag

  -info ksp

2) Neither solver is actually solving this system. We recommend first using
a (possibly slow) solver that solves the system, and then step-by-step
backing off it until you are happy with the performance. Here
I think we should first try accurate solves of the subdomain:

  -sub_pc_type lu

  Thanks,

     Matt



> ------------------------------
> *De:* Matthew Knepley <knepley at gmail.com>
> *Enviado:* viernes, 9 de junio de 2023 4:13:35
> *Para:* Nicolas Garcia Guzman
> *Cc:* petsc-users at mcs.anl.gov
> *Asunto:* Re: [petsc-users] Behavior of KSP iterations when using Restart
>
> On Thu, Jun 8, 2023 at 9:13 PM Nicolas Garcia Guzman <
> nicolas.garcia at tum.de> wrote:
>
>> Hello,
>>
>>
>> I am solving a linear system using petsc4py, with the following command:
>>
>>
>> python main.py -ksp_type gmres -ksp_gmres_restart 16 -ksp_max_it 180000
>> -ksp_monitor -ksp_converged_reason -ksp_rtol 1e-15 -pc_type asm
>> -sub_pc_type ilu -sub_pc_factor_levels 1 -sub_ksp_type preonly
>>
>>
>> In the script all I do is import the libraries, load the linear system,
>> set options and solve.
>>
>>
>> However, simply changing the restart parameter to something like 20, will
>> make the solution iterate to exactly 2 times the restart parameter, and
>> then say the iteration diverged. This happens every time no matter the
>> parameter chosen, unless it's 16 or less. Is this expected behavior or is
>> the problem coming from my linear system?
>>
>
> 1) Always send the complete output
>
> 2) I am guessing that the iteration stops because the restarted residual
> is too large.This could be due to your linear system. What kind of system
> are you solving?
>
>   Thanks,
>
>      Matt
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230609/3adeda84/attachment.html>


More information about the petsc-users mailing list