<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 27, 2015 at 4:28 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">Am Donnerstag, 26. März 2015, 07:34:27 schrieb Jed Brown:<br>
> Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>> writes:<br>
><br>
> > 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>
> bsize is collective (must be the same on all processes). It is used for<br>
> vector-valued problems (like elasticity -- bs=3 in 3 dimensions).<br>
<br>
It seems I'm still misunderstanding the bsize parameter.<br>
<br>
If I distribute a 10x10 matrix on three ranks I need to have a non-homogenous distribution, and thats what petsc does itself:<br></blockquote><div><br></div><div>blockSize really means the uniform block size of the matrix, thus is HAS to divide the global size. If it does not,</div><div>you do not have a uniform block size, you have a bunch of different sized blocks.</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">
A.createDense( (n, n) )<br>
<br>
print("Rank = ", rank, "Range = ", A.owner_range, "Size = ", A.owner_range[1] - A.owner_range[0])<br>
print("Rank = ", rank, "ColRange = ", A.getOwnershipRangeColumn(), "Size = ", A.getOwnershipRangeColumn()[1] - A.getOwnershipRangeColumn()[0])<br>
<br>
gives:<br>
<br>
Rank = 2 Range = (7, 10) Size = 3<br>
Rank = 2 ColRange = (7, 10) Size = 3<br>
Rank = 0 Range = (0, 4) Size = 4<br>
Rank = 0 ColRange = (0, 4) Size = 4<br>
Rank = 1 Range = (4, 7) Size = 3<br>
Rank = 1 ColRange = (4, 7) Size = 3<br>
<br>
<br>
How can I manually set a distribution of rows like above? My approach was to call create with bsize = [3,3,4][rank] but that obviously is not the way...<br>
<br>
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>