gRASPA

June 18, 2026 · View on GitHub

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

Tests License

Manual Manual Doxygen

GitHub repo size in bytes Lines STARS

Table of Code Capabilities (👇Click!)

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

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 :star: if our code helps!

Authors