Compiling LAMMPS

This page is for compiling LAMMPS for serial or parallel CPU computing.

Creating the Executable

  1. Obtain the source code following the instructions found here
  2. Navigate to the lammps-DayMonthYear/src directory.
  3. Ensure USER-KNOTTS has been copied to the lammps-DayMonthYear/src directory if doing Go model simulations. See here for more information.
  4. Load the desired compiler and MPI modules if on the supercomputer.
    • Example 1: module load gcc/14.1 openmpi/5.0
    • Example 2: module load gcc openmpi (Load the current default packages for gcc and openmpi.)
    • The version of gcc and openmpi will change as new versions are released.
    • Intel compilers and other MPI implementations could be tried.
  5. Build the colvars package
    • make lib-colvars args="-m mpi"
  6. Specify the additional packages you want (See below for descriptions)
    • Repeat the following command for all desired packages
      • $ make yes-name_of_package
    • Make sure to include the colvars package, but it must be built using the previous step.
  7. Run the makefile needed for your situation using commands such as the following:
    • $ make serial
    • $ make mpi
    • More pre-built makefiles are written in the src/MAKE/ directory. View their README to know when to use.

LAMMPS Packages

The following is a list of custom package commands used when making an executable. For different applications you will used different commands.
For further documentation visit: here.

General

Protein (with CHARMM)

  • $ make yes-rigid
    Import rigid package; This will import the package used for shaking fixes in big or many molecules
  • $ make yes-replica
    Import replica exchange package; This will import the package used for…??
  • $ make yes-molecule
    Import molecule package; This will import the package used for hydrogen bonding and water molecule simulations.
    • Used for all atom simulations???
  • $ make yes-class2
    Import class 2 package ; This will import the package used for Quantum mechanical calculations, typically used in CHARMM.
  • $ make yes-kspace
    This adds "pair_style lj/cut/coul/long", which is used for some of the force fields investigated in this project.
  • $ make yes-extra-dump
    This adds the ability to write dcd files.
  • $ make yes-colvars
    This adds collective variable support needed for many umbrella sampling techniques and any outputs of charmm-gui.
  • $ make yes-user-knotts
    (Optional) Import Knotts Go-model Group package; Included in this package are customizations to LAMMPS needed for the models we run in this group. This package is not default included in a lammps download.
    • Don't use this package if doing all-atom protein simulations.
    • Don't use the GPU package if using user-knotts.

Viscosity (Equilibrium MD)

These are the packages used for Viscosity prediction via EMD simulations.

  • $ make yes-user-misc
    This adds the fourier dihedral style, which is used in some of the force fields investigated in this project.
  • $ make yes-molecule
    This adds "atom_style full", which adds support for atoms with both molecular properties and charges.
  • $ make yes-kspace
    This adds "pair_style lj/cut/coul/long", which is used for some of the force fields investigated in this project.
  • $ make yes-misc
    This adds the "fix viscosity" fix, which is used for RNEMD simulations.

LAMMPS File Descriptions

All following files are within the "~/lammps-latest_release_date/" file

src/

This file contains all the source c++ files used during compilation. Also included are c++ files used for task-specific operations. We use many of these for molecular, course-grain and other corrections. User-made c++ files are typically denoted with the "USER-" tag.
Commonly used directories include:

  • src/MAKE/
This folder contains different make options, including mpi options and icc compiler options.
  • src/MOLECULE/
This c++ code includes corrections for molecular interactions
  • src/RIGID/
I believe this code prevents the molecule from denaturing.
  • src/REPLICA/
This code sets up the replica exchange boxes. Number of boxes and the corresponding temperature are indicated in your .in file.

examples/

This file contains some example input files, executable, and operating conditions for all-atom, course-grain and other simulation types.

bench/

This file contains benchmarking tools.

tools/

Contains various stand-alone conversion scripts and post-processing tools.

python/

Contains Python code which wraps LAMMPS as a library and allows the LAMMPS library interface to be invoked from python. Contains instructions on how to enable this.

src/USER-KNOTTS/

Knotts-Group Additions. All additions to the LAMMPS source code that enable Go-modeling are saved in one location and add additional modifications to generate a proper model appropriate for our research.
Code modifications are as follows:

  • pair_lj_cut_eten.cpp and pair_lj_cut_eten.h
    This code implements the Go-model modified Lennard-Jones interaction potential.
  • dihedral_eten.cpp and dihedral_eten.h
    Resolved issues that arise when doing Go-model dihedral calculations in an mpi replica exchange.
  • fix_hwall.cpp and fix_hwall.h
    This code creates a new type of fix where a surface hydropathy index can be read-in.
  • fix_hwall_hydro.cpp and fix_hwall_hydro.h
    This code implements a Go-model hydrophobically interacting surfaces with amio acids.


Run a Simulation

Before you run a simulation, make the following are in the same directory:

  • The executable: name_of_executable.exe
  • The input file: Input_file_name.in
    • Note you can daisy-chain input files together, but require special commands and is specified in the input file
  • The data file: data_file_name.data (This file is sometimes optional, but frequently used)
  • The submission script: submission_script_name.sbatch