<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 7, 2016 at 1:52 PM, Chris Eldred <span dir="ltr"><<a href="mailto:chris.eldred@gmail.com" target="_blank">chris.eldred@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hey All,<br>
<br>
(I sent this to petsc-users a few days ago and didn't get any replies,<br>
figured I would try here as well...)<br>
<br>
Does anyone know the correct syntax for setting ownership ranges for<br>
DMDAs in petsc4py? For example, if I have a 1D DMDA with 20 vertices<br>
and 3 processes, and I want to distribute the vertices as [8,8,4],<br>
should the correct create call be:<br>
<br>
da = PETSc.DMDA().create(dim=1,dof=1,sizes=[20,],proc_sizes=[3,],boundary_type=[PETSc.DM.BoundaryType.PERIODIC,],<br>
stencil_type= PETSc.DMDA.StencilType.BOX,<br>
stencil_width=1,ownership_ranges=[8,8,4])<br>
<br>
or<br>
<br>
da = PETSc.DMDA().create(dim=1,dof=1,sizes=[20,],proc_sizes=[3,],boundary_type=[PETSc.DM.BoundaryType.PERIODIC,],<br>
stencil_type= PETSc.DMDA.StencilType.BOX,<br>
stencil_width=1,ownership_ranges=[[8,8,4],])<br>
<br>
For me, the 1st version fails with<br>
ValueError: number of dimensions 1 and number ownership ranges 3<br>
(which I expected)<br>
but the 2nd version also fails with<br>
TypeError: Expected tuple, got list<br>
<br>
I have tried using tuples instead of lists and nothing changes.<br>
Creating without the ownership_ranges argument works fine as well. Is<br>
there something else I am missing?<br></blockquote><div><br></div><div>Here is the code:</div><div><br></div><div>  <a href="https://bitbucket.org/petsc/petsc4py/src/b234a50085607b793fce93d5dc46307c0d9b57c4/src/PETSc/petscdmda.pxi?at=master&fileviewer=file-view-default#petscdmda.pxi-150">https://bitbucket.org/petsc/petsc4py/src/b234a50085607b793fce93d5dc46307c0d9b57c4/src/PETSc/petscdmda.pxi?at=master&fileviewer=file-view-default#petscdmda.pxi-150</a></div><div><br></div><div>I do not understand why the 1st version fails.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Thanks in advance for any assistance!<br>
<br>
Regards,<br>
-Chris<br>
<span class=""><font color="#888888"><br>
<br>
--<br>
Chris Eldred<br>
Postdoctoral Fellow, LAGA, University of Paris 13<br>
PhD, Atmospheric Science, Colorado State University, 2015<br>
DOE Computational Science Graduate Fellow (Alumni)<br>
B.S. Applied Computational Physics, Carnegie Mellon University, 2009<br>
<a href="mailto:chris.eldred@gmail.com">chris.eldred@gmail.com</a><br>
</font></span></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>