[petsc-users] DMDAVecGetArray

Matthew Knepley knepley at gmail.com
Thu Apr 23 06:36:19 CDT 2015


On Thu, Apr 23, 2015 at 6:28 AM, anton <popov at uni-mainz.de> wrote:

> Hi,
>
> I'm currently calling DMDAVecGet(Restore)Array on a subset of processors.
> It seems to work correctly. So why does documentation say they are
> collective on Vec? Are they really? Unlike VecNorm, for example, it's not
> really clear why DMDAVecGetArray should be collective.
>

The documentation should be fixed. Its "logically collective" just like
VecGetArray(), and unlike VecGetArrayRead().


> Am I still on a safe side, or I'm seriously violating something that's not
> immediately obvious.
>

You are violating something that is not obvious. GetArray() will increment
the status marker on the Vec since you
could have changed something, but then you will get inconsistency across
processes in this marker, so you could
make different decisions about whether to recompute norms, etc. Hard to
debug errors.

  Thanks,

     Matt


> Thanks,
> Anton
>



-- 
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/20150423/f99eabdc/attachment-0001.html>


More information about the petsc-users mailing list