{"owner":"KarypisLab","repo":"METIS","hasSkills":true,"totalSkillsCount":1,"totalTokensCount":1412,"categories":["claude-rule"],"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMETIS is a C library (C99) for partitioning graphs/meshes and computing fill-reducing orderings of sparse matrices. It implements the multilevel paradigm: coarsen → initial partition → refine/uncoarsen. Version 5.2.1, authored by George Karypis. Licensed under Apache 2.0.\n\n**External dependency:** [GKlib](https://github.com/KarypisLab/GKlib) must be installed before building METIS.\n\n## Build Commands\n\n```bash\n# Configure (creates build/ directory, runs CMake)\nmake config prefix=~/local gklib_path=~/local\n\n# Build and install\nmake install\n\n# Common config variants\nmake config shared=1                    # shared library instead of static\nmake config i64=1 r64=1                 # 64-bit indices and floats\nmake config debug=1 assert=1 gdb=1     # debug build with assertions\n\n# Clean\nmake clean       # remove object files\nmake distclean   # remove entire build/ directory\n```\n\nThe top-level Makefile is a proxy that translates options into CMake flags and runs CMake inside `build/`.\n\n## Testing\n\nThere is no integrated test suite. Test manually using the CLI programs against sample graphs in `graphs/`:\nTest for 10, 50, and 100 partitions.\nUse the @cit-Patents.metis and @mdual.graph files for benchmarking.\n\n```bash\n./build/programs/gpmetis graphs/mdual.graph 4      # partition graph into 4 parts\n./build/programs/ndmetis graphs/mdual.graph        # nested dissection ordering\n./build/programs/mpmetis graphs/metis.mesh 4       # mesh partitioning\n./build/programs/graphchk graphs/4elt.graph        # validate graph file\n```\n\nNote: `test/mtest.c` exists but uses the old METIS 4.x API and has a non-functional build system.\n\n## Architecture\n\n### Directory Structure\n\n- `include/metis.h` — Public API: types (`idx_t`, `real_t`), enums, function prototypes\n- `libmetis/` — Core library (~45 source files, one algorithm per file)\n- `programs/` — Six CLI tools (`gpmetis`, `ndmetis`, `mpmetis`, `m2gmetis`, `graphchk`, `cmpfillin`)\n- `graphs/` — Sample graph/mesh files for testing\n- `conf/gkbuild.cmake` — Shared CMake config (compiler flags, platform detection)\n\n### Include Chain\n\n`metislib.h` is the single master internal include — every `libmetis/*.c` file includes only this. It pulls in:\n`GKlib.h` → `metis.h` → `rename.h` → `gklib_defs.h` → `defs.h` → `struct.h` → `macros.h` → `proto.h`\n\nPrograms use `metisbin.h` which includes both the internal libmetis headers and program-specific `defs.h`, `struct.h`, `proto.h`.\n\n### Core Data Structures (`libmetis/struct.h`)\n\n- **`graph_t`** — CSR graph (xadj/adjncy arrays), plus partition state (where, pwgts, boundary lists, refinement info). Coarsening levels form a linked list via `coarser`/`finer` pointers.\n- **`ctrl_t`** — Algorithm control: operation type, coarsening/refinement methods, balance tolerances, workspace memory core, neighbor pools.\n- **`mesh_t`** — Element-node connectivity in CSR format (eptr/eind).\n\n### Key Algorithmic Files\n\n| File | Algorithm |\n|------|-----------|\n| `kmetis.c` | Direct k-way partitioning (METIS_PartGraphKway) |\n| `pmetis.c` | Recursive bisection (METIS_PartGraphRecursive) |\n| `ometis.c` | Nested dissection ordering (METIS_NodeND) |\n| `coarsen.c` | Graph coarsening (RM, SHEM, 2-hop matching) |\n| `initpart.c` | Initial partitioning (grow bisection, random) |\n| `fm.c` | FM 2-way refinement |\n| `kwayfm.c` | Greedy k-way refinement (cut and volume) |\n| `sfm.c` | Separator FM refinement |\n| `contig.c` | Contiguity enforcement |\n| `minconn.c` | Subdomain connectivity minimization |\n| `mesh.c` | Mesh-to-graph conversion |\n\n### Public API\n\nAll functions return `METIS_OK`, `METIS_ERROR_INPUT`, `METIS_ERROR_MEMORY`, or `METIS_ERROR`. Options are passed as `idx_t options[METIS_NOPTIONS]` initialized to -1 via `METIS_SetDefaultOptions()`.\n\nKey entry points: `METIS_PartGraphRecursive`, `METIS_PartGraphKway`, `METIS_PartMeshDual`, `METIS_PartMeshNodal`, `METIS_NodeND`, `METIS_MeshToDual`, `METIS_MeshToNodal`.\n\n## Coding Conventions\n\n- **Naming:** Public API: `METIS_PascalCase`. Internal functions: `PascalCase`. Types: `lowercase_t` (enums: `_et`). Constants/macros: `SCREAMING_SNAKE_CASE`.\n- **Configurable widths:** `idx_t` is int32 or int64, `real_t` is float or double, set at build time via `IDXTYPEWIDTH`/`REALTYPEWIDTH`.\n- **Symbol isolation:** All internal symbols prefixed `libmetis__` via `rename.h` and `gklib_rename.h` to avoid collisions (critical for ParMETIS).\n- **Memory:** GKlib-based (`gk_malloc`/`gk_free`). Stack workspace via `WCOREPUSH`/`WCOREPOP`. Free flags on graph arrays track ownership. `gk_free()` uses `LTERM` sentinel.\n- **Error handling:** Public API uses `gk_sigtrap()`/`gk_sigcatch()` with `goto SIGTHROW` pattern. Internal errors use `gk_errexit()`.\n- **Patterns:** `IFSET(ctrl->dbglvl, ...)` for conditional debug output. `GETOPTION(options, key, default)` for safe option extraction. `BNDInsert`/`BNDDelete` for boundary management.\n- **Fortran bindings:** `frename.c` provides four naming variants per API function (ALLCAPS, alllower, alllower_, alllower__).\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMETIS is a C library (C99) for partitioning graphs/meshes and computing fill-reducing orderings of sparse matrices. It implements the multilevel paradigm: coarsen → initial partition → refine/uncoarsen. Version 5.2.1, authored by George Karypis. Licensed under Apache 2.0.\n\n**External dependency:** [GKlib](https://github.com/KarypisLab/GKlib) must be installed before building METIS.\n\n## Build Commands\n\n```bash\n# Configure (creates build/ directory, runs CMake)\nmake config prefix=~/local gklib_path=~/local\n\n# Build and install\nmake install\n\n# Common config variants\nmake config shared=1                    # shared library instead of static\nmake config i64=1 r64=1                 # 64-bit indices and floats\nmake config debug=1 assert=1 gdb=1     # debug build with assertions\n\n# Clean\nmake clean       # remove object files\nmake distclean   # remove entire build/ directory\n```\n\nThe top-level Makefile is a proxy that translates options into CMake flags and runs CMake inside `build/`.\n\n## Testing\n\nThere is no integrated test suite. Test manually using the CLI programs against sample graphs in `graphs/`:\nTest for 10, 50, and 100 partitions.\nUse the @cit-Patents.metis and @mdual.graph files for benchmarking.\n\n```bash\n./build/programs/gpmetis graphs/mdual.graph 4      # partition graph into 4 parts\n./build/programs/ndmetis graphs/mdual.graph        # nested dissection ordering\n./build/programs/mpmetis graphs/metis.mesh 4       # mesh partitioning\n./build/programs/graphchk graphs/4elt.graph        # validate graph file\n```\n\nNote: `test/mtest.c` exists but uses the old METIS 4.x API and has a non-functional build system.\n\n## Architecture\n\n### Directory Structure\n\n- `include/metis.h` — Public API: types (`idx_t`, `real_t`), enums, function prototypes\n- `libmetis/` — Core library (~45 source files, one algorithm per file)\n- `programs/` — Six CLI tools (`gpmetis`, `ndmetis`, `mpmetis`, `m2gmetis`, `graphchk`, `cmpfillin`)\n- `graphs/` — Sample graph/mesh files for testing\n- `conf/gkbuild.cmake` — Shared CMake config (compiler flags, platform detection)\n\n### Include Chain\n\n`metislib.h` is the single master internal include — every `libmetis/*.c` file includes only this. It pulls in:\n`GKlib.h` → `metis.h` → `rename.h` → `gklib_defs.h` → `defs.h` → `struct.h` → `macros.h` → `proto.h`\n\nPrograms use `metisbin.h` which includes both the internal libmetis headers and program-specific `defs.h`, `struct.h`, `proto.h`.\n\n### Core Data Structures (`libmetis/struct.h`)\n\n- **`graph_t`** — CSR graph (xadj/adjncy arrays), plus partition state (where, pwgts, boundary lists, refinement info). Coarsening levels form a linked list via `coarser`/`finer` pointers.\n- **`ctrl_t`** — Algorithm control: operation type, coarsening/refinement methods, balance tolerances, workspace memory core, neighbor pools.\n- **`mesh_t`** — Element-node connectivity in CSR format (eptr/eind).\n\n### Key Algorithmic Files\n\n| File | Algorithm |\n|------|-----------|\n| `kmetis.c` | Direct k-way partitioning (METIS_PartGraphKway) |\n| `pmetis.c` | Recursive bisection (METIS_PartGraphRecursive) |\n| `ometis.c` | Nested dissection ordering (METIS_NodeND) |\n| `coarsen.c` | Graph coarsening (RM, SHEM, 2-hop matching) |\n| `initpart.c` | Initial partitioning (grow bisection, random) |\n| `fm.c` | FM 2-way refinement |\n| `kwayfm.c` | Greedy k-way refinement (cut and volume) |\n| `sfm.c` | Separator FM refinement |\n| `contig.c` | Contiguity enforcement |\n| `minconn.c` | Subdomain connectivity minimization |\n| `mesh.c` | Mesh-to-graph conversion |\n\n### Public API\n\nAll functions return `METIS_OK`, `METIS_ERROR_INPUT`, `METIS_ERROR_MEMORY`, or `METIS_ERROR`. Options are passed as `idx_t options[METIS_NOPTIONS]` initialized to -1 via `METIS_SetDefaultOptions()`.\n\nKey entry points: `METIS_PartGraphRecursive`, `METIS_PartGraphKway`, `METIS_PartMeshDual`, `METIS_PartMeshNodal`, `METIS_NodeND`, `METIS_MeshToDual`, `METIS_MeshToNodal`.\n\n## Coding Conventions\n\n- **Naming:** Public API: `METIS_PascalCase`. Internal functions: `PascalCase`. Types: `lowercase_t` (enums: `_et`). Constants/macros: `SCREAMING_SNAKE_CASE`.\n- **Configurable widths:** `idx_t` is int32 or int64, `real_t` is float or double, set at build time via `IDXTYPEWIDTH`/`REALTYPEWIDTH`.\n- **Symbol isolation:** All internal symbols prefixed `libmetis__` via `rename.h` and `gklib_rename.h` to avoid collisions (critical for ParMETIS).\n- **Memory:** GKlib-based (`gk_malloc`/`gk_free`). Stack workspace via `WCOREPUSH`/`WCOREPOP`. Free flags on graph arrays track ownership. `gk_free()` uses `LTERM` sentinel.\n- **Error handling:** Public API uses `gk_sigtrap()`/`gk_sigcatch()` with `goto SIGTHROW` pattern. Internal errors use `gk_errexit()`.\n- **Patterns:** `IFSET(ctrl->dbglvl, ...)` for conditional debug output. `GETOPTION(options, key, default)` for safe option extraction. `BNDInsert`/`BNDDelete` for boundary management.\n- **Fortran bindings:** `frename.c` provides four naming variants per API function (ALLCAPS, alllower, alllower_, alllower__).\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/KarypisLab/METIS/HEAD/CLAUDE.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMETIS is a C library (C99) for partitioning graphs/meshes and computing fill-reducing orderings of sparse matrices. It implements the multilevel paradigm: coarsen → initial partition → refine/uncoarsen. Version 5.2.1, authored by George Karypis. Licensed under Apache 2.0.\n\n**External dependency:** [GKlib](https://github.com/KarypisLab/GKlib) must be installed before building METIS.\n\n## Build Commands\n\n```bash\n# Configure (creates build/ directory, runs CMake)\nmake config prefix=~/local gklib_path=~/local\n\n# Build and install\nmake install\n\n# Common config variants\nmake config shared=1                    # shared library instead of static\nmake config i64=1 r64=1                 # 64-bit indices and floats\nmake config debug=1 assert=1 gdb=1     # debug build with assertions\n\n# Clean\nmake clean       # remove object files\nmake distclean   # remove entire build/ directory\n```\n\nThe top-level Makefile is a proxy that translates options into CMake flags and runs CMake inside `build/`.\n\n## Testing\n\nThere is no integrated test suite. Test manually using the CLI programs against sample graphs in `graphs/`:\nTest for 10, 50, and 100 partitions.\nUse the @cit-Patents.metis and @mdual.graph files for benchmarking.\n\n```bash\n./build/programs/gpmetis graphs/mdual.graph 4      # partition graph into 4 parts\n./build/programs/ndmetis graphs/mdual.graph        # nested dissection ordering\n./build/programs/mpmetis graphs/metis.mesh 4       # mesh partitioning\n./build/programs/graphchk graphs/4elt.graph        # validate graph file\n```\n\nNote: `test/mtest.c` exists but uses the old METIS 4.x API and has a non-functional build system.\n\n## Architecture\n\n### Directory Structure\n\n- `include/metis.h` — Public API: types (`idx_t`, `real_t`), enums, function prototypes\n- `libmetis/` — Core library (~45 source files, one algorithm per file)\n- `programs/` — Six CLI tools (`gpmetis`, `ndmetis`, `mpmetis`, `m2gmetis`, `graphchk`, `cmpfillin`)\n- `graphs/` — Sample graph/mesh files for testing\n- `conf/gkbuild.cmake` — Shared CMake config (compiler flags, platform detection)\n\n### Include Chain\n\n`metislib.h` is the single master internal include — every `libmetis/*.c` file includes only this. It pulls in:\n`GKlib.h` → `metis.h` → `rename.h` → `gklib_defs.h` → `defs.h` → `struct.h` → `macros.h` → `proto.h`\n\nPrograms use `metisbin.h` which includes both the internal libmetis headers and program-specific `defs.h`, `struct.h`, `proto.h`.\n\n### Core Data Structures (`libmetis/struct.h`)\n\n- **`graph_t`** — CSR graph (xadj/adjncy arrays), plus partition state (where, pwgts, boundary lists, refinement info). Coarsening levels form a linked list via `coarser`/`finer` pointers.\n- **`ctrl_t`** — Algorithm control: operation type, coarsening/refinement methods, balance tolerances, workspace memory core, neighbor pools.\n- **`mesh_t`** — Element-node connectivity in CSR format (eptr/eind).\n\n### Key Algorithmic Files\n\n| File | Algorithm |\n|------|-----------|\n| `kmetis.c` | Direct k-way partitioning (METIS_PartGraphKway) |\n| `pmetis.c` | Recursive bisection (METIS_PartGraphRecursive) |\n| `ometis.c` | Nested dissection ordering (METIS_NodeND) |\n| `coarsen.c` | Graph coarsening (RM, SHEM, 2-hop matching) |\n| `initpart.c` | Initial partitioning (grow bisection, random) |\n| `fm.c` | FM 2-way refinement |\n| `kwayfm.c` | Greedy k-way refinement (cut and volume) |\n| `sfm.c` | Separator FM refinement |\n| `contig.c` | Contiguity enforcement |\n| `minconn.c` | Subdomain connectivity minimization |\n| `mesh.c` | Mesh-to-graph conversion |\n\n### Public API\n\nAll functions return `METIS_OK`, `METIS_ERROR_INPUT`, `METIS_ERROR_MEMORY`, or `METIS_ERROR`. Options are passed as `idx_t options[METIS_NOPTIONS]` initialized to -1 via `METIS_SetDefaultOptions()`.\n\nKey entry points: `METIS_PartGraphRecursive`, `METIS_PartGraphKway`, `METIS_PartMeshDual`, `METIS_PartMeshNodal`, `METIS_NodeND`, `METIS_MeshToDual`, `METIS_MeshToNodal`.\n\n## Coding Conventions\n\n- **Naming:** Public API: `METIS_PascalCase`. Internal functions: `PascalCase`. Types: `lowercase_t` (enums: `_et`). Constants/macros: `SCREAMING_SNAKE_CASE`.\n- **Configurable widths:** `idx_t` is int32 or int64, `real_t` is float or double, set at build time via `IDXTYPEWIDTH`/`REALTYPEWIDTH`.\n- **Symbol isolation:** All internal symbols prefixed `libmetis__` via `rename.h` and `gklib_rename.h` to avoid collisions (critical for ParMETIS).\n- **Memory:** GKlib-based (`gk_malloc`/`gk_free`). Stack workspace via `WCOREPUSH`/`WCOREPOP`. Free flags on graph arrays track ownership. `gk_free()` uses `LTERM` sentinel.\n- **Error handling:** Public API uses `gk_sigtrap()`/`gk_sigcatch()` with `goto SIGTHROW` pattern. Internal errors use `gk_errexit()`.\n- **Patterns:** `IFSET(ctrl->dbglvl, ...)` for conditional debug output. `GETOPTION(options, key, default)` for safe option extraction. `BNDInsert`/`BNDDelete` for boundary management.\n- **Fortran bindings:** `frename.c` provides four naming variants per API function (ALLCAPS, alllower, alllower_, alllower__).\n","isInternal":false,"tokens":1412,"sizeBytes":5185}],"systemPromptSnippet":"<yakaai_skills repo=\"KarypisLab/METIS\">\n<!-- File: CLAUDE.md (Tokens: ~1412 | Category: claude-rule) -->\n# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nMETIS is a C library (C99) for partitioning graphs/meshes and computing fill-reducing orderings of sparse matrices. It implements the multilevel paradigm: coarsen → initial partition → refine/uncoarsen. Version 5.2.1, authored by George Karypis. Licensed under Apache 2.0.\n\n**External dependency:** [GKlib](https://github.com/KarypisLab/GKlib) must be installed before building METIS.\n\n## Build Commands\n\n```bash\n# Configure (creates build/ directory, runs CMake)\nmake config prefix=~/local gklib_path=~/local\n\n# Build and install\nmake install\n\n# Common config variants\nmake config shared=1                    # shared library instead of static\nmake config i64=1 r64=1                 # 64-bit indices and floats\nmake config debug=1 assert=1 gdb=1     # debug build with assertions\n\n# Clean\nmake clean       # remove object files\nmake distclean   # remove entire build/ directory\n```\n\nThe top-level Makefile is a proxy that translates options into CMake flags and runs CMake inside `build/`.\n\n## Testing\n\nThere is no integrated test suite. Test manually using the CLI programs against sample graphs in `graphs/`:\nTest for 10, 50, and 100 partitions.\nUse the @cit-Patents.metis and @mdual.graph files for benchmarking.\n\n```bash\n./build/programs/gpmetis graphs/mdual.graph 4      # partition graph into 4 parts\n./build/programs/ndmetis graphs/mdual.graph        # nested dissection ordering\n./build/programs/mpmetis graphs/metis.mesh 4       # mesh partitioning\n./build/programs/graphchk graphs/4elt.graph        # validate graph file\n```\n\nNote: `test/mtest.c` exists but uses the old METIS 4.x API and has a non-functional build system.\n\n## Architecture\n\n### Directory Structure\n\n- `include/metis.h` — Public API: types (`idx_t`, `real_t`), enums, function prototypes\n- `libmetis/` — Core library (~45 source files, one algorithm per file)\n- `programs/` — Six CLI tools (`gpmetis`, `ndmetis`, `mpmetis`, `m2gmetis`, `graphchk`, `cmpfillin`)\n- `graphs/` — Sample graph/mesh files for testing\n- `conf/gkbuild.cmake` — Shared CMake config (compiler flags, platform detection)\n\n### Include Chain\n\n`metislib.h` is the single master internal include — every `libmetis/*.c` file includes only this. It pulls in:\n`GKlib.h` → `metis.h` → `rename.h` → `gklib_defs.h` → `defs.h` → `struct.h` → `macros.h` → `proto.h`\n\nPrograms use `metisbin.h` which includes both the internal libmetis headers and program-specific `defs.h`, `struct.h`, `proto.h`.\n\n### Core Data Structures (`libmetis/struct.h`)\n\n- **`graph_t`** — CSR graph (xadj/adjncy arrays), plus partition state (where, pwgts, boundary lists, refinement info). Coarsening levels form a linked list via `coarser`/`finer` pointers.\n- **`ctrl_t`** — Algorithm control: operation type, coarsening/refinement methods, balance tolerances, workspace memory core, neighbor pools.\n- **`mesh_t`** — Element-node connectivity in CSR format (eptr/eind).\n\n### Key Algorithmic Files\n\n| File | Algorithm |\n|------|-----------|\n| `kmetis.c` | Direct k-way partitioning (METIS_PartGraphKway) |\n| `pmetis.c` | Recursive bisection (METIS_PartGraphRecursive) |\n| `ometis.c` | Nested dissection ordering (METIS_NodeND) |\n| `coarsen.c` | Graph coarsening (RM, SHEM, 2-hop matching) |\n| `initpart.c` | Initial partitioning (grow bisection, random) |\n| `fm.c` | FM 2-way refinement |\n| `kwayfm.c` | Greedy k-way refinement (cut and volume) |\n| `sfm.c` | Separator FM refinement |\n| `contig.c` | Contiguity enforcement |\n| `minconn.c` | Subdomain connectivity minimization |\n| `mesh.c` | Mesh-to-graph conversion |\n\n### Public API\n\nAll functions return `METIS_OK`, `METIS_ERROR_INPUT`, `METIS_ERROR_MEMORY`, or `METIS_ERROR`. Options are passed as `idx_t options[METIS_NOPTIONS]` initialized to -1 via `METIS_SetDefaultOptions()`.\n\nKey entry points: `METIS_PartGraphRecursive`, `METIS_PartGraphKway`, `METIS_PartMeshDual`, `METIS_PartMeshNodal`, `METIS_NodeND`, `METIS_MeshToDual`, `METIS_MeshToNodal`.\n\n## Coding Conventions\n\n- **Naming:** Public API: `METIS_PascalCase`. Internal functions: `PascalCase`. Types: `lowercase_t` (enums: `_et`). Constants/macros: `SCREAMING_SNAKE_CASE`.\n- **Configurable widths:** `idx_t` is int32 or int64, `real_t` is float or double, set at build time via `IDXTYPEWIDTH`/`REALTYPEWIDTH`.\n- **Symbol isolation:** All internal symbols prefixed `libmetis__` via `rename.h` and `gklib_rename.h` to avoid collisions (critical for ParMETIS).\n- **Memory:** GKlib-based (`gk_malloc`/`gk_free`). Stack workspace via `WCOREPUSH`/`WCOREPOP`. Free flags on graph arrays track ownership. `gk_free()` uses `LTERM` sentinel.\n- **Error handling:** Public API uses `gk_sigtrap()`/`gk_sigcatch()` with `goto SIGTHROW` pattern. Internal errors use `gk_errexit()`.\n- **Patterns:** `IFSET(ctrl->dbglvl, ...)` for conditional debug output. `GETOPTION(options, key, default)` for safe option extraction. `BNDInsert`/`BNDDelete` for boundary management.\n- **Fortran bindings:** `frename.c` provides four naming variants per API function (ALLCAPS, alllower, alllower_, alllower__).\n</yakaai_skills>"}