Possible bug with fix property/atom and write_restart

Dear all,

I have found a problem with the fix property/atom and the write_restart commands. When I write a restart file after defining a fix property/atom the system start to behave very strangely, namely the pressure drops to zero for several timesteps before becoming normal again. A test input script is attached. Everything works fine if the write_restart line is commented.

This is using the latest version of LAMMPS. Using the stable Feb14 version is even worse, with a segmentation fault appearing during the write of the restart file.

Best regards,
Anton Peshkov

in.pour_test (1.1 KB)

The problem is that you are doing this:

run 25000

write_restart file

run 100 pre no

You can’t write a restart file and then do “pre no”.

That is b/c the writing of a restart file can
change data structures (e.g. move atoms to new
procs), and data structs like neighbor lists will
then be out-of-date if you don’t do a normal
run (w/out pre no) to redo their setup.

The doc page on run pre no should spell
this out more explicitly.

Note that if you just do run 25 for the 2nd run,

you will not get continuous values from the 1st
run, but I think that maybe b/c of how
forces are computed differently with half-step
vs full-step velocities in the 2 cases.


The reason your script is giving a huge pressure
change between the 1st and 2nd runs is that
you need this line:

compute_modify thermo_temp dynamic yes

Otherwise the temperature contribution to
the pressure in the first run is 0, b/c you started

with 0 atoms.


Hi Steve,

I figured this out. I did not thought that writing data to file can change data structure.