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

ning.an at ghiocel-tech.com ning.an at ghiocel-tech.com
Fri Mar 4 17:24:22 CST 2011


Dear Knepley,

         Thanks for your quick response.

         Yes, I have not pre-allocated sufficient space for the matrix, since I don't know the max. bandwidth. I got this matrix from other person. My task is to test PETSc solver for huge matrix size. I'm going to ask the person to give me that number. base on your experience, how fast could it be if I use "call  MatCreateSeqAIJ(comm,n,n,rowmax,PETSC_NULL,&mat)" ?
 
           Since I don't have the PETSc matrix yet, I couldn't use MatView() to write it in the binary format. Do you have another suggestion to generate matrix file in PETSc binary format? I'm not familiar with C. I couldn't dig it out from the source code. It is so appreciated If you get me an example.

          Have a good weekend.

          ning

  ----- Original Message ----- 
 From: knepley at gmail.comTo: petsc-users at mcs.anl.gov 
 Sent: 3/4/11 5:44 PM 
 Subject: Re: [petsc-users] how to write the symmetric matrix in PETSc binary

   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/7dc53156/attachment.htm>


More information about the petsc-users mailing list