> On Mar 6, 2015, at 4:41 PM, Jed Brown <[email protected]> wrote: > > Dmitry Karpeyev <[email protected]> writes: >> This is trickier than it might appear: nonzerostate effectively counts the >> global number of nonzeros.
No it does not. Note in MatZeroRows_SeqAIJ() when entries are deleted from the matrix we still increase the nonzerostate. >> 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. Just increase the nonzerostate flag by one on a reset (that is there is no reason to ever set it back to zero). Now nonzerostate is monotonically increasing. Barry Barry > > 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.)
