Skip to Content

LAMMPS

A. Description

LAMMPS is a classical molecular dynamics code. It can be applied to metals, semiconductors, biomolecules, polymers in all-atom or coarse-grained models. The source code is distributed under the terms of GPL by Sandia National Laboratories. See LAMMPS home page http://lammps.sandia.gov/ for additional information.

B. How to download LAMMPS

There are several different mechanisms to download LAMMPS. See complete instructions for downloading the code. You can download a recent stable version from the LAMMPS github repository https://github.com/lammps/lammps using wget. For example, the October, 2020 stable release can be obtained by running 

wget https://github.com/lammps/lammps/archive/stable_29Oct2020.zip

C. How to build LAMMPS

On Blue Waters, LAMMPS can be built under the GNU environment. Building under other compiler environments may be possible. Please contact help+bw@ncsa.illinois.edu if you need to use another environment.

C.1 Building under GNU environment

module swap PrgEnv-cray PrgEnv-gnu
module add fftw
module add cmake/3.17.3
mkdir ~/lammps
cd ~/lammps
wget https://github.com/lammps/lammps/archive/stable_29Oct2020.zip
unzip stable_29Oct2020.zip
cd lammps-stable_29Oct2020
mkdir build
cd build
cmake -D CMAKE_CXX_COMPILER=CC -D CMAKE_C_COMPILER=cc -D CMAKE_Fortran_COMPILER=ftn \
-D CMAKE_INSTALL_PREFIX=$HOME/lammps -D PKG_MOLECULE=yes ../cmake 
make
make install

D. Sample test

LAMMPS comes with an extensive suit of tests. To make sure that the compiled code works, we wil run one of the supplied tests.

cd ../examples/micelle

Create run.pbs file having the following content:

#!/bin/bash
#PBS -l nodes=1:ppn=32:xe
#PBS -l walltime=00:05:00
#PBS -q debug
cd $PBS_O_WORKDIR
export OMP_NUM_THREADS=8
aprun -n 4 -N 4 -d 8 $HOME/lammps/bin/lmp -in in.micelle -log job.out -screen none

Submit the job

qsub run.pbs

Open the file job.out with text editor and make sure that line "Loop time of 0.121433 on 4 procs for 1000 steps with 1200 atoms" is present near the end of the file. It indicates that the job performed 1,000 dynamics steps on 4 processors. Timing of 0.121433 will be different on different machines and may somewhat vary from run to run, which is normal.