Lammps rerun failed with read_dump error

I am using LAMMPS (29 Aug 2024) rerun with the following script

units           metal
boundary        p p p
atom_style      atomic
neighbor        1.0 bin

box          tilt large

read_data    data.lmp
change_box   all triclinic

mass   1  15.999000
mass   2  1.0080
mass   3  14.0067
mass   4  32.065
mass   5  12.0107
mass   6  18.9984
mass   7  6.941
mass   8  35.45
mass   9  30.974
mass  10  10.811
mass  11  79.90
mass  12  253.8
mass  13  28.0855
mass  14  55.85
mass  15  22.9898
mass  16  39.0983
mass  17  65.38

dump TRAJ all custom 100 mlmd_out.lammpstrj id type element xu yu zu
dump_modify TRAJ  sort id element O  H  N  S  C  F  Li  Cl  P  B  Br  I  Si  Fe  Na  K  Zn

rerun mlmd.lammpstrj first 0 last 10000000 every 100 dump xu yu zu x y z ix iy iz vx vy vz fx fy fz box yes

But it just keep reporting error

rerun mlmd.lammpstrj first 0 last 10000000 every 100 dump xu yu zu x y z ix iy iz vx vy vz fx fy fz box yes
ERROR: Read_dump must use at least either 'id' or 'type' field (src/read_dump.cpp:1173)
Last command: rerun mlmd.lammpstrj first 0 last 10000000 every 100 dump xu yu zu x y z ix iy iz vx vy vz fx fy fz box yes

The output of head -n 10 mlmd.lammpstrj is like the below

ITEM: TIMESTEP
0
ITEM: NUMBER OF ATOMS
4906
ITEM: BOX BOUNDS xy xz yz pp pp pp
0.0000000000000000e+00 3.7442024306722175e+01 0.0000000000000000e+00
0.0000000000000000e+00 3.7442024306722175e+01 0.0000000000000000e+00
0.0000000000000000e+00 3.7442024306722175e+01 0.0000000000000000e+00
ITEM: ATOMS id type xu yu zu x y z ix iy iz vx vy vz fx fy fz
742 1 0.142467 0.407191 0.355379 0.142467 0.407191 0.355379 0 0 0 0.299873 -0.644043 -4.79188 0.317896 0.668693 -1.11531

How can I fix the error to make the rerun work?

Hi @link89,

The error is quite explicit. You are not using either the type or id fields in the keywords of your rerun command, which uses read_dump in its implementation. Also note that some of the keywords you pass are not valid.

See the related documentation for details.

No. It turns out that xu yu zu is not supported. It works by just removing them.

Indeed, your error raises an ambiguous error message because you put your incorrect keyword at the first position.

This deserves a small patch.

2 Likes

Thank you for solving the problem that has been bothering me for a long time. However, there is still one issue, which is that I found that the read_rump command has mol as the keyword, but when I added this to my own command, an error occurred: Unknown read_rump keyword: mol. Do you know the reason for this situation?

Hi @ghuanhuan9,

It’s very hard to tell without the exact command you type and lammps version.

Please don’t necropost this thread and open a new one explaining your issue. It might be different from the one link89 was dealing with.

1 Like

The support for reading molecule IDs from native dump files was added only very recently.
Most likely your LAMMPS version is too old. You need LAMMPS version 10 December 2025 or later.