Maximum N in run command

Dear Lammps users,

I am trying to run a large time scale(microseconds) MD simulation. The elements are Nickel and Titanium.
Since I have to go through a huge amount of time(microseconds) with a small timestep value(0.01ps), N value in run command became large( N=750000000000).

However, I found that when N became large, the simulation outputs an error as following;

ERROR: Invalid run command N value (run.cpp:108)

I experience an error when N is larger than 2000000000. But when N is less then the number, the simulation runs well.

Are there any high limit of N value in run command?

Thank you.
Jeongwoo Lee

I am attaching my code for reference.


Temp change 1

velocity all create 300 4928459 dist gaussian

fix 1 all npt temp 300.0 480.6532 4.00 x 0 0 6 y 0 0 6 z 0 0 6 drag 0.2

variable press1 equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)

variable sigmazz equal c_p[3]/(20*vol)

variable shearall equal -(c_p[4]+c_p[5]+c_p[6])/(3*vol)

thermo 500
thermo_style custom step temp cella cellb cellc cellalpha cellbeta cellgamma vol press v_press1 v_shearall v_sigmazz atoms pe etotal pxx pyy pzz pxy pxz pyz

timestep 0.01

run 750000000000

This is explained in the “run” doc page.

Besideds, It is not practical to expect your simulation to finish 7500…(how ever many zeros) steps in one run anyway. You are better to use restart or write_data commands.


Trying to add this command “run 7500000000 upto” in the end, detailed description is in
Xuepeng Liu

Trying to add this command "run 7500000000 upto" in the end, detailed
description is in

Sorry but this wouldn't work since there is a maximum number of steps
allowed in the run command and 7500000000 is beyond that maximum number.


sorry, you could try this " run 2000000000
run 4000000000 upto
run 6000000000 upto
run 7500000000 upto" command.
Xuepeng Liu

The run doc page explains this, as Ray said:

The number of specified timesteps N must fit in a signed 32-bit integer, so you are limited to slightly more than 2 billion steps (2^31) in a single run. However, you can perform successive runs to run a simulation for any number of steps (ok, up to 2^63 steps).

Just do this:

run 2000000000
run 2000000000
run 2000000000

as many times as you like.