Actual source code: petscpartitioner.h

  1: #ifndef PETSCPARTITIONER_H
  2: #define PETSCPARTITIONER_H

  4: #include <petscsection.h>

  6: /* SUBMANSEC = MatOrderings */

  8: /*S
  9:   PetscPartitioner - PETSc object that manages a graph partitioner

 11:   Level: intermediate

 13: .seealso: `PetscPartitionerCreate()`, `PetscPartitionerSetType()`, `PetscPartitionerType`
 14: S*/
 15: typedef struct _p_PetscPartitioner *PetscPartitioner;

 17: PETSC_EXTERN PetscClassId   PETSCPARTITIONER_CLASSID;
 18: PETSC_EXTERN PetscErrorCode PetscPartitionerInitializePackage(void);
 19: PETSC_EXTERN PetscErrorCode PetscPartitionerFinalizePackage(void);

 21: /*J
 22:   PetscPartitionerType - String with the name of a PETSc graph partitioner

 24:   Level: beginner

 26: .seealso: `PetscPartitionerSetType()`, `PetscPartitioner`
 27: J*/
 28: typedef const char *PetscPartitionerType;
 29: #define PETSCPARTITIONERPARMETIS "parmetis"
 30: #define PETSCPARTITIONERPTSCOTCH "ptscotch"
 31: #define PETSCPARTITIONERCHACO    "chaco"
 32: #define PETSCPARTITIONERSIMPLE   "simple"
 33: #define PETSCPARTITIONERSHELL    "shell"
 34: #define PETSCPARTITIONERGATHER   "gather"

 36: PETSC_EXTERN PetscFunctionList PetscPartitionerList;
 37: PETSC_EXTERN PetscErrorCode    PetscPartitionerRegister(const char[], PetscErrorCode (*)(PetscPartitioner));

 39: PETSC_EXTERN PetscErrorCode PetscPartitionerCreate(MPI_Comm, PetscPartitioner *);
 40: PETSC_EXTERN PetscErrorCode PetscPartitionerDestroy(PetscPartitioner *);
 41: PETSC_EXTERN PetscErrorCode PetscPartitionerSetType(PetscPartitioner, PetscPartitionerType);
 42: PETSC_EXTERN PetscErrorCode PetscPartitionerGetType(PetscPartitioner, PetscPartitionerType *);
 43: PETSC_EXTERN PetscErrorCode PetscPartitionerSetUp(PetscPartitioner);
 44: PETSC_EXTERN PetscErrorCode PetscPartitionerReset(PetscPartitioner);
 45: PETSC_EXTERN PetscErrorCode PetscPartitionerSetFromOptions(PetscPartitioner);
 46: PETSC_EXTERN PetscErrorCode PetscPartitionerViewFromOptions(PetscPartitioner, PetscObject, const char[]);
 47: PETSC_EXTERN PetscErrorCode PetscPartitionerView(PetscPartitioner, PetscViewer);
 48: PETSC_EXTERN PetscErrorCode PetscPartitionerPartition(PetscPartitioner, PetscInt, PetscInt, PetscInt[], PetscInt[], PetscSection, PetscSection, PetscSection, IS *);

 50: PETSC_EXTERN PetscErrorCode PetscPartitionerShellSetPartition(PetscPartitioner, PetscInt, const PetscInt[], const PetscInt[]);
 51: PETSC_EXTERN PetscErrorCode PetscPartitionerShellSetRandom(PetscPartitioner, PetscBool);
 52: PETSC_EXTERN PetscErrorCode PetscPartitionerShellGetRandom(PetscPartitioner, PetscBool *);

 54: /* We should implement MatPartitioning with PetscPartitioner */
 55: #include <petscmat.h>
 56: #define PETSCPARTITIONERMATPARTITIONING "matpartitioning"
 57: PETSC_EXTERN PetscErrorCode PetscPartitionerMatPartitioningGetMatPartitioning(PetscPartitioner, MatPartitioning *);

 59: #endif