Python wrappers for parRSB - a library for parallel graph partitioning using Recursive Spectral Bisection (RSB).
parRSB.py provides Cython-based Python bindings for the parRSB C library. It
exposes functionality for:
- Partitioning graphs using RSB and other algorithms.
- Reading Nek5000/NekRS meshes from
.re2files. - Calculating mesh connectivity based on node coordinates.
The library is built on top of:
- parRSB - C library for parallel mesh partitioning.
- gslib - Highly scalable communication library.
- mpi4py - MPI for Python.
- NumPy - for array handling.
- A C compiler with MPI support (e.g.,
mpiccvia OpenMPI) - CMake (>= 3.21)
- A Fortran compiler (Only if you want to run the tests)
On Ubuntu/Debian, install them with:
sudo apt -y update
sudo apt install -y openmpi-bin libopenmpi-dev
sudo apt install -y cmake
sudo apt install -y gfortran- Python >= 3.10
uvfor virtual environment and package management
Install uv by following the instructions here.
First, build and install the parRSB C library into a virtual environment directory:
uv venv .venv
git clone https://github.com/thilinarmtb/parRSB.git -b general_graph
cd parRSB
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=../.venv
cmake --build build --target install
cd ..source .venv/bin/activate
uv pip install . --target .venv -Ccmake.define.parRSB_DIR=.venvNote: The
CC=mpiccenvironment variable should be set so that the C extension is compiled with MPI support.