Actual source code: spartition.c
petsc-3.12.5 2020-03-29
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: MatPartitioningRegister(), MatPartitioningRegisterDestroy()
39: @*/
40: PetscErrorCode MatPartitioningRegisterAll(void)
41: {
45: if (MatPartitioningRegisterAllCalled) return(0);
46: MatPartitioningRegisterAllCalled = PETSC_TRUE;
48: MatPartitioningRegister(MATPARTITIONINGCURRENT, MatPartitioningCreate_Current);
49: MatPartitioningRegister(MATPARTITIONINGAVERAGE, MatPartitioningCreate_Average);
50: MatPartitioningRegister(MATPARTITIONINGSQUARE, MatPartitioningCreate_Square);
51: MatPartitioningRegister(MATPARTITIONINGHIERARCH,MatPartitioningCreate_Hierarchical);
52: #if defined(PETSC_HAVE_PARMETIS)
53: MatPartitioningRegister(MATPARTITIONINGPARMETIS,MatPartitioningCreate_Parmetis);
54: #endif
55: #if defined(PETSC_HAVE_CHACO)
56: MatPartitioningRegister(MATPARTITIONINGCHACO, MatPartitioningCreate_Chaco);
57: #endif
58: #if defined(PETSC_HAVE_PARTY)
59: MatPartitioningRegister(MATPARTITIONINGPARTY, MatPartitioningCreate_Party);
60: #endif
61: #if defined(PETSC_HAVE_PTSCOTCH)
62: MatPartitioningRegister(MATPARTITIONINGPTSCOTCH,MatPartitioningCreate_PTScotch);
63: #endif
64: return(0);
65: }