# DMPlexRebalanceSharedPoints
Redistribute points in the plex that are shared in order to achieve better balancing. This routine updates the `PointSF` of the `DM` inplace. 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexRebalanceSharedPoints(DM dm, PetscInt entityDepth, PetscBool useInitialGuess, PetscBool parallel, PetscBool *success)
```

## Input parameters

- ***dm               -*** The `DMPLEX` object.
- ***entityDepth      -*** depth of the entity to balance (0 -> balance vertices).
- ***useInitialGuess  -*** whether to use the current distribution as initial guess (only used by ParMETIS).
- ***parallel         -*** whether to use ParMETIS and do the partition in parallel or whether to gather the graph onto a single process and use METIS.



## Output parameters

- ***success          -*** whether the graph partitioning was successful or not, optional. Unsuccessful simply means no change to the partitioning



## Options Database Keys

- ***-dm_plex_rebalance_shared_points_parmetis -*** Use ParMetis instead of Metis for the partitioner
- ***-dm_plex_rebalance_shared_points_use_initial_guess -*** Use current partition to bootstrap ParMetis partition
- ***-dm_plex_rebalance_shared_points_use_mat_partitioning -*** Use the MatPartitioning object to perform the partition, the prefix for those operations is -dm_plex_rebalance_shared_points_
- ***-dm_plex_rebalance_shared_points_monitor -*** Monitor the shared points rebalance process





## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMPlexDistribute()`, `DMPlexCreateOverlap()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexpartition.c.html#DMPlexRebalanceSharedPoints">src/dm/impls/plex/plexpartition.c</A>


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


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