[petsc-dev] Ghost update in VecAssembly?

Matthew Knepley knepley at gmail.com
Tue Mar 1 09:28:45 CST 2016


On Tue, Mar 1, 2016 at 8:56 AM, Jed Brown <jed at jedbrown.org> wrote:

> Matthew Knepley <knepley at gmail.com> writes:
> >> No.  You only need to call VecAssembly if you use VecSetValues.  But if
> >>
> >
> > I thought we had state increase on getarray() as well, but its just
> locking.
>
> VecRestoreArray calls PetscObjectStateIncrease, but what does that has
> to do with VecAssembly?
>
> >> you have a ghosted vector, you would normally use VecGetArray and never
> >> bother with VecSetValues.
> >
> >
> > Why would we assume people make the ghost values as well?
>
> Huh?
>
> > However, if this is the only case, I don't think putting it in is a
> > great idea.
>

I am trying to understand what you are saying here. I have a vector on 2
procs, divided as

p0  |----interior---|--ghost--|

p1  |----interior---|--ghost--|

Now I calculate some values in the interior on both procs using
VecGetArray(),

p0  |xxxxinteriorxxx|--ghost--|

p1  |xxxxinteriorxxx|--ghost--|

What is wrong with calling VecGhostUpdate() here to fill in the ghosts? Is
your contention
that I should have also calculated the ghosts?

  Matt

-- 
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-dev/attachments/20160301/d52f5761/attachment.html>


More information about the petsc-dev mailing list