[petsc-users] VecCopy on ghosted vectors

Dominik Szczerba dominik at itis.ethz.ch
Sun Apr 22 10:35:52 CDT 2012


I do

VecGhostUpdateBegin(x1, INSERT_VALUES, SCATTER_FORWARD);
VecGhostUpdateEnd(x1, INSERT_VALUES, SCATTER_FORWARD);

then

VecCopy(x1,x2)

to find that x2 does not have correct ghost values and I need to explicitly call

VecGhostUpdateBegin(x2, INSERT_VALUES, SCATTER_FORWARD);
VecGhostUpdateEnd(x2, INSERT_VALUES, SCATTER_FORWARD);

Is there a rationale for this behavior? I would suggest to add a note
to the VecCopy man page about it.

Thanks
Dominik


More information about the petsc-users mailing list