On Fri, Feb 5, 2010 at 5:28 PM, NovA <span dir="ltr"><<a href="mailto:av.nova@gmail.com">av.nova@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for the quick response!<br>
<br>
2010/2/6 Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>>:<br>
<div class="im">> 1) It will distribute block rows, so you will get 8 and 4 as you want<br>
<br>
</div>How can it distribute in such a way, if it doesn't know block size yet?<br>
Let's continue the example:<br>
MatCreate(comm, &A);<br>
MatSetSizes(A, PETSC_DECIDE,12, 12,12);<br>
MatSetType(A, MATMPIBAIJ);<br>
MatGetOwnershipRange(A, &rowS, &rowE);<br>
Then loop local rows from rowS/4 to rowE/4 to preallocate storage<br>
using MatMPIBAIJSetPreallocation(A,4,...)<br>
<br>
What will be the rowS and rowE here? I think they can be not divisible<br>
by 4 (block size)...<br><div class="im"></div></blockquote><div><br>You have to set the block size.<br><br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
><br>
> 2) Warning: This is an incredibly small problem. Using 2 processors<br>
> might not show any speedup at all.<br>
</div>Sure! It's just an example. I suppose it'll be much slower on two<br>
processors actually.<br>
<br>
<br>
Regards!<br>
Andrey<br>
<div><div></div><div class="h5"><br>
><br>
> Matt<br>
><br>
> On Fri, Feb 5, 2010 at 5:03 PM, NovA <<a href="mailto:av.nova@gmail.com">av.nova@gmail.com</a>> wrote:<br>
>><br>
>> Hi everybody!<br>
>><br>
>> I'm looking for the best way to distribute MPIBAIJ matrix among<br>
>> several processors.<br>
>><br>
>> For example, I have square matrix 3x3 of blocks 4x4 each (i.e. 12x12<br>
>> values) and need to distribute it among 2 processors. The generic way<br>
>> of creating such a matrix would be:<br>
>> Mat A;<br>
>> MatCreate(comm, &A);<br>
>> MatSetSizes(A, loc_rows,12, 12,12);<br>
>> MatSetType(A, MATMPIBAIJ);<br>
>><br>
>> What is the optimal value for loc_rows here?<br>
>><br>
>> Can I use PETSC_DECIDE for it? I suppose this will lead to division by<br>
>> 6 rows per processor, which is not consistent with block size. How<br>
>> MatMPIBAIJSetPreallocation(A,4,...) will deal with it?<br>
>><br>
>> Most likely, I have to manually set loc_rows to 8 and 4 according to<br>
>> the processor rank. But probably I miss some more clean way, when<br>
>> PETSc really decides. :)<br>
>><br>
>> Thanks in advance for any comments.<br>
>><br>
>> Regards!<br>
>> Andrey<br>
><br>
><br>
><br>
> --<br>
> What most experimenters take for granted before they begin their experiments<br>
> is infinitely more interesting than any results to which their experiments<br>
> lead.<br>
> -- Norbert Wiener<br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>