Skip to main content
QUICK REVIEW

[Paper Review] An Efficient SIMD Implementation of Pseudo-Verlet Lists for Neighbour Interactions in Particle-Based Codes

James S. Willis, Matthieu Schaller|arXiv (Cornell University)|Apr 17, 2018
Fluid Dynamics Simulations and InteractionsEngineering3 references3 citations
TL;DR

This paper presents a highly optimized SIMD vectorized implementation of the pseudo-Verlet list algorithm for particle-based simulations, using sorted particle projections along cell-pair axes, accurate loop bounds, and vectorized distance computation with masking. It achieves 2.24x, 2.43x, and 4.07x speedups on AVX, AVX2, and AVX-512, respectively, over scalar code in the Swift cosmological simulation framework.

ABSTRACT

In particle-based simulations, neighbour finding (i.e finding pairs of particles to interact within a given range) is the most time consuming part of the computation. One of the best such algorithms, which can be used for both Molecular Dynamics (MD) and Smoothed Particle Hydrodynamics (SPH) simulations, is the pseudo-Verlet list algorithm. This algorithm, however, does not vectorise trivially, and hence makes it difficult to exploit SIMD-parallel architectures. In this paper, we present several novel modifications as well as a vectorisation strategy for the algorithm which lead to overall speed-ups over the scalar version of the algorithm of 2.24x for the AVX instruction set (SIMD width of 8), 2.43x for AVX2, and 4.07x for AVX-512 (SIMD width of 16).

Motivation & Objective

  • Address the performance bottleneck in particle-based simulations caused by inefficient neighbor finding in pseudo-Verlet lists.
  • Overcome the challenges of SIMD vectorization in pseudo-Verlet lists due to branching and irregular memory access patterns.
  • Develop a vectorization strategy that maintains algorithmic correctness while maximizing data-level parallelism on modern CPU architectures.
  • Achieve significant speedups in real-world cosmological simulations using the Swift codebase.
  • Demonstrate that algorithmic optimization combined with low-level vectorization yields superior performance over naive SIMD application.

Proposed method

  • Project particle positions from neighboring cells onto the axis joining their centers to enable ordered neighbor search.
  • Sort particles in each cell by their projected distance along the cell-pair axis to enable early loop termination.
  • Use a precomputed upper bound on the loop trip count (dist_a[i] + h + max_dx) to reduce redundant distance calculations.
  • Implement vectorized loops using AVX, AVX2, and AVX-512 intrinsics with masked operations to handle partial vector lanes.
  • Employ an accumulator vector to batch results and reduce memory bandwidth pressure during neighbor interaction computation.
  • Use a hybrid approach: apply scalar code for corner cell-pairs (low interaction count) and vectorized code for edge and face pairs to optimize overall performance.

Experimental results

Research questions

  • RQ1Can the pseudo-Verlet list algorithm be effectively vectorized using SIMD instructions despite its irregular control flow and memory access?
  • RQ2What are the performance gains of vectorizing the pseudo-Verlet list using AVX, AVX2, and AVX-512 on real-world cosmological simulation workloads?
  • RQ3How does the choice of instruction set (AVX vs. AVX2 vs. AVX-512) affect the achievable speedup in neighbor-finding performance?
  • RQ4What is the impact of algorithmic optimizations—such as sorted projections and loop bounds—on reducing redundant distance calculations in vectorized code?
  • RQ5Can a hybrid scalar/vectorized strategy improve overall performance by avoiding vectorization overhead in low-activity configurations?

Key findings

  • The SIMD-optimized pseudo-Verlet list achieves a 2.24x speedup on AVX (SIMD width 8) compared to scalar code in the Swift simulation framework.
  • A 2.43x speedup is achieved using AVX2, demonstrating improved performance over AVX due to enhanced instruction-level parallelism and better masking support.
  • The AVX-512 instruction set yields the highest speedup of 4.07x, benefiting from wider vector lanes (16-wide), improved FMA instructions, and dedicated masking.
  • The performance gain is most significant for face and edge cell-pair configurations, where higher interaction counts allow better amortization of vectorization overhead.
  • Corner cell-pair interactions show minimal speedup (0.49x) due to low interaction counts, justifying the use of scalar code for these cases to avoid vectorization cost.
  • Even with ideal 8x SIMD speedup, a naive O(N²) neighbor-finding approach remains over 12x slower than the optimized pseudo-Verlet list, highlighting the importance of algorithmic efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.