<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br class="webkit-block-placeholder"></div><div>&nbsp;&nbsp; The files should be the same.</div><div><br class="webkit-block-placeholder"></div><div>&nbsp;&nbsp; Barry</div><div><br class="webkit-block-placeholder"></div><div>1) If the matrix is generated differently in parallel then sequential then rounding of the floating point</div><div>operations will result in very slightly different numerical values in the matrix.</div><div><br class="webkit-block-placeholder"></div><div>2) If the ordering of the the unknowns is different in the parallel and sequential then the matrices</div><div>will, of course, be permutations of each other.</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>On Feb 12, 2008, at 1:06 PM, Yujie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">hi, Matt<br><br>If I output matrix with binary format, should the file format obtained from sequential output is the same with that from parallel output? I mean that I don't need to consider whether  MatView_***_Binary() is parallel or sequential when I use the matrix file.<br> <br>thanks a lot.<br><br>Regards,<br>Yujie<br><br><div><span class="gmail_quote">On 1/23/08, <b class="gmail_sendername">Matthew Knepley</b> &lt;<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex"> On Jan 23, 2008 2:18 PM, Yujie &lt;<a href="mailto:recrusader@gmail.com">recrusader@gmail.com</a>&gt; wrote:<br>&gt; Thank you for your further explanation. I just want to use this data in<br>&gt; other packages. I think that ASCII file is likely better. Because I don't<br> &gt; know the format of the binary file? how to find it?<br><br>Look at MatView_SeqAIJ_Binary() in src/mat/impls/aij/seq/aij.c. The<br>format is pretty simple.<br><br>&gt; In addition, do you have any better methods to save the sparsity structure<br> &gt; picture of the matrix? Now, I use "-mat_view_draw" to do this. However, the<br>&gt; speed is very slow and the picture is small. I want to get a big picture and<br>&gt; directly save it to the disk?<br>&gt;&nbsp;&nbsp;could you give me some advice? thanks a lot.<br> <br>We do not have a better way to make the sparsity picture. I assume you could<br>write something that decides how many pixels to use, calculates an average<br>occupancy per pixel, and writes a BMP or something.<br><br> &nbsp;&nbsp;Matt<br><br>&gt; Regards,<br>&gt; Yujie<br>&gt;<br>&gt; On 1/23/08, Matthew Knepley &lt;<a href="mailto:knepley@gmail.com">knepley@gmail.com</a> &gt; wrote:<br>&gt; &gt; On Jan 22, 2008 11:01 PM, Yujie &lt;<a href="mailto:recrusader@gmail.com">recrusader@gmail.com</a>&gt; wrote:<br> &gt; &gt; &gt; Dear Matt:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; thank you for your reply. Do you have any method to generate an ascii<br>&gt; file<br>&gt; &gt; &gt; of the huge sparse matrix? thanks<br>&gt; &gt;<br>&gt; &gt; I think you miss my point. The PETSc function is not a bad way to generate<br> &gt; &gt; ASCII matrices. ASCII matrices make "no sense" for large operators.<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;Matt<br>&gt; &gt;<br>&gt; &gt; &gt; Regards,<br>&gt; &gt; &gt; Yujie<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br> &gt; &gt; &gt;<br>&gt; &gt; &gt; On 1/23/08, Matthew Knepley &lt;<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt; &gt; On Jan 22, 2008 8:50 PM, Yujie &lt; <a href="mailto:recrusader@gmail.com">recrusader@gmail.com</a>&gt; wrote:<br> &gt; &gt; &gt; &gt; &gt; Hi everyone:<br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; #include "petsc.h"<br>&gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char<br>&gt; &gt; &gt; &gt; &gt; name[],PetscViewer *lab)<br> &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; #include "petsc.h"<br>&gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char<br>&gt; &gt; &gt; &gt; &gt; name[],PetscFileMode type,PetscViewer *binv)<br> &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; if the difference between them is that one for ASCII output and the<br>&gt; &gt; &gt; other<br>&gt; &gt; &gt; &gt; &gt; for Binary output, why are there different parameters?<br> &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; It is historical. If you want to be generic, you should use<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt;&nbsp;&nbsp; PetscViewerCreate()<br>&gt; &gt; &gt; &gt;&nbsp;&nbsp; PetscViewerSetType()<br>&gt; &gt; &gt; &gt;&nbsp;&nbsp; PetscViewerFileSetMode()<br> &gt; &gt; &gt; &gt;&nbsp;&nbsp; PetscViewerFileSetName()<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; which can create both.<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; The speed to output matrix is very fast when I use<br> &gt; &gt; &gt; PetscViewerBinaryOpen.<br>&gt; &gt; &gt; &gt; &gt; However, when I use PetscViewerASCIIOpen, I can't get the matrix<br>&gt; output.<br>&gt; &gt; &gt; the<br>&gt; &gt; &gt; &gt; &gt; code always is running and it has taken about one day! what's the<br> &gt; &gt; &gt; problem?<br>&gt; &gt; &gt; &gt; &gt; thank you.<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; ASCII files do not make sense for large matrices. You should use<br>&gt; binary<br>&gt; &gt; &gt; files.<br>&gt; &gt; &gt; &gt;<br> &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;Matt<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; Regards,<br>&gt; &gt; &gt; &gt; &gt; Yujie<br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt;<br> &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; --<br>&gt; &gt; &gt; &gt; What most experimenters take for granted before they begin their<br>&gt; &gt; &gt; &gt; experiments is infinitely more interesting than any results to which<br> &gt; &gt; &gt; &gt; their experiments lead.<br>&gt; &gt; &gt; &gt; -- Norbert Wiener<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br> &gt; &gt; What most experimenters take for granted before they begin their<br>&gt; &gt; experiments is infinitely more interesting than any results to which<br>&gt; &gt; their experiments lead.<br>&gt; &gt; -- Norbert Wiener<br> &gt; &gt;<br>&gt; &gt;<br>&gt;<br>&gt;<br><br><br><br>--<br>What most experimenters take for granted before they begin their<br>experiments is infinitely more interesting than any results to which<br>their experiments lead.<br> -- Norbert Wiener<br><br></blockquote></div><br></blockquote></div><br></body></html>