passing restart file across the versions of LAMMPS

Dear Lammps users,

When I read the restart file written by same version LAMMPS, this is the output:

LAMMPS (3 May 2012)[…]
Reading restart file …
[…]

Step Temp KinEng PotEng TotEng Pxx Pyy Pzz
0 0 0 8319283.6 8319283.6 -6.9149398e-08 -1.150786e-07 -1.1679566e-06
1 1.3509226e-14 6.5612986e-12 8319283.6 8319283.6 -6.8768297e-08 -1.1502018e-07 -1.1677873e-06

and when I read the data file (which is generated through restart2data by processing restart file written by LAMMPS (3 May 2012) ), this is the output:

LAMMPS (3 Apr 2013)

[…]
Reading data file …

[…]

Step Temp KinEng PotEng TotEng Pxx Pyy Pzz
0 0 0 8318826.7 8318826.7 -0.61891411 -0.61891415 -0.6189152
1 1.3509226e-14 6.5612989e-12 8318826.7 8318826.7 -0.6189141 -0.61891415 -0.6189152

apaprently, pressure values are getting altered. Any suggestions on passing restart file across the versions of LAMMPS with out affecting pressure values?

How do we know the discrepancy is not due to inconsistencies in your input?

Restart files store much more information than data files.

Axel.

How do we know the discrepancy is not due to inconsistencies in your input?

Both the cases are run by same input file except using read_restart in
first case and read_data in second case.

Restart files store much more information than data files.

Yes, but reading restart file of other LAMMPS version is not feasible.
I am trying to use the older version's output from a minimization run with
very low pressures and temperatures. When I am reading that using current
version, pressure values are changing and temperatures are retaining. I
think, since data file does not contain force values, in current version
run, it computes newly from x , v. and failing to produce same forces as at
the end of previous run, so the change in pressures. Correct me if wrong.
And suggest any way to produce same pressures while using restart file
across versions of LAMMPS.

Prasad

Sorry, but this is no convincing evidence. On the contrary, your description makes it even more likely that your read data based input is missing something. Restart files are quite compatible across versions and I don't recall any recent changes.

If you believe that lammps is at fault, then please provide more tangible evidence.

Axel.

Reading restart file …

WARNING: Restart file version does not match LAMMPS version (…/read_restart.cpp:470)
restart file = 3 May 2012, LAMMPS = 3 Apr 2013
WARNING: Restart file used different # of processors (…/read_restart.cpp:517)
orthogonal box = (-50 -50 -5000.51) to (50 50 5000.51)
1 by 1 by 1 MPI processor grid
ERROR: Invalid flag in force field section of restart file (…/read_restart.cpp:792)

Same force field definitions used in both runs, at restart write and restart read. No such error found while reading this restart file using LAMMPS 3 May2102.

Well, Steve will probably be able to explain what is causing this. Nevertheless, that doesn't change the fact that you may need additional input statements to reproduce a restart via read_data.

Axel.

I have no idea. Without seeing a minimal input script that reproduces
the problem, it could be anything. There is no guarantee that an old
restart file will work with current LAMMPS. You can use the old restart2data
to convert it to a data file, and read it in the current version with read_data.

Steve

Dear Dr.Steve,
Input script attached here, and the error while running with Lammps3Apr2013

Reading restart file …

WARNING: Restart file version does not match LAMMPS version (…/read_restart.cpp:470)
restart file = 3 May 2012, LAMMPS = 3 Apr 2013
WARNING: Restart file used different # of processors (…/read_restart.cpp:517)
orthogonal box = (-50 -50 -5000.51) to (50 50 5000.51)
1 by 1 by 1 MPI processor grid
ERROR: Invalid flag in force field section of restart file (…/read_restart.cpp:792)

I’m sorry, Pls ignore the previous mail. Here is the input script

input.1010c60-l1000nm-pcff (2 KB)

One possible problem with the script
is that you are doing this:

pair_style lj/class2 9.5
pair_modify tail yes

and then reading the restart file. Reading
a restart file will create a new pair style
and wipe out the previous one. So the tail
setting will disappear. Ditto for your
special_bond settings.

You should not really do anything in the script
before reading the restart file, as it may wipe
out settings you think you have set.

In your first email, you are trying to read a new
restart file with an older version of the code.
I don’t see any reason why you should want/need
to do that.

Steve

Even after moving the ‘read_restart rs_1010c60_l1000nm’ line above the force field section, resulting the same error.

I’d like to try to present my problem once again.

Previously I used Lammps 3May2012. Using that version, I generated a restart file of minimized CNT.
Now, I would like to / have to use 3Apr2013 Lammps. So I have to read_restart that file. When I am attempting that the error is:
ERROR: Invalid flag in force field section of restart file (…/read_restart.cpp:792)

Even after moving the 'read_restart rs_1010c60_l1000nm' line above the
force field section, resulting the same error.

I'd like to try to present my problem once again.

Previously I used Lammps 3May2012. Using that version, I generated a
restart file of minimized CNT.
Now, I would like to / have to use 3Apr2013 Lammps. So I have to
read_restart that file. When I am attempting that the error is:
ERROR: Invalid flag in force field section of restart file
(../read_restart.cpp:792)

The error simply means that the new version is not able to recognize the
entry from your previous restart file. U can prefer reading the doc. page
or run your simulation on the same version of LAMMPS.

Sagar

