Actual source code: spartition.c

  1: #define PETSCMAT_DLL

 3:  #include petsc.h
 4:  #include petscmat.h

  7: EXTERN PetscErrorCode  MatPartitioningCreate_Current(MatPartitioning);
  8: EXTERN PetscErrorCode  MatPartitioningCreate_Square(MatPartitioning);
  9: EXTERN PetscErrorCode  MatPartitioningCreate_Parmetis(MatPartitioning);
 10: EXTERN PetscErrorCode  MatPartitioningCreate_Chaco(MatPartitioning);
 11: EXTERN PetscErrorCode  MatPartitioningCreate_Jostle(MatPartitioning);
 12: EXTERN PetscErrorCode  MatPartitioningCreate_Party(MatPartitioning);
 13: EXTERN PetscErrorCode  MatPartitioningCreate_Scotch(MatPartitioning);

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

 21:   Not Collective

 23:   Level: developer

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

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

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

 38: .seealso: MatPartitioningRegisterDynamic(), MatPartitioningRegisterDestroy()
 39: @*/
 40: PetscErrorCode  MatPartitioningRegisterAll(const char path[])
 41: {

 45:   MatPartitioningRegisterAllCalled = PETSC_TRUE;
 46:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_CURRENT,path,"MatPartitioningCreate_Current",MatPartitioningCreate_Current);
 47:   MatPartitioningRegisterDynamic("square",path,"MatPartitioningCreate_Square",MatPartitioningCreate_Square);
 48: #if defined(PETSC_HAVE_PARMETIS)
 49:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_PARMETIS,path,"MatPartitioningCreate_Parmetis",MatPartitioningCreate_Parmetis);
 50: #endif
 51: #if defined(PETSC_HAVE_CHACO)
 52:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_CHACO,path,"MatPartitioningCreate_Chaco",MatPartitioningCreate_Chaco);
 53: #endif
 54: #if defined(PETSC_HAVE_JOSTLE)
 55:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_JOSTLE,path,"MatPartitioningCreate_Jostle",MatPartitioningCreate_Jostle);
 56: #endif
 57: #if defined(PETSC_HAVE_PARTY)
 58:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_PARTY,path,"MatPartitioningCreate_Party",MatPartitioningCreate_Party);
 59: #endif
 60: #if defined(PETSC_HAVE_SCOTCH)
 61:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_SCOTCH,path,"MatPartitioningCreate_Scotch",MatPartitioningCreate_Scotch);
 62: #endif
 63:   return(0);
 64: }