:orphan:
# MatPartitioningRegister
Adds a new sparse matrix partitioning to the  matrix package. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatPartitioningRegister(const char sname[], PetscErrorCode (*function)(MatPartitioning))
```
Not Collective


## Input Parameters

- ***sname -*** name of partitioning (for example `MATPARTITIONINGCURRENT`) or `MATPARTITIONINGPARMETIS`
- ***function -*** function pointer that creates the partitioning type





## Sample usage
```none
   MatPartitioningRegister("my_part", MyPartCreate);
```


Then, your partitioner can be chosen with the procedural interface via
```none
MatPartitioningSetType(part, "my_part")
```
or at runtime via the option
```none
-mat_partitioning_type my_part
```


## See Also
 [](ch_matrices), `Mat`, `MatPartitioning`, `MatPartitioningType`, `MatPartitioningCreate()`, `MatPartitioningRegisterDestroy()`, `MatPartitioningRegisterAll()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/partition/partition.c.html#MatPartitioningRegister">src/mat/partition/partition.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/partition/partition.c)


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