Skip to main content

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.

Most ParMETIS V3 functions accept an options array of type idx_t[] as a parameter. This array provides a lightweight mechanism for controlling runtime behavior — such as enabling debug output or fixing the random seed — without recompiling the library. The array has a fixed layout: index 0 acts as a master switch, and indices 1 through 3 carry specific settings when that switch is active.

Enabling and disabling custom options

options[0] valueBehavior
0Use all defaults. Remaining entries in the array are ignored.
1Read custom values from options[1], options[2], and options[3].

Options indices

The following constants are defined in libparmetis/defs.h:
options[PMV3_OPTION_DBGLVL]
idx_t
default:"0"
Debug level. PMV3_OPTION_DBGLVL equals 1. OR together any combination of the PARMETIS_DBGLVL_* flags described below to select the diagnostic output you want.
options[PMV3_OPTION_SEED]
idx_t
default:"15"
Random number seed. PMV3_OPTION_SEED equals 2. Setting a fixed seed makes runs reproducible. The default internal seed is 15.
options[PMV3_OPTION_IPART]
idx_t
Initial partitioning type, used by ParMETIS_V3_PartKway. PMV3_OPTION_IPART equals 3.
options[PMV3_OPTION_PSR]
idx_t
Partition-to-subdomain relationship, used by ParMETIS_V3_RefineKway and ParMETIS_V3_AdaptiveRepart. PMV3_OPTION_PSR also equals 3 — it occupies the same slot as PMV3_OPTION_IPART but applies to different functions.
  • PARMETIS_PSR_COUPLED (1): the number of partitions equals the number of MPI processes.
  • PARMETIS_PSR_UNCOUPLED (2): the number of partitions does not equal the number of MPI processes.

Debug levels

The PARMETIS_DBGLVL_* constants are defined in include/parmetis.h. They are bit flags and can be combined with the bitwise OR operator (|).
ConstantValueDescription
PARMETIS_DBGLVL_TIME1Timing analysis
PARMETIS_DBGLVL_INFO2General information
PARMETIS_DBGLVL_PROGRESS4Coarsening progress
PARMETIS_DBGLVL_REFINEINFO8Refinement information
PARMETIS_DBGLVL_MATCHINFO16Matching information
PARMETIS_DBGLVL_RMOVEINFO32Vertex move information
PARMETIS_DBGLVL_REMAP64Remapping control
PARMETIS_DBGLVL_TWOHOP1282-hop matching
PARMETIS_DBGLVL_DROPEDGES256Drop edges during coarsening
PARMETIS_DBGLVL_FAST512Reduce trials for speed
PARMETIS_DBGLVL_ONDISK1024Save non-active graphs to disk
PARMETIS_DBGLVL_REMAP (64) controls whether remapping takes place rather than printing a message — setting it alters algorithmic behavior, not just output verbosity.

Code examples

Use all defaults (no custom options):
idx_t options[3];
options[0] = 0;
Enable timing and coarsening-progress output with a fixed random seed:
idx_t options[3];
options[0] = 1;
options[PMV3_OPTION_DBGLVL] = PARMETIS_DBGLVL_TIME | PARMETIS_DBGLVL_PROGRESS;
options[PMV3_OPTION_SEED]   = 42;
Use ParMETIS_V3_RefineKway in uncoupled mode (partitions ≠ processes):
idx_t options[3];
options[0] = 1;
options[PMV3_OPTION_PSR] = PARMETIS_PSR_UNCOUPLED;
Setting a fixed seed with PMV3_OPTION_SEED is the most reliable way to get reproducible partition results across runs. Even with a fixed seed, results may differ across different MPI process counts because the parallel algorithm is inherently process-count-dependent.

Build docs developers (and LLMs) love