[petsc-dev] petsc/petsc added -pc_use_amat option to PCSetFromOptions() (commit b9ee023)

Barry Smith bsmith at mcs.anl.gov
Thu Mar 21 21:21:11 CDT 2013


On Mar 21, 2013, at 9:07 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> 
> On Thu, Mar 21, 2013 at 3:31 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> > Why isn't this `PetscOptionsList()` so that it shows up in `-help`?
> 
>    My mistake, I cut and pasted the PetscOptionsGetInt() from the line above and figure that it mustn't be in a PetscOptionsBegin{} phase. You can fix it if you like.
> 
> Hmm, problem is deeper than that. If the method has no sub-solver, wouldn't we rather not be checking this option, so that it shows up as an unused option? (This is also useful if a PC logically ought to pay attention to this option, but isn't.) What about making PCSetUseAmat() use PetscTryMethod() and move the check of "-pc_use_amat" into each implementation?
> 
> Do we really want to leave the confusing option in place for all the PCs that don't have inner solvers?

  Is it really worth manually putting it into a bunch of places rather than just leaving it at the top level?  I reckon about 10 of the current preconditioners could utilize this function. If we change this we need to change PCSetModifySubMatrices() and PCSetInitialGuessNonzero() also since they work for far fewer PCs. I'm fine with either leaving it or changing it. 

   It would be nice if we could more automate handling these kinds of things for each PC rather than cut and pasting code all over.

  Barry





More information about the petsc-dev mailing list