On Sun, Mar 18, 2012 at 7:05 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote">On Sun, Mar 18, 2012 at 18:54, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="gmail_quote"><div>That has nothing to do with anything we are talking about.</div></div></blockquote><div><br></div><div>Bull, run your code in parallel, but have it create the matrix in two ways, one on COMM_SELF and one running on COMM_WORLD. Take the COMM_WORLD one and MatGetRedundantMatrix(Aworld,...,&Ared) to get the redundant matrix, then compute the norm of Ared - Aself.</div>
</div></blockquote><div><br></div><div>Oh, vastly complicate my code, so that I can do something equivalent to what I get in a few lines. Please</div><div>reconsider further coding suggestions.</div><div><br></div><div>  Matt</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>From looking at your code, this is more intrusive than below.</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote">
<div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>And if you really want to stay parallel and print all the non-small values, MatDuplicate and fill up the new matrix with the thresholded values.</div>


</blockquote><div><br></div></div><div>Neither does this.</div></div></blockquote><div><br></div><div>Imagine a world in which</div><div><br></div><div>    ierr = MatChop(JacP, 1.0e-10);CHKERRQ(ierr);<br></div><div>    ierr = MatView(JacP, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);<br>

</div><div><br></div><div>was instead written</div><div><br></div><div>    Mat Chopped;</div><div><div>    ierr = MatChop(JacP, 1.0e-10, &Chopped);CHKERRQ(ierr);</div><div>    ierr = MatView(Chopped, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);</div>

</div><div>    ierr = MatDestroy(&Chopped);CHKERRQ(ierr);</div><div><br></div><div>You could MatHeaderReplace(JacP,Chopped); if you were feeling ornery (considering that the local callback you are using didn't pass a Mat* or forward the SNES down that far (i.e. an API bug because we assert that you can change the matrix in a Jacobian evaluation routine)).</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>Note, there was a request a while back to be able to make an ASCII viewer use a user-defined floating-point format string.</div>

</blockquote></div></div><div><br></div><div>That would not help. For a small number, you do not want ANY significant digits.</div><div><div></div></div></blockquote></div><br><div>%f</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>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<br>