# VecGetOwnershipRange
Returns the range of indices owned by this processor, assuming that the vectors are laid out with the first n1 elements on the first processor, next n2 elements on the second, etc.  For certain parallel layouts this range may not be well defined. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecGetOwnershipRange(Vec x, PetscInt *low, PetscInt *high)
```
Not Collective


## Input Parameter

- ***x -*** the vector



## Output Parameters

- ***low -*** the first local element, pass in `NULL` if not interested
- ***high -*** one more than the last local element, pass in `NULL` if not interested





## Note
The high argument is one more than the last element stored locally.


## Fortran Note
`PETSC_NULL_INTEGER` should be used instead of NULL


## See Also
 [](chapter_vectors), `Vec`, `MatGetOwnershipRange()`, `MatGetOwnershipRanges()`, `VecGetOwnershipRanges()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/interface/vector.c.html#VecGetOwnershipRange">src/vec/vec/interface/vector.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/tagger/tutorials/ex1.c.html">src/vec/vec/utils/tagger/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex10.c.html">src/vec/vec/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex14f.F90.html">src/vec/vec/tutorials/ex14f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex15.c.html">src/vec/vec/tutorials/ex15.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex16.c.html">src/vec/vec/tutorials/ex16.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex16f.F90.html">src/vec/vec/tutorials/ex16f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex18.c.html">src/vec/vec/tutorials/ex18.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex18f.F90.html">src/vec/vec/tutorials/ex18f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex3.c.html">src/vec/vec/tutorials/ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex3f.F90.html">src/vec/vec/tutorials/ex3f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex5.c.html">src/vec/vec/tutorials/ex5.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/interface/vector.c)


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