<div dir="ltr"><br><br><div class="gmail_quote">On Wed Feb 25 2015 at 10:56:30 PM Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Feb 25, 2015, at 10:45 PM, Dmitry Karpeyev <<a href="mailto:karpeev@mcs.anl.gov" target="_blank">karpeev@mcs.anl.gov</a>> wrote:<br>
><br>
> Since user callbacks, such as the one to compute the Jacobian, are now supposed to modify matrices in place, we need to provide the equivalent of MatReset() so that the user can do things like reset the sparsity pattern, etc. What should that call do?<br>
><br>
> I assume it would keep the type, sizes and the block size of the matrix and reset everything else.   The impl-specific stuff is handled by MatDestroy(), but what about the generic data members?  I imagine that the structural properties, such as symmetry and others set with MatSetOption()<br>
<br>
Yes (this is in analogy to how KSPReset etc work, they clean out data objects but keep the options the user has selected for them)<br>
<br>
> as well as MatFactorType and MatStencilInfo should be preserved,<br>
<br>
<br>
Don't know about these.<br>
<br>
> while MatRedundant and the (Near)NullSpace have to go.<br>
<br>
  Yes<br>
<br>
> What about the logging info? num_ass?<br>
<br>
  Keep I think<br>
>  Do we increment nonzerostate or reset it?<br>
<br>
increment<br>
<br>
>  The PetscObject state?<br>
<br>
increment<br></blockquote><div>Yes, these two need to be incremented, as I realized, to avoid a situation where the same Mat object with a completely different structure has the same state index as a previous incarnation.  The PC will think it doesn't need to rebuild ...</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> I don't know what to do about the GPU pointers.<br>
<br>
I would clean those all out.<br></blockquote><div>I'm not sure how -- isn't freeing these implementation-dependent?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
><br>
> While MatReset() isn't yet available,  MatSetType(mat,newtype); MatSetType(mat,oldtype); should have the same effect,<br>
> but it doesn't, which to me is a bug<br>
<br>
   I agree it seems like a bug<br>
<br>
> and I'd like to fix it in maint.<br>
> It would be good, however, to do it "right" by answering the questions above.  Any opinions?<br>
><br>
> Dmitry.<br>
><br>
<br>
</blockquote></div></div>