LAMMPS
LAMMPS (large-scale atomic/molecular massively parallel simulator) is a classical molecular dynamics code developed by Sandia Laboratories in the United States. LAMMPS includes potentials for solid-state materials (metals, semiconductors), soft matter (biomolecules, polymers) and coarse-grained or mesoscopic systems. It can be used to model atoms or, more generically, as a parallel particle simulator at the atomic scale, mesoscale, or continuum scale.
Useful Links
Using LAMMPS on Cirrus
LAMMPS is Open Source software, and is freely available to all Cirrus users. Centrally installed versions are managed by Spack on Cirrus.
To see what versions are available:
$ module avail lammps
...
lammps/20250612
Optional LAMMPS packages
The centrally installed module versions of LAMMPS have a limited standand set of packages compiled. For the full configuration, try
$ module load lammps
$ lmp -h
...
Installed packages:
AMOEBA ASPHERE BOCS BODY BPM BROWNIAN CG-DNA CG-SPICA CLASS2 COLLOID COLVARS
COMPRESS CORESHELL DIELECTRIC DIFFRACTION DIPOLE DPD-BASIC DPD-MESO DPD-REACT
DPD-SMOOTH DRUDE EFF ELECTRODE EXTRA-COMMAND EXTRA-COMPUTE EXTRA-DUMP
EXTRA-FIX EXTRA-MOLECULE EXTRA-PAIR FEP GRANULAR INTERLAYER KSPACE LEPTON
MACHDYN MANYBODY MC MEAM MESONT MISC ML-IAP ML-POD ML-SNAP ML-UF3 MOFFF
MOLECULE OPT ORIENT PERI PHONON PLUGIN QEQ REACTION REAXFF REPLICA RHEO RIGID
SHOCK SPH SPIN SRD TALLY UEF VORONOI YAFF
...
Running parallel LAMMPS jobs (MPI)
LAMMPS scales well for appropriate problem sizes and can make use of more than one node. For example, the following script will run a LAMMPS job using 2 nodes (576 cores) with MPI in the Cray programming environment.
Exclusive SLURM job submission script for LAMMPS
#!/bin/bash
#SBATCH --export=none
#SBATCH --time=00:20:00
#SBATCH --nodes=2
#SBATCH --exclusive
#SBATCH --partition=standard
#SBATCH --qos=standard
#SBATCH --distribution=block:block
#SBATCH --hint=nomultithread
module load lammps
srun --ntasks=576 --ntasks-per-node=288 --cpus-per-task=1 lmp < in.test
#SBATCH --account=budget-code
budget-code is needed.
Non-exclusive jobs
Smaller problem sizes, requiring less than 288 cores (a full node), may be run in non-exclusive mode. Such a job might require only 36 MPI tasks.
Non-exclusive SLURM submission script for LAMMPS
#!/bin/bash
#SBATCH --export=none
#SBATCH --time=00:20:00
#SBATCH --ntasks=36
#SBATCH --cpus-per-task=1
#SBATCH --partition=standard
#SBATCH --qos=standard
#SBATCH --distribution=block:block
#SBATCH --hint=nomultithread
module load PrgEnv-cray
module load lammps
srun lmp < in.test
--cpus-per-task=1). Again,
a valid budget code may be required (see the previous example).
Compiling LAMMPS on Cirrus
LAMMPS supports a significant number of optional standard packages, and also provides a further large selection of unsupported ("USER") packages. If one or more of these are required, and not provided by the central installation, a separation compilation will be required.
Using Spack
LAMMPS may be installed using Spack. For information on availability:
$ module load spack
$ spack info lammps
Using CMake
LAMMPS offers developers a relatively simple and robust build mechanism using CMake.
Central install is equivalent to most.cmake
The central install of LAMMPS on Cirrus has been built with the same
packages enabled as you would get from using most.cmake.
A standard LAMMPS CMake configuration for "most" packages might look like, schematically:
module load PrgEnv-cray
module load cray-fftw
module load cray-python
cmake -C ../cmake/presets/most.cmake \
-D BUILD_MPI=on \
-D BUILD_SHARED_LIBS=yes \
-D CMAKE_CXX_COMPILER=CC \
-D CMAKE_CXX_FLAGS="-O2" \
-D CMAKE_Fortran_COMPILER=ftn \
-D CMAKE_INSTALL_PREFIX=${prefix} \
../cmake/
${prefix} environment variable is used to specify the location
of the installation. See
Build LAMMPS with CMake for
further information.