Actual source code: spartition.c

petsc-3.4.4 2014-03-13
  2: #include <petscmat.h>

  4: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Current(MatPartitioning);
  5: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Square(MatPartitioning);
  6: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Parmetis(MatPartitioning);
  7: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Chaco(MatPartitioning);
  8: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_Party(MatPartitioning);
  9: PETSC_EXTERN PetscErrorCode MatPartitioningCreate_PTScotch(MatPartitioning);

 13: /*@C
 14:   MatPartitioningRegisterAll - Registers all of the matrix Partitioning routines in PETSc.

 16:   Not Collective

 18:   Level: developer

 20:   Adding new methods:
 21:   To add a new method to the registry. Copy this routine and
 22:   modify it to incorporate a call to MatPartitioningRegister() for
 23:   the new method, after the current list.

 25:   Restricting the choices: To prevent all of the methods from being
 26:   registered and thus save memory, copy this routine and modify it to
 27:   register a zero, instead of the function name, for those methods you
 28:   do not wish to register.  Make sure that the replacement routine is
 29:   linked before libpetscmat.a.

 31: .keywords: matrix, Partitioning, register, all

 33: .seealso: MatPartitioningRegister(), MatPartitioningRegisterDestroy()
 34: @*/
 35: PetscErrorCode  MatPartitioningRegisterAll(void)
 36: {

 40:   MatPartitioningRegisterAllCalled = PETSC_TRUE;

 42:   MatPartitioningRegister(MATPARTITIONINGCURRENT, MatPartitioningCreate_Current);
 43:   MatPartitioningRegister("square",               MatPartitioningCreate_Square);
 44: #if defined(PETSC_HAVE_PARMETIS)
 45:   MatPartitioningRegister(MATPARTITIONINGPARMETIS,MatPartitioningCreate_Parmetis);
 46: #endif
 47: #if defined(PETSC_HAVE_CHACO)
 48:   MatPartitioningRegister(MATPARTITIONINGCHACO,   MatPartitioningCreate_Chaco);
 49: #endif
 50: #if defined(PETSC_HAVE_PARTY)
 51:   MatPartitioningRegister(MATPARTITIONINGPARTY,   MatPartitioningCreate_Party);
 52: #endif
 53: #if defined(PETSC_HAVE_PTSCOTCH)
 54:   MatPartitioningRegister(MATPARTITIONINGPTSCOTCH,MatPartitioningCreate_PTScotch);
 55: #endif
 56:   return(0);
 57: }