Actual source code: spartition.c

petsc-3.3-p7 2013-05-11
  2: #include <petscmat.h>

  4: EXTERN_C_BEGIN
  5: extern PetscErrorCode  MatPartitioningCreate_Current(MatPartitioning);
  6: extern PetscErrorCode  MatPartitioningCreate_Square(MatPartitioning);
  7: extern PetscErrorCode  MatPartitioningCreate_Parmetis(MatPartitioning);
  8: extern PetscErrorCode  MatPartitioningCreate_Chaco(MatPartitioning);
  9: extern PetscErrorCode  MatPartitioningCreate_Party(MatPartitioning);
 10: extern PetscErrorCode  MatPartitioningCreate_PTScotch(MatPartitioning);
 11: EXTERN_C_END

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

 18:   Not Collective

 20:   Level: developer

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

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

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

 35: .seealso: MatPartitioningRegisterDynamic(), MatPartitioningRegisterDestroy()
 36: @*/
 37: PetscErrorCode  MatPartitioningRegisterAll(const char path[])
 38: {

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