Error · LAMMPS · 5 min read

ERROR: Lost atoms: original N current M

Example
ERROR: Lost atoms: original 4000 current 3998
For more information see https://docs.lammps.org/err0008 (src/thermo.cpp:550)

The numbers are an example: the first is how many atoms the run started with, the second how many LAMMPS can find now. The second line, as the LAMMPS source code writes it, points to the manual's own page on this error; the file and line number at its end change between versions.

Checked against the docs · LAMMPS stable release 30 Sep 2026 · Last checked 11 November 2026 · Spot a mistake? Tell us

Short answer

LAMMPS counted fewer atoms than it started with, almost always because some atoms moved impossibly far in one step (overlapping atoms at the start, too large a time step or forces that blew up). Minimize the structure before the dynamics and shorten the time step first; only turn the check off when atoms are meant to leave the box.

What does this error mean?

When LAMMPS runs on several processors, it cuts the box into pieces called subdomains, one per MPI process, and each process "owns" the atoms in its piece. Every time it writes thermo output (the table of step, temperature, energy and so on), LAMMPS checks that the owned atoms still add up to the number it started with. If they do not, some atoms are lost, and by default the run stops with this error.

The thermo_modify page says when an atom counts as lost: it crossed a non-periodic box boundary, or it moved more than a box length outside the box, or more than one subdomain, before LAMMPS rebuilt its neighbor lists (reneighboring, when LAMMPS re-sorts atoms into subdomains and refreshes the list of nearby pairs). The manual calls the second case "typically due to bad dynamics": too large a time step, or huge forces and velocities.

What usually causes it?

  • Atoms that start too close. Overlapping atoms feel enormous forces on the first step and shoot off. The manual notes that atoms sitting almost on top of each other cannot be seen in a picture of the structure, and that a close pair can sit on opposite sides of a periodic box.
  • Too large a time step for how steep the potential is and how light the atoms are.
  • A box that changes fast, for example a large starting box with shrink-wrapped boundaries (s) that collapses on the first step.
  • The wrong units for the potential. The manual lists this as a frequent cause of many problems; a potential file from a paper or a database may not carry the UNITS: tag that lets LAMMPS check it.
  • Atoms that are meant to leave, as in sputtering or evaporation. Here losing atoms is the physics, not a fault.

The error often shows only in parallel runs. The manual's advice is that a run that survives in serial may have the same problem, only without the symptom.

What should I try, in order?

  1. Find when it fails. If the run stops in its first few steps, suspect overlapping atoms. The manual's test: add delete_atoms overlap 0.1 all all and see how many atoms it deletes; any at all means close contacts. Then fix the structure, or keep the deletion if that is acceptable for your system.
  2. Minimize before the dynamics. A minimize before the first run removes the worst forces; the manual suggests it for exactly this case. Overlapping atoms are one of the things to check before you submit.
  3. Shorten the time step. The manual lists reducing the time step among the cures. The defaults depend on units: 1.0 fs for real, 0.001 ps (1 fs) for metal. See Choose a time step for how to pick one.
  4. Ease the system in. For the first part of the run, fix nve/limit caps how far an atom may move in one step, which the manual describes as useful when starting from highly overlapped atoms; fix dt/reset adapts the time step to the displacements. Switch back to your normal integrator once the system has settled.
  5. Check the units against the potential. Make sure the units command matches what the potential was made for (most bundled files use metal; ReaxFF files use real).
  6. Go back to conservative neighbor settings. The defaults (neigh_modify delay 0 every 1 check yes) are chosen to be safe; if you raised delay or every, put them back. The manual warns that rebuilding the neighbor list less often has diminishing returns and increasing risks.
  7. With a shrink-wrapped box that collapses, use m instead of s in the boundary command, as the manual suggests.
  8. Only if atoms are meant to leave: thermo_modify lost warn (keep going and warn once) or thermo_modify lost ignore (stop checking). The manual is clear that ignoring a problem does not solve it, so use this only when losing atoms is the physics.

To see what goes wrong, write trajectory frames often near the failure (dump_modify delay holds output back until then) and look at them, ideally on a small test system that fails quickly.

When this error is in a job's output, Verlet recognizes it and explains in Analyze, in plain words, what usually causes it and what to try; everything on this page works without it.