customized restart

Dear lammps users and developers,

I've been trying to write a restart file at a specific run time. In order to do that, first I keep track of the mpi wall time via a customized thermo keyword, this part works fine. Then I tried to force a write_restart during a run. I realize you can't write a restart at any time without the proper system initialization. So I had a periodic restart set up via the input script and I tried calling the write() method on the corresponding restart object defined by the Output class whenever the run time reached the desired value. I observed that this would work only if done at a time step compatible with the "every" parameter of the restart command in the input script. Otherwise the restart file isn't written correctly (Did not assign all restart atoms correctly (../read_restart.cpp:501)).
I can't figure out why my restart file is bogus when written at a time step that is not a multiple of the restart every parameter. Looking at the code of the Output class, it seems to me that, whenever the time step is a multiple of 'every', the restart->write() method is called without any more precaution. So why can't I call it at a different time step?
I work with the 15 may 15 version.

Thank you.

Jonathan Severin
Institut Charles Gerhardt de Montpellier
Université de Montpellier

Dear lammps users and developers,

I've been trying to write a restart file at a specific run time. In
order to do that, first I keep track of the mpi wall time via a
customized thermo keyword, this part works fine. Then I tried to force a
write_restart during a run. I realize you can't write a restart at any
time without the proper system initialization. So I had a periodic
restart set up via the input script and I tried calling the write()
method on the corresponding restart object defined by the Output class
whenever the run time reached the desired value. I observed that this
would work only if done at a time step compatible with the "every"
parameter of the restart command in the input script. Otherwise the
restart file isn't written correctly (Did not assign all restart atoms
correctly (../read_restart.cpp:501)).
I can't figure out why my restart file is bogus when written at a time
step that is not a multiple of the restart every parameter. Looking at
the code of the Output class, it seems to me that, whenever the time
step is a multiple of 'every', the restart->write() method is called
without any more precaution. So why can't I call it at a different time
step?

you can, but you have to make sure that atoms are properly reneighbored.
please have a look at Neighbor::decide() in neighbor.cpp

axel.

Thanks that helped. I solved my issue by making the program believe the next periodic restart is to be done at the next time step whenever my thermo function detects that the run time is right. That way every precaution like reneighboring is done transparently.

Regards,
Jonathan Severin