# PetscPartitionerPartition
Partition a graph 
## Synopsis
```
#include "petscpartitioner.h" 
PetscErrorCode PetscPartitionerPartition(PetscPartitioner part, PetscInt nparts, PetscInt numVertices, PetscInt start[], PetscInt adjacency[], PetscSection vertexSection, PetscSection targetSection, PetscSection partSection, IS *partition)
```
Collective on PetscPartitioner


## Input Parameters

- ***part    -*** The PetscPartitioner
- ***nparts  -*** Number of partitions
- ***numVertices -*** Number of vertices in the local part of the graph
- ***start -*** row pointers for the local part of the graph (CSR style)
- ***adjacency -*** adjacency list (CSR style)
- ***vertexSection -*** PetscSection describing the absolute weight of each local vertex (can be NULL)
- ***targetSection -*** PetscSection describing the absolute weight of each partition (can be NULL)



## Output Parameters

- ***partSection     -*** The PetscSection giving the division of points by partition
- ***partition       -*** The list of points by partition



## Options Database

- ***-petscpartitioner_view -*** View the partitioner information
- ***-petscpartitioner_view_graph -*** View the graph we are partitioning



## Notes
The chart of the vertexSection (if present) must contain [0,numVertices), with the number of dofs in the section specifying the absolute weight for each vertex.
The chart of the targetSection (if present) must contain [0,nparts), with the number of dofs in the section specifying the absolute weight for each partition. This information must be the same across processes, PETSc does not check it.




## See Also
`PetscPartitionerCreate()`, `PetscPartitionerSetType()`, `PetscSectionCreate()`, `PetscSectionSetChart()`, `PetscSectionSetDof()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/interface/partitioner.c.html#PetscPartitionerPartition">src/dm/partitioner/interface/partitioner.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/impls/chaco/partchaco.c.html#PetscPartitionerPartition_Chaco">PetscPartitionerPartition_Chaco in src/dm/partitioner/impls/chaco/partchaco.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/impls/gather/partgather.c.html#PetscPartitionerPartition_Gather">PetscPartitionerPartition_Gather in src/dm/partitioner/impls/gather/partgather.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/impls/matpart/partmatpart.c.html#PetscPartitionerPartition_MatPartitioning">PetscPartitionerPartition_MatPartitioning in src/dm/partitioner/impls/matpart/partmatpart.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/impls/parmetis/partparmetis.c.html#PetscPartitionerPartition_ParMetis">PetscPartitionerPartition_ParMetis in src/dm/partitioner/impls/parmetis/partparmetis.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/impls/ptscotch/partptscotch.c.html#PetscPartitionerPartition_PTScotch">PetscPartitionerPartition_PTScotch in src/dm/partitioner/impls/ptscotch/partptscotch.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/impls/shell/partshell.c.html#PetscPartitionerPartition_Shell">PetscPartitionerPartition_Shell in src/dm/partitioner/impls/shell/partshell.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/partitioner/impls/simple/partsimple.c.html#PetscPartitionerPartition_Simple">PetscPartitionerPartition_Simple in src/dm/partitioner/impls/simple/partsimple.c</A><BR>


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


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