[lammps-users] request for feature: ascii restart files

Hi Steve, et. al.

I'd like to make a feature request. There is currently a tool, "restart2data.cpp" (which I guess is maintained by the LAMMPS maintainers?). One might use this to e.g. take a binary restart file generated on a PPC machine, make an ascii data file out of it, and then restart a run on x86 (with possible chaotic divergence of MD trajectories... which is fine).

The problem is that I have hacked in various pair potentials and bonded interactions into the LAMMPS proper. This breaks the restart2data.cpp solution, since it is based on the canonical LAMMPS distro. My current workaround is to use ascii dump files rather than binary restart files. There is some trivial but ugly and not so robust cut-and-paste python gook which is necessary to convert the "dump" file into a file in the "data" format which is acceptable for a LAMMPS restart.

A much cleaner solution would be to have an "ascii" option to the "restart" command which would write files in the "data" format. Seems like this would not be so tough to implement (?). Another option would be to incorporate the python dump->data cut-and-paste stuff into Pizza.py, but it seems like an "ascii restart" in the LAMMPS proper would be a nicer solution.

Thoughts?

Cheers,
Craig

There is currently a tool,
"restart2data.cpp" (which I guess is maintained by the LAMMPS
maintainers?).

Yes, we maintain it and it is somewhat a pain to keep up-to-date.
We try to sync it with every release, but obviously it does not
contain the info for new options you add to LAMMPS.

A much cleaner solution would be to have an "ascii" option to the
"restart" command which would write files in the "data" format.
Seems like this would not be so tough to implement (?).

That sounds like a good idea, but I can think of a few non-trivial issues.
First, for LAMMPS to be able to write out the coeffs for every potential,
every potential file (pair, bond, angle, etc) would need to have code
to format this appropriately. This would essentially be the same lines
of code that are in the tool (restart2data.cpp) - they would have to
be added to each potential class in LAMMPS. Maybe that is the right
way to do it - just some tedious work at this point.

The bigger issue is that the data file has full lists of atoms, bonds, etc.
That info is not stored that way in LAMMPS. No processor knows it. So it
would have to be collected in large arrays by a processor to dump it out.
Not impossible for most problems in the large memories of most chips,
but not very elegant.

Another solution is to use the data and dump tools in pizza, which are already
set up to do this. Not from restart files, but from data/dump files.
Something like this:

d = data("data.original")
d.map(1,"id",5,"x",6,"y",7,"z") # necessary, since every data
file is different
dm = dump("dump.run")
d.newxyz(dm,1000) # puts xyz from snapshot 1000
into data file
d.write("data.new") # now you have a new data file

If more data quantities than xyz changed, you might have to manipulate
the data fields at a lower level, or add new functions to data.py

Steve