<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 26, 2015 at 8:16 AM, Florian Lindner <span dir="ltr"><<a href="mailto:mailinglists@xgm.de" target="_blank">mailinglists@xgm.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I'm using petsc with petsc4py.<br>
<br>
A matrix is created like that<br>
<br>
MPIrank = MPI.COMM_WORLD.Get_rank()<br>
MPIsize = MPI.COMM_WORLD.Get_size()<br>
print("MPI Rank = ", MPIrank)<br>
print("MPI Size = ", MPIsize)<br>
parts = partitions()<br>
<br>
print("Dimension= ", nSupport + dimension, "bsize = ", len(parts[MPIrank]))<br>
<br>
MPI.COMM_WORLD.Barrier() # Just to keep the output together<br>
A = PETSc.Mat(); A.createDense( (nSupport + dimension, nSupport + dimension), bsize = len(parts[MPIrank]) ) # <-- crash here<br>
<br>
<br>
Output for mpirun -n 2 is like that and it works:<br>
<br>
MPI Rank = 0<br>
MPI Size = 2<br>
Dimension= 10 bsize = 5<br>
MPI Rank = 1<br>
MPI Size = 2<br>
Dimension= 10 bsize = 5<br>
<br>
But for mpirun -n 3 it crashes:<br>
<br>
MPI Rank = 2<br>
MPI Size = 3<br>
Dimension= 10 bsize = 3<br>
MPI Rank = 1<br>
MPI Size = 3<br>
Dimension= 10 bsize = 4<br>
MPI Rank = 0<br>
MPI Size = 3<br>
Dimension= 10 bsize = 3<br>
<br>
Error is ValueError: global size 10 not divisible by block size 3.<br>
<br>
I tried to dig a bit into the source. Mat_Create uses Mat_Dense to unpack the size and bsize parameters. When there just a scalar n, not a tuple t given as parameter it assumes t = (n, n). (Right?). That should be fine.<br>
<br>
When I omit bsize, and mpirun -n 3, A.owner_range returns<br>
<br>
(4, 7)<br>
(0, 4)<br>
(7, 10)<br>
<br>
Which essentially is the same partioning that I manually set (I need to set partioning manually). Also the sum of bsizes equals the dimension. What is the problem here?<br></blockquote><div><br></div><div>This looks to me like the lack of an error check. A global size not divisible by the block size makes no sense at all.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks,<br>
Florian<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>