[petsc-users] MatSetSizes for MATMPIBAIJ

Matthew Knepley knepley at gmail.com
Fri Feb 5 17:07:16 CST 2010

1) It will distribute block rows, so you will get 8 and 4 as you want

2) Warning: This is an incredibly small problem. Using 2 processors
    might not show any speedup at all.


On Fri, Feb 5, 2010 at 5:03 PM, NovA <av.nova at gmail.com> wrote:

> Hi everybody!
> I'm looking for the best way to distribute MPIBAIJ matrix among
> several processors.
> For example, I have square matrix 3x3 of blocks 4x4 each (i.e. 12x12
> values) and need to distribute it among 2 processors. The generic way
> of creating such a matrix would be:
>  Mat A;
>  MatCreate(comm, &A);
>  MatSetSizes(A, loc_rows,12, 12,12);
>  MatSetType(A, MATMPIBAIJ);
> What is the optimal value for loc_rows here?
> Can I use PETSC_DECIDE for it? I suppose this will lead to division by
> 6 rows per processor, which is not consistent with block size. How
> MatMPIBAIJSetPreallocation(A,4,...) will deal with it?
> Most likely, I have to manually set loc_rows to 8 and 4 according to
> the processor rank. But probably I miss some more clean way, when
> PETSc really decides. :)
> Thanks in advance for any comments.
> Regards!
>  Andrey

What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100205/fe70b13e/attachment.htm>

More information about the petsc-users mailing list