Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KarypisLab/METIS/llms.txt
Use this file to discover all available pages before exploring further.
mpmetis partitions finite element meshes directly, without requiring you to convert them to a graph first. Internally it converts the mesh into either a dual graph (one node per element, edges between adjacent elements) or a nodal graph (one node per mesh node, edges between nodes sharing an element), then partitions that graph. Both an element partition and a node partition are written as output.
Usage
| Argument | Description |
|---|---|
meshfile | Path to the mesh file to be partitioned. |
nparts | Number of partitions to produce. Must be ≥ 2. |
Dual vs. Nodal Graphs
Understanding the two graph types is key to choosing the right partitioning strategy.Dual Graph (GTYPE_DUAL)
Each element of the mesh becomes a vertex in the graph. Two vertices are connected by an edge if the corresponding elements share at least
ncommon mesh nodes. The resulting element partition (epart) directly tells you which processor each element is assigned to.Nodal Graph (GTYPE_NODAL)
Each mesh node becomes a vertex in the graph. Two vertices are connected if the corresponding nodes belong to the same element. The resulting node partition (
npart) tells you which processor owns each mesh node.Use the dual graph (default) when your solver assigns work to elements (e.g., finite element assembly). Use the nodal graph when your solver assigns work to nodes (e.g., finite difference or finite volume methods).
Output Files
mpmetis writes two partition files:
| File | Contents |
|---|---|
<meshfile>.epart.<nparts> | Element partition: one partition ID per line, one per element. |
<meshfile>.npart.<nparts> | Node partition: one partition ID per line, one per mesh node. |
Examples
Options Reference
Graph Type
Specifies which graph representation of the mesh to partition.
| Value | Description |
|---|---|
dual | Partition the dual graph: one vertex per element (default) |
nodal | Partition the nodal graph: one vertex per mesh node |
Applies only when
-gtype=dual. The minimum number of mesh nodes that two elements must share in order to be connected by an edge in the dual graph. Increasing this threshold produces a sparser dual graph, which can improve partition quality for higher-order elements.Partitioning Algorithm
Selects the k-way partitioning scheme.
| Value | Description |
|---|---|
kway | Direct k-way partitioning (default) |
rb | Recursive bisection |
-contig, -minconn, and -objtype=vol are only valid with ptype=kway and will cause an error if combined with ptype=rb.Objective function to optimize. Applies only when
-ptype=kway.| Value | Description |
|---|---|
cut | Minimize the total edge-cut (default) |
vol | Minimize the total communication volume |
Coarsening
Vertex matching scheme for graph coarsening.
| Value | Description |
|---|---|
shem | Sorted heavy-edge matching (default) |
rm | Random matching |
Initial Partitioning
Initial partitioning scheme. Applies only when
-ptype=rb.| Value | Description |
|---|---|
grow | Greedy growth bisection (default) |
random | Random bisection |
Refinement
Number of refinement iterations at each uncoarsening level.
Number of independent partitionings to compute; the one with the best objective value is retained.
Load Balance
Maximum allowed load imbalance, expressed as integer
x meaning 1 + x/1000 tolerance.ptype=rbdefault:x=1→ tolerance 1.001ptype=kwaydefault:x=30→ tolerance 1.030
Path to a file specifying target partition weights. Each line contains a floating-point weight for one partition; weights must sum to 1.0. By default all partitions have equal weight.
Partition Quality Constraints
Requires that the partitioning produce contiguous (connected) partitions. Only valid with
-ptype=kway. Silently ignored if the graph is disconnected.Minimizes the maximum degree of the subdomain connectivity graph to reduce the number of neighboring partitions each partition must communicate with. Only valid with
-ptype=kway.I/O and Diagnostics
Suppresses writing the
.epart and .npart output files.Seed for the random number generator. Use a fixed value for reproducible results.
Debug verbosity level. Set to
0 for no debug output (default).