restart file

Dear LAMMPS developers and users,

Greetings, I am encountering a problem that might be related to the backward compatibility of restart file. Attached please find my restart file (0.binary) created under lammps-27Nov13 version.

I am using lammps-17Dec13 to read the restart file, and it says, “ERROR: Invalid LAMMPS restart file (…/read_restart.cpp:966)”. Then I tried to use the old restart2data.cpp, it gave me 0.ascii, where all the atom index numbers are missing, so the file is not usable. Hence, did I make any mistake in the process? I would greatly appreciate if any hint/direction is given. Thank you very much.

Regards,

LC Liu

0.ascii (268 KB)

0.binary (237 KB)

As you can see from the bugfix / changelog page, there have been changes to the format. Your best option is probably to use the write_data command with the old executable instead of restart2data. Axel.

Hi, Axel,

Thanks, and is seem to be the fastest cure. Now I am converting a large amount of (old) binary restart files to ascii topology files,

  1. what I need are only the atom location, velocity, and bond/angle relation. Is there an option like -nc in restart2data that remove the pair information?

  2. Please accept my apologies if I misunderstand something. From the latest feature of 23 Nov 2013, it seems that write_data is an one-time command. Is there anyway to periodically write the data output, just like command restart?

Thanks again for the help.

LC Liu

Hi, Axel,

Thanks, and is seem to be the fastest cure. Now I am converting a large
amount of (old) binary restart files to ascii topology files,

1. what I need are only the atom location, velocity, and bond/angle
relation. Is there an option like -nc in restart2data that remove the pair
information?

not that i know of. at least not yet. i never used it. does it do any
harm? you can always override it later, through changing the pair
style and/or resetting pair coefficients.

2. Please accept my apologies if I misunderstand something. From the latest
feature of 23 Nov 2013, it seems that write_data is an one-time command. Is
there anyway to periodically write the data output, just like command
restart?

no. you should update to the very latest version of LAMMPS. the
functionality of restart2data is now integrated into LAMMPS directly.
you can still write out restart files as before and convert them to
data files.

Hi, Axel,

Thank you so much for the valuable comments. The reason I need to prepare topology files is because I am giving them to other folks who use other tools. Well I can do a little coding to convert them by myself…thought that it is no harm to ask.

Yes the read_restart -> write_data trick works. Thanks for the help.

As for the LAMMPS executable, I use it as an “plain” executable (as stated in the webpage lmp_g++ -r restartfile datafile) to convert binary to ascii. The binary files are created under 27-Nov version, and the following messages are shown. (I am simulating TIP4P/2005 water, FYI)

LAMMPS (27 Nov 2013)
Reading restart file …
orthogonal box = (0 0 0) to (26.0644 26.0644 26.0644)
1 by 1 by 1 MPI processor grid
1536 atoms
1024 bonds
512 angles
Finding 1-2 1-3 1-4 neighbors …
2 = max # of 1-2 neighbors
1 = max # of 1-3 neighbors
1 = max # of 1-4 neighbors
2 = max # of special neighbors
System init for write_data …
ERROR: Pair style requires a KSpace style (…/pair_lj_cut_coul_long.cpp:706)

LAMMPS (17 Dec 2013)
Reading restart file …
ERROR: Invalid LAMMPS restart file (…/read_restart.cpp:966)

Namely, neither works. Did I miss something?

LC Liu

Hi, Axel,

Thank you so much for the valuable comments. The reason I need to prepare
topology files is because I am giving them to other folks who use other
tools. Well I can do a little coding to convert them by myself....thought
that it is no harm to ask.

Yes the read_restart -> write_data trick works. Thanks for the help.

As for the LAMMPS executable, I use it as an "plain" executable (as stated
in the webpage lmp_g++ -r restartfile datafile) to convert binary to ascii.
The binary files are created under 27-Nov version, and the following
messages are shown. (I am simulating TIP4P/2005 water, FYI)

LAMMPS (27 Nov 2013)
Reading restart file ...
  orthogonal box = (0 0 0) to (26.0644 26.0644 26.0644)
  1 by 1 by 1 MPI processor grid
  1536 atoms
  1024 bonds
  512 angles
Finding 1-2 1-3 1-4 neighbors ...
  2 = max # of 1-2 neighbors
  1 = max # of 1-3 neighbors
  1 = max # of 1-4 neighbors
  2 = max # of special neighbors
System init for write_data ...
ERROR: Pair style requires a KSpace style (../pair_lj_cut_coul_long.cpp:706)

LAMMPS (17 Dec 2013)
Reading restart file ...
ERROR: Invalid LAMMPS restart file (../read_restart.cpp:966)

Namely, neither works. Did I miss something?

yes. the binary restart format has changed between versions multiple
times recently. as a rule, you cannot expect restarts to work with
different versions of LAMMPS. the recent changes are mean to improve
portability of restart files, but that means that they become
incompatible with older version restart files. as indicated by
LAMMPS Molecular Dynamics Simulator, the -r flag didn't work properly
until after the dec 7 version. thus what you are trying to do cannot
work. you have to stay consistent with the LAMMPS version.

axel.