[petsc-dev] Integrating PFLOTRAN, PETSC & SAMRAI

Boyce Griffith griffith at cims.nyu.edu
Mon Jun 6 17:09:17 CDT 2011



On 6/6/11 5:56 PM, Jed Brown wrote:
> On Mon, Jun 6, 2011 at 23:49, Boyce Griffith <griffith at cims.nyu.edu
> <mailto:griffith at cims.nyu.edu>> wrote:
>
>     But if the model is that the Vec implementation is responsible for
>     updating the state, then would it be better if PETSc did NOT
>     increase the state, e.g., in calls to VecAXPY, or MatVecMult?  It
>     seems like it might be better if it did not, so that if one has a
>     non-"compliant" implementation, one finds out more quickly that
>     their code is broken.
>
>
> Good point. We could replace the increments with debug-mode checks that
> the state actually did get incremented, with errors if it didn't. There
> are perhaps 50 call sites to update. It would not be a big deal.
>
> This would be great for SNESComputeFunction() too because a common
> mistake is to forget to put anything in the output vector. This would
> check that they at least got access to the vector (though we still
> couldn't confirm that they put anything into it).

Personally, I think this would be much better.  As things stand now, if 
all you do is poke around the Vec implementations in PETSc, you might 
come away with the impression that state is managed automatically.

-- Boyce



More information about the petsc-dev mailing list