[petsc-users] How do I scatter a Vec from one processor to many?

Sun, Hui hus003 at ucsd.edu
Thu Apr 23 18:48:43 CDT 2015


I have a Sequential Vec v and a parallel Vec u, and I want to scatter v from processor rank 0 to Vec u. How shall I do it?

If I directly call:
VecScatterBegin(ctx,v,u,INSERT_VALUES,SCATTER_FORWARD);

VecScatterEnd(ctx,v,u,INSERT_VALUES,SCATTER_FORWARD);

Then how does the computer know that I want to scatter v from processor 0?

If I call:
if (rank==0) {
    VecScatterBegin(ctx,v,u,INSERT_VALUES,SCATTER_FORWARD);

    VecScatterEnd(ctx,v,u,INSERT_VALUES,SCATTER_FORWARD);

}

Then how can other processors know that a scatter has been called?

So what shall I do here?

Best,
Hui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150423/3326e218/attachment.html>


More information about the petsc-users mailing list