Skip to content

Repository files navigation

gRASPA

gRASPA (pronounced “gee raspa”) is a GPU-accelerated Monte Carlo simulation software built for molecular adsorption in nanoporous materials, such as zeolites and metal-organic frameworks (MOFs).

Table of Code Capabilities (👇Click!)

Functionalities gRASPA gRASPA-fast gRASPA-HTC
Simulation Types
Canonical Monte Carlo
(NVT-MC)
✔️ ✔️ ✔️
Grand Canonical Monte Carlo
(GCMC)
✔️ ✔️ ✔️
Transition-Matrix Monte Carlo
in grand canonical ensemble
(GC-TMMC)
✔️ ✔️
Mixture Adsorption via GCMC ✔️
NVT-Gibbs MC ✔️ ✔️
Interactions
Lennard-Jones (12-6) ✔️ ✔️ ✔️
Short-Range Coulomb ✔️ ✔️ ✔️
Long-Range Coulomb: Ewald Summation ✔️ ✔️ ✔️
Analytical Tail Correction ✔️ ✔️
Machine-Learning Potential
(via LibTorch and cppFlow)
✔️
Moves
Translation/Rotation ✔️ ✔️ ✔️
Configurational-Bias Monte Carlo (CBMC) ✔️ ✔️
Widom test particle insertion ✔️ ✔️
Insertion/Deletion
(without CBMC)
✔️ ✔️ ✔️
Insertion/Deletion
(with CBMC)
✔️ ✔️
Identity Swap ✔️
NVT-Gibbs volume change move ✔️ ✔️
Gibbs particle transfer ✔️ ✔️
Configurational Bias/
Continuous Fractional Components
(CB/CFC) MC
✔️ ✔️
Extra Functionalities
Write: LAMMPS data file ✔️ ✔️ ✔️
Read: LAMMPS data file ✔️
Write: Restart files
(Compatible with RASPA-2)
✔️ ✔️
Read: Restart files ✔️ ✔️
Peng-Robinson Equation of State ✔️
Automatic Determination
of # unit cells
✔️

Installation

Installation in clusters

To install gRASPA on NERSC (DOE) and QUEST (Northwestern) clusters, check out Cluster-Setup

Installation on local machines

A detailed installation note for gRASPA on CentOS/Ubuntu 24.04 is documented in the manual here

Compatible GPUs

  • For NVIDIA GPUs, gRASPA code has been tested on the following NVIDIA GPUs:
    • A40, A100, RTX 3080 Ti, RTX 3090, RTX 4090.
    • 🤯: RTX 3090/4090 is faster than A40/A100 for gRASPA
  • For AMD GPUs, gRASPA builds for ROCm/HIP (see below); tested on MI250X (gfx90a).
  • gRASPA has a SYCL version (experimental) that supports other devices, available in Releases

AMD / ROCm (HIP)

The src_clean/ source tree is dual-platform: under nvc++/nvcc it builds for NVIDIA exactly as before, and under hipcc it builds for AMD GPUs through HIP via the src_clean/gpu_compat.h shim (no separate source tree). Both the classical MC core and the Allegro ML-potential path are supported on ROCm.

cd src_clean && ../HIP_COMPILE          # classical core  -> hip_main.x
# Allegro: run patch.py, then ../libtorch_HIP_COMPILE against ROCm LibTorch

Notes:

  • Both scripts target gfx90a by default; override the GPU with GRASPA_ARCH (e.g. GRASPA_ARCH=gfx942 for MI300X).
  • At runtime AMD builds require HSA_XNACK=1 (the code uses managed memory).
  • libtorch_HIP_COMPILE links ROCm LibTorch (-ltorch_hip -lc10_hip) and sets -D_GLIBCXX_USE_CXX11_ABI=1 (matches PyTorch 2.x wheels); use =0 if you hit std::__cxx11 link errors.
  • Validate against the CUDA reference with the binary-agnostic harness: HSA_XNACK=1 GRASPA_BIN=.../src_clean/hip_main.x python run_designated_folders.py then pytest -s in Examples/.
  • The LCLin/cppflow (TensorFlow) path is CUDA-only and is not available on ROCm.

Pybind Extension (testing)

  • Pybind extension for gRASPA allows user to interact with the internal variables of gRASPA, break down MC moves, add their modifications
  • Access the pybind-gRASPA extension here, as a patch to the original code

AutoJIT-gRASPA (automated GPU optimization)

  • AutoJIT-gRASPA is an automated, agent-driven optimization pipeline that takes a specific simulation (input + force field + framework) and produces a specialized binary that runs ~5–20% faster with bit-for-bit identical results (verified automatically after every change).
  • Three phases: deterministic dead-code stripping → LLM-driven per-kernel micro-optimizations → structural multi-file changes (e.g., CUDA Graph capture, kernel fusion).
  • Access AutoJIT-gRASPA here.

Quick Start

gRASPA Manual

Reference

  • gRASPA paper is now published. Please kindly cite it if you find it useful.
    • Li, Shi, Dubbeldam, Dewing, Knight, Vázquez-Mayagoitia, Snurr, "Efficient Implementation of Monte Carlo Algorithms on Graphical Processing Units for Simulation of Adsorption in Porous Materials", J. Chem. Theory Comput. 2024, 20, 23, 10649–10666
    • DOI: 10.1021/acs.jctc.4c01058
  • Also, please give our repository a ⭐ if our code helps!

Authors