about src/mat/examples/tutorials/ex5.c.html

Ryan Yan vyan2000 at gmail.com
Sun Jul 12 16:56:41 CDT 2009


On Sun, Jul 12, 2009 at 5:41 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>  The manual page for MatLoad() and VecLoad() contain the definitions of
> those structs.


This pointer is great.


>
>   The file binary format is independent of parallel storage of the matrix
> so has no information about the "diagonal" and "off-diagonal" parts of the
> matrix. That is all determined when the binary file is read in.


That's exactly what I get confused with.

Thank you very much,

Yan


>
>   Barry
>
>
>
> On Jul 12, 2009, at 3:30 PM, Ryan Yan wrote:
>
>
>> http://www.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/src/mat/examples/tutorials/ex5.c.html
>>
>> Hi All,
>> I am tring to read through an example about PetscBinaryRead. It looks like
>> the matrix is reading from a CRS matrix object descriptor "fd1, or fd2".
>>
>> I have difficulty of understand the line 50:
>> +++++++++++++++++++++++++++++
>> 50: PetscBinaryRead(fd2,(char *)header,4,PETSC_INT);
>> +++++++++++++++++++++++++++++
>> From the context, my guess is:
>> header[0] unknown
>>
>> header[1] contains the info of how many rows of matrix stored on this
>> processor
>>
>> header[2] contains the info of how many global columns of the matrix
>>
>> header[3] unknown
>>
>> and line:
>> ++++++++++++++++++++++++++++
>> 86: PetscBinaryRead(fd1,ourlens,m,PETSC_INT);
>> 101: PetscBinaryRead(fd1,mycols,ourlens[i],PETSC_INT);
>> +++++++++++++++++++++++++++++++
>> From the context, my guess is:
>> ourlens[i] stores the length of the ith local row for the "local" portion
>> of the matrix.
>>
>> mycols is an array storing the column indices of the nonzero entries of
>> the ith local row for the "local" portion of the matrix(include diagonal and
>> off diagonal).
>>
>>
>>
>>
>>
>> Is there any pointer to the definition of the struct descriptor.
>>
>> 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.
>>
>> Thank you very much,
>>
>> Yan
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090712/85772825/attachment.htm>


More information about the petsc-users mailing list