Abstract
Monte Carlo (MC) methods have been widely used to solve the particle transport equation due to their high accuracy and capability of processing complex geometries. History-based and event-based algorithms that are applicable to different architectures are two methods for parallelizing the MC code. There is a large work on evaluating and optimizing parallel algorithms with continuous-energy schemes. In this work, we evaluate the single-node performance of history-based and event-based algorithms for multigroup MC methods on both CPUs and GPUs with Quicksilver, a multigroup MC transport code that has already implemented the history-based algorithms. We first implement and optimize the event-based algorithm based on Quicksilver and then perform the evaluation work extensively on the Coral2 benchmark. Numerical results indicate that contrary to continuous-energy schemes, the history-based approach with multigroup schemes outperforms the event-based algorithm on both architectures in all cases. We summarize that the performance loss of the event-based algorithm is mainly due to: 1) extra operations to reorganize particles, 2) batched atomic operations, and 3) poor particle data locality. Despite the poor performance, the event-based algorithm achieves higher memory bandwidth utilization. We further discuss the impact of memory access patterns and calculation of cross sections (xs) on the performance of the GPU. Built on the analytics, and shed light on the algorithm choice and optimizations for paralleling the MC transport code on different architectures.
Introduction
Monte Carlo (MC) methods are the gold standard for simulating particle transport, but their computational intensity often necessitates high-performance parallelization. Two primary strategies exist: history-based, where a thread follows a single particle's lifecycle, and event-based, where particles are grouped into batches based on physical events (e.g., collisions or cross-section lookups). While event-based methods are traditionally favored for GPU acceleration in complex continuous-energy simulations, this study investigates whether that advantage persists in multigroup simulations, where physics calculations are simplified into energy bins.
Methodology and Implementation
The research utilizes Quicksilver, a proxy application for the Mercury code. To facilitate comparison, the authors implemented an event-based framework within Quicksilver, which originally only supported history-based tracking. This framework utilizes a queue-driven design with four primary event queues: cross-section calculation ($Q_{xs}$), particle advancing ($Q_{ad}$), collisions ($Q_{cl}$), and facet crossings ($Q_{cf}$).
Key optimizations for the event-based algorithm included replacing slow atomic operations with prefix-sum-based redistribution and implementing an "event-fixed" approach. The latter maintains high GPU occupancy by injecting new particles to replace those that have terminated, preventing the "kernel tail" inefficiency where GPU cores sit idle as a batch finishes.
Performance Evaluation
Testing was conducted using the Coral2 benchmark (specifically the "Godiva in water" problem) on both CPU and GPU architectures. The results revealed a significant reversal of the typical event-based advantage seen in continuous-energy problems.
Key Results
- History-Based Superiority: In multigroup simulations, the history-based approach outperformed the event-based algorithm in all tested cases. On CPUs, history-based tracking was over 1.5x faster; on GPUs, the performance gap widened to 3x–4x.
- Optimization Impact: The "event-fixed" strategy and prefix-sum optimizations were critical; using prefix sums for queue management was approximately 2x faster than using standard atomic operations.
Discussion: Why Event-Based Fails in Multigroup Schemes
The study identifies three primary reasons for the poor performance of event-based algorithms in a multigroup context:
- Overhead vs. Complexity: In continuous-energy simulations, the heavy lifting of cross-section lookups justifies the overhead of sorting particles. In multigroup simulations, these lookups are trivial, making the sorting overhead the dominant cost.
- Data Locality: History-based algorithms keep a particle's data in local registers or L1 cache throughout its life. Event-based algorithms constantly move data in and out of global memory to manage queues, destroying locality.
- The Bandwidth Paradox: While the event-based algorithm showed higher memory bandwidth utilization (e.g., 140 GB/s vs 95 GB/s on GPU), this was largely "unproductive" bandwidth spent on data movement for queue management rather than physics calculations.
Conclusion
Contrary to the prevailing trend in GPU-accelerated Monte Carlo methods, history-based algorithms remain the optimal choice for multigroup transport simulations. The findings suggest that for memory-latency-bound problems like MC transport, software-level vectorization through event-based sorting may be counterproductive when the underlying physics calculations are simplified. Future work points toward specialized hardware architectures designed to handle random memory access and hide latency more effectively than general-purpose GPUs.
Summary updated