<div dir="ltr">Jed,<div><br></div><div>can you please take a look at this? I don't have any experience on multilevel SNES and I don't know what is the proper fix</div><div><br></div><div><a href="https://bitbucket.org/petsc/petsc/src/40b9351e49c32bd0ef34d75e511ace44084621e9/src/snes/interface/snes.c?at=master&fileviewer=file-view-default#snes.c-645">https://bitbucket.org/petsc/petsc/src/40b9351e49c32bd0ef34d75e511ace44084621e9/src/snes/interface/snes.c?at=master&fileviewer=file-view-default#snes.c-645</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-09-25 18:37 GMT+03:00 Stefano Zampini <span dir="ltr"><<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Jed,<div><br></div><div>Today I fought for several hours against a strange behaviour occuring when reusing a TS for multiple solves. You can reproduce it by applying the attached patch.<div><br></div><div>The issue is with DMCoarsenHookAdd called in SNESSetUpMatrices, and git blames you ;-).</div><div><br></div><div>Every time you call TSGetRHSMats_Private, TSGetIJacobian gets called, which in turns calls SNESSetUpMatrices, that adds the entry in the linked list of hooks via DMCoarsenHookAdd. This causes a considerable slow down when using the RHS interface with an implicit solver, as you can see from running the patched code. <br><div><br></div><div>can you please take a look?</div><span class="HOEnZb"><font color="#888888"><div>-- <br><div class="m_9142357640654122209gmail_signature">Stefano</div>
</div></font></span></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Stefano</div>
</div>