# VecScatterCreateToAll

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

### Synopsis

    PetscErrorCode PETSCVEC_DLLEXPORT VecScatterCreateToAll(Vec vin,VecScatter *ctx,Vec *vout)

Collective

### Input Parameter

vin -input MPIVEC

### Output Parameter

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

### Usage

           VecScatterCreateToAll(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);

### See Also

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

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