1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
5 :link(lc,Section_commands.html#comm)
13 run_style style args :pre
15 style = {verlet} or {verlet/split} or {respa} or {respa/omp} :ulb,l
17 {verlet/split} args = none
18 {respa} args = N n1 n2 ... keyword values ...
19 N = # of levels of rRESPA
20 n1, n2, ... = loop factor between rRESPA levels (N-1 values)
21 zero or more keyword/value pairings may be appended to the loop factors
22 keyword = {bond} or {angle} or {dihedral} or {improper} or
23 {pair} or {inner} or {middle} or {outer} or {hybrid} or {kspace}
25 M = which level (1-N) to compute bond forces in
27 M = which level (1-N) to compute angle forces in
29 M = which level (1-N) to compute dihedral forces in
31 M = which level (1-N) to compute improper forces in
33 M = which level (1-N) to compute pair forces in
34 {inner} values = M cut1 cut2
35 M = which level (1-N) to compute pair inner forces in
36 cut1 = inner cutoff between pair inner and
37 pair middle or outer (distance units)
38 cut2 = outer cutoff between pair inner and
39 pair middle or outer (distance units)
40 {middle} values = M cut1 cut2
41 M = which level (1-N) to compute pair middle forces in
42 cut1 = inner cutoff between pair middle and pair outer (distance units)
43 cut2 = outer cutoff between pair middle and pair outer (distance units)
45 M = which level (1-N) to compute pair outer forces in
46 {hybrid} values = M1 M2 ... (as many values as there are hybrid sub-styles
47 M1 = which level (1-N) to compute the first pair_style hybrid sub-style in
48 M2 = which level (1-N) to compute the second pair_style hybrid sub-style in
51 M = which level (1-N) to compute kspace forces in :pre
57 run_style respa 4 2 2 2 bond 1 dihedral 2 pair 3 kspace 4
58 run_style respa 4 2 2 2 bond 1 dihedral 2 inner 3 5.0 6.0 outer 4 kspace 4 :pre
59 run_style respa 3 4 2 bond 1 hybrid 2 2 1 kspace 3 :pre
63 Choose the style of time integrator used for molecular dynamics
64 simulations performed by LAMMPS.
66 The {verlet} style is a standard velocity-Verlet integrator.
70 The {verlet/split} style is also a velocity-Verlet integrator, but it
71 splits the force calculation within each timestep over 2 partitions of
72 processors. See "Section 2.7"_Section_start.html#start_7 for an
73 explanation of the -partition command-line switch.
75 Specifically, this style performs all computation except the
76 "kspace_style"_kspace_style.html portion of the force field on the 1st
77 partition. This include the "pair style"_pair_style.html, "bond
78 style"_bond_style.html, "neighbor list building"_neighbor.html,
79 "fixes"_fix.html including time intergration, and output. The
80 "kspace_style"_kspace_style.html portion of the calculation is
81 performed on the 2nd partition.
83 This is most useful for the PPPM kspace_style when its performance on
84 a large number of processors degrades due to the cost of communication
85 in its 3d FFTs. In this scenario, splitting your P total processors
86 into 2 subsets of processors, P1 in the 1st partition and P2 in the
87 2nd partition, can enable your simulation to run faster. This is
88 because the long-range forces in PPPM can be calculated at the same
89 time as pair-wise and bonded forces are being calculated, and the FFTs
90 can actually speed up when running on fewer processors.
92 To use this style, you must define 2 partitions where P1 is a multiple
93 of P2. Typically having P1 be 3x larger than P2 is a good choice.
94 The 3d processor layouts in each partition must overlay in the
95 following sense. If P1 is a Px1 by Py1 by Pz1 grid, and P2 = Px2 by
96 Py2 by Pz2, then Px1 must be an integer multiple of Px2, and similarly
97 for Py1 a multiple of Py2, and Pz1 a multiple of Pz2.
99 Typically the best way to do this is to let the 1st partition choose
100 its onn optimal layout, then require the 2nd partition's layout to
101 match the integer multiple constraint. See the
102 "processors"_processors.html command with its {part} keyword for a way
103 to control this, e.g.
105 procssors * * * part 1 2 multiple :pre
107 You can also use the "partition"_partition.html command to explicitly
108 specity the processor layout on each partition. E.g. for 2 partitions
109 of 60 and 15 processors each:
111 partition yes 1 processors 3 4 5
112 partition yes 2 processors 3 1 5 :pre
114 When you run in 2-partition mode with the {verlet/split} style, the
115 thermodyanmic data for the entire simulation will be output to the log
116 and screen file of the 1st partition, which are log.lammps.0 and
117 screen.0 by default; see the "-plog and -pscreen command-line
118 switches"_Section_start.html#start_7 to change this. The log and
119 screen file for the 2nd partition will not contain thermodynamic
120 output beyone the 1st timestep of the run.
122 See "Section 5"_Section_accelerate.html of the manual for
123 performance details of the speed-up offered by the {verlet/split}
124 style. One important performance consideration is the assignemnt of
125 logical processors in the 2 partitions to the physical cores of a
126 parallel machine. The "processors"_processors.html command has
127 options to support this, and strategies are discussed in
128 "Section 5"_Section_accelerate.html of the manual.
132 The {respa} style implements the rRESPA multi-timescale integrator
133 "(Tuckerman)"_#Tuckerman with N hierarchical levels, where level 1 is
134 the innermost loop (shortest timestep) and level N is the outermost
135 loop (largest timestep). The loop factor arguments specify what the
136 looping factor is between levels. N1 specifies the number of
137 iterations of level 1 for a single iteration of level 2, N2 is the
138 iterations of level 2 per iteration of level 3, etc. N-1 looping
139 parameters must be specified.
141 The "timestep"_timestep.html command sets the timestep for the
142 outermost rRESPA level. Thus if the example command above for a
143 4-level rRESPA had an outer timestep of 4.0 fmsec, the inner timestep
144 would be 8x smaller or 0.5 fmsec. All other LAMMPS commands that
145 specify number of timesteps (e.g. "neigh_modify"_neigh_modify.html
146 parameters, "dump"_dump.html every N timesteps, etc) refer to the
149 The rRESPA keywords enable you to specify at what level of the
150 hierarchy various forces will be computed. If not specified, the
151 defaults are that bond forces are computed at level 1 (innermost
152 loop), angle forces are computed where bond forces are, dihedral
153 forces are computed where angle forces are, improper forces are
154 computed where dihedral forces are, pair forces are computed at the
155 outermost level, and kspace forces are computed where pair forces are.
156 The inner, middle, outer forces have no defaults.
158 For fixes that support it, the rRESPA level at which a given fix is
159 active, can be selected through the "fix_modify"_fix_modify.html command.
161 The {inner} and {middle} keywords take additional arguments for
162 cutoffs that are used by the pairwise force computations. If the 2
163 cutoffs for {inner} are 5.0 and 6.0, this means that all pairs up to
164 6.0 apart are computed by the inner force. Those between 5.0 and 6.0
165 have their force go ramped to 0.0 so the overlap with the next regime
166 (middle or outer) is smooth. The next regime (middle or outer) will
167 compute forces for all pairs from 5.0 outward, with those from 5.0 to
168 6.0 having their value ramped in an inverse manner.
170 Only some pair potentials support the use of the {inner} and {middle}
171 and {outer} keywords. If not, only the {pair} keyword can be used
172 with that pair style, meaning all pairwise forces are computed at the
173 same rRESPA level. See the doc pages for individual pair styles for
176 Another option for using pair potentials with rRESPA is with the
177 {hybrid} keyword, which requires the use of the "pair_style hybrid or
178 hybrid/overlay"_pair_hybrid.html command. In this scenario, different
179 sub-styles of the hybrid pair style are evaluated at different rRESPA
180 levels. This can be useful, for example, to set different timesteps
181 for hybrid coarse-grained/all-atom models. The {hybrid} keyword
182 requires as many level assignments as there are hybrid substyles,
183 which assigns each sub-style to a rRESPA level, following their order
184 of definition in the pair_style command. Since the {hybrid} keyword
185 operates on pair style computations, it is mututally exclusive with
186 either the {pair} or the {inner}/{middle}/{outer} keywords.
188 When using rRESPA (or for any MD simulation) care must be taken to
189 choose a timestep size(s) that insures the Hamiltonian for the chosen
190 ensemble is conserved. For the constant NVE ensemble, total energy
191 must be conserved. Unfortunately, it is difficult to know {a priori}
192 how well energy will be conserved, and a fairly long test simulation
193 (~10 ps) is usually necessary in order to verify that no long-term
194 drift in energy occurs with the trial set of parameters.
196 With that caveat, a few rules-of-thumb may be useful in selecting
197 {respa} settings. The following applies mostly to biomolecular
198 simulations using the CHARMM or a similar all-atom force field, but
199 the concepts are adaptable to other problems. Without SHAKE, bonds
200 involving hydrogen atoms exhibit high-frequency vibrations and require
201 a timestep on the order of 0.5 fmsec in order to conserve energy. The
202 relatively inexpensive force computations for the bonds, angles,
203 impropers, and dihedrals can be computed on this innermost 0.5 fmsec
204 step. The outermost timestep cannot be greater than 4.0 fmsec without
205 risking energy drift. Smooth switching of forces between the levels
206 of the rRESPA hierarchy is also necessary to avoid drift, and a 1-2
207 angstrom "healing distance" (the distance between the outer and inner
208 cutoffs) works reasonably well. We thus recommend the following
209 settings for use of the {respa} style without SHAKE in biomolecular
213 run_style respa 4 2 2 2 inner 2 4.5 6.0 middle 3 8.0 10.0 outer 4 :pre
215 With these settings, users can expect good energy conservation and
216 roughly a 2.5 fold speedup over the {verlet} style with a 0.5 fmsec
219 If SHAKE is used with the {respa} style, time reversibility is lost,
220 but substantially longer time steps can be achieved. For biomolecular
221 simulations using the CHARMM or similar all-atom force field, bonds
222 involving hydrogen atoms exhibit high frequency vibrations and require
223 a time step on the order of 0.5 fmsec in order to conserve energy.
224 These high frequency modes also limit the outer time step sizes since
225 the modes are coupled. It is therefore desirable to use SHAKE with
226 respa in order to freeze out these high frequency motions and increase
227 the size of the time steps in the respa hierarchy. The following
228 settings can be used for biomolecular simulations with SHAKE and
231 fix 2 all shake 0.000001 500 0 m 1.0 a 1
233 run_style respa 2 2 inner 1 4.0 5.0 outer 2 :pre
235 With these settings, users can expect good energy conservation and
236 roughly a 1.5 fold speedup over the {verlet} style with SHAKE and a
239 For non-biomolecular simulations, the {respa} style can be
240 advantageous if there is a clear separation of time scales - fast and
241 slow modes in the simulation. Even a LJ system can benefit from
242 rRESPA if the interactions are divided by the inner, middle and outer
243 keywords. A 2-fold or more speedup can be obtained while maintaining
244 good energy conservation. In real units, for a pure LJ fluid at
245 liquid density, with a sigma of 3.0 angstroms, and epsilon of 0.1
246 Kcal/mol, the following settings seem to work well:
249 run_style respa 3 3 4 inner 1 3.0 4.0 middle 2 6.0 7.0 outer 3 :pre
253 The {respa/omp} styles is a variant of {respa} adapted for use with
254 pair, bond, angle, dihedral, improper, or kspace styles with an {omp}
255 suffix. It is functionally equivalent to {respa} but performs additional
256 operations required for managing {omp} styles. For more on {omp} styles
257 see the "Section 5"_Section_accelerate.html of the manual.
258 Accelerated styles take the same arguments and should produce the same
259 results, except for round-off and precision issues.
261 You can specify {respa/omp} explicitly in your input script, or
262 you can use the "-suffix command-line switch"_Section_start.html#start_7
263 when you invoke LAMMPS, or you can use the "suffix"_suffix.html
264 command in your input script.
266 See "Section 5"_Section_accelerate.html of the manual for
267 more instructions on how to use the accelerated styles effectively.
273 The {verlet/split} style can only be used if LAMMPS was built with the
274 REPLICA package. Correspondingly the {respa/omp} style is available only
275 if the USER-OMP package was included. See the "Making LAMMPS"_Section_start.html#start_3
276 section for more info on packages.
278 Whenever using rRESPA, the user should experiment with trade-offs in
279 speed and accuracy for their system, and verify that they are
280 conserving energy to adequate precision.
284 "timestep"_timestep.html, "run"_run.html
288 run_style verlet :pre
293 [(Tuckerman)] Tuckerman, Berne and Martyna, J Chem Phys, 97, p 1990