[petsc-dev] viewing factored matrices

Barry Smith bsmith at mcs.anl.gov
Fri Nov 22 18:52:41 CST 2013


On Nov 22, 2013, at 6:36 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Barry Smith <bsmith at mcs.anl.gov> writes:
> 
>>> Indeed, but I thought we wanted to avoid this because it can lead to
>>> options being checked on each iteration
>> 
>>    No, no, and no.  Look in mg.c 
>> 
>> if (!pc->setupcalled) {
>>    for (i=0; i<n; i++) {
>>      ierr = KSPSetFromOptions(mglevels[i]->smoothd);CHKERRQ(ierr);
> 
> In gamg.c:
> 
>  PetscBool      redo_mesh_setup = (PetscBool)(!pc_gamg->reuse_prol);
> 
>    if (redo_mesh_setup) {
>      /* reset everything */
>      ierr = PCReset_MG(pc);CHKERRQ(ierr);
>      pc->setupcalled = 0;
> 
> The number of levels can change because the strength of connection and
> thus thresholding changes.

   Sure, but so what? The setfromoptions has to be recalled on all the levels anyways and relative to setting up the GAMG the calls to the setfromoptions is not an issue.

  Barry



> 
>>   You are correct that currently there are other unprotected calls in
>>   fieldsplit.c but I think they can be easily fixed so that the inner
>>   SetFromOptions() is called only when setup called is zero. Having
>>   non-nested XXXSetFromOptions() has nothing to do with things being
>>   check every iteration stuff.
> 
> Fair enough, the case above is a different issue and I agree that your
> other points are at the very least, pragmatic.




More information about the petsc-dev mailing list