LAMMPS - 22Aug2018

Basic information

Tested on (Requirements)

  • OS base: CentOS (x86_64) \(\boldsymbol{\ge}\) 6.6 (Rocks 6.2)
  • Compiler: Intel MPI Library \(\boldsymbol{\ge}\) 17.0.1
  • Math Library: Intel MKL \(\boldsymbol{\ge}\) 17.0.1

Installation

The following procedure will compile LAMMPS as an executable, using the Intel MPI implementation and MKL as the Linear Algebra Library.

  1. Load the necessary modules for compiling LAMMPS

    $ module load impi
    $ module load mkl
    $ module load python/3.x.x
    

    Note

    The installation script requires Python \(\boldsymbol{\ge}\) 3.0

  2. Download and compile the desired packages before compiling lammps.

    The flag yes-all activates the compilation of all the packages. However, some lammps packages require external libraries and additional configuration procedures.

    After executing yes-all, these packages that require additional configuration procedures can be disabled executing make no-lib.

    These make options (yes-all, no-lib) are used to reproduce the list of packages present in LAMMPS Ubuntu prebuild version. For more information read [1].

    $ git clone -b stable_22Aug2018 https://github.com/lammps/lammps.git
    $ cd lammps/src
    $ make yes-all     # install all pkgs in src dir
    $ make no-lib      # remove all pkgs with libs
    
  3. To check which packages are going to be installed, execute:

    $ make ps
    
  4. If you want to install an additional package, read the specific procedure in [2].

    After following the procedure described in the page, execute:

    $ make yes-<LIB_NAME>
    

    Example for USER_COLVARS

    $ make yes-user-colvars
    

    Verify again executing make ps that you have enabled correctly the installation of the desired packages.

    Warning

    If you have an existing version of LAMMPS and you want to add a new package it’s necessary to recompile LAMMPS.

  5. Compile LAMMPS with it’s packages. This procedure will compile it using the Intel architecture options defined by default in src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi

    $ make intel_cpu_intelmpi
    

    Note

    icpc: command line warning #10006: ignoring unknown option ‘-qopt-zmm-usage=high’

    This message appears when you compile LAMMPS using the intel_cpu_intelmpi architecture but the Intel processor doesn’t have the AVX512 instruction set. If this is the case, just ignore the warning message. For more information about the flag qopt-zmm-usage read [3].

  6. If you want to install LAMMPS in a specific directory, create the directories and copy the binary as follows:

    $ mkdir -p <INSTALL_DIR>/bin
    $ cp lmp_intel_cpu_intelmpi <INSTALL_DIR>/bin/
    $ cd <INSTALL_DIR>/bin/
    $ ln -s lmp_intel_cpu_intelmpi lammps
    

    Note

    For more information about the installation process, read the official page [4].

  7. Finally, if the program will be used with Environment modules, create the respective module.

Alternative Installation modes

  • If you want to compile LAMMPS as a static library called liblammps_machine.a, then execute:

    $ make mode=lib <machine>
    
  • If you want to compile LAMMPS as a shared library called liblammps_machine.so, then execute:

    $ make mode=shlib <machine>
    

Test LAMMPS

After installing LAMMPS, run the benchmarks present in the repository.

$ sbatch example.sh

The following code is an example for running LAMMPS using SLURM:

#!/bin/bash
#SBATCH --job-name=LAMMPS_Bench
#SBATCH --nodes=1
#SBATCH --ntasks=16
#SBATCH --partition=longjobs
#SBATCH --time=01:00:00
#SBATCH -o results_%j.out
#SBATCH -e results_%j.err

export OMP_NUM_THREADS=1

module load lammps

export WDIR=<REPO_DIR>/bench

srun --mpi=pmi2 lammps -in $WDIR/in.lj
srun --mpi=pmi2 lammps -in $WDIR/in.chain
srun --mpi=pmi2 lammps -in $WDIR/in.eam
srun --mpi=pmi2 lammps -in $WDIR/in.chute
srun --mpi=pmi2 lammps -in $WDIR/in.rhodo

Modulefile

Apolo II

#%Module1.0####################################################################
##
## module load lammps/22Aug18_impi-2017_update-1
##
## /share/apps/modules/lammps/22Aug18_impi-2017_update-1
## Written by Andres Felipe Zapata Palacio
##

proc ModulesHelp {} {
     global version modroot
     puts stderr "Sets the environment for using lammps 22Aug18\
		  \nin the shared directory \
		  \n/share/apps/lammps/22Aug18/impi-2017_update-1/\
		  \nbuilded with impi-2017_update-1"
}

module-whatis "(Name________) lammps"
module-whatis "(Version_____) 22Aug18"
module-whatis "(Compilers___) impi-2017_update-1"
module-whatis "(System______) x86_64-redhat-linux"
module-whatis "(Libraries___) mkl-2017_update-1"

# for Tcl script use only
set         topdir        /share/apps/lammps/22Aug18/impi-2017_update-1/
set         version       22Aug18
set         sys           x86_64-redhat-linux

conflict lammps
module load impi/2017_update-1
module load mkl/2017_update-1
 
setenv		LAMMPSROOT		$topdir

prepend-path	PATH			$topdir/bin

Cronos

#%Module1.0####################################################################
##
## module load lammps/22Aug18_impi-18.0.2
##
## /share/apps/modules/lammps/22Aug18_impi-18.0.2
## Written by Andres Felipe Zapata Palacio
##

proc ModulesHelp {} {
     global version modroot
     puts stderr "Sets the environment for using lammps 22Aug18\
		  \nin the shared directory \
		  \n/share/apps/lammps/22Aug18/impi-18.0.2/\
		  \nbuilded with impi-18.0.2"
}

module-whatis "(Name________) lammps"
module-whatis "(Version_____) 22Aug18"
module-whatis "(Compilers___) impi-18.0.2"
module-whatis "(System______) x86_64-redhat-linux"
module-whatis "(Libraries___) mkl-18.0.2"

# for Tcl script use only
set         topdir        /share/apps/lammps/22Aug18/impi-18.0.2/
set         version       22Aug18
set         sys           x86_64-redhat-linux

conflict lammps
module load impi/18.0.2
module load mkl/18.0.2
 
setenv		LAMMPSROOT		$topdir

prepend-path	PATH			$topdir/bin

References

[1]Download an executable for Linux, Pre-built Ubuntu Linux executables -LAMMPS documentation. Retrieved January 17, 2019, from https://lammps.sandia.gov/doc/Install_linux.html#ubuntu
[2]Include packages in build - LAMMPS documentation Retrieved June 10, 2019, from https://lammps.sandia.gov/doc/Build_package.html
[3]Intel® C++ Compiler 19.0 Developer Guide and Reference, qopt-zmm-usage, Qopt-zmm-usage. Retrieved January 17, 2019, from https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-qopt-zmm-usage-qopt-zmm-usage
[4]Download source via Git - LAMMPS documentation. Retrieved January 17, 2019, from https://lammps.sandia.gov/doc/Install_git.html

Authors