read_dump bug

I’m getting incorrect error messages from the read_dump command using the July 25 version of lamps

Here is the original dump command that produces the file config

dump 1 all custom 10000 config id mol type x y z ix iy iz

If I do the following read_dump command

read_dump config 0 id mol type x y z ix iy iz

I get the following error message.

ERROR: Read_dump must use at least either ‘id’ or ‘type’ field (…/read_dump.cpp:1186)
Last input line: read_dump config 0 id mol type x y z ix iy iz

This error message occurs also if

  1. the file config is not there !
  2. the file config is there, but NSTEP value is not in the file
  3. the file config is there and NSTEP is in the file, AND id and type are in the read_dump command.

There error messages need to be corrected, and there appears to be a bug that is making a correct command fail.

According to the documentation, the “mol” attribute is not supported by read_dump and triggers this error.

We have improved the error message. But it is not simple to have an accurate error message in this case since the detection or additional arguments is done through stopping to parse arguments when an unexpected property is encountered. In your case only the ID property is present at this point and that would be the same if there were no attributes given (since ID is added by default).

The command is not correct. Sorry.

P.S.: also the “id” and “type” attributes are not documented but are silently accepted since they can get added by default. I am adding some corrections to the read_dump command for the next feature release and will also backport them to the next stable release update. For the next feature release I am also trying to add the “mol” attribute as a supported property for the native reader.

I encourage adding the mol attribute as it is a key attribute that needs to be part of rerun and read_dump for analysis purposes.

@msteve The change is already on the way: Collected small fixes and updates by akohlmey · Pull Request #4800 · lammps/lammps · GitHub
It should be included in the next LAMMPS feature release due tomorrow (unless some issue turns up causing an unexpected delay).