基于细粒度粒子排序的粒子胞码自适应SIMD优化
Adaptive SIMD optimizations in particle-in-cell codes with fine-grain particle sorting
摘要:
粒子模拟程序广泛应用于从激光与物质相互作用到天体物理等离子体的动力学模拟。通过使用单指令多数据(SIMD)captured或向量化,可以减轻其沉重的仿真成本,现在大多数架构上都可以使用。本文详细介绍并讨论了在代码Smilei中开发的矢量化策略,该策略利用了高效、系统、基于细胞的粒子分选。粒子上的PIC运算符(投影、推动、沉积)已进行优化,以受益于最近和较旧架构上的大型SIMD向量。这些矢量化操作的效率随着每个单元的粒子数(PPC)而增加,通常在256 PPC的情况下将三维模拟加速2倍。虽然此实现显示了从少至8个PPC的加速,但在包含较少PPC的域中,它可能比标量版本慢,这通常在矢量化尝试中观察到。这个问题是克服了自适应算法,局部切换之间的标量(对于少数PPC)和矢量化的运营商(否则)。新实施的方法基准上三个不同的,大规模的模拟考虑经常与PIC代码研究的配置。
英文摘要:
Particle-In-Cell (PIC) codes are broadly applied to the kinetic simulation of plasmas, from laser-matter interaction to astrophysics. Their heavy simulation cost can be mitigated by using the Single Instruction Multiple Data (SIMD) capibility, or vectorization, now available on most architectures. This article details and discusses the vectorization strategy developed in the code Smilei which takes advantage from an efficient, systematic, cell-based sorting of the particles. The PIC operators on particles (projection, push, deposition) have been optimized to benefit from large SIMD vectors on both recent and older architectures. The efficiency of these vectorized operations increases with the number of particles per cell (PPC), typically speeding up three-dimensional simulations by a factor 2 with 256 PPC. Although this implementation shows acceleration from as few as 8 PPC, it can be slower than the scalar version in domains containing fewer PPC as usually observed in vectorization attempts. This issue is overcome with an adaptive algorithm which switches locally between scalar (for few PPC) and vectorized operators (otherwise). The newly implemented methods are benchmarked on three different, large-scale simulations considering configurations frequently studied with PIC codes.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。