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


## Input Parameters

- ***name        -*** The name of a new user-defined creation routine
- ***create_func -*** The creation routine itself



## 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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
