Skip to content
This repository was archived by the owner on Jun 17, 2026. It is now read-only.

Latest commit

 

History

History
71 lines (44 loc) · 4.21 KB

File metadata and controls

71 lines (44 loc) · 4.21 KB

neorand

Version: v0.6.56 (Archived Snapshot, 2019)

High-performance quasi-random number generator utilizing NVIDIA CUDA and cuRAND.

⚠️ Disclaimer

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.

Features (circa 2019)

  • Generates pseudo-random doubles using cuRAND for 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).

📊 Statistical Validation

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).

📜 Оригинальная документация (2019)

Приложение разработано для ускорения генерации квази-рандомизированных чисел. Для генерации чисел приложение использует унифицированные шейдерные блоки. За генерацию отвечает библиотека cuRAND.

Для получения числа необходимо задать как минимум два аргумента: количество SM-блоков для данной операции, а также количество потоков. Стоит обратить внимание на то, что каждый GPU имеет аппаратное ограничение для каждого из двух вышеперечисленных аргументов, в связи с чем необходимо ознакомиться с технической документацией предоставленного оборудования перед началом работы.

Список аргументов командной строки:

Аргумент Описание
-b [число] / --blocks [число] Количество SM-блоков
-t [число] / --threads [число] Количество потоков
-h / --help Справка по работе с приложением
-v / --version Версия приложения
-i / --info Конфигурация устройства

🛠 How to build (Linux)

# 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 256

📄 License

This project is licensed under the MIT License - see the copyright header in kernel.cu for details.