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.

ParMETIS does not define its own integer or floating-point widths. Instead, it inherits them directly from METIS: when METIS is built, its header metis/include/metis.h defines idx_t and real_t using the IDXTYPEWIDTH and REALTYPEWIDTH constants. ParMETIS reads those same definitions at compile time and selects the corresponding MPI datatypes. This means the type widths for your entire stack — GKlib, METIS, ParMETIS, and your application — are all controlled by a single configuration point in metis/include/metis.h.

Integer type: idx_t

idx_t is the integer type used for vertex counts, adjacency lists, partition vectors, and all other integer data passed across the ParMETIS API.
Set IDXTYPEWIDTH 32 in metis/include/metis.h.
  • idx_t resolves to a 32-bit integer.
  • ParMETIS maps it to MPI_INT for communication.
  • KEEP_BIT is set to 0x40000000L.
#if IDXTYPEWIDTH == 32
  #define IDX_T    MPI_INT
  #define KEEP_BIT 0x40000000L
#endif

Floating-point type: real_t

real_t is the floating-point type used for partition weights (tpwgts), imbalance tolerances (ubvec), and geometry coordinates (xyz).
Set REALTYPEWIDTH 32 in metis/include/metis.h.
  • real_t resolves to float.
  • ParMETIS maps it to MPI_FLOAT for communication.
#if REALTYPEWIDTH == 32
  #define REAL_T MPI_FLOAT
#endif

Full definitions from parmetis.h

The complete preprocessor block in include/parmetis.h that selects MPI types based on the METIS-defined widths:
#if IDXTYPEWIDTH == 32
  #define IDX_T    MPI_INT
  #define KEEP_BIT 0x40000000L
#elif IDXTYPEWIDTH == 64
  #define IDX_T    MPI_LONG_LONG_INT
  #define KEEP_BIT 0x4000000000000000LL
#endif

#if REALTYPEWIDTH == 32
  #define REAL_T MPI_FLOAT
#elif REALTYPEWIDTH == 64
  #define REAL_T MPI_DOUBLE
#endif
If IDXTYPEWIDTH or REALTYPEWIDTH is set to any value other than 32 or 64, the header emits a compile-time #error.

How to configure type widths

1

Edit metis/include/metis.h

Open the METIS header and set IDXTYPEWIDTH and REALTYPEWIDTH to the desired widths (32 or 64).
2

Build and install METIS

Rebuild METIS from source so the header changes take effect in the installed library.
3

Build and install ParMETIS

Build ParMETIS pointing at the freshly installed METIS. ParMETIS picks up the type widths automatically at compile time.
4

Compile your application

Build your application against the same ParMETIS and METIS headers to ensure all types match.

Platform constraints

On 32-bit platforms, only IDXTYPEWIDTH=32 is supported. On 64-bit platforms, both 32-bit and 64-bit widths are supported.

Consistency requirement

All libraries in the build — GKlib, METIS, ParMETIS, and your application — must be compiled with identical IDXTYPEWIDTH and REALTYPEWIDTH values. Mixing widths across libraries will cause silent data corruption or crashes at runtime.

Build docs developers (and LLMs) love