# PetscSplitOwnershipEqual
Given a global (or local) length determines a local (or global) length via a simple formula, trying to have all local lengths equal 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscSplitOwnershipEqual(MPI_Comm comm, PetscInt *n, PetscInt *N)
```
Collective (if n or N is `PETSC_DECIDE`)


## Input Parameters

- ***comm -*** MPI communicator that shares the object being divided
- ***n -*** local length (or `PETSC_DECIDE` to have it set)
- ***N -*** global length (or `PETSC_DECIDE`)





## Notes
This is intended to be used with `MATSCALAPACK`, where the local size must
be equal in all processes (except possibly the last one). For instance,
the local sizes when spliting N=50 with 6 processes are 9,9,9,9,9,5

n and N cannot be both `PETSC_DECIDE`

If one processor calls this with n or N of `PETSC_DECIDE` then all processors
must. Otherwise, an error is thrown in debug mode while the program will hang
in optimized (i.e. configured --with-debugging=0) mode.


## See Also
 `PetscSplitOwnership()`, `PetscSplitOwnershipBlock()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/psplit.c.html#PetscSplitOwnershipEqual">src/sys/utils/psplit.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/utils/psplit.c)


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