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).
Table of Code Capabilities (👇Click!)
| Functionalities | gRASPA | gRASPA-fast | gRASPA-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
gfx90aby default; override the GPU withGRASPA_ARCH(e.g.GRASPA_ARCH=gfx942for MI300X). - At runtime AMD builds require
HSA_XNACK=1(the code uses managed memory). libtorch_HIP_COMPILElinks ROCm LibTorch (-ltorch_hip -lc10_hip) and sets-D_GLIBCXX_USE_CXX11_ABI=1(matches PyTorch 2.x wheels); use=0if you hitstd::__cxx11link 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.pythenpytest -sinExamples/. - 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
- Go to
Examples/folder and read more!
gRASPA Manual
- gRASPA manual is available online @ https://zhaoli2042.github.io/gRASPA-mkdoc
- also available in Chinese
- a doxygen documentation is also available @ https://zhaoli2042.github.io/gRASPA
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
- Zhao Li (Northwestern University, currently at Purdue University/University of Notre Dame, zhaoli2023@u.northwestern.edu)
- Kaihang Shi (Northwestern University, currently at University at Buffalo, kaihangs@buffalo.edu)
- David Dubbeldam (University of Amsterdam, d.dubbeldam@uva.nl)
- Mark Dewing (Argonne National Laboratory, markdewing@yahoo.com)
- Christopher Knight (Argonne National Laboratory, knightc@anl.gov)
- Alvaro Vazquez Mayagoitia (Argonne National Laboratory, vama@alcf.anl.gov)
- Randall Q. Snurr (Northwestern University, snurr@northwestern.edu)