[petsc-dev] PetscLogView with PETSC_VIEWER_ASCII_INDEX et al.
Barry Smith
bsmith at mcs.anl.gov
Thu Jan 14 21:10:22 CST 2016
> On Jan 14, 2016, at 1:54 PM, Jed Brown <jed at jedbrown.org> wrote:
>
> It turns out that if someone puts
>
> PetscViewerSetFormat(PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_ASCII_INDEX);
We could get rid of this routine and instead make users use PetscViewerPushFormat(). They can still forget to pop and end up later with the wrong format but the Push and Pop model is much better and less prone to this type of error. Should we remove this?
>
> in their code and forgets to reset the format before PetscFinalize, then
> -log_summary will not print. This was easy enough for me to figure out
> with a debugger, but totally perplexing for the application.
If they used the non-deprecated version of -log_view then I believe it will always work correctly because usage with PetscOptionsGetViewer() always does a fresh push and then pop of the format.
So I think we just need to train people to use -log_view (and the simplest way to do that is to remove -log_summary)
Barry
>
> We can patch this specific case easily enough, but can we address the
> general case where only certain formats should be significant for
> different kinds of output? Opinions?
More information about the petsc-dev
mailing list