CHAPTER 27

Solver Acceleration and Performance

How to make simulations faster without compromising physics: backend, parallelism, parameters and modeling strategies.

The cost of a DEM simulation grows with the number of particleswith contact stiffness (which forces a small Δt) and with output frequency. The strategies below attack each of these axes. Apply them incrementally and confirm that the physics of interest does not change.

27.1 Where time is spent

At each step, the solver (1) locates neighbors, (2) solves contacts and (3) integrates the movement. Neighbour detection and contact resolution dominate the cost. A small Δt multiplies the number of steps; many particles multiply the cost per step.

27.2 Backend: CPU or GPU

Choose the backend in Setup › Execution backend (Chapter 12.4). The practical rule:

SCENARIO BACKEND OBSERVATION
Validation, calibration, small cases CPU GPU preparation and transfer overhead does not pay off in small cases
Cases with extensive STL geometry CPU Complex geometry reduces the advantage of GPU
Large-scale production (hundreds of thousands to millions of particles) GPU GPU dominates when there is enough parallel work to amortize overhead
GPU is not always faster - In small cases or with a lot of STL geometry, GPU can stay slower than the CPU because of the transfer and preparation overhead. Measure before assuming: Run the same case on both backends and compare wall time.

27.3 CPU parallelism

  • Number of threads - increase the number of threads in Setup to use all physical cores. Gain decreases after the number of physical cores (hyper-threading helps little in DEM);
  • Verlet Neighbor Search (CPU) - activate it: the solver takes advantage of the list of neighbours for several steps, rebuilding it only when a particle moves beyond half the margin (skin). This greatly reduces the cost of contact detection;
  • Margin (skin) - a greater margin rebuilds the list less frequently (faster per step), but examines more candidates. The standard value (~1⁄2 of the maximum radius) is a good balance.

27.4 GPU specific acceleration

  • Mixed precision — FP32 contacts with the Verlet neighbor list enabled automatically. The speedup depends on the GPU, case and active models. Turn it off for calibration and CPU/GPU comparison; validate the quantities of interest from identical initial conditions.
  • Verlet neighbourhood on GPU - list of precomputed neighbours rebuilt each K steps instead of redoing cell-list every step;

27.5 Reduce the physical cost of the case

STRATEGY BENEFIT CAUTION
Reduce Young’s modulus E Larger Δt → fewer steps Maintain maximum overlap < ~1 % of radius
Coarse-graining (CGF) k³ fewer particles; Δt approximately k× larger Rescale correctly; validate against fine case (Chapter 10.7)
Save Count Less I/O and disk Do not miss the time resolution of fast events
Fit the domain closely to the problem Fewer empty search cells Do not cut regions where there are particles
Moderate polydispersion More uniform search cells Extreme size ratios make neighbour searching more difficult

27.6 Suggested hardware matrix

Starting points by case size (the exact count depends on radius, stiffness and active models):

CASE SIZE PARTICLES (order) HARDWARE / SUGGESTED BACKEND
Teaching / validation up to ~50,000 CPU 4–8 cores, 8–16 GB RAM, Verlet enabled
Medium Engineering ~50,000 to ~500,000 CPU 8–16 cores, 16–32 GB RAM; evaluate GPU
Large production ~500 thousand to a few million Dedicated NVIDIA GPU, 32–64 GB RAM; Mixed Precision
Very large / parametric millions High-performance GPU + coarse-graining; queued batches
Acceleration workflow - (1) activate Verlet search and use all cores; (2) reduce E while keeping the overlap < 1 %; (3) adjust the Save Count to what is needed; (4) evaluate coarse-graining for huge cases; (5) only then migrate to GPU - and confirm the gain by measuring the wall time in both backends.