[petsc-dev] GAMG hiding MG -help

Jed Brown jedbrown at mcs.anl.gov
Mon Mar 19 22:23:43 CDT 2012


On Mon, Mar 19, 2012 at 22:11, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>  Mark,
>
>    The problem is all the code Jed added to prevent the same help message
> from being printed more than once. He added a field to each object,
> optionsprinted, which gets set once an object is used with
> PetscObjectOptionsBegin() and prevents printing the next time that same
> object is used with options. Since the same PC is used for the
> setfromoptions for gamg and mg the second one mg gets ignored.
>
>    I cannot see, off hand, the correct fix that respects Jed's desire to
> have the help messages printed exactly once. You can change
> PetscObjectOptionsBegin() to PetscOptionsBegin() to get the MG message
> printed but it will be printed again for each new GAMG setup violating
> Jed's clean output. You could hide a variable in the _GAMG data structure
> indicating the help for MG was printed to prevent multiple prints but that
> is ugly and ideally Jed will point out the correct way to do what you want
> to do.
>

I don't know anything simple. Best would be to make it possible to call
PCSetFromOptions_MG() before the number of levels has been set. I don't
know if people really want to see the options printed for every level
anyway.

The easiest thing might be to save and restore obj->optionsprinted. (We
could make it an integer instead of a PetscBool.)


>
>
>   Barry
>
>   It never bothered me that help messages were printed more than once .....
>

It's still a mess, actually. Try running

$ ./ex5 -snes_grid_sequence 4 -help

and tell me you are patient enough to scroll up far enough to see a
meaningful option.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120319/25e2b689/attachment.html>


More information about the petsc-dev mailing list