Actual source code: partitionerimpl.h
1: #pragma once
3: #include <petscpartitioner.h>
4: #include <petsc/private/petscimpl.h>
6: PETSC_EXTERN PetscBool PetscPartitionerRegisterAllCalled;
7: PETSC_EXTERN PetscErrorCode PetscPartitionerRegisterAll(void);
9: typedef struct _PetscPartitionerOps *PetscPartitionerOps;
10: struct _PetscPartitionerOps {
11: PetscErrorCode (*setfromoptions)(PetscPartitioner, PetscOptionItems);
12: PetscErrorCode (*setup)(PetscPartitioner);
13: PetscErrorCode (*reset)(PetscPartitioner);
14: PetscErrorCode (*view)(PetscPartitioner, PetscViewer);
15: PetscErrorCode (*destroy)(PetscPartitioner);
16: PetscErrorCode (*partition)(PetscPartitioner, PetscInt, PetscInt, PetscInt[], PetscInt[], PetscSection, PetscSection, PetscSection, PetscSection, IS *);
17: };
19: struct _p_PetscPartitioner {
20: PETSCHEADER(struct _PetscPartitionerOps);
21: void *data; /* Implementation object */
22: PetscInt height; /* Height of points to partition into non-overlapping subsets */
23: PetscInt edgeCut; /* The number of edge cut by the partition */
24: PetscReal balance; /* The maximum partition size divided by the minimum size */
26: PetscBool printHeader;
27: PetscViewer viewer, viewerGraph;
28: PetscViewerFormat viewerFmt;
30: PetscBool noGraph; /* if true, the partitioner does not need the connectivity graph, only the number of local vertices */
31: PetscBool usevwgt; /* if true, the partitioner looks at the local section vertSection to weight the vertices of the graph */
32: PetscBool useewgt; /* if true, the partitioner looks at the topology to weight the edges of the graph */
33: };
35: /* All levels > 8 logged in 8-th level */
36: #define PETSCPARTITIONER_MS_MAXSTAGE 8
37: #define PETSCPARTITIONER_MS_NUMSTAGE (PETSCPARTITIONER_MS_MAXSTAGE + 1)
38: PETSC_EXTERN PetscLogEvent PetscPartitioner_MS_SetUp;
39: PETSC_EXTERN PetscLogEvent PetscPartitioner_MS_Stage[PETSCPARTITIONER_MS_NUMSTAGE];
40: PETSC_EXTERN PetscErrorCode PetscPartitionerMultistageGetStages_Multistage(PetscPartitioner, PetscInt *, MPI_Group *[]);
41: PETSC_EXTERN PetscErrorCode PetscPartitionerMultistageSetStage_Multistage(PetscPartitioner, PetscInt, PetscObject);
42: PETSC_EXTERN PetscErrorCode PetscPartitionerMultistageGetStage_Multistage(PetscPartitioner, PetscInt *, PetscObject *);