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_RefineKway improves an existing partition of a distributed graph by applying multilevel k-way refinement. Unlike the full partitioning routines, it takes the current partition assignment as its starting point and optimizes it locally, which is faster but may not escape poor initial configurations. This function is well suited for situations where a valid partition already exists and only incremental improvement is needed. The part array serves as both input (the initial partition) and output (the refined partition).
Parameters
Distribution of vertices across processes.
vtxdist[i] is the global index of the first vertex on process i. Size npes + 1; must be identical on all processes.Local adjacency row pointers in CSR format. Size
local_nvtxs + 1.Local adjacency column indices in CSR format. Size
xadj[local_nvtxs].Vertex weights.
ncon values per vertex in interleaved order. May be NULL when bit 1 of wgtflag is 0.Edge weights, one value per entry in
adjncy. May be NULL when bit 0 of wgtflag is 0.Bitmask controlling which weights are used.
0 = no weights, 1 = edge weights only, 2 = vertex weights only, 3 = both.Indexing convention.
0 for C-style 0-based indexing; 1 for Fortran-style 1-based indexing.Number of balancing constraints per vertex.
Number of partitions. Should match the number of distinct partition IDs already present in
part.Target partition weights. Array of
nparts * ncon values. Values for each constraint must sum to 1.0. Pass NULL for equal-weight partitions.Per-constraint imbalance tolerance. Array of
ncon values greater than 1.0.Algorithm options. If
options[0] = 0, all defaults are used. If options[0] = 1, options[PMV3_OPTION_DBGLVL] (index 1) sets the debug level, options[PMV3_OPTION_SEED] (index 2) sets the random seed, and options[PMV3_OPTION_PSR] (index 3) controls partition-to-process coupling: PARMETIS_PSR_COUPLED (1) when the number of partitions equals the number of processes, PARMETIS_PSR_UNCOUPLED (2) otherwise.Output. Total weight of edges crossing partition boundaries after refinement.
Input and output. On entry, contains the initial partition assignment for each local vertex. On return, contains the refined partition assignment. Caller must allocate at least
local_nvtxs elements.Pointer to the MPI communicator covering all participating processes.
Return value
ReturnsMETIS_OK (1) on success. Any other value indicates an error.