Actual source code: spartition.c
2: #include <petscmat.h>
3: #include <petsc/private/matimpl.h>
5: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Current(MatPartitioning);
6: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Average(MatPartitioning part);
7: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Square(MatPartitioning);
8: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Parmetis(MatPartitioning);
9: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Hierarchical(MatPartitioning);
10: #if defined(PETSC_HAVE_CHACO)
11: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Chaco(MatPartitioning);
12: #endif
13: #if defined(PETSC_HAVE_PARTY)
14: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Party(MatPartitioning);
15: #endif
16: #if defined(PETSC_HAVE_PTSCOTCH)
17: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_PTScotch(MatPartitioning);
18: #endif
20: /*@C
21: MatPartitioningRegisterAll - Registers all of the matrix partitioning routines in PETSc.
23: Not Collective
25: Level: developer
27: Adding new methods:
28: To add a new method to the registry. Copy this routine and
29: modify it to incorporate a call to `MatPartitioningRegister()` for
30: the new method, after the current list.
32: Restricting the choices: To prevent all of the methods from being
33: registered and thus save memory, copy this routine and modify it to
34: register a zero, instead of the function name, for those methods you
35: do not wish to register. Make sure that the replacement routine is
36: linked before libpetscmat.a.
38: .seealso: `MatPartitioning`, `MatPartitioningType`, `MatPartitioningRegister()`, `MatPartitioningRegisterDestroy()`
39: @*/
40: PetscErrorCode MatPartitioningRegisterAll(void)
41: {
42: if (MatPartitioningRegisterAllCalled) return 0;
43: MatPartitioningRegisterAllCalled = PETSC_TRUE;
45: MatPartitioningRegister(MATPARTITIONINGCURRENT, MatPartitioningCreate_Current);
46: MatPartitioningRegister(MATPARTITIONINGAVERAGE, MatPartitioningCreate_Average);
47: MatPartitioningRegister(MATPARTITIONINGSQUARE, MatPartitioningCreate_Square);
48: MatPartitioningRegister(MATPARTITIONINGHIERARCH, MatPartitioningCreate_Hierarchical);
49: #if defined(PETSC_HAVE_PARMETIS)
50: MatPartitioningRegister(MATPARTITIONINGPARMETIS, MatPartitioningCreate_Parmetis);
51: #endif
52: #if defined(PETSC_HAVE_CHACO)
53: MatPartitioningRegister(MATPARTITIONINGCHACO, MatPartitioningCreate_Chaco);
54: #endif
55: #if defined(PETSC_HAVE_PARTY)
56: MatPartitioningRegister(MATPARTITIONINGPARTY, MatPartitioningCreate_Party);
57: #endif
58: #if defined(PETSC_HAVE_PTSCOTCH)
59: MatPartitioningRegister(MATPARTITIONINGPTSCOTCH, MatPartitioningCreate_PTScotch);
60: #endif
61: return 0;
62: }