[petsc-dev] PetscLogView with PETSC_VIEWER_ASCII_INDEX et al.

Barry Smith bsmith at mcs.anl.gov
Fri Jan 15 00:01:31 CST 2016


> On Jan 14, 2016, at 10:37 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> Barry Smith <bsmith at mcs.anl.gov> writes:
> 
>>> 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?
> 
> I prefer the push/pop model, but I think it's orthogonal.  I wouldn't
> mind marking PetscViewerSetFormat as deprecated (indefinitely), but
> would rather not remove it immediately.

  Fine

> 
>>> 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) 
> 
> Why force people to use a new name?  PETSc developers (including you)
> are still telling people to use -log_summary, so it seems premature to
> delete it.
> 
> Why not make -log_summary behave reasonably?

  In the short run we can make it "behave reasonably" but we should also deprecate it since it is not as powerful as -log_view and does not match 1) the "view" convention name for displaying things and 2) does not match the new viewer:filename:format convention for viewing everything else.






More information about the petsc-dev mailing list