arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.00093cs.MS
收藏

使LAMMPS中的RANMAR伪随机数生成器速度提升四倍,实现jump-ahead功能

Making the RANMAR pseudorandom number generator in LAMMPS up to four times faster, with an implementation of jump-ahead

Center for Data Science, Ehime University(爱媛大学数据科学中心);Faculty of Science, Yamagata University(山形大学理学部)

Hiroshi Haramoto, Kosuke Suzuki

AI总结:

LAMMPS中RANMAR生成器通过实现jump-ahead功能,将生成速度提升四倍,同时保证非重叠性和可重复性。

摘要:

大规模并行分子模拟需要能够证明非重叠且在数千个计算单元中可重复的伪随机数流。在广泛使用的LAMMPS包中,标准的RANMAR生成器缺乏数学上精确的jump-ahead机制;通常会为不同的种子分配不同的种子,这并不能保证流的不重叠。我们介绍了在LAMMPS中为RANMAR开发的数学上精确的jump-ahead扩展。在实践中,一个随机序列可以被划分为连续、非重叠的长度为J的块,每个计算单元分配一个块,在正式的非重叠保证下。在我们的方法中,我们开发了一种代数改写,通过将状态推进转换为有限剩余环上的多项式计算,从而在保持内存小的同时,能够高效地实现jump-ahead,即使对于非常大的J。我们使用Number Theory Library(NTL)用C++实现该扩展,并将其整合到LAMMPS中而不改变用户的工作流程。除了使精确划分成为可能外,将24位浮点递推转换为等效的24位整数递推还加速了生成本身:在各种CPU上,生成速度比浮点基线快大约两到四倍。计算非常大的跳跃(例如J≈2^120)仍然可行。

英文摘要:

Massively parallel molecular simulations require pseudorandom number streams that are provably non-overlapping and reproducible across thousands of compute units in parallel computing environments. In the widely used LAMMPS package, the standard RANMAR generator lacks a mathematically exact mechanism to jump ahead; distinct seeds are typically assigned instead, which does not ensure disjoint streams. We introduce a mathematically exact jump-ahead extension for RANMAR in LAMMPS. In practice, a single random sequence can be partitioned into consecutive, non-overlapping blocks of length $J$, with one block assigned to each compute unit under formal non-overlap guarantees. In our approach, we develop an algebraic reformulation that enables efficient jump-ahead even for very large $J$ by casting state advancement into polynomial computations over finite residue rings while keeping memory small. We implement the extension in C++ using Number Theory Library (NTL) and integrate it into LAMMPS without altering user workflows. Beyond enabling exact partitioning, converting the 24-bit floating-point recurrence to an equivalent 24-bit integer recurrence accelerates generation itself: across diverse CPUs, generation is approximately two to four times faster than the floating-point baseline. Computing very large jumps (e.g., $J \approx 2^{120}$) remains practical.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