Actual source code: spartition.c

petsc-3.9.4 2018-09-11
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

 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: .keywords: matrix, Partitioning, register, all

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

 47:   if (MatPartitioningRegisterAllCalled) return(0);
 48:   MatPartitioningRegisterAllCalled = PETSC_TRUE;

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