[petsc-users] Drastic increase in memory usage between DMDA_STENCIL_BOX and DMDA_STENCIL_STAR

Peter Brune prbrune at gmail.com
Tue Mar 18 20:30:12 CDT 2014

On Tue, Mar 18, 2014 at 8:04 PM, Mani Chandra <mc0710 at gmail.com> wrote:

> Hi,
> I see a 4x increase in the memory usage when I change from
> DMDA_STENCIL_STAR to DMDA_STENCIL_BOX. Attached are the outputs of
> -log_summary which shows a huge increase in the matrix memory usage. Is
> this expected?
Yup.  In 2D your matrices balloon from 5 entries per row to 9.  In 3D it's
7 to 27.  The number of colors required to color the matrix will increase
by a significant factor as well, explaining the situation in your log files
by simple multiplication.

> On a different note, suppose I am running a serial calculation with no
> need to exchange data but I am using corner node information, do I need to
> use DMDA_STENCIL_BOX? Would the jacobian when computed using colored finite
> differences be correctly represented if I use corner information but still
If you're using diagonal corners in your function evaluation, then you need
DMDA_STENCIL_BOX.  Otherwise you're going to have columns of the Jacobian
of the same color that aren't structurally orthogonal, and the finite
difference Jacobian will be straightup wrong.

- Peter

> Thanks,
> Mani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140318/ff3b65d9/attachment.html>

More information about the petsc-users mailing list