[petsc-users] Preconditioning Diagnostics

Matthew Knepley knepley at gmail.com
Tue May 3 15:43:29 CDT 2022

On Tue, May 3, 2022 at 3:28 PM Barry Smith <bsmith at petsc.dev> wrote:

>   A difficult question with no easy answers.
>   First, do you have a restart system so you can save your state just
> before your "bad behavior" and run experiments easily at the bad point?
>   You could try to use SLEPc to compute the first few eigenmodes
> (presumably associated with excessively small eigenvalues) and visualize
> them? You could restart with and without preconditioning to see how badly
> the conditioning becomes for both the system and the preconditioned system
> to help see if the problem comes from just the preconditioner starting to
> behavior poorly or because the operator starts to behave poorly.
>   There should be a way to allow doing this directly from within the
> KSPSolve trivially with appropriate monitors but I suspect that does not
> exist because calling SLEPc trivially from PETSc is a nightmare because of
> the dependency diamond.

A quick and dirty thing is the plot the residual when your system does not
converge. You can get an idea where
the algebraic error is largest. There is already a -ksp_monitor_range, and
Barry had code to cut out the region of
high residual in a DMDA woth a halo, solve that, and project it back in,
but I cannot remember where it is. Barry?



>   Barry
> On May 3, 2022, at 11:58 AM, Alfredo J Duarte Gomez <aduarteg at utexas.edu>
> wrote:
> Good morning PETSC team,
> I have a bit of an open question on diagnosing preconditioner performance.
> For a bit of background, I am using the TS object in combination with the
> matrix-free snes, and a custom user defined preconditioner (PCSHELL).
> Everything is implemented with the help of a DMDA. Smallest problem size
> that I can get away with is a grid with 2.1 million points with 4 fields
> each, for a total of 8.4 million equations.
> The preconditioner works very well overall, but at some stages of the
> solution it performs poorly, evidenced by significant increases in the
> number of GMRES iterations and the maximum/minimum eigenvalue computed
> using KSPComputeExtremeSingularValues().
> I am trying to understand the locations where the preconditioner is not
> working well, so for example, is there any way to map the maximum
> eigenvalue to a particular location/field in the DMDA. Alternatively, are
> there any other ways of diagnosing where the preconditioner is not doing a
> good job?
> GMRES iterations and the max/min eigenvalue provide a good overall
> picture, but I am struggling to get preconditioner metrics that are
> specific to a location and field.
> So far I have taken a close look at fields such as the residual, and
> Newton updates, but it is difficult to tell how to assess these in
> combination with the preconditioner.
> I appreciate any suggestions.
> Thank you and have a good day.
> -Alfredo
> --
> Alfredo Duarte
> Graduate Research Assistant
> The University of Texas at Austin

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/20220503/4a5fd36d/attachment.html>

More information about the petsc-users mailing list