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

Barry Smith bsmith at mcs.anl.gov
Fri Mar 4 20:02:42 CST 2011


  Did you not get this mail?

	Subject: 	Re: [petsc-users] how to write the symmetric matrix in PETSc binary matrix format directly
	From: 	Barry Smith <bsmith at mcs.anl.gov>
	Date: 	March 4, 2011 4:59:05 PM CST
	To: 	PETSc users list <petsc-users at mcs.anl.gov>


 The exact binary file layout for matrices is given in the manual page for MatLoad().

  Barry

   Is the petsc mail irretrievably broken and and we should switch to pigeons?


On 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.
> 
> Please help on how to write the symmetric matrix in PETSc binary matrix format directly? 
> Both the guidance and examples are welcome. 
> 
> Ning



On Mar 4, 2011, at 5:24 PM, ning.an at ghiocel-tech.com wrote:

> 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.com
> To: 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



More information about the petsc-users mailing list