[petsc-users] fill matrix using dynamic load balancing code

Gao Bin bin.gao at uit.no
Thu May 3 04:04:44 CDT 2012


Hi, Matt

Thank you very much for your detailed reply.

Cheers

Gao
________________________________
From: petsc-users-bounces at mcs.anl.gov [petsc-users-bounces at mcs.anl.gov] on behalf of Matthew Knepley [knepley at gmail.com]
Sent: Thursday, May 03, 2012 2:56 AM
To: PETSc users list
Subject: Re: [petsc-users] fill matrix using dynamic load balancing code

On Wed, May 2, 2012 at 7:55 PM, Gao Bin <bin.gao at uit.no<mailto:bin.gao at uit.no>> wrote:
Hi, all

(1) I am using PETSc to perform, for instance matrix-matrix multiplication. But the numerical values of the matrix are calculated from my integral code. I guess, for matrix-matrix multiplication, it might be better to distribute the rows of matrix uniformly on processors, right?

It depends on the matrix.

(2) If yes, I have a problem in my integral code. Since I need dynamic load balancing to calculate the matrix elements and then put them into correct places by using MatSetValues. But I have two questions regarding MatSetValues:

(2.1) If one processor calculated a lot of elements belong to another remote processor, will this become a problem for the performance? Should I make all processors calculate as many local elements as possible?

It will raise the communication cost. This, of course, must be weighed against the penalty for load imbalance in your case.

(2.2) From the manual, I see MatSetValues only caches the values, but MatAssemblyBegin() and MatAssemblyEnd() assembles the matrix. Therefore, is there any memory limit for MatSetValues, or in other words, will it cost a lot of memory before assembling?

Yes, there is a limit to the stash space:

http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatStashSetInitialSize.html

    Matt

Thank you in advance.

Cheers

Gao



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


More information about the petsc-users mailing list