No, it’s the opposite of that. You are trying to use an old version of LAMMPS
to read a restart file generated by a new version of LAMMPS. As I said
before, I don’t think that is wise, nor see why you would want to do that.
If you want to use an old version of LAMMPS, then use the old version
to generate the restart flie.

Also, in your first post, you said you were getting difference in thermo
output when you did this. Now you say you get an error message (before
thermo output). And the error message is a reasonable one if something
in the format of the restart file changed.

Steve

Dr. Steve,
I am using pair_style lj/class2 9.5, currently working with recent version of Lammps(14May2013).
Trying to read_restart a restart file created by an older version Lammps(3May2012).
and facing an error: “Invalid flag in force field section of restart file”

When I tried to print the flag in ReadRestart::force_fields() section of read_restart.cpp, flag taking value of 7, so that the error.

LAMMPS (14 May 2013)
Reading restart file …
WARNING: Restart file version does not match LAMMPS version (…/read_restart.cpp:470)
restart file = 3 May 2012, LAMMPS = 14 May 2013
WARNING: Restart file used different # of processors (…/read_restart.cpp:517)
orthogonal box = (-50 -50 -5000.51) to (50 50 5000.51)
1 by 1 by 1 MPI processor grid
*********** PRAS flag = 0
*********** PRAS PAIR = 0, BOND = 1, ANGLE = 2, DIHEDRAL = 3, IMPROPER = 4
*********** PRAS flag = 7
*********** PRAS PAIR = 0, BOND = 1, ANGLE = 2, DIHEDRAL = 3, IMPROPER = 4
ERROR: Invalid flag in force field section of restart file (…/read_restart.cpp:795)

I request you to help me get out of this situation.

From the Lammps mail lists I came to know this kind of problem with read_restart while using hybrid pair style is found bug and it was fixed already. But still I am facing it.

Note: Since I need to work with recent features of lammps, I must use 14May2013 Lammps. The restart file from which I should continue my work was created by 3May2012 Lammps. Since its highly difficult to me to start from beginning to arrive at the similar configuration as in that restart file, I am trying to use that particular restart file only. Hope I put the problem clear to you at least this time.

regards.
Prasad

Dr. Steve,
I am using pair_style lj/class2 9.5, currently working with recent version
of Lammps(14May2013).
Trying to read_restart a restart file created by an older version
Lammps(3May2012).
and facing an error: "Invalid flag in force field section of restart file"

as has been said many times, restart files should not be expected to
be portable across such a large time between the two versions.

When I tried to print the flag in ReadRestart::force_fields() section of
read_restart.cpp, flag taking value of 7, so that the error.

LAMMPS (14 May 2013)
Reading restart file ...
WARNING: Restart file version does not match LAMMPS version
(../read_restart.cpp:470)
  restart file = 3 May 2012, LAMMPS = 14 May 2013
WARNING: Restart file used different # of processors
(../read_restart.cpp:517)
  orthogonal box = (-50 -50 -5000.51) to (50 50 5000.51)
  1 by 1 by 1 MPI processor grid
*********** PRAS flag = 0
*********** PRAS PAIR = 0, BOND = 1, ANGLE = 2, DIHEDRAL = 3, IMPROPER = 4
*********** PRAS flag = 7
*********** PRAS PAIR = 0, BOND = 1, ANGLE = 2, DIHEDRAL = 3, IMPROPER = 4
ERROR: Invalid flag in force field section of restart file
(../read_restart.cpp:795)

I request you to help me get out of this situation.

there is no way to make this work.

From the Lammps mail lists I came to know this kind of problem with
read_restart while using hybrid pair style is found bug and it was fixed
already. But still I am facing it.

Note: Since I need to work with recent features of lammps, I must use
14May2013 Lammps. The restart file from which I should continue my work was
created by 3May2012 Lammps. Since its highly difficult to me to start from
beginning to arrive at the similar configuration as in that restart file, I
am trying to use that particular restart file only. Hope I put the problem
clear to you at least this time.

you can easily import the configuration from the old simulation by
generated a data file using the restart2data version that is
compatible with the old restart and then import the configuration into
the new simulation using read data. as mentioned before as well, this
requires to make *all* options explicit, i.e. you cannot depend on
anything beyond the coordinates/velocities, box and topology being
imported.

axel.

Dr. Axel,
This restart2data and read data scheme is not working for me. As I explained earlier, the very minute change in the coordinates (may be after 4th or 5th decimal) affecting the pressure components.

Dr. Axel,
This restart2data and read data scheme is not working for me. As I explained
earlier, the very minute change in the coordinates (may be after 4th or 5th
decimal) affecting the pressure components.

using restart2data is your only reasonable option. as of august 2008
restart2data writes out coordinates, velocities and box dimensions
with 16 digits accuracy. that is fully containing the accuracy of
IEEE-754 double precision floating point numbers. please see
http://en.wikipedia.org/wiki/IEEE_754-1985.

so if you get *siginificant* differences (you have to produce an
example that reproduces that), there are two likely explanations:
- you are not doing the restarting correctly, i.e. you may be missing
some settings that are stored in a restart, but not in the data file.
- there was a bug in a feature you are using in the old code that was
fixed since, thus indicating that your "old" data is probably flawed.

there could also be a newly introduced bug, however, the other two
cases are *by far* more likely and in order to make us believe of it,
you need to produce convincing evidence.

in summary, there is currently no indication that LAMMPS is not doing
what it promises to do. the problems that you have are likely due to
incorrect usage and not due to LAMMPS.

axel.