<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Jan 16, 2019 at 9:17 AM Hapla Vaclav <<a href="mailto:vaclav.hapla@erdw.ethz.ch">vaclav.hapla@erdw.ethz.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> On 16 Jan 2019, at 14:42, Lawrence Mitchell <<a href="mailto:wence@gmx.li" target="_blank">wence@gmx.li</a>> wrote:<br>
> <br>
> <br>
> <br>
>> On 16 Jan 2019, at 13:21, Matthew Knepley via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:<br>
>> <br>
>> I think you just Push and do not Pop. Do we check for a non-empty stack? We silently ignore too many Pops.<br>
> If you don't pop, at least in the past, you would get an error. <br>
<br>
Concerning this specific Push, you only get an error after you reach a certain limit of Pushes without Pops.<br>
<a href="https://bitbucket.org/petsc/petsc/src/master/src/sys/classes/viewer/interface/viewa.c#lines-150" rel="noreferrer" target="_blank">https://bitbucket.org/petsc/petsc/src/master/src/sys/classes/viewer/interface/viewa.c#lines-150</a><br>
<br>
The limit is set 25 in <br>
<a href="https://bitbucket.org/petsc/petsc/src/master/include/petsc/private/viewerimpl.h#lines-24" rel="noreferrer" target="_blank">https://bitbucket.org/petsc/petsc/src/master/include/petsc/private/viewerimpl.h#lines-24</a><br>
<br>
So is it wise to do that as Matt wrote? It would basically make PetscViewerSetFromOptions() non-reentrant.<br></blockquote><div><br></div><div>1) Its crazy to have a limit. We should make it reallocate and copy, like everything else.</div><div><br></div><div>2) I agree that Pushing is just a bad stopgap. I think we should un-deprecate Set if we are using it this way.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Vaclav<br>
<br>
> <br>
> Lawrence<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>