[petsc-users] Multiple distributed arrays having equivalent partitioning but different stencil widths

Matthew Knepley knepley at gmail.com
Mon Nov 28 17:36:54 CST 2016


On Mon, Nov 28, 2016 at 5:30 PM, Jason Lefley <jason.lefley at aclectic.com>
wrote:

> 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.
>
> 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.
>
> 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.
>

Yes, you just use the lm,ln,lp arguments to prescribe the partitioning.
Here is an example doing that


https://bitbucket.org/petsc/petsc/src/db95f2d7f2b6de90a713b83cb05f32153c473dd3/src/snes/examples/tutorials/ex28.c?at=master&fileviewer=file-view-default#ex28.c-357

albeit in a slightly tricky way since the second DMDA is at staggered
points.

  Thanks,

     Matt


> Thanks




-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161128/0e19a55f/attachment.html>


More information about the petsc-users mailing list