Making the RANMAR pseudorandom number generator in LAMMPS up to four times faster, with an implementation of jump-ahead
Abstract Massively parallel molecular simulations require pseudorandom number streams that are provably non-overlapping and reproducible across thousands of compute units. In LAMMPS, the standard RANMAR generator lacks exact jump-ahead; distinct seeds do not ensure disjoint streams. We introduce a mathematically exact jump-ahead for RANMAR in LAMMPS. A single sequence is partitioned into consecutive blocks of length J , assigning one block per unit with formal non-overlap guarantees. 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. 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.
Authors
- Kosuke Suzuki (ORCID: https://orcid.org/0000-0001-6569-5294)
- Hiroshi Haramoto (ORCID: https://orcid.org/0000-0003-4833-0108)
Institutions
- Yamagata University (JP)
- Ehime University (JP)
Publication Details
- Journal
- Monte Carlo Methods and Applications
- Published
- 2026-07-28
- DOI
- https://doi.org/10.1515/mcma-2026-3010
- Primary Topic
- Cryptography and Residue Arithmetic
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Japan Society for the Promotion of Science