<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 28, 2016 at 5:30 PM, Jason Lefley <span dir="ltr"><<a href="mailto:jason.lefley@aclectic.com" target="_blank">jason.lefley@aclectic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I’m developing an application and used PETSc’s DMDA functionality to perform distributed computation on a cartesian grid. I encountered a situation where I need two distributed arrays with equivalent partitioning but each having a different stencil width.<br>
<br>
Right now I accomplish this through multiple calls to DMDACreate3d(), however I found that for some combinations of global array dimensions and number of processors, the multiple calls to DMDACreate3d() result in partition sizes that differ by a single cell when comparing the partitioning of the two distributed arrays. The application cannot run if this happens because a particular process needs access to the same grid locations in both of the distributed arrays.<br>
<br>
Is it possible to use PETSc’s cartesian grid partitioning functionality to perform a single partitioning of the domain and then set up the two distributed arrays using that partitioning in combination with different stencil widths? I looked at the source code that performs the partitioning but did not see an obvious way to use it in the capacity I describe. I think I could use lower level calls in PETSc and some other partitioning algorithm if necessary but I want to make sure that there is no way to do this using the built-in partitioning functionality.<br></blockquote><div><br></div><div>Yes, you just use the lm,ln,lp arguments to prescribe the partitioning. Here is an example doing that</div><div><br></div><div> <a href="https://bitbucket.org/petsc/petsc/src/db95f2d7f2b6de90a713b83cb05f32153c473dd3/src/snes/examples/tutorials/ex28.c?at=master&fileviewer=file-view-default#ex28.c-357">https://bitbucket.org/petsc/petsc/src/db95f2d7f2b6de90a713b83cb05f32153c473dd3/src/snes/examples/tutorials/ex28.c?at=master&fileviewer=file-view-default#ex28.c-357</a></div><div><br></div><div>albeit in a slightly tricky way since the second DMDA is at staggered points.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks</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>