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)
15 file = filename of new input script to switch to
16 label = optional label within file to jump to :ul
22 jump SELF runloop :pre
26 This command closes the current input script file, opens the file with
27 the specified name, and begins reading LAMMPS commands from that file.
28 Unlike the "include"_include.html command, the original file is not
29 returned to, although by using multiple jump commands it is possible
30 to chain from file to file or back to the original file.
32 If the word "SELF" is used for the filename, then the current input
33 script is re-opened and read again.
35 NOTE: The SELF option is not guaranteed to work when the current input
36 script is being read through stdin (standard input), e.g.
38 lmp_g++ < in.script :pre
40 since the SELF option invokes the C-library rewind() call, which may
41 not be supported for stdin on some systems or by some MPI
42 implementations. This can be worked around by using the "-in
43 command-line argument"_Section_start.html#start_7, e.g.
45 lmp_g++ -in in.script :pre
47 or by using the "-var command-line
48 argument"_Section_start.html#start_7 to pass the script name as a
49 variable to the input script. In the latter case, a
50 "variable"_variable.html called "fname" could be used in place of
53 lmp_g++ -var fname in.script < in.script :pre
55 The 2nd argument to the jump command is optional. If specified, it is
56 treated as a label and the new file is scanned (without executing
57 commands) until the label is found, and commands are executed from
58 that point forward. This can be used to loop over a portion of the
59 input script, as in this example. These commands perform 10 runs,
60 each of 10000 steps, and create 10 dump files named file.1, file.2,
61 etc. The "next"_next.html command is used to exit the loop after 10
62 iterations. When the "a" variable has been incremented for the tenth
63 time, it will cause the next jump command to be skipped.
67 dump 1 all atom 100 file.$a
73 If the jump {file} argument is a variable, the jump command can be
74 used to cause different processor partitions to run different input
75 scripts. In this example, LAMMPS is run on 40 processors, with 4
76 partitions of 10 procs each. An in.file containing the example
77 variable and jump command will cause each partition to run a different
80 mpirun -np 40 lmp_ibm -partition 4x10 -in in.file :pre
82 variable f world script.1 script.2 script.3 script.4
85 Here is an example of a loop which checks every 1000 steps if the
86 system temperature has reached a certain value, and if so, breaks out
87 of the loop to finish the run. Note that any variable could be
88 checked, so long as it is current on the timestep when the run
89 completes. As explained on the "variable"_variable.html doc page,
90 this can be insured by includig the variable in thermodynamic output.
92 variable myTemp equal temp
96 if "$\{myTemp\} < 300.0" then "jump SELF break"
100 print "ALL DONE" :pre
102 Here is an example of a double loop which uses the if and
103 "jump"_jump.html commands to break out of the inner loop when a
104 condition is met, then continues iterating thru the outer loop.
112 if "$b > 2" then "jump SELF break"
122 If you jump to a file and it does not contain the specified label,
123 LAMMPS will come to the end of the file and exit.
127 "variable"_variable.html, "include"_include.html, "label"_label.html,