PetscErrorCode VecScatterCreateToZero(Vec vin,VecScatter *ctx,Vec *vout)Collective
ctx | - scatter context | |
vout | - output MPIVEC that is large enough to scatter into on processor 0 and of length zero on all other processors |
VecScatterCreateToZero(vin,&ctx,&vout);
// scatter as many times as you need
VecScatterBegin(vin,vout,INSERT_VALUES,SCATTER_FORWARD,ctx);
VecScatterEnd(vin,vout,INSERT_VALUES,SCATTER_FORWARD,ctx);
// destroy scatter context and local vector when no longer needed
VecScatterDestroy(ctx);
VecDestroy(vout);
Note: If you want to treat the vector on processor zero as a sequential vector call VecGetArray() on it and create a sequential vector with VecCreateSeqWithArray().
Level:intermediate
Location:src/vec/utils/vecmpitoseq.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages