[petsc-users] copy vector between communicators

Jed Brown jed at jedbrown.org
Tue Feb 11 20:00:34 CST 2014

Alexander Grayver <agrayver at gfz-potsdam.de> writes:

> Hello,
> I need to have a copy of a vector created on the communicator COMM to 
> another vector created on the communicator SUBCOMM (which is a subset of 
> the COMM processes).
> Are there any standard functions that can help here? I assume VecScatter 
> could help, but I am not sure how to use it here?

Where is the information to specify from where you need to get the data?
You can always create a dummy sequential vector and VecPlaceArray the
SUBCOMM-Vec's array as the destination of the scatter.  Any processes
not part of SUBCOMM should have an empty destination Vec.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140211/9c761b03/attachment.pgp>

More information about the petsc-users mailing list