<div><a href="http://www.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/src/mat/examples/tutorials/ex5.c.html">http://www.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/src/mat/examples/tutorials/ex5.c.html</a></div>

<div> </div>
<div>Hi All,<br>I am tring to read through an example about PetscBinaryRead. It looks like the matrix is reading from a CRS matrix object descriptor &quot;fd1, or fd2&quot;.  </div>
<div><br>I have difficulty of understand the line 50:<br>+++++++++++++++++++++++++++++<br>50: PetscBinaryRead(fd2,(char *)header,4,PETSC_INT);<br>+++++++++++++++++++++++++++++</div>
<div>From the context, my guess is:<br>header[0] unknown</div>
<div><br>header[1] contains the info of how many rows of matrix stored on this processor<br><br>header[2] contains the info of how many global columns of the matrix<br><br>header[3] unknown<br></div>
<div><br>and line:<br>++++++++++++++++++++++++++++<br>86: PetscBinaryRead(fd1,ourlens,m,PETSC_INT);<br></div>
<div>101: PetscBinaryRead(fd1,mycols,ourlens[i],PETSC_INT);<br>+++++++++++++++++++++++++++++++<br>From the context, my guess is:<br></div>
<div>ourlens[i] stores the length of the ith local row for the &quot;local&quot; portion of the matrix.<br><br>mycols is an array storing the column indices of the nonzero entries of the ith local row for the &quot;local&quot; portion of the matrix(include diagonal and off diagonal).</div>

<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>Is there any pointer to the definition of the struct descriptor.</div>
<div> <br></div>
<div>Can anyone confirm my guess and provide a pointer or example?  How does the PetscBinaryRead() switch smoothly between reading different informations with the same parameter list.</div>
<div> </div>
<div>Thank you very much,</div>
<div> </div>
<div>Yan</div>
<div> </div>