Actual source code: spartition.c

  1: /*$Id: spartition.c,v 1.23 2001/03/23 23:22:49 balay Exp $*/
  2: 
 3:  #include petsc.h
 4:  #include petscmat.h

  6: EXTERN_C_BEGIN
  7: EXTERN int MatPartitioningCreate_Current(MatPartitioning);
  8: EXTERN int MatPartitioningCreate_Square(MatPartitioning);
  9: EXTERN int MatPartitioningCreate_Parmetis(MatPartitioning);
 10: EXTERN_C_END

 12: #undef __FUNCT__  
 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 MatPartitioningRegisterDynamic() 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: MatPartitioningRegisterDynamic(), MatPartitioningRegisterDestroy()
 35: @*/
 36: int MatPartitioningRegisterAll(char *path)
 37: {
 38:   int         ierr;

 41:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_CURRENT,path,"MatPartitioningCreate_Current",MatPartitioningCreate_Current);
 42:   MatPartitioningRegisterDynamic("square",path,"MatPartitioningCreate_Square",MatPartitioningCreate_Square);
 43: #if defined(PETSC_HAVE_PARMETIS)
 44:   MatPartitioningRegisterDynamic(MAT_PARTITIONING_PARMETIS,path,"MatPartitioningCreate_Parmetis",MatPartitioningCreate_Parmetis);
 45: #endif
 46:   return(0);
 47: }