<div class="gmail_quote">On Sun, Mar 18, 2012 at 18:54, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">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><br></div><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 class="im"><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 class="im"><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>