Adaptive simulations change the mesh as computation proceeds — through local refinement, coarsening, or load changes — so that the initial partition becomes unbalanced over time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KarypisLab/ParMETIS/llms.txt
Use this file to discover all available pages before exploring further.
ParMETIS_V3_AdaptiveRepart repartitions an already-distributed graph while trying to minimize data movement between processes. Unlike a full repartition from scratch, it takes the existing partition into account and trades off partition quality against the cost of redistributing vertices.
When to repartition
Repartition when:- Adaptive mesh refinement or coarsening has shifted vertex counts significantly between processes.
- Per-vertex computation costs (modeled by
vwgt) have changed since the last partition, causing load imbalance to grow beyond theubvectolerance. - Communication volume has grown because the current partition no longer reflects the graph structure.
The ipc2redist parameter
ipc2redist controls the tradeoff between inter-partition communication and redistribution cost.
| Value | Behavior |
|---|---|
Low (e.g. 1.0) | Minimize data movement — keep vertices close to where they already are, even if partition quality suffers. |
High (e.g. 1000.0) | Maximize partition quality — redistribute aggressively to achieve the best cut, similar to a full repartition. |
10.0 and 100.0 provides a good balance. Start at 10.0 and increase if load imbalance remains high after repartitioning.
Coupling modes
Theoptions[PMV3_OPTION_PSR] field controls whether the number of partitions must match the number of processes.
| Constant | Value | Meaning |
|---|---|---|
PARMETIS_PSR_COUPLED | 1 | nparts == npes. Partition and process counts are locked together. Use this for the common case. |
PARMETIS_PSR_UNCOUPLED | 2 | nparts may differ from npes. Allows over- or under-decomposition. |
vsize: per-vertex communication volume
vsize is an optional array of length local_nvtxs that gives the communication volume associated with moving each vertex during redistribution. Pass NULL to treat all vertices as equal. Provide explicit values when vertices carry different amounts of data (e.g. variable-degree nodes with attached field data).
Workflow
Create an initial partition
Use
ParMETIS_V3_PartKway (or load a checkpoint) to create the first partition. Record the part[] array on each process.Run the simulation
Advance the simulation. Update the mesh and recompute
vwgt to reflect the new per-vertex computational cost. Existing xadj and adjncy arrays should reflect the updated graph structure.Update vertex weights
Set
vwgt[i] to reflect the current compute cost of local vertex i. For a uniform-cost simulation you can keep all weights at 1. For adaptive simulations, heavier vertices might represent finer-resolution regions.Call AdaptiveRepart
Pass the current
part[] as input. After the call, part[] holds the updated partition and edgecut reports the new cut value.