<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 16 Jan 2019, at 15:28, Jed Brown <<a href="mailto:jed@jedbrown.org" class="">jed@jedbrown.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hapla Vaclav via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a>> writes:<br class="">
<br class="">
<blockquote type="cite" class="">So is it wise to do that as Matt wrote? It would basically make PetscViewerSetFromOptions() non-reentrant.<br class="">
</blockquote>
<br class="">
I think non-idempotent is the word you're looking for here.  Reentrancy<br class="">
refers to being able to call the function from an interrupt handler and<br class="">
similar circumstances.<br class="">
<br class="">
<a href="https://en.wikipedia.org/wiki/Reentrancy_(computing)" class="">https://en.wikipedia.org/wiki/Reentrancy_(computing)</a><br class="">
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Sure :-)</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class=""><br class="">
<br class="">
I think PetscViewerSetFormat could be undeprecated (but marked as<br class="">
developer level to steer people toward PetscViewerPushFormat) or<br class="">
PetscViewerSetFromOptions could just set viewer->format directly.<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
<div class="">Agree. Let's just set viewer->format directly so no need for undeprecation. But what to do with the current stack (viewer->formats)?</div>
<div class="">See</div>
<div class=""><a href="https://bitbucket.org/petsc/petsc/src/master/src/sys/classes/viewer/interface/viewa.c#lines-145" class="">https://bitbucket.org/petsc/petsc/src/master/src/sys/classes/viewer/interface/viewa.c#lines-145</a></div>
<div class=""><a href="https://bitbucket.org/petsc/petsc/src/master/src/sys/classes/viewer/interface/viewa.c#lines-95" class="">https://bitbucket.org/petsc/petsc/src/master/src/sys/classes/viewer/interface/viewa.c#lines-95</a></div>
<div class="">Should I just ignore the stack?</div>
<div class=""><br class="">
</div>
<div class="">If I see it well, overwriting current viewer->format shouldn't cause any harm. If there is Push before and Pop after Set, that Pop should just set the value prior to Push. Which I think makes sense.</div>
<div class=""><br class="">
</div>
<div class="">Vaclav</div>
</body>
</html>