|
peclet-dem
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
|
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.
../tools/bootstrap_deps.sh into ../extern/install/<backend> (nvidia-cuda / host-openmp / lumi-hip). A hard build dependency.pyproject.toml)PATH, hipcc (ROCm), or just a host C++ compiler (OpenMP)-DDEM_MPI=ON) — OpenMPI or MPICH 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).
Example scripts are provided in the root directory:
The simulation supports two primary output formats:
For particle visualization (especially non-spherical shapes), we use the LAMMPS dump format combined with an STL mesh.
files. **Generate Shape**: Runpython generate_particles.pyto createparticle_shape.stl. **Visualize**:
- Open **Ovito**.
- Load thedump.custom.*
sequence.
Add a **Particle Types** modifier.
Set the shape visualization to **Mesh/User-defined** and loadparticle_shape.stl`.
- Ovito will automatically scale the mesh by the particle radius.
See docs/visualization.md for a detailed guide.
For visualizing fields (like the Signed Distance Field or occupancy grids), the simulation exports VTI files (.vti).
Simulation.export_sdf("filename.vti", resolution=...)..vti file.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.