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

Reply via email to