[petsc-users] how to write the symmetric matrix in PETSc binary
Matthew Knepley
knepley at gmail.com
Fri Mar 4 17:34:20 CST 2011
On Fri, 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)" ?
That will be fast as long as no row is greater than rowmax long. However,
why not just count first? This is easy and fast.
>
> 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.
>
The C is the only reference.
Matt
> 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
>
--
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/c3648f67/attachment.htm>
More information about the petsc-users
mailing list