petsc-3.7.1 2016-05-15
Report Typos and Errors

VecScatterCreateToAll

Creates a vector and a scatter context that copies all vector values to each processor

Synopsis

#include "petscvec.h"    
PetscErrorCode  VecScatterCreateToAll(Vec vin,VecScatter *ctx,Vec *vout)
Collective on Vec Many br

Input Parameter

vin -input MPIVEC Many br

Output Parameter

ctx - scatter context Many br
vout - output SEQVEC that is large enough to scatter into Many br

Many br

Note: vout may be NULL [NULL_OBJECT from fortran] if you do not Many brneed to have it created Many br

Usage

       VecScatterCreateToAll(vin,&ctx,&vout);

       // scatter as many times as you need
       VecScatterBegin(ctx,vin,vout,INSERT_VALUES,SCATTER_FORWARD);
       VecScatterEnd(ctx,vin,vout,INSERT_VALUES,SCATTER_FORWARD);

       // destroy scatter context and local vector when no longer needed
       VecScatterDestroy(&ctx);
       VecDestroy(&vout);

Do NOT create a vector and then pass it in as the final argument vout! vout is created by this routine Many brautomatically (unless you pass NULL in for that argument if you do not need it). Many br

See Also

VecScatterCreate(), VecScatterCreateToZero(), VecScatterBegin(), VecScatterEnd()

Level:intermediate
Location:
src/vec/vec/utils/vecmpitoseq.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/ksp/ksp/examples/tutorials/ex43.c.html
src/ksp/ksp/examples/tutorials/ex49.c.html