Making the RANMAR pseudorandom number generator in LAMMPS up to four times faster, with an implementation of jump-ahead
Fuente:
arXiv
Gespeichert in:
| Hauptverfasser: | , |
|---|---|
| Format: | Preprint |
| Veröffentlicht: |
2025
|
| Schlagworte: | |
| Online-Zugang: | |
| Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
| _version_ | 1866909933397606400 |
|---|---|
| author | Haramoto, Hiroshi Suzuki, Kosuke |
| author_facet | Haramoto, Hiroshi Suzuki, Kosuke |
| contents | 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. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2512_00093 |
| institution | arXiv |
| publishDate | 2025 |
| record_format | arxiv |
| spellingShingle | Making the RANMAR pseudorandom number generator in LAMMPS up to four times faster, with an implementation of jump-ahead Haramoto, Hiroshi Suzuki, Kosuke Mathematical Software 11K45, 13P25 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. |
| title | Making the RANMAR pseudorandom number generator in LAMMPS up to four times faster, with an implementation of jump-ahead |
| topic | Mathematical Software 11K45, 13P25 |
| url | https://arxiv.org/abs/2512.00093 |