:orphan:
# PetscPartitionerRegister
Adds a new PetscPartitioner implementation 
## Synopsis
```
#include "petscpartitioner.h" 
PetscErrorCode PetscPartitionerRegister(const char sname[], PetscErrorCode (*function)(PetscPartitioner))
```
Not Collective


## Input Parameters

- ***sname -*** The name of a new user-defined creation routine
- ***function -*** The creation routine



## Notes
PetscPartitionerRegister() may be called multiple times to add several user-defined PetscPartitioners


## Sample usage
```none
    PetscPartitionerRegister("my_part", MyPetscPartitionerCreate);
```


Then, your PetscPartitioner type can be chosen with the procedural interface via
```none
    PetscPartitionerCreate(MPI_Comm, PetscPartitioner *);
    PetscPartitionerSetType(PetscPartitioner, "my_part");
```

or at runtime via the option
```none
    -petscpartitioner_type my_part
```





## See Also
 `PetscPartitionerRegisterAll()`


## Level
advanced

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


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


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