Re: [petsc-dev] I do not think this is the right solution
On Sun, Mar 18, 2012 at 6:37 PM, Jed Brown <[email protected]> wrote:
On Sun, Mar 18, 2012 at 18:24, Matthew Knepley <[email protected]> wrote:
In the alternate model, you call MatAssemblyBegin/End() when the matrix is marked as unassembled. Its easy to check this flag, so the user will not be confused. Barry is correct that the flag reset is not collective, so that query would have to be.
We should think as though we are in a world where the query costs as much as the assembly itself because that is a better approximation of reality than the alternatives.
I do not think "fragile" is an accurate characterization because failure is immediate when trying to use a function that requires assembly, and it also obvious what the fix is, to assemble the matrix.
It's not collective.
You might mean that the existing model is more intuitive. I disagree since it is currently impossible to do something simple like chop out small values from a matrix.
MatGetArray()
Of course I fucking tried that first. It does not work. Matt
Or you actually want to remove them from the nonzero pattern? In that case, you definitely have to assemble, which means there is a new partly-assembled state (locally consistent, but not globally).
The proposal is to augment the current model with MatGetRowWrite(). This would mean not only adding to the interface, but writing all the code to put values back into the matrix if the row is a copy. I think it is more intuitive to allow the user to SetValues() if the nonzero pattern is unchanged and no values need to be communicated.
MatSetValues() is a very permissive interface for modifying data in-place.
-- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
participants (1)
-
Matthew Knepley