# DMDAGetScatter
Gets the global-to-local, and local-to-local vector scatter contexts for a distributed array. 
## Synopsis
```
#include "petscdmda.h"   
PetscErrorCode DMDAGetScatter(DM da, VecScatter *gtol, VecScatter *ltol)
```
Collective on da


## Input Parameter

- ***da -*** the distributed array



## Output Parameters

- ***gtol -*** global-to-local scatter context (may be NULL)
- ***ltol -*** local-to-local scatter context (may be NULL)





## Note
The output contexts are valid only as long as the input da is valid.
If you delete the da, the scatter contexts will become invalid.


## See Also
 `DM`, `DMDA`, `DMGlobalToLocalBegin()`, `DMGlobalToLocalEnd()`, `DMLocalToGlobalBegin()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/da/dascatter.c.html#DMDAGetScatter">src/dm/impls/da/dascatter.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/da/dascatter.c)


[Index of all DMDA routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
