Ellipsoidflag Density in LAMMPS
Ellipsoidflag Density in LAMMPS
SAND2018-7268C
LAMMPS Tutorial
Stan Moore
Modeling Supra-molecular Structures with LAMMPS
Philadelphia, PA
.V AIMM101 Sandia National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly
ENERGY
Ew l owned subsidiary of Honeywell International, inc., for the U.S. Department of Energy's National Nuclear Security Administration under contract DE-NA-
0003525.. SAND NO. 2011-XXXXP
Sandia
National
About Me Laboratories
• Stan Moore
• Core LAMMPS developer at Sandia National Labs in Albuquerque, New
Mexico
• Been at Sandia for 6 years
• Main developer of the KOKKOS package in LAMMPS (runs on GPUs
and multi-core CPUs)
• Expertise in long-range electrostatics
• PhD in Chemical Engineering, dissertation on molecular dynamics
method development for predicting chemical potential
:ECCR
2
Sandia
National
Tutorial Overview Laboratories
• • • • It It • .11. • 4 4 ••••••••••‘Itt•••••11
II II Rio • Rio % le i i 111 % # i•• II •• i i•••
lige% ilte••%•••••%••••• 41••• 41 00.1
‘00 11,••••• 11 ••••• 11 •0 1, 000911
• RIO RI% .11.0 .•••••••••••••••• 4 0 ••••• 41
410411 •••••••••••••••••• 1.011101111110
%Obi ibeille ibe ibe ll0 10 0 . 11 .
11 11.00 11, 000 ,11
••
1110 'I
•• • • 11, 010• 11,•%• 11•*• 11•11•11 •00 11 00110 11
411 .11.•.11.•.11. % •11•411 110 110RA41.10‘.1
lt%toolititipegbibeeibeeibRhihihieviee;
‘
, 1„1414,041i1
• •••• w•••••••e e •••••• w •• •lb • •
••• I •••••••• %.1h111 411 414 11 11 114 11 11 1
1 llll
11111111tibiliololoilo%%•.#41144111.111.111.1111llll
•
3
Sandia
National
Getting Help Laboratories
4
Sandia
National
LAMMPS: Modular and Flexible Laboratories
5
Sandia
National
LAMMPS Code Design: C++ Laboratories
■ Why c++?
■ Allows object-oriented design, encapsulation
■ Allows virtual inheritance, which reduces code duplication
■ Performance still on par with older Fortran version of LAMMPS
■ What style of c++?
■ Object-oriented c
■ Use c for low-level operations and c++ for high level (e.g. classes with
virtual inheritance)
■ In LAMMPS core, simple data structures, no stl vectors, few
templates, etc.
■ Multidimensional arrays are contiguous in memory
■ In USER packages, more freedom (can use stl vectors, templates, etc.)
6
Sandia
National
MPI Parallelization Approach Laboratories
proc 1 proc 2
proc 3 proc 4
7
Sandia
National
Ghost Atoms Laboratories
proc 1
local atoms
ir,
ghost atoms
8
Sandia
National
Communication Patterns Laboratories
9
Sandia
National
Strong vs Weak Scaling Laboratories
10
Sandia
National
Atom IDs Laboratories
11
Sandia
National
Neighbor Lists Laboratories
12
Sandia
National
Neighbor Options Laboratories
■ delay setting means never build new lists until at least N steps
after the previous build
■ every setting means build lists every M steps (after the delay
has passed)
■ If the check setting is no, the lists are built on the first step
that satisfies the delay and every settings. If the check setting
is yes, an actual build only occurs if some atom has moved
more than half the skin distance (still respects delay and
every)
■ exclude turns off pairwise interactions between certain pairs
of atoms, by not including them in the neighbor list
neighbor 0.3 bin
neigh modify every 2 aelay 10 check yes
neigh modify excluce type 2 3
13
Sandia
National
Newton Option Laboratories
newton on #c efault
newton off
14
Sandia
National
Half Neighbor List Laboratories
■ With newton flag on, each pair is stored only once (usually
better for CPUs)
15
Sandia
National
Full Neighbor List Laboratories
16
Sandia
National
Basic MD Timestep Laboratories
1. initial integrate
2. MPI forward communication
3. compute forces (pair, bonds, etc.)
4. MPI reverse communication (if newton flag on)
5. final integrate
6. output (if requested on this timestep)
• See lammps.sandia.gov/bench.html#potentials
Potential System Atoms Timestep CPU LJ Ratio
Granular chute flow 32000 0.0001 tau 5.08e-7 0.34x
FENE bead/spring polymer melt 32000 0.012 tau 5.32e-7 0.36x
Lennard-Jones LJ liquid 32000 0.005 tau 1.48e-6 1.0x
DPD pure solvent 32000 0.04 tau 2.16e-6 1.46x
EAM bulk Cu 32000 5 fmsec 3.59e-6 2.4x
Tersoff bulk Si 32000 1 fmsec 6.Ole-6 4.1x
Stillinger-Weber bulk Si 32000 1 fmsec 6.10e-6 4.1x
EIM crystalline NaC1 32000 0.5 fmsec 9.69e-6 6.5x
SPC/E liquid water 36000 2 fmsec 1.43e-5 9.7x
CHARMM + PPPM solvated protein 32000 2 fmsec 2.Ole-5 13.6x
MEAM bulk Ni 32000 5 fmsec 2.31e-5 15.6x
Peridynamics glass fracture 32000 22.2 nsec 2.42e-5 16.4x
Gay-Berne ellipsoid mixture 32768 0.002 tau 4.09e-5 28.3x
AIREBO polyethylene 32640 0.5 fmsec 8.09e-5 54.7x
COMB crystalline Si02 32400 0.2 fmsec 4.19e-4 284x
eFF H plasma 32000 0.001 fmsec 4.52e-4 306x
ReaxFF PETN crystal 16240 0.1 fmsec 4.99e-4 337x
ReaxFF/C PETN crystal 32480 0.1 fmsec 2.73e-4 185x
VASP/small water 192/512 0.3 fmsec 26.2 17.7e6
VASP/medium CO2 192/1024 0.8 fmsec 252 170e6
VASP/large Xe 432/3456 2.0 fmsec 1344 908e6
19
Sandia
National
Accuracy = Higher Cost Laboratories
GAP —
•-
SNAP1
•
COMB
• • 0-
ReaxFF eFF SNAP2-
AIREBO
•
MEAM °BOP
CHARMM•
••
SPC • EIM
ti1linger-Weber REBO • 7
•
EAM Tersoff
n-6
10 1980 1990 2000 2010
Year Published
20
Sandia
National
Hybrid force fields Laboratories
21
Sandia
National
Hybrid force fields Example Laboratories
metal
/
/1
22
Sandia
National
Syntax specifying advanced force field input Laboratories
23
Sande
Mond
EAM,SW, and Tersoff Syntax laboratories
pair style
pair coeff si.sw Si
pair coeff GaN.sw Ga N Ga
24
Sandia
National
ReaxFF Syntax Laboratories
Examples
25
Sandia
National
Atom-style Formats Laboratories
26
Sandia
National
Atom-style Formats Laboratories
28
Sandia
National
Molecular Topology Laboratories
9 \ )11
... _j-
1
fix 1 all shake 0.0001 5 0 m 1.0 a 232
30
Sandia
National
Special Bonds Laboratories
bouncary p 3 f
ksoace modify slab 3.0
33
Sandia
National
Run vs Minimize Laboratories
34
Sandia
National
LAMMPS Files Laboratories
35
Sandia
National
LAMMPS Input File Laboratories
36
Sandia
National
Input Script Variables Laboratories
37
Sandia
National
Averaging Frequency Laboratories
histogram
fix 1 all ave/histo 1 4 8 ... computed here
39
Sandia
National
Data Files Laboratories
40
Sandia
NAmM
Data file and molecule file formats Wborataies
100 atoms (this must be the 3rd line, 1st 2 lines are ignored)
95 bonds (# of bonds to be simulated)
50 angles (include these lines even if number = 0)
30 dihedrals
20 impropers
-0.5 0.5 xlo xhi (for periodic systems this is box size,
-0.5 0.5 ylo yhi for non-periodic it is min/max extent of atoms)
-0.5 0.5 zlo zhi (do not include this line for 2-d simulations)
41
Santla
Mond
Data file and molecule file formats laboratories
Masses
1 mass
•••
N mass (N = # of atom types)
Nonbond Coeffs
1 coeffl coeff2 ..
••
N coeffl coeff2 .. (N = # of atom types)
Bond Coeffs
1 coeffl coeff2 ..
•••
N coeffl coeff2 ... (N = # of bond types)
(N = # of angle types)
42
Santla
Mond
Data file and molecule file formats laboratories
Atoms
••
N molecule-tag atom-type q x y z nx ny nz (N = # of atoms)
Velocities
1 vx vy vz
• • •
N vx vy vz (N = # of atoms)
43
Santla
Mond
Data file and molecule file formats laboratories
Bonds
Angles
Dihedrals
1 dihedral-type atom-1 atom-2 atom-3 atom-4 (atoms 2-3 form central bond)
Impropers
45
Sandia
National
Load Balancing Laboratories
ii ■
■
■
47
Sandia
National
Downloading LAMMPS Laboratories
48
Sandia
National
Compiling LAMMPS Laboratories
$ cd src
$ make m-oi # uses src/MAKE/Makefile.serial
49
Sandia
National
Using the MPI STUBS Library Laboratories
51
Sandia
National
Running LAMMPS Laboratories
52
Sandia
National
Common Errors Laboratories
53
Sandia
National
Common Errors (Continued) Laboratories
54
Sandia
National
LAMMPS Directories Laboratories
55
Sandia
National
Example: Lennard Jones Laboratories
56
Sandia
NAmM
Example: Lennard Jones Wborataies
$ cd bench
$ ../src/lmp serial -in in.lj
57
Sandia
NAmM
Example: Lennard Jones Wborataies
58
Sandia
NAmM
Example: Lennard Jones Wborataies
close to 1.0
59
Sandia
Maori
Example: Lennard Jones laboratories
60
Sandia
NAmM
Example: Lennard Jones Wborataies
61
Stub
NAmM
Example: Lennard Jones Wborataies
run 100
write data out.data
write restart out.rst
LAMMPS data file via write data, version 29 Jun 2018, timestep = 100
32000 atoms
1 atom types
62
Sandia
National
Example: Lennard Jones Laboratories
0.14
0.12
0.1
= 0.08
20.06
a
0.04
0.02
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
kinetic energy (LJ units)
63
Sandia
National
Example: Rhodopsin (Solvated Protein) Laboratories
64
Sandia
National
Example: Rhodopsin Laboratories
cd src
make yes-molecule # bonds, anc-les, etc.
make yes-kokkos # long-rance electrostatics
make yes-ric-id # fix shake
make mpi
65
Sandia
National
Example: Rhodopsin Laboratories
cd bench
../src/lmp mpi -in in.rhodo
66
Sandia
National
Example: Rhodopsin Laboratories
#thermo 50
thermo 1
67
Sandia
National
Example: Rhodopsin Laboratories
68
Sandia
National
Example: Rhodopsin laboratories
69
Sandia
National
Example: Crack Laboratories
70
Sandia
National
Example: Obstacle Laboratories
r.......:.!,..::::::.....
...4
.:
. .:. ..••
•
. • * :;•:
. .4YO
:.....•:1:• .I, a. ••
.
. %• ••.:4 0••••
4.:•:........
•••••••:•••••••••••::
: _• •
.
.
•• •
0•••..•
. •.
...
••••••..: • a
....•
• .•• • •• ••
•• • •
•
.:-
•• ••,1.
••••:.••••";••••
• :
••• :::: : ••••••••••....
ab ••••• •..d .•: :4
......•:•....,:: I.• ••••• * 4 !J.:•Ili ••• •"FF
. •
•••::••••:. • •:, •••• •.:•• •
:1
•••••••••: • • 0 4. —• •• •••• • •
• • ••• • •• • •••• • ••
•. .. ,•• • •• •• ••• •....
rl
. ........%•
. ....... .. .•
• • •• • • •• 1 0 di'
ffiddbommem *************** 0.0.0011.00000.0.00
.........................7.......................................7.4.7.7:::.7........7.41
71
Sandia
National
Example of Extending LAMMPS Laboratories
• I wanted to use fix efield and an Ewald sum with point dipoles
but it wasn't yet supported
• I emailed the LAMMPS mail list to ask if anyone was working
on an Ewald sum (to not duplicate work)
• I consulted with Steve Plimpton (LAMMPS developer)for
advice
• I used the existing code as a starting point/pattern and then
added my own code,following the existing style
• I tested the code and updated doc page and when done sent
it to Steve to be included in LAMMPS so that others could use
it too
72
Sandia
National
Use Existing Code First Laboratories
73
Sande
Mond
Example of Extending LAMMPS laboratories
74
Sandia
National
Example of Extending LAMMPS Laboratories
e -> perpendicular
(a
• N. parallel zw,—
114-74 -An ✓ 04 4...'
USL, k°
or ^1142.1
.
,11',*1747-.7
. 1-6/24rza.7::%. v . lv v .4 ,to
6.• 4
•I. • v ..... ::. v
ko V 6.
!...?Vip., 1%"6,
'" 0
7 4
"QAT.7,
•
%V t "
ko". V Jr L.,,0
‘
e .4.
v. 4%?5,11; 0i,brweeip i. cr'i'Pe • t 0"4 %„ 4le— v J
• -log, .66,7p.141_
4*A Itde"
..i.go :0 11e, •
'.> --Pet op •iiroe' go
,4
(b)
zero field
- - - parallel
- - perpendicular
1
0.9
Liquid-vapor interface of the Stockmayer fluid in a uniform external field, Moore, Stevens, and Grest, Phys. Rev. E 91, 022309(2015)
76
Sandia
National
Laboratories
Questions?
77