[petsc-users] partial stencil in DMDA?

Barry Smith bsmith at mcs.anl.gov
Fri Feb 21 11:20:35 CST 2014

On Feb 21, 2014, at 11:02 AM, Fischer, Greg A. <fischega at westinghouse.com> wrote:

> Hello,
> I’m interested in using PETSc to manage distributed arrays. Based on my reading about the DMDA objects, I see that ghost points can be communicated in box-type stencils or star-type stencils.
> For my application, assume that I have a 2D DMDA object with star-type stencils. For a typical local calculation, I only need to access ghost values from two of the four directions at a time. For example, I’d like access to ghost values in the South and East directions, but not in the North or West directions. Communicating North and West data would seem to be wasting bandwidth. Is there any way to accomplish this?


    There is not anything built in. Here is what I suggest: 

1)  write your application code not worrying about the fact that the DMGlobalToLocalBegin/End() is moving values you don’t need.

2) when your code is running correctly for your problem and giving useful results if the communication times are impacting how long it takes to run you can provide a custom communication pattern. It would involve little additional coding essentially taking DMSetUp_DA_2D() which creates the list of ghost points and removing the  unneeded ghost points.  But it would be premature to do this optimization until you have a full working application code.


> Thanks,
> Greg

More information about the petsc-users mailing list