Version: v0.6.56 (Archived Snapshot, 2019)
High-performance quasi-random number generator utilizing NVIDIA CUDA and cuRAND.
This is an archived legacy project from 2019. It was developed to accelerate quasi-random number generation for Monte Carlo simulations during my time at the Skobeltsyn Institute of Nuclear Physics, Moscow State University (SINP MSU).
The code includes hardware profiling specifically tailored for the NVIDIA Tesla P100 (PCIe 12GB, GP100 architecture, 3584 CUDA cores) cluster we were running at the time.
Fun Fact: The logic was heavily tested on a consumer GTX 1080 Ti at home. Since the fully unlocked GP100 (P100) and GP102 (1080 Ti) share the same 3584 FP32 CUDA cores, the consumer card served as a perfect, accessible sandbox for debugging before deploying to the FP64-heavy scientific cluster.
Another Fun Fact: The copyright header in kernel.cu still reads v0.4.2. A classic reminder that updating version strings in every single file was the last priority before the 2019 deadline. The actual compiled release is v0.6.56.
Note: As a legacy v0.6.56 release, it contains known performance anti-patterns by modern standards (such as initializing curandState inside the kernel). It is provided "as-is" for historical and archival purposes.
- Generates pseudo-random doubles using
cuRANDfor scientific computations. - CLI interface with short and long options.
- Built-in GPU architecture info tool (with hardcoded core counts for Fermi, Kepler, Maxwell, Pascal, and Volta).
The generated sequences were empirically validated for Monte Carlo suitability. Test results confirmed:
-
Mean: ≈ 0.50 (Theoretical for
$U(0,1)$ : 0.5) -
Standard Deviation: ≈ 0.288 (Theoretical for
$U(0,1)$ :$\sqrt{1/12} \approx 0.288675$ ) - Pearson Correlation between parallel streams: ≈ 0.0 (Confirming statistical independence of concurrent GPU threads, which is critical for parallel Monte Carlo).
Приложение разработано для ускорения генерации квази-рандомизированных чисел. Для генерации чисел приложение использует унифицированные шейдерные блоки. За генерацию отвечает библиотека cuRAND.
Для получения числа необходимо задать как минимум два аргумента: количество SM-блоков для данной операции, а также количество потоков. Стоит обратить внимание на то, что каждый GPU имеет аппаратное ограничение для каждого из двух вышеперечисленных аргументов, в связи с чем необходимо ознакомиться с технической документацией предоставленного оборудования перед началом работы.
| Аргумент | Описание |
|---|---|
-b [число] / --blocks [число] |
Количество SM-блоков |
-t [число] / --threads [число] |
Количество потоков |
-h / --help |
Справка по работе с приложением |
-v / --version |
Версия приложения |
-i / --info |
Конфигурация устройства |
# Extract the archive
tar -zxvf neorand_v0.6.56.tar.gz
# Compile (requires NVIDIA CUDA Toolkit)
nvcc kernel.cu -o neorand
# Check GPU info
./neorand -i
# Run generation (e.g., 120 blocks, 256 threads per block)
./neorand -b 120 -t 256This project is licensed under the MIT License - see the copyright header in kernel.cu for details.