Source-linked AI summary
A comparison between parallelization approaches in molecular dynamics simulations on GPUs
Lorenzo Rovigatti, Petr Šulc, István Z. Reguly, Flavio Romano
TL;DR
GPU molecular-dynamics simulations need parallel force calculations that avoid concurrent writes while supplying enough balanced work. This paper compares per-particle and per-interaction GPU approaches, finding that their relative performance depends on interaction complexity and hardware. Edge-based parallelization is often competitive or faster, with its strongest reported advantage for complex DNA interactions.
Problem
GPU simulations offer access to larger systems and longer timescales, but MD packages must manage concurrent writes and provide enough balanced parallel tasks to use GPU hardware.
Source: §I · p. 1Method
The authors compare vertex-based GPU threads assigned per particle with edge-based threads assigned per potentially non-zero pair, using three molecular models and multiple GPU architectures.
Source: §I · p. 2, §II · p. 3Results
Edge-based is competitive and often outperforms vertex-based; it favors few or complex interactions, while vertex wins simple, many-neighbor potentials; oxDNA gained a 70% performance increase or more on newest K20 hardware.
Source: §IV · p. 7, §V · p. 8Takeaways & Limitations
The authors predict edge-based parallelization will become more competitive if GPU hardware continues increasing scalar processors.
Source: §V · p. 8
Abstract
from arXiv · showhide
We test the performances of two different approaches to the computation of forces for molecular dynamics simulations on Graphics Processing Units. A "vertex-based" approach, where a computing thread is started per particle, is compared to a newly proposed "edge-based" approach, where a thread is started per each potentially non-zero interaction. We find that the former is more efficient for systems with many simple interactions per particle, while the latter is more efficient if the system has more complicated interactions or fewer of them. By comparing computation times on more and less recent GPU technology, we predict that, if the current trend of increasing the number of processing cores - as opposed to their computing power - remains, the "edge-based" approach will gradually become the most efficient choice in an increasing number of cases.
I. INTRODUCTION
GPU molecular-dynamics codes must expose balanced parallel work while avoiding concurrent force writes, and the best decomposition depends on the system and hardware. This paper compares vertex- and edge-based GPU force computation across three models and finds an edge-based advantage on newer GPUs for short-range anisotropic systems.
I. INTRODUCTION
- GPU architecture changes can alter the relative performance of algorithms, and the authors argue that edge-based parallelization can help exploit newer GPUs in the studied field.They describe the approach as readily implementable in modern MD packages.Source: §I · pp. 1–2
- GPU parallelization choices must address concurrent writes and provide many balanced tasks, with communication cost and load balance helping determine the optimal scheme.GPUs offer high throughput through massive parallelism, but programming them requires explicit exposure of data parallelism.Source: §I · pp. 1–2
- The study implements vertex-based threads per particle and edge-based threads per potentially non-zero interaction, comparing three models with different interaction complexity on different hardware.Vertex-based computation calculates each pair force separately for both particles; edge-based computation uses Newton’s third law and atomic force updates.Source: §I · p. 2
- Prior GPU work mostly used atom decomposition, and a prior study of both atom and force decomposition did not report a performance comparison.The authors state that, to their knowledge, the two approaches had not yet been systematically compared on GPUs.Source: §I · p. 2
- On newer hardware, edge-based parallelization performs better for short-ranged, anisotropically interacting systems.The authors note that these systems include coarse-grained models studied in soft matter and biophysics.Source: §I · p. 2
II. METHODS
The methods compare GPU force calculations assigned per particle or per potentially interacting pair, alongside implementation choices and checks against established simulation packages. The vertex approach avoids concurrent writes, while the edge approach uses atomic updates and is constrained by interaction range and update costs.
II. METHODS
- Performance tests use Brownian dynamics in the NV T ensemble, Verlet lists updated with a cell algorithm, and varying particle counts; sorting Lennard-Jones and patchy data yields 20%–100% speed-up for N > 10^4.Sorting is not applied to DNA simulations because it provides no significant measurable gain.Source: §II · p. 2
- Vertex-based threads each handle one particle’s neighbor list and sum its forces independently; edge-based threads handle a potentially interacting pair and update both particles’ forces.Zero-force edge interactions skip atomic operations, which can reduce concurrent writes in anisotropic models.Source: §II · p. 3, Figure 1 · p. 4
- Vertex-based work is limited by insufficient parallelism at low particle counts, while edge-based work is suited to short-range forces and can incur costly concurrent updates.For long-range forces, the edge approach would require O(N^2) threads; vertex-based execution also depends on the slowest thread in a warp.Source: §II · p. 3
- Using Newton’s third law in the vertex approach was at most 1.2 times faster in some systems and otherwise matched or underperformed the version without it; it never beat edge-based where it was fastest.The variant uses atomic addition to update particle forces.Source: §II · p. 3
- For Lennard-Jones systems, oxDNA was within 10% of HOOMD-blue for systems of 10,000 particles or more and at least 20% faster than LAMMPS across tested systems.The comparison used Tesla C2070 and Kepler K10 GPUs; oxDNA was also reported much faster than GROMACS for the supplementary Lennard-Jones comparison.Source: Figure 2 · p. 4, §II · pp. 4–5
III. MODELS
The study implements Lennard-Jones, patchy-particle, and oxDNA models whose interaction complexity and neighbor counts span distinct computational workloads.
III. MODELS
- Lennard-Jones interactions are pairwise and spherically symmetric, depend on particle separation, and are cut and shifted at 2.5σ.The model is used for systems such as noble gases and glass-forming materials; ε controls attraction depth and σ is particle diameter.Source: §III · p. 5
- The patchy potential combines spherical hard-core-like repulsion with short-range interactions depending on the particles’ relative distances and orientations.Each particle has M = 2 patches.Source: §III · p. 5
- oxDNA models nucleotides as rigid bodies interacting through a short-range, highly anisotropic potential with several interaction contributions.The model targets DNA’s mechanical, structural, and thermodynamic properties.Source: §III · p. 5
- LJ is relatively long-ranged with many neighbors, patchy interactions are short-ranged and sparse, and oxDNA is computationally demanding with branched, imbalanced pair calculations.The patchy and oxDNA models also have few interacting neighbors because of their anisotropy.Source: §III · p. 5
- The DNA simulations use double-stranded octamers at 2.7 mM concentration and 300 K.Source: §III · p. 6
IV. RESULTS
The comparison shows that the faster parallelization approach depends on the model and GPU generation. Density shifts the balance for patchy particles, while the edge-based approach substantially benefits oxDNA.
IV. RESULTS
- Tests compare Tesla C2070 with Kepler K10 and K20 GPUs, averaging repeated timings over cycles longer than each system’s decorrelation time.Newer hardware performs better in all cases when using the same algorithm and model.Source: §IV · pp. 6–7
- LJ is fastest with the vertex approach on every tested GPU; patchy favors edge by almost 40% on the newest GPU but is 50% slower on the oldest, while oxDNA gains 70% or more on K20.Source: §IV · p. 7
- The edge approach’s oxDNA advantage reflects workload imbalance: it uses more threads to hide imbalance that is worse in the vertex approach.Source: §IV · p. 7
- For LJ, relative performance stays roughly constant with density except on the oldest hardware, while increasing patchy density favors edge on newer GPUs and vertex on older ones.Potential interactions increase faster than non-zero interactions as density rises; on the oldest hardware, the resulting atomic-operation burden leaves vertex favored.Source: §IV · p. 7
- With Newton’s third law, vertex is slower for LJ, can be up to 1.2 times faster for patchy on Kepler but remains slower than edge, and gains at most 16% for DNA.The reported vertex results in this section do not use Newton’s third law.Source: §IV · p. 7
V. CONCLUSIONS
The edge-based approach is competitive and often outperforms the vertex-based approach, but vertex-based remains fastest for simple potentials with many neighbors. The authors predict edge-based will grow more competitive if GPU scalar-processor counts continue to increase.
V. CONCLUSIONS
- GPU computing can make previously untreatable system sizes and timescales accessible, but requires rethinking simulation-code structure.Source: §V · pp. 7–8
- The edge-based approach is competitive and often outperforms vertex-based, which can lack enough parallelism to use the GPU fully.The paper compares the approaches across three models with distinct computational complexities.Source: §V · p. 8
- Edge-based is fastest when non-zero interactions per particle are few and/or complicated, while vertex-based is fastest for simple potentials with many neighbors.The vertex-based case includes large-range spherical interactions; edge-based performs best for highly anisotropic, complicated potentials such as oxDNA.Source: §V · p. 8
- Edge-based benefits more from increased scalar-processor counts, and continued hardware trends would make it increasingly competitive.Source: §V · p. 8
VI. COMPARISON TO HOOMD-BLUE AND LAMMPS
The authors compare oxDNA with GPU-enabled HOOMD-blue and LAMMPS, finding roughly equivalent large-system performance. In a separate comparison, oxDNA is faster than GROMACS 5.0.1 for all considered particle counts.
VI. COMPARISON TO HOOMD-BLUE AND LAMMPS
- Figure 5 compares oxDNA/GROMACS average-time ratios for an MD step and for the force-computing kernels on a C2070 GPU.Source: Figure 5 · p. 9
- Large-N oxDNA, HOOMD-blue, and LAMMPS performances are roughly equivalent, with the largest difference under 20%.Their asymptotic performances are also very similar.Source: §VI · p. 9
- OxDNA is faster than GROMACS 5.0.1 for all considered particle counts at ρ = 0.1.GROMACS is not tailored to short-ranged-only potentials, which the authors note may explain its performance in this test.Source: §VI · p. 9
VII. ABSOLUTE TIMINGS AND COMPARISON OF THE VERTEX-BASED APPROACH WITH AND WITHOUT NEWTON’S THIRD LAW
The section reports absolute single-step timings for edge-based, vertex-based, and Newton's-third-law vertex-based variants across three GPU architectures and model systems.
VII. ABSOLUTE TIMINGS AND COMPARISON OF THE VERTEX-BASED APPROACH WITH AND WITHOUT NEWTON’S THIRD LAW
- Single-step absolute timings compare edge, vertex, and Newton's-third-law vertex variants on C2070, K10, and K20 GPUs.Source: §VII · p. 9
- Figure 6 plots absolute timings against system size for DNA, Lennard-Jones, and patchy models.Source: Figure 6 · p. 10
- The DNA panel uses 2.7 mM double-strand concentration at 300 K; the LJ panel uses kBT/ϵ = 1.8 and ρσ3 = 0.5.The patchy panel lists kBT/ϵ = 0.15, kBT/ϵ = 1.8, and ρσ3 = 0.5.Source: Figure 6 · p. 10