Actual source code: spartition.c

petsc-3.6.4 2016-04-12
Report Typos and Errors
  2: #include <petscmat.h>
  3: #include <petsc/private/matimpl.h>

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

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

 17:   Not Collective

 19:   Level: developer

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

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

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

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

 41:   if (MatPartitioningRegisterAllCalled) return(0);
 42:   MatPartitioningRegisterAllCalled = PETSC_TRUE;

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