<div dir="ltr"><div dir="ltr">On Mon, Oct 23, 2023 at 10:23 PM Rene Chenard via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
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.<br>
<br>
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).<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Your expertise in this matter would be invaluable to us, and we thank you in advance for your consideration and support.<br></blockquote><div><br></div><div>Since you are not using DM, does that mean that you register a callback with</div><div><br></div><div> <a href="https://petsc.org/main/manualpages/SNES/DMSNESSetFunction/">https://petsc.org/main/manualpages/SNES/DMSNESSetFunction/</a></div><div><br></div><div>If so, we do not do any kind of local-to-global calls. I am not sure how NGMRES would populate local</div><div>vectors for you. My guess is that you have a ghost update call somewhere in your callback, and this</div><div>gets hit in the NGMRES because it has extra residual evaluations.</div><div><br></div><div>We can be more specific with more details about the code.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Warm regards,<br>
<br>
—René Chenard<br>
Research Professional at Université Laval<br>
<a href="mailto:rene.chenard.1@ulaval.ca" target="_blank">rene.chenard.1@ulaval.ca</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>