Actual source code: spartition.c

petsc-3.7.5 2017-01-01
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_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

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

 25:   Not Collective

 27:   Level: developer

 29:   Adding new methods:
 30:   To add a new method to the registry. Copy this routine and
 31:   modify it to incorporate a call to MatPartitioningRegister() for
 32:   the new method, after the current list.

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

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

 42: .seealso: MatPartitioningRegister(), MatPartitioningRegisterDestroy()
 43: @*/
 44: PetscErrorCode  MatPartitioningRegisterAll(void)
 45: {

 49:   if (MatPartitioningRegisterAllCalled) return(0);
 50:   MatPartitioningRegisterAllCalled = PETSC_TRUE;

 52:   MatPartitioningRegister(MATPARTITIONINGCURRENT, MatPartitioningCreate_Current);
 53:   MatPartitioningRegister(MATPARTITIONINGAVERAGE, MatPartitioningCreate_Average);
 54:   MatPartitioningRegister(MATPARTITIONINGSQUARE,  MatPartitioningCreate_Square);
 55:   MatPartitioningRegister(MATPARTITIONINGHIERARCH,MatPartitioningCreate_Hierarchical);
 56: #if defined(PETSC_HAVE_PARMETIS)
 57:   MatPartitioningRegister(MATPARTITIONINGPARMETIS,MatPartitioningCreate_Parmetis);
 58: #endif
 59: #if defined(PETSC_HAVE_CHACO)
 60:   MatPartitioningRegister(MATPARTITIONINGCHACO,   MatPartitioningCreate_Chaco);
 61: #endif
 62: #if defined(PETSC_HAVE_PARTY)
 63:   MatPartitioningRegister(MATPARTITIONINGPARTY,   MatPartitioningCreate_Party);
 64: #endif
 65: #if defined(PETSC_HAVE_PTSCOTCH)
 66:   MatPartitioningRegister(MATPARTITIONINGPTSCOTCH,MatPartitioningCreate_PTScotch);
 67: #endif
 68:   return(0);
 69: }