[petsc-dev] Ghost update in VecAssembly?

Jed Brown jed at jedbrown.org
Tue Mar 1 10:19:10 CST 2016


Matthew Knepley <knepley at gmail.com> writes:

> Okay, this shows that we always need to specify exactly which vector,
> local or global, we are talking about (and also why I don't use
> VecGhost).

Yes, it can be confusing and it wastes storage if you have many global
Vecs (e.g., large Krylov space).

> I was confusing the VecGhostUpdate() above which puts local values in the
> global vector
> with the update which would refresh the local portion. The former update
> should be called
> automatically during assembly, which already happens in the
> FormFunctionLocals, 

Uh, no, and they don't use VecGhost...

> and would make sense to have in VecAssembly() for VecGhost I think.

No.  VecAssembly goes with VecSetValues, which has *nothing* to do with
VecGhost.  If you don't want to use VecSetValues/VecAssembly, then you
can use VecGhost and VecGetArray on the local form, followed by
VecGhostUpdate(x,ADD_VALUES,SCATTER_REVERSE).  You use one or the other;
I don't have any compelling use case for using both and it definitely
wouldn't be typical.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160301/f778cfbe/attachment.sig>


More information about the petsc-dev mailing list