TL;DR
This paper tackles the significant computational bottleneck of energy lookup in Monte Carlo neutron transport simulations. By comparing and optimizing various lookup algorithms (hashing, unionized grids, fractional cascading, and vectorized linear search) on both traditional CPUs and Intel MIC many-core architectures, the authors identify the logarithmic material hashing method as the best compromise for performance, scalability, and memory usage.
What Problem Does This Paper Address?
Monte Carlo (MC) simulations are crucial for nuclear engineering, but they are computationally intensive due to their slow convergence. A major performance bottleneck, consuming up to 80% of computation time, is the "energy lookup process." This involves finding the correct interaction probabilities (cross-sections) for a neutron at a given energy. Traditional methods like binary search are inefficient, especially on modern many-core architectures like Intel MIC, which require highly parallel and vectorized operations. The challenge is to find energy lookup algorithms that are both fast and efficient across different hardware platforms, particularly those with many processing cores and wide vector units.
Methods
The authors evaluate several energy lookup algorithms:
- Binary Search: The conventional, baseline method.
- Hashing: Algorithms that divide the energy range into bins. They explore both material-level and isotope-level hashing, and investigate logarithmic vs. linear scales for binning.
- Unionized Grid: A method that creates a global table of all energy points and a secondary table for isotope-specific indexes.
- Fractional Cascading: A technique to speed up searches across a series of related data sets by building unified grids.
- Vectorized Linear Search: Adapting linear search to leverage SIMD (Single Instruction, Multiple Data) instructions on CPU (AVX) and Intel MIC (KNC) architectures. This includes basic and branchless vectorized versions.
- SIMD-Based Search Method: A novel approach proposed by the authors, similar to hashing but dividing energy grids based on an equal number of grid points rather than equal energy intervals, designed for MIC vectorization.
The algorithms were implemented in the PATMOS MC prototype and tested on both Sandy Bridge CPUs and Intel MIC coprocessors.
Datasets
The primary dataset used is the nuclear data library containing cross-section tables for 390 isotopes. The authors created a benchmark test case called "PointKernel," simulating a neutron slowing down in an infinite medium composed of these isotopes, representative of PWR burn-up computations. They also used a simplified version, "PointKernelU238," with only the 238U isotope for specific tests.
Key Insights and Ideas
- Vectorization is Key for Many-Core: The Intel MIC architecture's 512-bit Vector Processing Unit (VPU) offers significant speedups when fully utilized. Vectorized linear search showed substantial gains on MIC, outperforming basic linear search by up to 10x.
- CPU vs. MIC Vectorization Differences: While vectorization is beneficial on both architectures, the wider VPUs on MIC lead to more pronounced speedups compared to CPUs, which have narrower vector units (e.g., AVX).
- No Silver Bullet: No single algorithm is universally superior. The "best" choice depends on the trade-offs between performance, memory usage, and scalability.
- Hashing Trade-offs: Logarithmic hashing generally provides better bin balance, but linear hashing can be more effective in regions with sharp resonance changes. The authors found that a specific hashing size (N~500) was optimal for their mixed-isotope test case.
- Unionized Grid: Fast but Memory Hungry: The unionized grid method was the fastest in terms of execution time but required a dramatic increase in memory footprint (up to 11x).
- Scalability vs. Performance: Algorithms that offer the best raw performance (like unionized grids) tend to have worse scalability with increasing numbers of threads. Conversely, algorithms with better scalability (like binary search) are often slower.
- Logarithmic Material Hashing as a Sweet Spot: The logarithmic material hashing method emerged as a strong contender, offering a good balance between performance, scalability, and memory footprint, making it a recommended choice.
Key Results
- Vectorized Linear Search: Achieved speedups of up to 10x on MIC compared to basic linear search. On CPU, it was more efficient than binary search for array sizes less than 200.
- SIMD-Based Lookup: The proposed SIMD-based lookup method yielded a 13% speedup over conventional binary search on MIC with negligible memory increase.
- Unionized Method: The fastest algorithm, but with a significant memory overhead.
- Hashing and Fractional Cascading: Showed similar performance on both CPU and MIC, with modest speedups over binary search.
- Scalability: Algorithms with better performance generally showed worse scalability. The unionized grid, while fast, scaled poorly.
- Overall Recommendation: Logarithmic material hashing was identified as the best compromise for performance, scalability, and memory footprint.
Limitations and Future Work
- MIC Performance: A disappointing observation was that algorithms running with 240 threads on MIC were sometimes slower than with 16 threads on CPU. This is attributed to the vectorized code snippets not being computationally intensive enough and potential overheads.
- Data Structure Replication: The current prototype replicates certain data structures for each working thread, leading to significant memory overhead on MIC. Future work is needed to reduce this duplication.
- Further Optimization: The authors suggest that further optimization of hashing by varying hash size and reorganizing hashing regions could be explored.
- Algorithm Choice Threshold: The paper suggests a threshold of 200 elements for choosing between linear and binary search on MIC, but this could be further refined.
Summary updated