LAMMPS
LAMMPS
LAMMPS
Steve Plimpton
Sandia National Labs
sjplimp@sandia.gov
Presentation: SAND2014-2239C
Classical MD in a nutshell
Versatile
bio, materials, mesoscale
atomistic, coarse-grained, continuum
use with other codes, e.g. multiscale models
2
3
Well documented
extensive web site
1300 page manual
Define groups
Set attributes of atoms: mass, velocity
Pair style for atom interactions
Fixes for time integration and constraints
Computes for diagnostics
Output: thermo, dump, restart
Run or minimize
Rinse and repeat (script executed one command at a time)
Thermodynamic output
Look for blow-ups or NaNs, print every step if necessary
WARNING: Temperature for thermo pressure is not
for group all (../thermo.cpp:436)
Setting up run ...
Memory usage per processor = 2.23494 Mbytes
Step Temp E pair E mol TotEng Press Volume
0 1.0004177 0 0 0.68689281 0.46210058 1143.0857
1000 1 -0.32494012 0 0.36166587 1.2240503 1282.5239
2000 1 -0.37815616 0 0.30844982 1.0642877 1312.5691
...
...
...
25000 1 -0.36649381 0 0.32011217 0.98366691 1451.5444
25000 1 -0.38890426 0 0.29770172 0.95284427 1455.9361
Loop time of 1.76555 on 4 procs for
25000 steps with 769 atoms
Timing info
Run statistics
x
x
x
x
x
x
x
x
Moltemplate
Pair styles
Pair styles
Pair styles
Aspherical
gayberne, resquared, line, tri
Pair styles
See doc/Section commands.html for full list
Pair styles
And they come in accelerated flavors: omp, gpu, cuda
Pair styles
See doc/pair style.html for one-line descriptions
Estimate CPU cost for system size & timesteps you need
Assume good parallel scalability if have 1000+ atoms/core
Cost [core-sec/atom-timestep]
10
-2
GAP
-3
10
COMB
ReaxFF
10
-4
AIREBO
MEAM
CHARMm
-5
10
10
eFF
BOP
SPC/E
EIM
REBO
Stillinger-Weber
EAM
Tersoff
-6
1980
1990
2000
Year Published
2010
Verlet lists:
Verlet, Phys Rev, 159, p 98 (1967)
Rneigh = Rforce + skin
build list: once every few timesteps
other timesteps: scan larger list for
neighbors within force cutoff
rebuild: any atom moves 1/2 skin
Link-cells (bins):
Hockney et al, J Comp Phys,
14, p 148 (1974)
grid domain: bins of size Rforce
each step: search 27 bins for
neighbors (or 14 bins)
Long-range Coulombics
KSpace style in LAMMPS lingo, see doc/kspace style.html
Options:
traditional Ewald, scales as O(N 3/2 )
PPPM (like PME), scales as O(N log(N))
MSM, scales as O(N), lj/cut/coul/msm
Additional options:
non-periodic, PPPM (z) vs MSM (xyz)
long-range dispersion (LJ)
Long-range Coulombics
KSpace style in LAMMPS lingo, see doc/kspace style.html
Options:
traditional Ewald, scales as O(N 3/2 )
PPPM (like PME), scales as O(N log(N))
MSM, scales as O(N), lj/cut/coul/msm
Additional options:
non-periodic, PPPM (z) vs MSM (xyz)
long-range dispersion (LJ)
Long-range Coulombics
KSpace style in LAMMPS lingo, see doc/kspace style.html
Options:
traditional Ewald, scales as O(N 3/2 )
PPPM (like PME), scales as O(N log(N))
MSM, scales as O(N), lj/cut/coul/msm
Additional options:
non-periodic, PPPM (z) vs MSM (xyz)
long-range dispersion (LJ)
Good news: Cost of PPPM is only 2x more than 8-10 Ang cutoff
Fixes
Fixes
Fixes
100+ fixes in LAMMPS
You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix
fix
fix
fix
fix
1
2
3
5
6
all nve
flow temp/rescale 200 1.0 1.0 0.02 1.0
lower setforce 0.0 0.0 0.0
upper aveforce 0.0 -0.5 0.0
flow addforce 1.0 0.0 0.0
Fixes
100+ fixes in LAMMPS
You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix
fix
fix
fix
fix
1
2
3
5
6
all nve
flow temp/rescale 200 1.0 1.0 0.02 1.0
lower setforce 0.0 0.0 0.0
upper aveforce 0.0 -0.5 0.0
flow addforce 1.0 0.0 0.0
Fixes
100+ fixes in LAMMPS
You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix
fix
fix
fix
fix
1
2
3
5
6
all nve
flow temp/rescale 200 1.0 1.0 0.02 1.0
lower setforce 0.0 0.0 0.0
upper aveforce 0.0 -0.5 0.0
flow addforce 1.0 0.0 0.0
Fixes
100+ fixes in LAMMPS
You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix
fix
fix
fix
fix
1
2
3
5
6
all nve
flow temp/rescale 200 1.0 1.0 0.02 1.0
lower setforce 0.0 0.0 0.0
upper aveforce 0.0 -0.5 0.0
flow addforce 1.0 0.0 0.0
Computes
75 computes in LAMMPS
Calculate some property of system, in parallel
Always for the current timestep
To learn what compute styles LAMMPS has ...
Computes
75 computes in LAMMPS
Calculate some property of system, in parallel
Always for the current timestep
To learn what compute styles LAMMPS has ...
doc/Section commands.html or doc/compute.html
Computes
Key point:
computes store their results
other commands invoke them and use the results
e.g. thermo output, dumps, fixes
Computes
Key point:
computes store their results
other commands invoke them and use the results
e.g. thermo output, dumps, fixes
Examples:
temp & pressure = global scalar or vector
pe/atom = potential energy per atom (vector)
displace/atom = displacement per atom (array)
pair/local & bond/local = per-neighbor or per-bond info
Thermo output
One line of output every N timesteps to screen and log file
See doc/thermo style.html
Thermo output
One line of output every N timesteps to screen and log file
See doc/thermo style.html
Any scalar can be output:
dozens of keywords: temp, pyy, eangle, lz, cpu
any output of a compute or fix: c ID, f ID[N], c ID[N][M]
fix ave/time stores time-averaged quantities
Thermo output
One line of output every N timesteps to screen and log file
See doc/thermo style.html
Any scalar can be output:
dozens of keywords: temp, pyy, eangle, lz, cpu
any output of a compute or fix: c ID, f ID[N], c ID[N][M]
fix ave/time stores time-averaged quantities
Post-process via:
tools/python/logplot.py log.lammps X Y (via GnuPlot)
tools/python/log2txt.py log.lammps data.txt X Y ...
Pizza.py log tool
can read thermo output across multiple runs
Dump output
Dump output
Dump output
Dump output
Dump output
Additional options:
control which atoms by group or region
control which atoms by threshold
dump modify thresh c pe > 3.0
Dump output
Additional options:
control which atoms by group or region
control which atoms by threshold
dump modify thresh c pe > 3.0
Post-run conversion
tools/python/dump2cfg.py, dump2pdb.py, dump2xyz.py
Pizza.py dump, cfg, ensight, pdb, svg, vtk, xyz tools
Classical MD in parallel
MD is inherently parallel
forces on each atom can be computed simultaneously
X and V can be updated simultaneously
Classical MD in parallel
MD is inherently parallel
forces on each atom can be computed simultaneously
X and V can be updated simultaneously
Short-range forces
CPU cost scales as O(N/P)
Parallel performance
See http://lammps.sandia.gov/bench.html
Parallel performance
See http://lammps.sandia.gov/bench.html
Useful exercise:
run bench/in.lj, change N and P, is it O(N/P) ?
% mpirun -np 2 lmp linux < in.lj
% lmp linux -v x 2 -v y 2 -v z 2 < in.lj
USER-CUDA:
fixes and computes onto GPU (many timesteps)
one core per GPU
30 pair styles, 15 fixes, 4 computes, PPPM
USER-OMP:
threading via OpenMP, run 1 or 2 MPI tasks/node
95 pair styles, 29 fixes, many PPPM variants
See http://lammps.sandia.gov/features.html
1
Units
see doc/units.html
LJ, real, metal, cgs, si, micro, nano
all input/output in one unit system
Ensembles
see doc/Section howto.html 6.16
one or more thermostats (by group)
single barostat
rigid body dynamics (RIGID package)
Hybrid models
pair style hybrid and hybrid/overlay
atom style hybrid sphere bond ...
Aspherical particles
see doc/Section howto.html 6.14
ellipsoidal, lines, triangles, rigid bodies
ASPHERE package
Multi-replica modeling
see doc/Section howto.html 6.14
parallel tempering via temper command
PRD, TAD, NEB in REPLICA package
Multi-replica modeling
see doc/Section howto.html 6.14
parallel tempering via temper command
PRD, TAD, NEB in REPLICA package
Load balancing
balance command for static LB
fix balance command for dynamic LB
work by adjusting proc dividers in 3d brick grid
Energy minimization
Via dynamics to un-overlap particles
pair style soft with time-dependent push-off
fix nve/limit and fix viscous
doc/Section howto.html
6.10 and 6.19
C-style interface
(C, C++,
Fortran, Python)
examples/COUPLE dir
python and
python/examples
directories
Elasto-dynamic response:
Papers: http://lammps.sandia.gov/papers.html
authors, titles, abstracts for 3600 papers
doc/Section modify.html
LAMMPS: http://lammps.sandia.gov
post a question: http://lammps.sandia.gov/mail.html
my email: sjplimp@sandia.gov
Thanks to LAMMPS developers at Sandia and elsewhere:
Aidan Thompson, Paul Crozier
Stan Moore, Ray Shan, Christian Trott
Axel Kohlmeyer (ICTP & Temple Univ)
http://lammps.sandia.gov/authors.html