[petsc-users] creating a DM with fewer processors than available?

Frederik Treue frtr at fysik.dtu.dk
Mon Jul 8 09:17:23 CDT 2013

On Mon, 2013-07-08 at 07:15 -0500, Jed Brown wrote:
> Frederik Treue <frtr at fysik.dtu.dk> writes:
> > Hi,
> >
> > I am solving 2D problems using petsc, but for some diagnostics I need 1D
> > objects. This works fine, except if I use many processors for a
> > relatively small grid: say gridsize 512x512, with 256 processors. In the
> > 2D DM, this is not a problem, I get 32x32 blocks on each processor. But
> > in the 1D object petsc allocates 2 points to each processor, and since I
> > have a stencil with of 2, it croaks! Is there any way around this, ie.
> > use less processors for a designated DM?
> No, you can create the DMDA on a subcommunicator, but then it can't be
> composed into the outer solver.  How is it currently being used?  Can it
> be eliminated from the solve and just used as an auxiliary component to
> solve the 2D problem?
> Unfortunately, there is currently no way to do a reduced distribution on
> the global communicator.  If the number of points is less than 1000, you
> might just use DMRedundant.

Nevermind, I found a workaround: I realized that I never actually used
the stencil (it was a relic from a previous version of the code), so I
just set the stencil size to 0, and no more problems. However, you might
consider adding this functionality, it would be quite usable, in
particular for diagnostics.

/Frederik Treue

More information about the petsc-users mailing list