LAMMPS
Overview
LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) is a classical molecular dynamics code and has potentials for soft materials (biomolecules, polymers) and solid-state materials (metals, semiconductors) and coarse-grained or mesoscopic systems. It can be used to model atoms or, more generically, as a parallel particle simulator at the atomic, meso, or continuum scale.
Several versions are installed on the CSF:
- Version 29-Aug-24 (CPU and GPU builds with PLUMED, many additional packages, python interface and JPEG/PNG support)
- Version 02-Aug-23 (CPU and GPU builds with PLUMED, many additional packages, python interface and JPEG/PNG support)
- Version 29-Sep-21 (CPU and GPU builds with PLUMED, many additional packages and user reaxc, python interface and JPEG/PNG support)
- Version 29-Oct-20 (CPU and GPU builds with PLUMED, many additional packages and user reaxc, python interface and JPEG/PNG support)
- Version 03-Oct-20 (CPU and GPU builds with PLUMED, many additional packages and user reaxc, python interface and JPEG/PNG support)
- Version 22-Aug-18 (CPU and GPU builds with PLUMED, many additional packages and user reaxc, python interface and JPEG/PNG support)
- Version 11-Aug-17 (CPU and GPU builds with PLUMED, many additional packages and user reaxc, python interface and JPEG/PNG support)
- Version 30-Jul-16 (CPU and GPU builds with many additional packages and user reaxc, python interface and JPEG/PNG support)
Version 29-Aug-24 has been built with the gcc compiler with fftw3 providing the FFT implementation. All versions prior to Version 29-Aug-24 have been compiled with the Intel compiler suite with multiple code paths allowing optimised usage on Ivybridge, Broadwell, Haswell and Skylake hardware if available. Intel MKL provides the FFT implementation.
For the 29.08.24 CPU/GPU build the following packages are included: ASPHERE BOCS BODY BROWNIAN CG-DNA CLASS2 COLLOID COLVARS COMPRESS CORESHELL
DIELECTRIC DIFFRACTION DIPOLE DPD-BASIC DPD-MESO DPD-REACT DPD-SMOOTH DRUDE EFF EXTRA-COMPUTE EXTRA-FIX EXTRA-MOLECULE EXTRA-PAIR FEP GRANULAR INTERLAYER KIM KSPACE MACHDYN MANYBODY MC MDI MEAM MESONT MISC ML-PACE ML-SNAP MOFFF MOLECULE MOLFILE NETCDF OPENMP OPT ORIENT PERI PHONON PLUGIN PLUMED POEMS PTM PYTHON QEQ REACTION REAXFF REPLICA RIGID SCAFACOS SHOCK SPH SPIN SRD TALLY UEF VORONOI YAFF
For the 02.08.23 CPU/GPU build the following packages are included: ASPHERE BOCS BODY BROWNIAN CG-DNA CLASS2 COLLOID COLVARS COMPRESS CORESHELL
DIELECTRIC DIFFRACTION DIPOLE DPD-BASIC DPD-MESO DPD-REACT DPD-SMOOTH DRUDE EFF EXTRA-COMPUTE EXTRA-FIX EXTRA-MOLECULE EXTRA-PAIR FEP GRANULAR INTERLAYER KIM KSPACE MACHDYN MANYBODY MC MDI MEAM MESONT MISC ML-PACE ML-SNAP MOFFF MOLECULE OPENMP OPT ORIENT PERI PHONON PLUGIN PLUMED POEMS PTM PYTHON QEQ REACTION REAXFF REPLICA RIGID SCAFACOS SHOCK SPH SPIN SRD TALLY UEF VORONOI YAFF
For the 29.09.21 CPU build the following packages are included: ASPHERE, BODY, CLASS2, COLLOID, COMPRESS, CORESHELL, DIPOLE, GRANULAR, KIM, KOKKOS, KSPACE, MANYBODY, MC, MESSAGE, MISC, MLIAP, MOLECULE, MPIIO, OPT, PERI, POEMS, PYTHON, QEQ, REPLICA, RIGID, SHOCK, SNAP, SPIN, SRD, USER-ATC, USER-AWPMD, USER-BOCS, USER-CGDNA, USER-CGSDK, USER-COLVARS, USER-DIFFRACTION, USER-DPD, USER-DRUDE, USER-EFF, USER-FEP, USER-INTEL, USER-LB, USER-MANIFOLD, USER-MEAMC, USER-MESODPD, USER-MESONT, USER-MGPT, USER-MISC, USER-MOFFF, USER-MOLFILE, USER-OMP, USER-PHONON, USER-PLUMED, USER-PTM, USER-QMMM, USER-QTB, USER-REACTION, USER-REAXC, USER-SCAFACOS, USER-SDPD, USER-SMD, USER-SMTBQ, USER-SPH, USER-TALLY, USER-UEF, USER-YAFF, VORONOI. In addition the GPU builds have the package GPU.
For the 29.10.20 CPU build the following packages are included: ASPHERE, BODY, CLASS2, COLLOID, COMPRESS, CORESHELL, DIPOLE, GRANULAR, KIM, KOKKOS, KSPACE, MANYBODY, MC, MESSAGE, MISC, MLIAP, MOLECULE, MPIIO, OPT, PERI, POEMS, PYTHON, QEQ, REPLICA, RIGID, SHOCK, SNAP, SPIN, SRD, USER-ATC, USER-AWPMD, USER-BOCS, USER-CGDNA, USER-CGSDK, USER-COLVARS, USER-DIFFRACTION, USER-DPD, USER-DRUDE, USER-EFF, USER-FEP, USER-INTEL, USER-LB, USER-MANIFOLD, USER-MEAMC, USER-MESODPD, USER-MESONT, USER-MGPT, USER-MISC, USER-MOFFF, USER-MOLFILE, USER-OMP, USER-PHONON, USER-PLUMED, USER-PTM, USER-QMMM, USER-QTB, USER-REACTION, USER-REAXC, USER-SCAFACOS, USER-SDPD, USER-SMD, USER-SMTBQ, USER-SPH, USER-TALLY, USER-UEF, USER-YAFF, VORONOI. In addition the GPU builds have the package GPU.
For the 22.08.18 CPU build the following standard packages are included: ASPHERE, BODY, CLASS2, COLLOID, COMPRESS, CORESHELL, DIPOLE, GRANULAR, KIM, KSPACE, MANYBODY, MC, MEAM, MISC, MOLECULE, MPIIO, OPT, PERI, POEMS, PYTHON, QEQ, REAX, REPLICA, RIGID, SHOCK, SNAP, SPIN, SRD, VORONOI, USER-COLVARS, USER-DPD, USER-MISC, USER-REAXC. In addition the GPU builds have the package GPU.
For the 11.08.17 CPU build the following standard packages are included: ASPHERE, BODY, CLASS2, COLLOID, COMPRESS, CORESHELL, DIPOLE, GRANULAR, KIM, KSPACE, MANYBODY, MC, MEAM, MISC, MOLECULE, MPIIO, OPT, PERI, POEMS, PYTHON, QEQ, REAX, REPLICA, RIGID, SHOCK, SNAP, SRD, VORONOI, USER-COLVARS, USER-DPD, USER-REAXC. In addition the GPU builds have the package GPU.
For the 30.07.16 CPU build ASPHERE, BODY, CLASS2, COLLOID, COMPRESS, CORESHELL, DIPOLE, GRANULAR, KIM, KSPACE, MANYBODY, MC, MEAM, MISC, MOLECULE, MPIIO, OPT, PERI, POEMS, PYTHON, QEQ, REAX, REPLICA, RIGID, SHOCK, SNAP, SRD, VORONOI, USER-COLVARS, USER-DPD, USER-REAXC. In addition the GPU builds have the package GPU.
If you require additional user packages please contact us.
GPU builds are available in single precision, double precision and mixed precision versions (where mixed precision means Accumulation of forces, etc. in double). Please see $LAMMPS_HOME/lib/gpu/README for more information about the build procedure.
Various tools have been compiled for pre and post processing: binary2txt, restart2data, chain, micelle2d, data2xmovie
Restrictions on use
There are no restrictions on accessing LAMMPS. It is distributed as an open source code under the terms of the GPL.
Set up procedure
To access the software you must first load the modulefile.
module load modulefile
where modulefile is replaced with the relevant module file as listed below.
NOTE we now recommend loading the module file in your batch script.
- CPU and CPU+GPU – choose only one
module loadcommand from the following:# v29.08.24 - MPI with additional lammps packages and python. module load apps/gcc/lammps/29.08.24-packs-user # v02.08.23 - MPI with additional lammps packages and python. module load apps/intel-19.1/lammps/02.08.23-packs-user # v29.09.21 - MPI with additional lammps packages and python. module load apps/intel-19.1/lammps/29.09.21-packs-user # v29.10.20 - MPI with additional lammps packages and python. module load apps/intel-18.0/lammps/29.10.20-packs-user # v03.03.20 - MPI with additional lammps packages and python. module load apps/intel-18.0/lammps/03.03.20-packs-user # v22.08.18 with PLUMED - MPI with Plumed and additional lammps packages and python. module load apps/intel-17.0/lammps/22.08.18-packs-user-python-plumed # v22.08.18 - MPI with additional lammps packages and python. module load apps/intel-17.0/lammps/22.08.18-packs-user-python-plumed # v11.08.17 with PLUMED - MPI with Plumed and additional lammps packages and python. module load apps/intel-17.0/lammps/11.08.17-packs-user-python-plumed # v11.08.17 - MPI with additional lammps packages and python. module load apps/intel-17.0/lammps/11.08.17-packs-user-python # v30.07.16 - MPI with additional lammps packages and python. module load apps/intel-17.0/lammps/30.07.16-packs-user-python
Running the application
Please do not run LAMMPS on the login node. Jobs should be submitted to the compute nodes via batch. The GPU version must be submitted to a GPU node – it will not run otherwise.
Note also that LAMMPS may produce very large files (particularly the trajectory file ending in .trj and the potentials file ending in .pot). Hence you must run from your scratch directory. This will prevent your job filling up the home area. If you do not need certain files in your results, please turn off writing of the specific files in your control file (e.g., lmp_control) or delete them in your jobscript using:
rm -f *.trj rm -f *.pot
Serial CPU batch job submission
LAMMPS can be run in parallel but you can run the pre/post processing tools in serial. Create a batch submission script which loads the most appropriate LAMMPS modulefile, for example:
#!/bin/bash --login #SBATCH -p serial # Partition of nodes for serial (1-core) jobs #SBATCH -n 1 # Number of cores (optional, serial jobs are always 1 core) #SBATCH -t 2-0 # Wallclock timelimit (2-0 is 2 day, max permitted is 7-0) module purge module load apps/intel-17.0/lammps/22.08.18-packs-user-python lmp_linux -in infile # Optional: delete any unwanted output files that may be huge rm -f *.trj
Submit the jobscript using:
sbatch scriptname
Single-node Parallel CPU batch job submission: 2 to 40 cores
The following jobscript will run LAMMPS with 24 cores on a single node
#!/bin/bash --login #SBATCH -p multicore_small # Intel CPUs for jobs 2--40 cores #SBATCH -n 24 # Number of cores #SBATCH -t 2-0 # Wallclock timelimit (2-0 is 2 days, max permitted is 7-0) module purge module load apps/intel-17.0/lammps/22.08.18-packs-user-python mpirun -n $SLURM_NTASKS lmp_linux -in infile
Submit the jobscript using:
sbatch scriptname
Single-node Parallel CPU batch job submission: 2 to 168 cores
The following jobscript will run LAMMPS with 84 cores on a single AMD “Genoa” compute node. These nodes are recommended for larger multicore jobs. If you are running lots of small multicore jobs, the multicore_small partition may provide shorter queue times.
#!/bin/bash --login #SBATCH -p multicore # AMD CPUs for jobs 2--168 cores #SBATCH -n 24 # Number of cores #SBATCH -t 2-0 # Wallclock timelimit (2-0 is 2 days, max permitted is 7-0) module purge module load apps/intel-17.0/lammps/22.08.18-packs-user-python mpirun -n $SLURM_NTASKS lmp_linux -in infile
Submit the jobscript using:
sbatch scriptname
Multi-node Parallel CPU batch job submission
These jobs must be 80 cores or more in multiples of 40 when running in the mutlinode partition.
The following jobscript will run LAMMPS:
#!/bin/bash --login #SBATCH -p multinode # Partition - contains 40-core Intel nodes #SBATCH -N 4 # Number of compute nodes (required!) #SBATCH -n 160 # Total number of cores for MPI processes (4x40 in this case) #SBATCH -t 2-0 # Wallclock timelimit (2-0 is 2 days, max permitted is 7-0). module purge module load apps/intel-17.0/lammps/22.08.18-packs-user-python mpirun -n $SLURM_NTASKS lmp_linux -in infile
Submit the jobscript using:
sbatch scriptname
Running on a single GPU
You need to request being added to the relevant group to access GPUs before you can run LAMMPS on them.
The CUDA kernel precision (single, double, mixed) is determined by the name of the executable you use in the jobscript. The executables are named:
lmp_linux_gpu_singlelmp_linux_gpu_doublelmp_linux_gpu_mixed
Create a jobscript similar to:
#!/bin/bash --login ### Choose ONE of the following partitions: #SBATCH -p gpuA # Nvidia A100(80GB vRAM) - provides double-precision support #SBATCH -p gpuL # Nvidia L40S(40GB vRAM) - Provides faster single-precision support ### #SBATCH -G 1 # Number of GPUs (1-4) #SBATCH -n 1 # Number of cores for MPI tasks - must match number of GPUs #SBATCH -c 8 # Number of cores per MPI tasks - increase host-RAM available to job #SBATCH -t 2-0 # Wallclock timelimit (2-0 is 2 days, max permitted is 4-0) module purge module load apps/intel-17.0/lammps/22.08.18-packs-user-python ## The LAMMPS arg '-pk gpu ${SLURM_GPUS}' tells lammps how many GPUs we are using. ## See $LAMMPS_HOME/bench/GPU/bench.in.gpu for the input file. lmp_linux_gpu_double -sf gpu -nc -pk gpu ${SLURM_GPUS} -in bench.in.gpu
Submit the jobscript using:
sbatch scriptname
Running on several GPUs
The CUDA kernel precision (single, double, mixed) is determined by the name of the executable you use in the jobscript. The executables are named:
lmp_linux_gpu_singlelmp_linux_gpu_doublelmp_linux_gpu_mixed
For example, to run the mixed precision job on 2 GPUs and 1 CPU on the CSF v100 nodes:
Create a jobscript similar to:
#!/bin/bash --login ### Choose ONE of the following partitions: #SBATCH -p gpuA # Nvidia A100(80GB vRAM) - provides double-precision support #SBATCH -p gpuL # Nvidia L40S(40GB vRAM) - Provides faster single-precision support ### #SBATCH -G 4 # Number of GPUs (1-4) #SBATCH -n 4 # Number of cores for MPI tasks - must match number of GPUs #SBATCH -c 8 # Number of cores per MPI tasks - increase host-RAM available to job #SBATCH -t 2-0 # Wallclock timelimit (2-0 is 2 days, max permitted is 4-0) module purge module load apps/intel-17.0/lammps/22.08.18-packs-user-python ## The LAMMPS arg '-pk gpu ${SLURM_GPUS}' tells lammps how many GPUs we are using. ## See $LAMMPS_HOME/bench/GPU/bench.in.gpu for the input file. lmp_linux_gpu_mixed -sf gpu -nc -pk gpu ${SLURM_GPUS} -in bench.in.gpu
Submit the jobscript using:
sbatch scriptname
Further info
- LAMMPS website
Updates
None
