# PetscLayoutCreateFromRanges
Creates a new `PetscLayout` with the given ownership ranges and sets it up. 
## Synopsis
```
#include "petscis.h" 
PetscErrorCode PetscLayoutCreateFromRanges(MPI_Comm comm, const PetscInt range[], PetscCopyMode mode, PetscInt bs, PetscLayout *newmap)
```
Collective


## Input Parameters

- ***comm  -*** the MPI communicator
- ***range -*** the array of ownership ranges for each rank with length commsize+1
- ***mode  -*** the copy mode for range
- ***bs    -*** the block size (or `PETSC_DECIDE`)



## Output Parameters

- ***newmap -*** the new `PetscLayout`





## See Also
 [PetscLayout](sec_matlayout), `PetscLayoutCreate()`, `PetscLayoutSetLocalSize()`, `PetscLayoutSetSize()`, `PetscLayoutGetSize()`,
`PetscLayoutGetLocalSize()`, `PetscLayout`, `PetscLayoutDestroy()`,
`PetscLayoutGetRange()`, `PetscLayoutGetRanges()`, `PetscLayoutSetBlockSize()`, `PetscLayoutGetBlockSize()`, `PetscLayoutSetUp()`, `PetscLayoutCreateFromSizes()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/utils/pmap.c.html#PetscLayoutCreateFromRanges">src/vec/is/utils/pmap.c</A>


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


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