|
peclet-dem 1.1.0
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
|
Measured 2026-09-25 on the tree dem e4e17f0 + the diagnostic commit that carries this file (tests/kokkos_mpi/test_momentum_mpi.cpp, a CoM print in test_ghost_band_mpi.cpp; src/ untouched). The task is suite/docs/HANDOFF_DEM_MPI_MOMENTUM.md. Nothing here is fixed; this is the baseline.
Host: AMD Threadripper PRO 5965WX (24 cores / 48 threads, one NUMA node), shared with other sessions. Build (host OpenMP backend, Release):
test_momentum_mpi <mode> runs a closed, force-free, polydisperse cluster (scale 1 ± 0.1, m ∝ s³, I = 2/5 m (s r)²). It has N = 925 spheres (base r = 0.5) on a jittered cubic lattice with spacing = base diameter, so the larger grains start overlapping. They fill a ball of radius 6 centred at (0.3, −0.2, 0.1) in the box [−16, 16]³. The ORB puts that centre on the common corner of all blocks at np 2, 4 and 8. There are no walls within reach and no gravity, except in cluster_pgs. Initial velocities are Gaussian (σ = 1.5), plus a drift (0.7, −0.4, 0.3), plus an inward radial term of magnitude 1·r/6. e = 0.5, 20 position and 8 velocity iterations, dt = 1e-2, 50 steps. Hertz uses E = 1e5, ν = 0.25, dt = 1e-4 and 40 × 25 substeps. After every step the global sums are Allreduce'd in double over the owned bodies.
| column | definition | phase |
|---|---|---|
| dP | max_t |P(t) − P(0) − M g t| / Σ m|v(0)| | velocity (the position phase never writes v) |
| dX | max_t |X(t) − X(0) − V(0) t − g t²/2| / r | both |
| dXpos | max_t |Σ_steps [X(n+1) − X(n) − dt (P(n)+P(n+1))/2M]| / r | position projection |
| dL | max_t |L(t) − L(0)| / Lscale, about the origin (about the CoM under gravity) | both |
| dLcm | the same about the moving CoM | both |
| dLvel | max_t |Σ_steps Σ_i [m (x_pred − X_pred) × (Δv − g dt) + I Δω]| / Lscale | velocity |
Here Lscale = Σ (m|x − X||v − V| + I|ω|) at t = 0. The step integrates x(n+1) = x(n) + dt (v(n) + v(n+1))/2 and then projects, so dXpos isolates the projection exactly. dLvel uses the predicted positions x + (v + g dt) dt, which are where the velocity phase evaluates its lever arms.
Modes:
The test is REPORT-ONLY. kGate = false, and the gate thresholds kTolP = 1e-6, kTolX = 1e-5 and kTolL = 1e-5 (on dLvel) sit at the top of the file. The 20 new ctests are momentum_<mode>_np{1,2,4,8}; the battery now has 98 tests.
Command: docs/momentum_evidence/run_matrix.sh build_mom, i.e. for each mode, np ∈ {1, 2, 4, 8}, OMP_NUM_THREADS ∈ {1, 8} and 3 repeats: OMP_NUM_THREADS=$thr OMP_PROC_BIND=false mpirun --bind-to none -np $np build_mom/tests/kokkos_mpi/test_momentum_mpi $mode. Raw lines are in matrix.txt. Load average (1/5/15 min) was 2.7/21.9/24.8 at the start and 32.8/43.0/37.2 at the end.
Cells show the median [min–max] of 3 runs; "(=)" means all 3 agreed to every printed digit (4 significant).
| np | thr | dP | dX | dXpos | dL | dLcm | dLvel |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2.8e-09 (=) | 3.2e-07 (=) | 3.3e-07 (=) | 8.2e-04 (=) | 8.2e-04 (=) | 2.9e-09 (=) |
| 1 | 8 | 2.6e-09 [2.2e-09–2.9e-09] | 2.4e-07 [1.9e-07–2.7e-07] | 2.4e-07 [1.8e-07–2.8e-07] | 8.0e-04 [7.9e-04–8.1e-04] | 8.0e-04 [7.9e-04–8.1e-04] | 3.2e-09 [1.8e-09–3.7e-09] |
| 2 | 1 | 3.9e-03 (=) | 8.3e-03 (=) | 6.9e-04 (=) | 2.3e-03 (=) | 2.1e-03 (=) | 1.4e-03 (=) |
| 2 | 8 | 3.6e-03 [3.3e-03–4.3e-03] | 8.3e-03 [5.0e-03–1.1e-02] | 1.2e-03 [1.2e-03–1.3e-03] | 2.4e-03 [2.4e-03–3.0e-03] | 2.3e-03 [2.2e-03–2.9e-03] | 1.6e-03 [1.4e-03–2.1e-03] |
| 4 | 1 | 6.2e-03 (=) | 1.4e-02 (=) | 1.9e-03 (=) | 2.3e-03 (=) | 2.2e-03 (=) | 2.3e-03 (=) |
| 4 | 8 | 4.2e-03 [3.2e-03–5.3e-03] | 7.8e-03 [7.4e-03–1.2e-02] | 1.7e-03 [5.4e-04–2.0e-03] | 2.4e-03 [2.2e-03–3.0e-03] | 2.3e-03 [2.1e-03–3.1e-03] | 2.4e-03 [2.4e-03–2.8e-03] |
| 8 | 1 | 3.3e-03 (=) | 7.5e-03 (=) | 3.3e-03 (=) | 5.7e-03 (=) | 5.6e-03 (=) | 5.5e-03 (=) |
| 8 | 8 | 3.6e-03 [3.0e-03–3.6e-03] | 8.7e-03 [7.5e-03–1.0e-02] | 2.4e-03 [2.1e-03–2.4e-03] | 5.1e-03 [3.9e-03–5.3e-03] | 5.2e-03 [3.8e-03–5.3e-03] | 4.6e-03 [3.5e-03–5.3e-03] |
| np | thr | dP | dX | dXpos | dL | dLcm | dLvel |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 3.7e-09 (=) | 1.3e-07 (=) | 1.3e-07 (=) | 3.2e-04 (=) | 3.2e-04 (=) | 1.9e-05 (=) |
| 1 | 8 | 4.0e-09 [3.9e-09–7.1e-09] | 1.5e-07 [1.4e-07–3.3e-07] | 1.5e-07 [1.3e-07–3.3e-07] | 3.1e-04 [3.1e-04–3.3e-04] | 3.1e-04 [3.1e-04–3.3e-04] | 2.1e-05 [1.4e-05–2.2e-05] |
| 2 | 1 | 3.7e-03 (=) | 9.7e-03 (=) | 1.3e-03 (=) | 1.1e-03 (=) | 9.9e-04 (=) | 1.2e-03 (=) |
| 2 | 8 | 3.6e-03 [3.1e-03–4.2e-03] | 7.7e-03 [7.3e-03–1.0e-02] | 6.1e-04 [5.5e-04–1.1e-03] | 1.4e-03 [8.0e-04–1.7e-03] | 1.3e-03 [7.1e-04–1.6e-03] | 1.6e-03 [9.8e-04–1.8e-03] |
| 4 | 1 | 5.0e-03 (=) | 1.4e-02 (=) | 4.5e-03 (=) | 1.1e-03 (=) | 1.1e-03 (=) | 1.3e-03 (=) |
| 4 | 8 | 5.4e-03 [4.4e-03–7.5e-03] | 1.6e-02 [1.1e-02–1.8e-02] | 9.5e-04 [8.0e-04–3.7e-03] | 1.7e-03 [1.6e-03–2.3e-03] | 1.6e-03 [1.6e-03–2.0e-03] | 1.8e-03 [1.7e-03–2.0e-03] |
| 8 | 1 | 3.8e-03 (=) | 1.0e-02 (=) | 2.3e-03 (=) | 3.2e-03 (=) | 3.3e-03 (=) | 3.1e-03 (=) |
| 8 | 8 | 3.6e-03 [3.5e-03–3.6e-03] | 9.5e-03 [5.8e-03–1.0e-02] | 3.6e-03 [3.1e-03–3.8e-03] | 2.5e-03 [2.4e-03–3.1e-03] | 2.4e-03 [2.3e-03–3.0e-03] | 2.1e-03 [2.1e-03–2.9e-03] |
| np | thr | dP | dX | dXpos | dL | dLcm | dLvel |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 7.9e-07 (=) | 4.2e-07 (=) | 1.4e-07 (=) | 3.8e-04 (=) | 3.8e-04 (=) | 1.9e-08 (=) |
| 1 | 8 | 7.9e-07 [7.8e-07–7.9e-07] | 4.9e-07 [4.2e-07–5.3e-07] | 1.4e-07 [1.3e-07–2.2e-07] | 3.8e-04 [3.8e-04–3.8e-04] | 3.8e-04 [3.8e-04–3.8e-04] | 1.7e-08 [1.6e-08–1.9e-08] |
| 2 | 1 | 6.8e-03 (=) | 1.7e-02 (=) | 1.3e-03 (=) | 3.7e-03 (=) | 3.7e-03 (=) | 4.0e-03 (=) |
| 2 | 8 | 7.4e-03 [6.2e-03–8.2e-03] | 1.7e-02 [1.7e-02–2.2e-02] | 1.4e-03 [5.7e-04–3.0e-03] | 2.8e-03 [2.7e-03–4.0e-03] | 2.8e-03 [2.7e-03–4.0e-03] | 3.2e-03 [3.0e-03–4.3e-03] |
| 4 | 1 | 1.1e-02 (=) | 2.9e-02 (=) | 4.8e-03 (=) | 1.6e-03 (=) | 1.6e-03 (=) | 1.9e-03 (=) |
| 4 | 8 | 9.5e-03 [9.1e-03–9.9e-03] | 2.5e-02 [2.2e-02–2.5e-02] | 2.0e-03 [1.3e-03–2.5e-03] | 2.6e-03 [2.2e-03–2.8e-03] | 2.6e-03 [2.2e-03–2.8e-03] | 2.9e-03 [2.5e-03–2.9e-03] |
| 8 | 1 | 1.3e-02 (=) | 1.3e-02 (=) | 2.1e-03 (=) | 4.2e-03 (=) | 4.2e-03 (=) | 3.8e-03 (=) |
| 8 | 8 | 1.2e-02 [1.0e-02–1.3e-02] | 1.5e-02 [1.3e-02–2.0e-02] | 2.9e-03 [1.8e-03–3.6e-03] | 5.0e-03 [4.3e-03–5.3e-03] | 5.0e-03 [4.3e-03–5.3e-03] | 4.6e-03 [3.8e-03–5.2e-03] |
| np | thr | dP | dX | dXpos | dL | dLcm | dLvel |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 0.0e+00 (=) | 4.9e-07 (=) | 4.9e-07 (=) | 2.9e-03 (=) | 2.9e-03 (=) | 0.0e+00 (=) |
| 1 | 8 | 0.0e+00 (=) | 5.3e-07 [4.5e-07–7.8e-07] | 5.3e-07 [4.5e-07–7.8e-07] | 2.9e-03 [2.9e-03–2.9e-03] | 2.9e-03 [2.9e-03–2.9e-03] | 0.0e+00 (=) |
| 2 | 1 | 0.0e+00 (=) | 4.8e-03 (=) | 4.8e-03 (=) | 2.8e-03 (=) | 2.8e-03 (=) | 0.0e+00 (=) |
| 2 | 8 | 0.0e+00 (=) | 3.1e-03 [2.9e-03–3.6e-03] | 3.1e-03 [2.9e-03–3.6e-03] | 2.7e-03 [2.7e-03–2.8e-03] | 2.8e-03 [2.7e-03–2.8e-03] | 0.0e+00 (=) |
| 4 | 1 | 0.0e+00 (=) | 7.0e-03 (=) | 7.0e-03 (=) | 2.8e-03 (=) | 2.7e-03 (=) | 0.0e+00 (=) |
| 4 | 8 | 0.0e+00 (=) | 5.4e-03 [4.6e-03–6.0e-03] | 5.4e-03 [4.6e-03–6.0e-03] | 2.9e-03 [2.9e-03–2.9e-03] | 2.8e-03 [2.8e-03–2.9e-03] | 0.0e+00 (=) |
| 8 | 1 | 0.0e+00 (=) | 7.2e-03 (=) | 7.2e-03 (=) | 2.4e-03 (=) | 2.2e-03 (=) | 0.0e+00 (=) |
| 8 | 8 | 0.0e+00 (=) | 7.5e-03 [6.0e-03–1.0e-02] | 7.5e-03 [6.0e-03–1.0e-02] | 2.7e-03 [2.7e-03–3.0e-03] | 2.7e-03 [2.7e-03–2.9e-03] | 0.0e+00 (=) |
| np | thr | dP | dX | dXpos | dL | dLcm | dLvel |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2.8e-08 (=) | 8.8e-07 (=) | n/a | 4.4e-07 (=) | 4.4e-07 (=) | n/a |
| 1 | 8 | 2.6e-08 [2.1e-08–2.7e-08] | 8.8e-07 [8.7e-07–8.8e-07] | n/a | 4.3e-07 [4.3e-07–4.4e-07] | 4.4e-07 [4.3e-07–4.4e-07] | n/a |
| 2 | 1 | 1.5e-08 (=) | 8.7e-07 (=) | n/a | 4.4e-07 (=) | 4.4e-07 (=) | n/a |
| 2 | 8 | 2.4e-08 [2.2e-08–2.5e-08] | 8.7e-07 [8.7e-07–8.8e-07] | n/a | 4.4e-07 [4.4e-07–4.4e-07] | 4.4e-07 [4.4e-07–4.4e-07] | n/a |
| 4 | 1 | 2.4e-08 (=) | 8.7e-07 (=) | n/a | 4.3e-07 (=) | 4.3e-07 (=) | n/a |
| 4 | 8 | 2.2e-08 [1.9e-08–2.3e-08] | 8.8e-07 [8.7e-07–8.8e-07] | n/a | 4.3e-07 [4.3e-07–4.4e-07] | 4.4e-07 [4.4e-07–4.4e-07] | n/a |
| 8 | 1 | 2.5e-08 (=) | 8.7e-07 (=) | n/a | 4.3e-07 (=) | 4.3e-07 (=) | n/a |
| 8 | 8 | 2.0e-08 [1.8e-08–2.3e-08] | 8.8e-07 [8.8e-07–8.8e-07] | n/a | 4.4e-07 [4.3e-07–4.4e-07] | 4.4e-07 [4.4e-07–4.4e-07] | n/a |
The pin in tests/kokkos_mpi/CMakeLists.txt is still in place. The runs override OMP_NUM_THREADS on the command line: docs/momentum_evidence/run_chain.sh build_mom, 8 runs per cell. The instrument is a new comShift field on the [margin] line, the x-CoM displacement over the 4 steps for the distributed run and for the serial reference. Every body has unit mass and starts at rest, so a conserving solve gives 0. Raw lines are in chain.txt; the load average was 36.3 at the start and 28.2 at the end.
| np | threads | runs with the rigid shift | shift (dist CoM) | serial reference CoM |
|---|---|---|---|---|
| 2 | 8 | 4 / 8 | +2.133e-2 (all 4) | −0.7e-6 … −1.4e-6 |
| 2 | 1 | 0 / 8 | −1.19e-6 | −1.19e-6 |
| 4 | 8 | 5 / 8 | +2.133e-2 (all 5) | −1.0e-6 … −1.4e-6 |
| 4 | 1 | 0 / 8 | −1.19e-6 | −1.19e-6 |
In every flake, posErr equals comShift (2.133e-2): the whole chain translates rigidly. The flake rate is higher than in the c64e117 investigation (2 of 8), which ran on a less loaded host; the rate depends on thread timing. A clean 1-thread run is not evidence of conservation. The cluster matrix above is non-conserving at 1 thread too.
Command: docs/momentum_evidence/run_perf.sh build_mom, test modes perf_gas and perf_pgs.
| mode | np × thr | runs (ms/step) | median | min |
|---|---|---|---|---|
| perf_gas | 4 × 4 | 48.0, 15.2, 27.2, 15.6, 15.6 | 15.6 | 15.2 |
| perf_gas | 8 × 2 | 7.9, 16.4, 8.1, 9.3, 8.1 | 8.1 | 7.9 |
| perf_pgs | 4 × 4 | 15.5, 119.8, 26.2, 15.9, 15.6 | 15.9 | 15.5 |
| perf_pgs | 8 × 2 | 98.8, 8.2, 8.3, 10.2, 9.3 | 9.3 | 8.2 |
The host is shared, and the outliers (27–120 ms) are contention from other sessions. Compare the "after" numbers to these medians and minima under the same script.