1 #if !defined(PETSCPARTITIONER_H) 2 #define PETSCPARTITIONER_H 3 4 #include <petscsection.h> 5 6 /*S 7 PetscPartitioner - PETSc object that manages a graph partitioner 8 9 Level: intermediate 10 11 .seealso: PetscPartitionerCreate(), PetscPartitionerSetType(), PetscPartitionerType 12 S*/ 13 typedef struct _p_PetscPartitioner *PetscPartitioner; 14 15 PETSC_EXTERN PetscClassId PETSCPARTITIONER_CLASSID; 16 PETSC_EXTERN PetscErrorCode PetscPartitionerInitializePackage(void); 17 PETSC_EXTERN PetscErrorCode PetscPartitionerFinalizePackage(void); 18 19 /*J 20 PetscPartitionerType - String with the name of a PETSc graph partitioner 21 22 Level: beginner 23 24 .seealso: PetscPartitionerSetType(), PetscPartitioner 25 J*/ 26 typedef const char *PetscPartitionerType; 27 #define PETSCPARTITIONERPARMETIS "parmetis" 28 #define PETSCPARTITIONERPTSCOTCH "ptscotch" 29 #define PETSCPARTITIONERCHACO "chaco" 30 #define PETSCPARTITIONERSIMPLE "simple" 31 #define PETSCPARTITIONERSHELL "shell" 32 #define PETSCPARTITIONERGATHER "gather" 33 34 PETSC_EXTERN PetscFunctionList PetscPartitionerList; 35 PETSC_EXTERN PetscErrorCode PetscPartitionerRegister(const char[], PetscErrorCode (*)(PetscPartitioner)); 36 37 PETSC_EXTERN PetscErrorCode PetscPartitionerCreate(MPI_Comm, PetscPartitioner*); 38 PETSC_EXTERN PetscErrorCode PetscPartitionerDestroy(PetscPartitioner*); 39 PETSC_EXTERN PetscErrorCode PetscPartitionerSetType(PetscPartitioner, PetscPartitionerType); 40 PETSC_EXTERN PetscErrorCode PetscPartitionerGetType(PetscPartitioner, PetscPartitionerType*); 41 PETSC_EXTERN PetscErrorCode PetscPartitionerSetUp(PetscPartitioner); 42 PETSC_EXTERN PetscErrorCode PetscPartitionerReset(PetscPartitioner); 43 PETSC_EXTERN PetscErrorCode PetscPartitionerSetFromOptions(PetscPartitioner); 44 PETSC_EXTERN PetscErrorCode PetscPartitionerViewFromOptions(PetscPartitioner, PetscObject, const char[]); 45 PETSC_EXTERN PetscErrorCode PetscPartitionerView(PetscPartitioner, PetscViewer); 46 PETSC_EXTERN PetscErrorCode PetscPartitionerPartition(PetscPartitioner, PetscInt, PetscInt, PetscInt[], PetscInt[], PetscSection, PetscSection, PetscSection, IS*); 47 48 PETSC_EXTERN PetscErrorCode PetscPartitionerShellSetPartition(PetscPartitioner, PetscInt, const PetscInt[], const PetscInt[]); 49 PETSC_EXTERN PetscErrorCode PetscPartitionerShellSetRandom(PetscPartitioner, PetscBool); 50 PETSC_EXTERN PetscErrorCode PetscPartitionerShellGetRandom(PetscPartitioner, PetscBool*); 51 52 /* We should implement MatPartitioning with PetscPartitioner */ 53 #include <petscmat.h> 54 #define PETSCPARTITIONERMATPARTITIONING "matpartitioning" 55 PETSC_EXTERN PetscErrorCode PetscPartitionerMatPartitioningGetMatPartitioning(PetscPartitioner, MatPartitioning*); 56 57 #endif 58