Is there any way I can continue a simulation without ‘write_restart’?

Hello everyone,

I set run 150000 in my simulation. Unfortunately, I found that the simulation time was not long enough. In this script, I haven’t added commands like write_restart for restarting (I’m new to this and encountering this issue for the first time). The only available data are in the log file (thermo_style custom step temp etotal time) and the dump file that I outputted. I used the following dump command to save the positions and energy information of the atoms:

compute ke_atom all ke/atom
compute pe_atom all pe/atom
variable E_total atom c_ke_atom+c_pe_atom
dump 1 all custom 10 myfile.dump id type x y z v_E_total

Is there any way I can continue the simulation from the last step?
(It seems that there is no information about the velocity direction of each particle, so is it necessary to rerun the simulation and add the write_restart command? I’ve been running it on my own computer for almost two days, and I’m reluctant to give up on this portion of the data.)

Thank you.

I found a way to access my LAMMPS script (myshell.lmp) in memory while my program is still running. My system is Ubuntu. First, I identified the LAMMPS process running using:

ps aux | grep lmp

Then I found the corresponding PID number, for example, mine is 4582 (the four below are four cores running programs). Then navigate to the file descriptors directory:

cd /proc/4582/fd  (PID number)

List the files in this directory:


This command allows you to see the script being read from memory:

lr-x------ 1 mylinux mylinux 64 13:17 0 → /media/lammps/lammps-2Aug2023/examples/myshell.lmp (deleted)
lrwx------ 1 mylinux mylinux 64 13:17 1 → /dev/pts/1
lr-x------ 1 mylinux mylinux 64 13:17 10 → pipe:[38420]…

Where 0, 1, 10 correspond to different files. You just need to edit your script:

vi 0

Then I added the command at the end of the script:

run 200000 upto.

However, it is still recommended to develop the habit of using write_restart.

I didn’t know it was possible to alter a script after a process had been initiated. Then why not append a write_restart or write_data command at the end of it?

Also, if you also dump velocities (and angular momenta if the system includes finite-size particles), you can reconstruct a viable starting point, e.g. with Moltemplate.