peclet.dem — performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
Project description
peclet-dem (peclet.dem)
Performance-portable Discrete Element Method (DEM) particle simulation: an XPBD solver with SDF-based point-shell collision detection. Built on Kokkos + ArborX, so the same source runs on CUDA, HIP (AMD/LUMI), and OpenMP backends (selected at build time by the install prefix). Optional MPI for domain partitioning, with nanobind Python bindings (zero-copy, via scikit-build-core) for scripting and visualization.
The CUDA implementation was retired (2026-06): the Kokkos
peclet.demmodule was validated against it before the CUDA sources were removed. Restore point: git tagpre-cuda-retirement.
Features
- Hybrid XPBD Solver: Two-pass velocity/position solver for stable high-density packing.
- SDF Collision: Point-shell collision detection using Signed Distance Fields (supports analytic shapes like hollow cylinders).
- Periodicity: Full periodic boundary conditions (Ghost Particles).
- Python Bindings: Control simulation logic, data initialization, and export entirely from Python.
- MPI Support: Optional Multi-GPU/Node support via domain decomposition.
Folder Structure
├── CMakeLists.txt # Build configuration (find_package Kokkos + ArborX)
├── src # Kokkos sources (header-only, namespace peclet::dem)
│ ├── dem_bindings.cpp # nanobind module entry point (the `peclet.dem` module)
│ ├── sim.hpp # Simulation facade + the demStep XPBD substep
│ ├── integration.hpp # Time integration & prediction
│ ├── broadphase_arborx.hpp # ArborX BVH broad-phase
│ ├── narrowphase.hpp # Narrow-phase point-shell-vs-SDF collision
│ ├── solver_velocity.hpp # Velocity solver kernels
│ ├── solver_position.hpp # Position solver kernels (XPBD overlap removal)
│ ├── solver_friction.hpp # Coulomb friction cluster
│ ├── output_sdf.hpp # SDF/VTI grid generation (Eikonal)
│ ├── shapes_portable.hpp # Analytic shapes (sphere / hollow cylinder / box)
│ ├── io.hpp # LAMMPS-dump + SDF-VTI export
│ └── mpi_halo.hpp # Distributed particle halo (core), gated PECLET_DEM_MPI
├── tests # C++ unit tests: kokkos/ (kernels), arborx/, kokkos_mpi/
├── docs # Documentation
└── *.py # Python verification/example scripts (verify_*.py)
Prerequisites
- Linux
- CMake >= 3.24
- Kokkos 5.x + ArborX (C++20) — provisioned by
../tools/bootstrap_deps.shinto../extern/install/<backend>(nvidia-cuda/host-openmp/lumi-hip). A hard build dependency. - nanobind + scikit-build-core (found via the active Python interpreter; see
pyproject.toml) - a backend compiler: nvcc (CUDA) on
PATH, hipcc (ROCm), or just a host C++ compiler (OpenMP) - Python >= 3.10
- MPI (optional,
-DDEM_MPI=ON) — OpenMPI or MPICH
Build Instructions
python -m venv .venv && source .venv/bin/activate && pip install nanobind numpy
export PATH=/usr/local/cuda-13.2/bin:$PATH # if building the CUDA backend
# Canonical: build + install the module via scikit-build-core
CMAKE_PREFIX_PATH="$PWD/../extern/install/nvidia-cuda" pip install .
# Or a dev cmake build (nanobind is found via the active interpreter, no cmakedir needed):
cmake -B build -S . -DCMAKE_PREFIX_PATH="$PWD/../extern/install/nvidia-cuda"
cmake --build build -j$(nproc)
Swap the prefix to ../extern/install/host-openmp for the OpenMP backend. -DDEM_MPI=ON links MPI
and exposes the distributed step (init_mpi / enable_mpi_step / step_mpi), including dynamic load
balancing — enable_mpi_step(..., rebalance_every=N) or an explicit rebalance() re-decomposes by
particle count (weighted ORB) and migrates ownership so each rank keeps a near-equal share.
The compiled peclet.dem extension is placed in build/peclet/dem/; run scripts with build/ on PYTHONPATH (import peclet.dem).
Running Simulations
Example scripts are provided in the root directory:
# Add build artifact to python path if needed (or symlink it)
export PYTHONPATH=$PYTHONPATH:$(pwd)/build
# Run a verification script
python verify_packing_hollow_cylinders.py
Output & Visualization
The simulation supports two primary output formats:
1. LAMMPS + STL (Ovito)
For particle visualization (especially non-spherical shapes), we use the LAMMPS dump format combined with an STL mesh.
- Generate Output: The simulation writes
dump.custom.*files. - Generate Shape: Run
python generate_particles.pyto createparticle_shape.stl. - Visualize:
- Open Ovito.
- Load the
dump.custom.*sequence. - Add a Particle Types modifier.
- Set the shape visualization to Mesh/User-defined and load
particle_shape.stl. - Ovito will automatically scale the mesh by the particle radius.
See docs/visualization.md for a detailed guide.
2. VTI (ParaView)
For visualizing fields (like the Signed Distance Field or occupancy grids), the simulation exports VTI files (.vti).
- Generate Output: Use
Simulation.export_sdf("filename.vti", resolution=...). - Visualize:
- Open ParaView.
- Load the
.vtifile. - Use "Volume" representation or "Slice" filter to inspect the field.
Status
The single-GPU engine is complete and validated: it reaches stable high-density (random close)
packing, and energy is conserved to ~0.3% (see docs/packing_investigation.md). Friction is
stabilized for spheres; body-body tangential friction is a known follow-up (currently weaker than
ideal). Active work is at-scale multi-GPU/MPI tuning.
[!NOTE] The distributed (MPI) step is validated against the single-rank result (
tests/kokkos_mpi, np=1,2,4 on OpenMP + CUDA) and supports dynamic load rebalancing; remaining MPI work is at-scale multi-GPU tuning.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file peclet_dem-0.2.1.tar.gz.
File metadata
- Download URL: peclet_dem-0.2.1.tar.gz
- Upload date:
- Size: 399.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
492c45c75f4e09a400fb3a7fe5a27cb01348007791df73d3e3413bd4e044f4b9
|
|
| MD5 |
50be33d98dd0033fe0076d2434cd31b1
|
|
| BLAKE2b-256 |
c9b9eab4f2d0f286ced303f229569c42df22a7cd68446b3d78c7009a056676eb
|
Provenance
The following attestation bundles were made for peclet_dem-0.2.1.tar.gz:
Publisher:
release.yml on computational-chemical-engineering/peclet-dem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peclet_dem-0.2.1.tar.gz -
Subject digest:
492c45c75f4e09a400fb3a7fe5a27cb01348007791df73d3e3413bd4e044f4b9 - Sigstore transparency entry: 2059758349
- Sigstore integration time:
-
Permalink:
computational-chemical-engineering/peclet-dem@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/computational-chemical-engineering
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Trigger Event:
push
-
Statement type:
File details
Details for the file peclet_dem-0.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: peclet_dem-0.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 678.1 kB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7718fdf7a2d4adfc0ef75fac00dea5987779572420a6491db7a0e9d8fd5e6e1a
|
|
| MD5 |
714085bc3638c93628280c11511cae48
|
|
| BLAKE2b-256 |
f7fc0d763b4a7a25b550533400b1dcc19960dac9beca1a7fbc2ae288f23024cb
|
Provenance
The following attestation bundles were made for peclet_dem-0.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on computational-chemical-engineering/peclet-dem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peclet_dem-0.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
7718fdf7a2d4adfc0ef75fac00dea5987779572420a6491db7a0e9d8fd5e6e1a - Sigstore transparency entry: 2059758836
- Sigstore integration time:
-
Permalink:
computational-chemical-engineering/peclet-dem@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/computational-chemical-engineering
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Trigger Event:
push
-
Statement type:
File details
Details for the file peclet_dem-0.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: peclet_dem-0.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 678.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2e9d8a1fde47eb449be38534b1050cfd85d05f5f68bd5651dac59f48ba2505f
|
|
| MD5 |
deabb8ddc6102b9c7cde7933de576878
|
|
| BLAKE2b-256 |
33e6bf28155c9f3511a28397d8d531a850660582b3f7f7ca92bba2ed31b9213f
|
Provenance
The following attestation bundles were made for peclet_dem-0.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on computational-chemical-engineering/peclet-dem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peclet_dem-0.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
f2e9d8a1fde47eb449be38534b1050cfd85d05f5f68bd5651dac59f48ba2505f - Sigstore transparency entry: 2059759302
- Sigstore integration time:
-
Permalink:
computational-chemical-engineering/peclet-dem@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/computational-chemical-engineering
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Trigger Event:
push
-
Statement type:
File details
Details for the file peclet_dem-0.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: peclet_dem-0.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 678.0 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bbceac3c2d69d38fb89aa6a7470e5aa17a3e559b835788efdb48a9c0be620d7
|
|
| MD5 |
b642c1a870ead5803e21139059002b1b
|
|
| BLAKE2b-256 |
0431d65c6322bb8eec6a6478b565648a25d1c8b8fc48cb83503693de7572fc89
|
Provenance
The following attestation bundles were made for peclet_dem-0.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on computational-chemical-engineering/peclet-dem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peclet_dem-0.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
3bbceac3c2d69d38fb89aa6a7470e5aa17a3e559b835788efdb48a9c0be620d7 - Sigstore transparency entry: 2059760171
- Sigstore integration time:
-
Permalink:
computational-chemical-engineering/peclet-dem@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/computational-chemical-engineering
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Trigger Event:
push
-
Statement type:
File details
Details for the file peclet_dem-0.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: peclet_dem-0.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 678.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afdd1ba2fabb6de9fa54c4d9cf36c732788d2582ef5a84b6f68c5578e43493ad
|
|
| MD5 |
b7d3d8ca927d5ed46cb18daeed96489e
|
|
| BLAKE2b-256 |
84426907dc58c3e93f399168208baa39461f16b98632fe4bf37b2cf13688dbd6
|
Provenance
The following attestation bundles were made for peclet_dem-0.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on computational-chemical-engineering/peclet-dem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peclet_dem-0.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
afdd1ba2fabb6de9fa54c4d9cf36c732788d2582ef5a84b6f68c5578e43493ad - Sigstore transparency entry: 2059759713
- Sigstore integration time:
-
Permalink:
computational-chemical-engineering/peclet-dem@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/computational-chemical-engineering
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42a5b121ee5f93063f89ad33b85e85964b4c5738 -
Trigger Event:
push
-
Statement type: