<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 6, 2018 at 6:30 AM, Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
<br>
> On Jun 5, 2018, at 7:36 PM, Matthew Overholt <<a href="mailto:overholt@capesim.com">overholt@capesim.com</a>> wrote:<br>
> <br>
> <br>
> On Tue, Jun 5, 2018 at 1:48 PM, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> <br>
> <br>
> > On Jun 5, 2018, at 4:08 PM, Matthew Overholt <<a href="mailto:overholt@capesim.com">overholt@capesim.com</a>> wrote:<br>
> > <br>
> > Yes to Matthew - not repeating Phase 1: Fill-reduction analysis and symbolic factorization . Numerical factoring is required because the matrix values have changed (although only slightly) as well as the RHS.<br>
> > <br>
> > We are using KSPPREONLY with Picard iterations. Thank you, Barry, for the KSP*Preconditioner calls I wasn't aware of.<br>
> > <br>
> > It sounds like PETSc and/or Pardiso automatically determines whether Phase 1 is required or not, but if we want to force a new Phase 1 (such as in a long unsteady run), then I suppose we could just destroy KSP and remake it.<br>
> <br>
> I'm confused. Yes PETSc will do a new analysis if the nonzero structure changes otherwise it will never do a new analysis. <br>
> <br>
> Is your nonzero structure changing? <br>
> <br>
> If you nonzero structure is not changing you have to do nothing. <br>
> <br>
> If the nonzero structure does change than the code needs to do a new analysis because the old factors (for the numerical part) cannot work with the new nonzero locations of the matrix.<br>
> <br>
> I really don't see why you have to do anything?<br>
> <br>
> Barry<br>
> <br>
> No, the nonzero structure never changes. Redoing the analysis is not required, in the sense that a solution can still be obtained without it; however, for long unsteady runs (with heat sources turning on and off) the matrix values change so much that, without redoing the analysis, more iterations are required to converge at each time step, resulting in a doubling of the total solve time compared to when the analysis is periodically redone. I don't know exactly what Pardiso is doing "under the hood" but that has been our experience.<br>
<br>
</span> Strange; I've never heard of this before, anyways,<br>
<br>
You could trick it by "saying" that the nonzero structure has changed even if it has not. The matrix struct has a field A->nonzerostate you could simply increase this value by 1 (include #include <petsc/private/matimpl.h> to get access to the field). Any time you change this value will trigger a new analysis stage.<br><br>
</blockquote></div>Thanks, I'll give this a try.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Matt...</div></div>