[petsc-users] how to write the symmetric matrix in PETSc binary matrix format directly

Matthew Knepley knepley at gmail.com
Fri Mar 4 16:44:43 CST 2011


On Fri, Mar 4, 2011 at 4:40 PM, <ning.an at ghiocel-tech.com> wrote:

> Hello There,
>
>  I am new to PETSc and programming with FORTRAN. For the huge sparse
> matrix  (200,000x200,000 symmetric), it is so slow to set the matrix in
> PETSc by reading them in matrix market format, which is far beyond our
> patience. Therefore, I guess that it would be much  fast to load the huge
> matrix, if the matrix is in PETSc binary matrix format
>  directly.
>

It is probably slow because you have not preallocated the matrix correctly:
http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#efficient-assembly


>  Please help on how to write the symmetric matrix in PETSc binary matrix
> format directly?
>

You just save it using MatView(). For example:


http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/ksp/pc/examples/tutorials/ex2.c.html

  Matt


>  Both the guidance and examples are welcome.
>
> Ning

-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110304/1863f703/attachment.htm>


More information about the petsc-users mailing list