LAMMPS
LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel Simulator and is copywrited by Sandia (DOE). See the On-line Manual for LAMMPS documentation, which is linked below. Here we give instructions how to run it on the CPUs and GPUs with the staff supported version on the Hazel HPC. Also given are instructions for users to install their own version.External Links:
LAMMPS website
LAMMPS Tutorials
LAMMPS benchmarks
Typically, it's not a good idea to run lammps from your /home directory, as its output can easily overflow your quota.
The current staff-supported version is 22Jul2025 (stable_22Jul2025_update4), compiled with PrgEnv-intel/2025.3-slurm and cuda/12.0. The binary is named lmp_hazel, installed at /usr/local/apps/lammps/22Jul2025/intel/gpu/bin/lmp_hazel.
The modulefiles are:
module avail lammps/22Jul2025
They are:
lammps/22Jul2025/intel/gpu-slurm (for GPU nodes)
lammps/22Jul2025/intel/cpu-slurm (for CPU nodes)
Previous version (2024Aug29):
CPU only, no GPU support. This version predates the Slurm-integrated compiler stack.
Older versions (2022Jun23):
These are the previous GPU-capable staff-supported builds. Prior to the 22Jul2025 build, these were the only staff-supported versions with GPU acceleration.
Modulefiles:
- lammps/2022Jun23/intel/gpu (recommended — Intel compiler, GPU nodes)
- lammps/2022Jun23/intel/cpu (Intel compiler, CPU nodes)
- lammps/2022Jun23/gnu/gpu (GNU compiler, GPU nodes)
- lammps/2022Jun23/gnu/cpu (GNU compiler, CPU nodes)
Earlier versions (29Sep21u3, 7Aug19, 22Aug2018) are no longer supported.
Table of Contents - Select for a Particular Topic
To test LAMMPS on the 22Jul2025 version for GPUs (interactively) do
salloc --ntasks=16 --nodes=1 --time=00:05:00 \ --partition=gpu_partners --qos=short_gpu --gres=gpu:a30:2 module load lammps/22Jul2025/intel/gpu-slurm srun lmp_hazel -sf gpu -in \ /usr/local/apps/lammps/22Jul2025/intel/gpu/share/lammps/bench/in.lj
To test LAMMPS 22Jul2025 for GPUs in batch mode, create "lammps_gpu_benchmark_slurm.sh" with the following lines:
#!/bin/bash #SBATCH --ntasks=16 #SBATCH --nodes=1 #SBATCH --time=00:05:00 #SBATCH --partition=gpu_partners #SBATCH --qos=short_gpu #SBATCH --gres=gpu:a30:2 #SBATCH --output=out.%j #SBATCH --error=err.%j module load lammps/22Jul2025/intel/gpu-slurm srun lmp_hazel -sf gpu -in /usr/local/apps/lammps/22Jul2025/intel/gpu/share/lammps/bench/in.ljand run it with:
sbatch lammps_gpu_benchmark_slurm.sh
Note: use --qos=short_gpu alongside --partition=gpu_partners for GPU jobs. Available GPU types can be checked with:
sinfo -o "%N %G %t" -p gpu_partners | grep idle
How to select a specific GPU:
- sinfo -o "%N %G %t" -p gpu_partners | grep idle This shows the node name, GPU type/count, and state for idle nodes. Example output:
gpu[05-06] gpu:a30:2 idle gpu13 gpu:a100:4 idleUse the GPU type from the second column in your --gres flag. For example, to select the A30 GPU, use
--gres=gpu:a30:2
To use any of the older gpus (the RTX2080 or the GTX1080), use:
--gres=gpu:rtx2080:2 or --gres=gpu:gtx1080:2
To use the P100 GPU for applications that require double precision (eg. ab-initio applications), use:
--gres=gpu:p100:2
Most of the GPU nodes have 2 GPUs per node, but the rtx2080 has 4.
--nodelist=c041n01
--exclude=c014n01
salloc --ntasks=16 --nodes=1 --time=00:10:00 \ --partition=compute_partners --qos=short --constraint=cascadelake module load lammps/22Jul2025/intel/cpu-slurm srun lmp_hazel -in \ /usr/local/apps/lammps/22Jul2025/intel/gpu/share/lammps/bench/in.ljTo do the same thing in batch mode, create "parallel_cpu_slurm.sh" with the following lines:
#!/bin/bash #SBATCH --ntasks=16 #SBATCH --nodes=1 #SBATCH --time=00:10:00 #SBATCH --partition=compute_partners #SBATCH --qos=short #SBATCH --constraint=cascadelake #SBATCH --output=out.%j #SBATCH --error=err.%j module load lammps/22Jul2025/intel/cpu-slurm srun lmp_hazel -in /usr/local/apps/lammps/22Jul2025/intel/gpu/share/lammps/bench/in.ljRun this batch job with:
sbatch parallel_cpu_slurm.sh
Here is the link to the Hazel benchmarks.
lj model, cascadelake CPU node, 1 MPI rank (serial):
Performance: 1809.691 tau/day, 4.189 timesteps/s
lj model, cascadelake CPU node, 16 MPI ranks (parallel):
Performance: 26643.269 tau/day, 61.674 timesteps/s
lj model, A30 2x GPU node, 16 MPI ranks:
Performance: 141252.926 tau/day, 326.974 timesteps/s
Users are encouraged to install and maintain their own version of LAMMPS in:
/usr/local/usrapps/projectidWhere "projectid" is a directory name given to the project by the HPC administrator (a request must be made). The following instructions describe how to compile LAMMPS from source using the stable branch. You can choose which packages to include at the CMake configuration step.
Step 1 — Get the source
git clone -b stable https://github.com/lammps/lammps.git src cd src && git describe --tags
Step 2 — Load the build environment
module purge module load PrgEnv-intel/2025.3-slurm module load cuda/12.0 which mpiicx mpiicpx mpiifx nvcc g++ # all must resolve before continuing
Step 3 — Configure with CMake
Choose your packages with-D PKG_<NAME>=yes:
mkdir build && cd build cmake \ -D CMAKE_INSTALL_PREFIX=/usr/local/usrapps/[your_path]/lammps \ -D CMAKE_BUILD_TYPE=Release \ -D BUILD_MPI=yes -D BUILD_OMP=yes \ -D CMAKE_C_COMPILER=$(which mpiicx) \ -D CMAKE_CXX_COMPILER=$(which mpiicpx) \ -D CMAKE_Fortran_COMPILER=$(which mpiifx) \ -D CMAKE_CUDA_HOST_COMPILER=$(which g++) \ -D CMAKE_CXX_FLAGS="-march=native" \ -D CMAKE_C_FLAGS="-march=native" \ -D LAMMPS_MACHINE=[your_machine_name] \ -D FFT=MKL \ -D PKG_GPU=yes -D GPU_API=cuda \ -D GPU_ARCH="sm_61;sm_75;sm_80;sm_86;sm_89;sm_90" \ -D GPU_PREC=mixed \ -D PKG_INTEL=yes \ -D PKG_OPENMP=yes \ -D PKG_KSPACE=yes \ -D PKG_MOLECULE=yes \ -D PKG_MANYBODY=yes \ -D PKG_RIGID=yes \ # add or remove -D PKG_<NAME>=yes lines for any other packages you need # full list of available packages: https://docs.lammps.org/Packages_list.html ../cmakeAfter cmake runs, check the summary output to confirm your packages are listed under "Enabled packages" before building.
Step 4 — Build and install
make -j 8 make install
Note: Build in /tmp rather than your install directory to avoid hitting inode quotas on /usr/local. Delete the build tree after installation with rm -rf /tmp/your-build-dir.
The following alternative installation methods (conda and makefile) are preserved for reference and will be re-validated in a future update.
As of 22Jul2025 (stable_22Jul2025_update4), compiled with PrgEnv-intel/2025.3-slurm and cuda/12.0:
GPU, INTEL, KSPACE, MANYBODY, MOLECULE, OPENMP, RIGID
Last modified: July 01 2026 10:44:32.