[petsc-users] MatCopy and MatSetValue consume most 99 percentage of runtime

Debao Shao Debao.Shao at brion.com
Tue Apr 19 20:31:11 CDT 2011


Hi, Barry:

Thanks for the reply.

I preallocated enough space for the sparse matrix, but I found mat->data->imax changed after "MatAssemblyEnd", and it caused many rowmax less than the number of nonzeros per row, then "MatSeqXAIJReallocateAIJ" is called frequently when doing MatSetValues again to the matrix.

Any suggestions?

Thanks,
Debao
-----Original Message-----
From: petsc-users-bounces at mcs.anl.gov [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Barry Smith
Sent: Friday, April 15, 2011 9:25 PM
To: PETSc users list
Subject: Re: [petsc-users] MatCopy and MatSetValue consume most 99 percentage of runtime


   Debao,

      Please see http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#efficient-assembly It should resolve the difficulties.

    Barry

On Apr 15, 2011, at 2:16 AM, Debao Shao wrote:

> Dear Petsc:
>
> I'm trying on Petsc iterative solver(KSPCG & PCJACOBI), but it's strange that the two functions "MatCopy" and "MatSetValue" consume most of runtime, and the functions were not called frequently, just several times.
>
> My libpetsc.a is built as follows:
> 1, /config/configure.py --with-mpi=0 --with-debugging=0 -with-log=0 -with-info=0
> 2, make all;
>
> It's very appreciated to get your reply.
>
> Thanks a lot,
> Debao
>
> -- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.


-- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.


More information about the petsc-users mailing list