Parth accelerates sparse Cholesky factorizations by providing fill-reducing orderings that reuse computations when sparsity patterns change dynamically. Works with MKL, Accelerate, CHOLMOD, and other state-of-the-art solvers.
#include <parth/parth.h>
PARTH::ParthAPI parth;
parth.setMatrix(n, column_ptrs, row_indices, 1); // Set your sparse matrix
std::vector<int> perm;
parth.computePermutation(perm); // Get fill-reducing permutation
// Use perm with your favorite sparse solver (MKL, CHOLMOD, etc.)Expected output: Permutation vector
See it in action first: examples/api_demos/quick_start.cpp
- Complete working example showing computational reuse
- Shows the core Parth workflow step-by-step
Ready-to-use solver integrations: examples/cholesky_integration/
- MKL:
mkl.cpp- Intel MKL PARDISO integration - Accelerate:
accelerate.cpp- Apple Accelerate framework - CHOLMOD:
cholmod.cpp- SuiteSparse CHOLMOD
Copy-paste project setup: integration_example/
- Complete CMake project template
- Automatic dependency fetching with FetchContent
- One-command build:
./scripts/build_with_parth.sh
Add to your CMakeLists.txt:
include(FetchContent)
FetchContent_Declare(parth
GIT_REPOSITORY https://github.com/BehroozZare/parth.git
GIT_TAG main)
FetchContent_MakeAvailable(parth)
target_link_libraries(your_target PRIVATE Parth::parth)#include <parth/parth.h>
PARTH::ParthAPI parth;
parth.setMatrix(n, column_ptrs, row_indices, 1); // CSR/CSC sparse matrix
std::vector<int> perm;
parth.computePermutation(perm); // Get permutation
// Use permutation with your favorite sparse solver...Test that everything works:
# Clone and test the integration example
git clone https://github.com/BehroozZare/parth.git
cd parth/integration_example
./scripts/build_with_parth.sh && cd build && ./use_parthExpected output:
Computing permutation (from scratch)...
Computing permutation (with reuse from previous computation)...
Modified matrix permutation computed successfully.
setReorderingType(ReorderingType): Set ordering algorithm (METIS, AMD, MORTON_CODE)setVerbose(bool): Enable/disable verbose outputsetNDLevels(int): Set nested dissection levelssetNumberOfCores(int): Set number of cores for parallel processing
setMesh(n, Mp, Mi): Set mesh connectivity in CSR formatsetMesh(n, Mp, Mi, map): Set mesh with DOF mapping for dynamic meshessetMatrix(N, Ap, Ai, dim): Set matrix connectivity and convert to meshsetMatrix(N, Ap, Ai, map, dim): Set matrix with DOF mappingsetNewToOldDOFMap(map): Set mapping for factor reuse
computePermutation(perm, dim): Compute fill-reducing permutationmapMeshPermToMatrixPerm(mesh_perm, matrix_perm, dim): Map to matrix DOFs
getReuse(): Get factor reuse percentagegetNumChanges(): Get number of topology changesprintTiming(): Print detailed timing informationresetTimers(): Reset performance timers
- CMake 3.14 or newer
- C++17 compatible compiler (C++20 for the library itself)
- Eigen3 (automatically downloaded if not found)
- METIS (required for the core functionality)
- Intel MKL (for high-performance sparse solvers for intel processors)
- Apple Accelerate (for high-performance sparse solvers in Apple silicon)
Configure the build with these CMake options:
cmake -DPARTH_WITH_TESTS=ON \
-DPARTH_WITH_API_DEMO=ON \
-DPARTH_WITH_CHOLMOD_DEMO=ON \
-DPARTH_WITH_ACCELERATE_DEMO=ON \
-DPARTH_WITH_MKL_DEMO=ON \
-DPARTH_WITH_SOLVER_WRAPPER=ON \
..Available options:
PARTH_WITH_TESTS: Build test suite (default: ON)PARTH_WITH_API_DEMO: Build API demonstration examples (default: OFF)PARTH_WITH_CHOLMOD_DEMO: Build CHOLMOD integration examples (default: OFF)PARTH_WITH_ACCELERATE_DEMO: Build Accelerate integration examples (default: OFF)PARTH_WITH_MKL_DEMO: Build Intel MKL integration examples (default: OFF)PARTH_WITH_SOLVER_WRAPPER: Build solver wrapper utilities (default: OFF)
- Enable METIS: Provides the best ordering quality for most problems
- Use factor reuse: For dynamic meshes (meshes with change in number DOFs), provide DOF mapping to reuse previous factorizations
- Match problem dimension: Set the correct DOF count per node (1 for scalar, 3 for 3D, etc.)
To reproduce the benchmarks from the Parth paper:
- Paper Examples: For the original paper usage examples and benchmarks, switch to the
paper_codebranch - IPC Benchmark: See the IPC benchmark generator repository for matrix generation with Docker setup
- Remeshing Benchmark: Download meshes from Oded Stein's repository for testing with various mesh topologies
- macOS: Use Accelerate framework integration (recommended)
- Linux: All solvers (CHOLMOD, MKL, etc.) are supported
- Docker: Use the setup from this repository for reproducible builds
If you use Parth in your research or build upon this work, please cite:
@article{zarebavani2025adaptive,
title={Adaptive Algebraic Reuse of Reordering in Cholesky Factorizations with Dynamic Sparsity Patterns},
author={Zarebavani, Behrooz and M. Kaufman, Danny and IW Levin, David and Mehri Dehnavi, Maryam},
journal={ACM Transactions on Graphics (TOG)},
volume={44},
number={4},
pages={1--17},
year={2025},
publisher={ACM New York, NY, USA}
}