[petsc-dev] What should MatReset() do?

Dmitry Karpeyev karpeev at mcs.anl.gov
Fri Mar 6 20:13:37 CST 2015


On Fri, Mar 6, 2015 at 4:41 PM Jed Brown <jed at jedbrown.org> wrote:

> Dmitry Karpeyev <karpeev at mcs.anl.gov> writes:
> > This is trickier than it might appear: nonzerostate effectively counts
> the
> > global number of nonzeros. The PC will rebuild if its state is stale, but
> > it will reuse matrices (e.g., subdomain matrices in PCASM) if
> nonzerostate
> > is up to date.  This works if the sparsity pattern never drops nonzeros,
> > but that's no longer true if reset is allowed. I can reset a matrix,
> > preallocate and assemble it so that the global number of nonzeros will be
> > the same as before the resetting, but local sparsity patterns will
> change.
> > This could happen, for example, when I have moving particles or, less
> > exotically, when I have elastic contact and nodes move past each other.
> > That will break PCASM.
>
> On pretty simple and reliable solution would be to take a cryptographic
> hash of the row/col arrays.  I assume BG is really atrocious at hashing,
> but is it so bad that this is not viable?  (There are several places
> where we use kinda fragile state counters or trust the user, but hashes
> would make rebuilding more reliable and transparent.)
>
This sounds interesting. The problem with using this in maint that it is
too intrusive, and for master we can have a simpler (and guaranteed) fix of
keeping a separate 'reset' counter.  Together with 'nonzerostate' it
provides an unambiguous discriminator for the PC to base its rebuild
decisions on.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20150307/5ce587c1/attachment.html>


More information about the petsc-dev mailing list