[petsc-users] Seeking Clarification on SNES Solver Behavior

Matthew Knepley knepley at gmail.com
Tue Oct 24 07:23:17 CDT 2023


On Mon, Oct 23, 2023 at 10:23 PM Rene Chenard via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hi!
>
> We have recently noticed some inconsistencies in the behavior of the SNES
> solver when using different solver types, and we would greatly appreciate
> your insights in resolving this matter.
>
> While working with SNESSolve in parallel, we have encountered a
> discrepancy in the behavior of the evaluation functions for the
> ComputeFunction and the JacobianFunction. Specifically, there seems to be
> an inconsistency in whether Vec x receives automatic updates to its ghosts
> or if manual updates are required (with calls to VecGhostUpdateBegin/End).
>
> For instance, when using the ngmres solver, the ghosts of Vec x are
> adequately updated. However, when employing the nrichardson solver, it
> appears that manual updates to the ghosts are necessary.
>
> It's important to note that we do not utilize the DM object in our
> implementation, as we have developed our own solution to manage models and
> discretization.
>
> To better understand the root cause of this behavior, we kindly request
> your assistance in determining if we may be overlooking something in our
> implementation, or if there are inherent inconsistencies in the SNES solver
> itself.
>
> Your expertise in this matter would be invaluable to us, and we thank you
> in advance for your consideration and support.
>

Since you are not using DM, does that mean that you register a callback with

  https://petsc.org/main/manualpages/SNES/DMSNESSetFunction/

If so, we do not do any kind of local-to-global calls. I am not sure how
NGMRES would populate local
vectors for you. My guess is that you have a ghost update call somewhere in
your callback, and this
gets hit in the NGMRES because it has extra residual evaluations.

We can be more specific with more details about the code.

   Thanks,

     Matt



> Warm regards,
>
> —René Chenard
> Research Professional at Université Laval
> rene.chenard.1 at ulaval.ca
>


-- 
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/20231024/e7f7ff9a/attachment.html>


More information about the petsc-users mailing list