run 100000 start 0 stop 1000000 every 1000 "print 'Protein Rg = $r'"
run 100000 every 1000 NULL
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Run or continue dynamics for a specified number of timesteps.</p>
<p>When the <a class="reference internal" href="run_style.html"><em>run style</em></a> is <em>respa</em>, N refers to outer
loop (largest) timesteps.</p>
<p>A value of N = 0 is acceptable; only the thermodynamics of the system
are computed and printed without taking a timestep.</p>
<p>The <em>upto</em> keyword means to perform a run starting at the current
timestep up to the specified timestep. E.g. if the current timestep
is 10,000 and “run 100000 upto” is used, then an additional 90,000
timesteps will be run. This can be useful for very long runs on a
machine that allocates chunks of time and terminate your job when time
is exceeded. If you need to restart your script multiple times
(reading in the last restart file), you can keep restarting your
script with the same run command until the simulation finally
completes.</p>
<p>The <em>start</em> or <em>stop</em> keywords can be used if multiple runs are being
performed and you want a <a class="reference internal" href="fix.html"><em>fix</em></a> command that changes some
value over time (e.g. temperature) to make the change across the
entire set of runs and not just a single run. See the doc page for
individual fixes to see which ones can be used with the <em>start/stop</em>
keywords.</p>
<p>For example, consider this fix followed by 10 run commands:</p>
<div class="highlight-python"><div class="highlight"><pre>fix 1 all nvt 200.0 300.0 1.0
run 1000 start 0 stop 10000
run 1000 start 0 stop 10000
...
run 1000 start 0 stop 10000
</pre></div>
</div>
<p>The NVT fix ramps the target temperature from 200.0 to 300.0 during a
run. If the run commands did not have the start/stop keywords (just
“run 1000”), then the temperature would ramp from 200.0 to 300.0
during the 1000 steps of each run. With the start/stop keywords, the
ramping takes place over the 10000 steps of all runs together.</p>
<p>The <em>pre</em> and <em>post</em> keywords can be used to streamline the setup,
clean-up, and associated output to the screen that happens before and
after a run. This can be useful if you wish to do many short runs in
succession (e.g. LAMMPS is being called as a library which is doing
other computations between successive short LAMMPS runs).</p>
<p>By default (pre and post = yes), LAMMPS creates neighbor lists,
computes forces, and imposes fix constraints before every run. And
after every run it gathers and prints timings statistics. If a run is
just a continuation of a previous run (i.e. no settings are changed),
the initial computation is not necessary; the old neighbor list is
still valid as are the forces. So if <em>pre</em> is specified as “no” then
the initial setup is skipped, except for printing thermodynamic info.
Note that if <em>pre</em> is set to “no” for the very 1st run LAMMPS
performs, then it is overridden, since the initial setup computations
must be done.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If your input script changes the system between 2 runs, then the
initial setup must be performed to insure the change is recognized by
all parts of the code that are affected. Examples are adding a
<a class="reference internal" href="fix.html"><em>fix</em></a> or <a class="reference internal" href="dump.html"><em>dump</em></a> or <a class="reference internal" href="compute.html"><em>compute</em></a>, changing
a <a class="reference internal" href="neigh_modify.html"><em>neighbor</em></a> list parameter, or writing restart file
which can migrate atoms between processors. LAMMPS has no easy way to
check if this has happened, but it is an error to use the <em>pre no</em>
option in this case.</p>
</div>
<p>If <em>post</em> is specified as “no”, the full timing summary is skipped;
only a one-line summary timing is printed.</p>
<p>The <em>every</em> keyword provides a means of breaking a LAMMPS run into a
series of shorter runs. Optionally, one or more LAMMPS commands (c1,
c2, ..., cN) will be executed in between the short runs. If used, the
<em>every</em> keyword must be the last keyword, since it has a variable
number of arguments. Each of the trailing arguments is a single
LAMMPS command, and each command should be enclosed in quotes, so that
the entire command will be treated as a single argument. This will
also prevent any variables in the command from being evaluated until
it is executed multiple times during the run. Note that if a command
itself needs one of its arguments quoted (e.g. the <a class="reference internal" href="print.html"><em>print</em></a>
command), then you can use a combination of single and double quotes,
as in the example above or below.</p>
<p>The <em>every</em> keyword is a means to avoid listing a long series of runs
and interleaving commands in your input script. For example, a
<a class="reference internal" href="print.html"><em>print</em></a> command could be invoked or a <a class="reference internal" href="fix.html"><em>fix</em></a> could
be redefined, e.g. to reset a thermostat temperature. Or this could
be useful for invoking a command you have added to LAMMPS that wraps
some other code (e.g. as a library) to perform a computation
periodically during a long LAMMPS run. See <a class="reference internal" href="Section_modify.html"><em>this section</em></a> of the documentation for info about how
to add new commands to LAMMPS. See <a class="reference internal" href="Section_howto.html#howto-10"><span>this section</span></a> of the documentation for ideas
about how to couple LAMMPS to other codes.</p>
<p>With the <em>every</em> option, N total steps are simulated, in shorter runs
of M steps each. After each M-length run, the specified commands are
invoked. If only a single command is specified as NULL, then no
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.