<p>This command closes the current input script file, opens the file with
the specified name, and begins reading LAMMPS commands from that file.
Unlike the <a class="reference internal" href="include.html"><span class="doc">include</span></a> command, the original file is not
returned to, although by using multiple jump commands it is possible
to chain from file to file or back to the original file.</p>
<p>If the word “SELF” is used for the filename, then the current input
script is re-opened and read again.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The SELF option is not guaranteed to work when the current input
script is being read through stdin (standard input), e.g.</p>
</div>
<pre class="literal-block">
lmp_g++ < in.script
</pre>
<p>since the SELF option invokes the C-library rewind() call, which may
not be supported for stdin on some systems or by some MPI
implementations. This can be worked around by using the <a class="reference internal" href="Section_start.html#start-7"><span class="std std-ref">-in command-line argument</span></a>, e.g.</p>
<pre class="literal-block">
lmp_g++ -in in.script
</pre>
<p>or by using the <a class="reference internal" href="Section_start.html#start-7"><span class="std std-ref">-var command-line argument</span></a> to pass the script name as a
variable to the input script. In the latter case, a
<a class="reference internal" href="variable.html"><span class="doc">variable</span></a> called “fname” could be used in place of
SELF, e.g.</p>
<pre class="literal-block">
lmp_g++ -var fname in.script < in.script
</pre>
<p>The 2nd argument to the jump command is optional. If specified, it is
treated as a label and the new file is scanned (without executing
commands) until the label is found, and commands are executed from
that point forward. This can be used to loop over a portion of the
input script, as in this example. These commands perform 10 runs,
each of 10000 steps, and create 10 dump files named file.1, file.2,
etc. The <a class="reference internal" href="next.html"><span class="doc">next</span></a> command is used to exit the loop after 10
iterations. When the “a” variable has been incremented for the tenth
time, it will cause the next jump command to be skipped.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>variable a loop 10
label loop
dump 1 all atom 100 file.$a
run 10000
undump 1
next a
jump in.lj loop
</pre></div>
</div>
<p>If the jump <em>file</em> argument is a variable, the jump command can be
used to cause different processor partitions to run different input
scripts. In this example, LAMMPS is run on 40 processors, with 4
partitions of 10 procs each. An in.file containing the example
variable and jump command will cause each partition to run a different
simulation.</p>
<pre class="literal-block">
mpirun -np 40 lmp_ibm -partition 4x10 -in in.file
</pre>
<div class="highlight-default"><div class="highlight"><pre><span></span>variable f world script.1 script.2 script.3 script.4
jump $f
</pre></div>
</div>
<p>Here is an example of a loop which checks every 1000 steps if the
system temperature has reached a certain value, and if so, breaks out
of the loop to finish the run. Note that any variable could be
checked, so long as it is current on the timestep when the run
completes. As explained on the <a class="reference internal" href="variable.html"><span class="doc">variable</span></a> doc page,
this can be insured by includig the variable in thermodynamic output.</p>
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>.