About this page
Troubleshooting- What this page solves
- LAMMPS printed an ERROR or WARNING line and stopped, or it ran without an error but the results look wrong. You want to know whether the input is wrong, the units are wrong, or the system itself has blown up, and what to change.
- Who it is for
- Graduate students and researchers who can already run lmp and have hit an error or odd results.
- What you will have
- A cause and a fix for each error text, a general troubleshooting order, and a minimal input template for reproducing an error.
- Covers
- Find causes and fixes by error text, sorted by how often they occur
- Dynamics errors: Lost atoms, Out of range atoms, Bond atoms missing, and NaN
- Data file, command order, missing package, build, MPI and Windows errors
- Runs that hang or give odd results without an error, plus ReaxFF-specific errors
- Does not cover
- Installing LAMMPS and writing the first input file (see the LAMMPS install guide)
- Physical choice and validation of force-field and potential parameters
- Errors from other molecular simulation programs such as GROMACS
- Individual errors not listed here: send the error text and input files to the forum (see the checklist at the end)
Main steps
Workflow
Why this stepErrors can have many causes. Narrowing the cause in a fixed order is faster than changing parameters at random, and it avoids changing several things at once and not knowing which one mattered.
- 01
Read the whole error
Note the error text, whether it is ERROR or ERROR on proc N, the source location and the err number, and open the official explanation. Read all earlier WARNINGs; warnings issued during a run are printed only to the screen, not to the log file.
- 02
Decide whether it is the input stage or the run stage
Errors before or after box definition and before run are usually syntax, command order or data file problems. Errors in the middle of a run are usually dynamics problems.
- 03
Shrink the interval and find where it starts
Set thermo to 1 to 10 and output pe, press, temp and lx. Write a dump every 1 to 10 steps, and use dump_modify delay to record only the stretch before the error.
- 04
Build a minimal reproducer
Reproduce the same error with a small system, one core and the fewest commands. If the small system fails within a few hundred steps, each iteration takes only minutes.
- 05
Change one variable at a time
Change one thing per run: minimize first, then check units and parameters, then the timestep, and only then the neighbor list. Changing several things at once hides the real cause.
- 06
Confirm the fix
A vanished error does not make the result trustworthy. Run at least a stretch of NVE to check energy conservation, and check that Dangerous builds is 0.
Concepts and judgment
Reading errors
Source location
The parentheses at the end of the ERROR line give the source file and line number, e.g. (src/thermo.cpp:526). Line numbers change between versions, so compare against the source of the same version.
ERROR versus ERROR on proc N
The former is an error detected consistently by all processes; the latter is detected and raised by a single process, and a serial run also prints it as ERROR on proc 0 (tested on this page: Substitution for illegal variable, Neighbor list overflow and Too many neighbor bins all use this format in serial). Lost atoms, Out of range and Bond atoms missing all depend on domain decomposition, so the error may appear or disappear with a different number of processes. That means the input itself is unstable; it does not mean “changing the core count fixed it”.
Last input line
Most input syntax errors print the command being executed. Run-time errors such as Lost atoms are flagged NOLASTLINE and do not print this line, so read the thermo output before the error.
Each entry below explains under which condition LAMMPS raises the error. The fixes are in the troubleshooting section.
Lost atoms
The reported step comes later than the step where the atoms were actually lost, because by default LAMMPS checks the total atom count only on steps that write thermo output. With thermo 1000, the reported step can be up to 999 steps after the atoms were actually lost, so the first step is to shrink the thermo interval.
thermo_modify lost accepts error (default), warn and ignore. The official documentation says ignore is only for simulations where atoms are supposed to leave the system. With ignore the atom count changes, output formats that require a constant atom count such as dcd will fail, and statistics will be biased.
Out of range atoms - cannot compute PPPM
PPPM spreads each charge over several surrounding grid points. In parallel, each process holds only the grid for its subdomain plus the skin. If an atom moves out of that range before the next neighbor list rebuild, LAMMPS reports Out of range atoms - cannot compute PPPM. The “range” is the subdomain, which equals the whole box only in serial runs, so enlarging the box does not fix this error.
A widely shared practice in the Chinese community (a PPPM troubleshooting article by the same author on CSDN and Zhihu) splits the problem in two: if atoms are not moving very fast, rebuilding more often with neigh_modify delay 0 every 1 check yes is enough; if forces and velocities are very high, also reduce the timestep (the article goes down to 0.1 fs) and revisit the model and force field parameters; early in structure optimization, you can leave PPPM off. This agrees with the official explanation, provided you first confirm there are no overlapping atoms; otherwise a smaller timestep only delays the error.
Bond atoms missing
Bond atoms missing means the other atom of a bond is outside the communication cutoff. By default the communication cutoff is the pair cutoff plus the skin. Force fields with very short cutoffs, such as repulsive-only LJ, or pair_style none need a larger cutoff via comm_modify cutoff; if the system has already blown up, a larger cutoff does not help.
Too many neighbor bins
A bin is the spatial grid used for neighbor searching, and its edge length defaults to half the largest pair cutoff. If the box grows until the bin count exceeds the integer limit, LAMMPS reports Too many neighbor bins.
Neighbor list overflow
Per-atom preallocation of the neighbor list is controlled by the one and page settings of neigh_modify. The defaults are one 2000 and page 100000. page should be at least 10 times one, and 50 to 100 times is recommended.
NaN and Non-numeric errors
LAMMPS does not always stop immediately when NaN appears. The run may continue with temperature and pressure showing nan, so the step where NaN first appears is the key clue.
Set thermo to 1 and run again to see which step NaN first appears. If it is already NaN at step 0, the most common cause is overlapping atoms. With periodic boundaries, if the box is set to the extreme atom coordinates with no gap, atoms on opposite sides overlap through the periodic boundary.
Build and packages
The 22Jul2025 release built with CMake requires CMake 3.16 or later and a compiler that supports at least C++11. It uses C++17 automatically when available, and KOKKOS requires C++17. After adding packages you must recompile, and the traditional make cannot install packages and compile in the same command, so use two separate commands.
Units
With units real, the default timestep is 1.0 fs and skin 2.0 Å; with units metal, the default timestep is 0.001 ps and skin 2.0 Å. Converting a real input to metal while keeping timestep 1.0 makes the timestep 1 ps, 1000 times larger. ReaxFF potentials use real; most EAM and Tersoff potential files use metal.
Reference and appendix
Cheat sheet
The “Official explanation” column is the address printed after For more information see at the end of the error, and can be opened directly. Tested on this page: the first 18 rows were all triggered with small inputs on conda-forge LAMMPS 22Jul2025 update6 (macOS arm64, CPU build), and the error texts and err numbers match the table; the last 4 rows (MS-MPI, msmpi.dll, make and GPU) need environments not available on the test machine and were not reproduced.
| Error text | Most common actual cause | What to check first | Official explanation |
|---|---|---|---|
| ERROR: Lost atoms: original N current M | Atoms move too far in one step: initial overlaps, timestep too large, wrong units or parameters, boundary settings | Set thermo to 10 and find the step where PotEng, Press and Temp start to look abnormal | docs.lammps.org/err0008 |
| Out of range atoms - cannot compute PPPM | A charged atom moves out of its process's subdomain plus skin in one step | Whether Dangerous builds at the end of the log is non-zero; if it fails at step 0, check for overlaps | docs.lammps.org/err0004 |
| Bond atoms X Y missing on proc P at step S | Bonded atoms are farther apart than the communication cutoff; usually the system has already blown up | Temperature and pressure before the error; whether the pair cutoff is very short (e.g. repulsive-only LJ) | docs.lammps.org/err0005 |
| Non-numeric pressure - simulation unstable (and the atom coords / box dimensions variants) | Forces overflow to NaN or Inf | Whether NaN already appears at step 0; how many atoms delete_atoms overlap removes | docs.lammps.org/err0006 |
| Temp or Press shows nan or -nan in thermo output, but the run continues | Same as above; LAMMPS does not always stop immediately | Same as above; rerun with double-precision GPU settings | Section Pressure, forces, positions becoming NaN or Inf in Errors_details |
| Too many neighbor bins | The box has expanded too much, or the largest cutoff is too small | Add lx ly lz to thermo and see whether the box is growing quickly | docs.lammps.org/err0009 |
| Domain too large for neighbor bins | Some atoms are blown far away (s boundaries), or fix deform or a barostat has grown the box too much | Whether boundaries are s; the rate and units of fix deform | docs.lammps.org/err0017 |
| Cannot use neighbor bins - box size << cutoff | One box dimension is much smaller than the cutoff, common in thin-layer systems | Box length in the thinnest direction versus the pair cutoff | docs.lammps.org/err0015 |
| Neighbor list overflow, boost neigh_modify one | An atom has more neighbors than one (default 2000); a wrong box size can also inflate the density | Whether the box dimensions are correct; whether the data file mistakenly uses fractional coordinates | docs.lammps.org/err0036 |
| Did not assign all atoms correctly | With non-periodic boundaries, some atoms in the data file lie outside the box | Whether xlo xhi / ylo yhi / zlo zhi enclose all coordinates | docs.lammps.org/err0016 |
| Invalid atom ID in Bonds section of data file | A bond references an atom ID ≤ 0, larger than the maximum ID, or the same atom at both ends | The atoms count in the header versus lines in the Atoms section; whether IDs from the conversion tool start at 1 | Errors_messages |
| Incorrect format in Atoms section of data file | atom_style does not match the number of columns in the data file, or the header count exceeds the actual lines | Whether atom_style matches the comment on the Atoms section header (e.g. # full) | docs.lammps.org/err0002 |
| Unknown identifier in data file | A header keyword or section name is misspelled, or the first line contains a header keyword (the first line is always skipped as a comment) | The first line of the data file; capitalization of section names | docs.lammps.org/err0001 |
| Unrecognized pair style 'xxx' is part of the YYY package which is not enabled in this LAMMPS binary | The executable was built without package YYY | Installed packages in the lmp -h output | docs.lammps.org/err0010 |
| Incorrect args for pair coefficients | pair_coeff format does not match pair_style, e.g. mixing up eam and eam/alloy, or missing the sub-style name with hybrid | Compare with the pair_coeff examples on that pair_style's doc page | docs.lammps.org/err0021 |
| Numeric index X is out of bounds | A type number in pair_coeff or bond_coeff exceeds the number of types declared in the data file | atom types and bond types in the data file header | docs.lammps.org/err0019 |
| XXX command before / after simulation box is defined | Wrong command order: units and atom_style must come before read_data, pair_coeff after it | Position of the command relative to read_data / create_box | docs.lammps.org/err0033, err0034 |
| Substitution for illegal variable | A multi-letter variable without braces: $cutoff is parsed as $c | Change it to ${cutoff} | docs.lammps.org/err0013 |
| job aborted: [ranks] message ... abort code 1 (MS-MPI) | MPI-level summary; LAMMPS has already exited because of an input error | Remove -screen none and read the last ERROR in log.lammps | MatSci forum thread (see references) |
| Windows reports that msmpi.dll cannot be found | The MSMPI build of LAMMPS is being run, but the MS-MPI runtime is not installed or the machine was not rebooted after installing it | Whether msmpisetup.exe was installed and the machine rebooted | docs.lammps.org/Run_windows.html |
| mpicxx: command not found or mpi.h: No such file or directory during make mpi | The system has no MPI compiler wrapper or development headers | which mpicxx; without MPI, use make serial instead | docs.lammps.org/Build_basics.html |
| GPU library not compiled for this accelerator | The architecture or CUDA version the GPU library was built for does not match the current GPU and driver | The GPU_ARCH setting versus the GPU and driver version shown by nvidia-smi | docs.lammps.org/Build_extras.html |
Template
Keep only the commands needed to trigger the error. Shrink the system until the error reproduces within a few hundred steps, and keep force-field parameters in a separate file for comparison.
# Minimal reproducer: start from the failing restart or data file and keep only commands needed to trigger the error
units real
atom_style full
read_data small.data # use the smallest cell before replicate, or remove most of the solvent
pair_style lj/cut/coul/long 10.0
kspace_style pppm 1.0e-4
include ff.params # keep force field parameters in a separate file for easy comparison
thermo 1
thermo_style custom step temp pe press vol
dump d1 all custom 1 dump.min id type x y z fx fy fz
fix f1 all nve
run 200 # reproducing within a few hundred steps is enough
Measured
The numbers below come from actual runs (2026-10-10, LAMMPS 22Jul2025 update6, conda-forge CPU build, macOS arm64, unless noted).
Tested on this page (LAMMPS 22Jul2025 update6, CPU, 1 core): in an 864-atom LJ liquid, adding one atom about 0.15σ from an existing atom gives a step-0 potential energy of 5.2×10⁷, and an NVE run reports Lost atoms: original 865 current 863 at the first thermo step. Applying the in.debug above to the same structure, minimization followed by 5000 steps of nve/limit and 2000 steps of NVE runs without errors, with Dangerous builds 0. With two atoms at exactly the same position, the step-0 potential energy is inf and the pressure is nan; fix nve keeps running and the temperature stays nan afterwards.
Tested on this page (same version, 4 MPI processes): 800 atoms with ±1 charges placed randomly in a 30 Å cubic box (with severe overlaps), pair_style lj/cut/coul/long 10.0 plus pppm 1.0e-4. With neigh_modify delay 10 every 10 check no the run reports Out of range atoms - cannot compute PPPM; with the default rebuild settings the same structure reports Lost atoms instead; with the conservative settings below (skin 3.0 Å, 0.5 fs) it still reports Lost atoms; minimizing first makes it run normally. The conservative settings only fix late neighbor rebuilds; when the structure has overlaps you must minimize first.
Tested on this page: with two bonded atoms 10 Å apart, pair cutoff 2.0 Å, skin 0.5 Å and 2 processes, LAMMPS reports Bond atom missing in image check (err0014) before the run starts; adding comm_modify cutoff 12.0 lets it run. When two bonded atoms are pulled apart during the run, the message is Bond atoms 1 2 missing on proc 0 at step 4 (err0005).
Rerun with thermo 1. If NaN appears at step 0, the most common cause is overlapping atoms, which look like a single atom in a visualization. With periodic boundaries, if the box is set to the coordinate extremes without padding, atoms on opposite sides overlap through the boundary. Tested on this page: with two atoms at identical coordinates, fix nve alone raises no error and thermo keeps printing nan; with fix npt the run stops at step 0 with Non-numeric pressure - simulation unstable; a 4-process fix nve run stops with Non-numeric atom coords - simulation unstable.
ReaxFF preallocates its bond and hydrogen-bond lists from the current system plus a safety factor. With vigorous reactions, a sparse system or very few atoms per process, the lists overflow. Tested on this page: 8 RDX molecules (168 atoms) in a periodic box with 120 Å edges, NVT at 3000 K with a 0.25 fs timestep. With default settings, 1 process reported hbondchk failed at step 13617, 2 processes at step 13014 and 8 processes at step 5219. With safezone 1.6 mincap 100 minhbonds 50, both 1 and 8 processes completed 20,000 steps. The two other remedies in the official documentation are splitting a long run into segments and switching to the KOKKOS version of ReaxFF. Splitting the same system into 20 segments of 1000 steps on 8 processes still ended in a segmentation fault between steps 3000 and 4000, so splitting is not always enough.
The LAMMPS error round-up on Zhihu gives a rule of thumb of at least 100 atoms per core for ReaxFF, with 300 to 500 being better; in a pyrolysis help thread on keinsci, recurring lost atoms disappeared after the author changed the core count. More cores is not always faster: for the sparse 168-atom system above with the larger safezone, 20,000 steps took 8.0 s on 1 process and 111.5 s on 8 processes on the same machine. For small systems, measure the time per step on 1 to 2 processes before adding cores.
| Settings (real units, 1 fs baseline) | Neighbor list builds | Dangerous builds | Relative run time |
|---|---|---|---|
| delay 10, skin 2.0 Å, 1.0 fs | 1000 | 1000 | 1.00× |
| delay 0, skin 2.0 Å, 1.0 fs | 1229 | 0 | 1.04× |
| delay 10, skin 3.0 Å, 1.0 fs | 617 | 0 | 1.00× |
| delay 10, skin 2.0 Å, 0.5 fs | 1252 | 0 | 1.84× |
Hand this to an agent
Example instruction: “Here are my in.npt, system.data and error log. At step 3200 it reports Out of range atoms - cannot compute PPPM. Reproduce the error, check minimization, units and parameters, timestep and neighbor list in that order, changing one thing at a time. Once you find the cause, give me the corrected input file and an NVE energy conservation check.”
Steps the agent performs: reproduce the error in an environment with LAMMPS 2025.07.22 GPU build preinstalled; shrink the thermo and dump intervals to find where things go wrong; build a minimal reproducer; change and rerun one item at a time; run an energy conservation check on the corrected input and adversarially review the result.
Output files: the corrected in file, the log and dump from each troubleshooting round, Dangerous builds statistics and energy drift data, and a record explaining the cause and the basis for each change.
You still need to check: whether the force field and potential suit your system, whether units and parameter sources are consistent, and whether the corrected timestep and thermostat/barostat settings are adequate for the physical quantities you will analyze in your paper.
Asking for help
The official place to ask for help is the LAMMPS category of the MatSci community forum. For posts missing information, developers usually only reply “please attach a complete input”.
- LAMMPS version (first line of the log, e.g. LAMMPS (22 Jul 2025)) and platform, plus the installed packages and MPI information from lmp -h
- The complete error text, including source location and err number, as text rather than a screenshot
- A complete input that runs as is: in file, data file and potential files in a zip; avoid binary restart files where possible
- The smallest reproducing system: fewest atoms, fewest processes, shortest run
- The run command (mpirun -np 4 lmp -in ..., whether -sf gpu or -k on is used)
- Thermo output from the steps before the error
- Changes already tried and their results, e.g. “lowering the timestep from 1 fs to 0.5 fs delayed the error from step 3200 to step 9000”
- Whether serial and parallel runs agree
- Search the forum archive first: Out of range atoms is one of the most frequently asked questions on the forum
Troubleshooting by error text or symptom
Entries are roughly ordered by how often they occur. Each symptom is the error text or an observable behaviour, so match yours against it first.
ERROR: Lost atoms: original N current M (potential energy or pressure is already abnormally large at step 0, and temperature rises sharply in the first steps)
Cause: The starting structure has overlapping atoms or very close contacts.
Fix: Remove close contacts with minimize first. Or run a few thousand steps with fix nve/limit 0.1 and then switch back to NVE. The diagnostic settings are in the code below.
# Diagnostic settings: place after read_data / create_atoms and the force field, before run
thermo 10 # Lost atoms is only checked on thermo steps; shrink the interval first
thermo_style custom step temp pe ke etotal press vol lx ly lz
thermo_modify lost error norm no # keep the default error; do not switch to ignore
neigh_modify delay 0 every 1 check yes
# 1) Minimize first to remove close contacts
min_style cg
minimize 1.0e-4 1.0e-6 1000 10000
reset_timestep 0 # must come before the dump is defined, otherwise: Cannot reset timestep with active dump
# 2) Write coordinates, velocities and forces every 10 steps
dump d1 all custom 10 dump.debug id type x y z vx vy vz fx fy fz
dump_modify d1 delay 0 # if the error is known to occur near step N, change 0 to N-200
# 3) Limit per-step displacement during the initial stage (distance units; do not combine with fix shake)
fix f_lim all nve/limit 0.1
run 5000
unfix f_lim
ERROR: Lost atoms (temperature keeps rising over the first few hundred steps, and total energy drifts in one direction under NVE)
Cause: The time step is too large.
Fix: Halve the step and run again. If the error moves later or disappears, that confirms it. Typical steps: 0.25 fs for flexible water, 1 fs when SHAKE constrains bonds to H, and about 1 fs for organic systems with C, O, and N.
ERROR: Lost atoms (runs a few steps, but temperature and pressure are far off, and the log has a Changing timestep warning)
Cause: The units are wrong, or a parameter uses units that do not match.
Fix: Check the units of the potential file and the literature parameters against the units setting. For numeric symptoms, see the silent-error entries.
ERROR: Lost atoms (two atom types come closer than they should, or pass through each other)
Cause: The element mapping in pair_coeff is wrong.
Fix: Check that the element order after the file name in pair_coeff * * matches types 1, 2, and so on in the data file. With hybrid, write NULL for unused types.
ERROR: Lost atoms (atoms fly off the surface with f boundaries; the box collapses on the first step with a large box and s boundaries)
Cause: The boundary conditions do not suit the system.
Fix: Confirm the lost atoms should leave the system. For sputtering or evaporation runs, use thermo_modify lost warn. Change s boundaries to m.
ERROR: Lost atoms (atoms near fix wall have abnormal velocities)
Cause: The wall potential is too close to the box edge.
Fix: Check where the lost atoms are in the dump file. A forum case was solved by switching to fix wall/reflect.
ERROR: Lost atoms (lx changes a lot every step in thermo, with temperature rising)
Cause: The fix deform rate is too high, or the unit conversion is wrong.
Fix: Convert erate to 1/s to check it: in metal units, an erate of 0.001 equals 1e9 s⁻¹. Lower the strain rate, and check the units box or lattice setting.
ERROR: Lost atoms (temperature or volume oscillates strongly)
Cause: The thermostat or barostat damping is too small.
Fix: Convert Tdamp and Pdamp to steps: about 100 steps for Tdamp and about 1000 steps for Pdamp, which can be written as $(100.0*dt) and $(1000.0*dt).
After switching to a newer LAMMPS, the same input starts to report ERROR: Lost atoms
Cause: The input was already on the edge of stability, and the older version simply did not trigger the error.
Fix: Treat it as a new problem: find the first bad step with thermo, then check the causes above one by one.
ERROR: Out of range atoms - cannot compute PPPM
Cause: A charged atom moved out of its process subdomain plus the skin before the next neighbor-list rebuild.
Fix: First confirm there are no overlapping atoms. Rebuild more often with neigh_modify delay 0 every 1 check yes. If forces and speeds are high, also reduce the time step. Early in model building, you can skip PPPM for now. The conservative settings are in the code below.
# Conservative settings for Out of range atoms / Bond atoms missing (real or metal units)
neighbor 3.0 bin # raise skin from the default 2.0 A to 3.0 A
neigh_modify delay 0 every 1 check yes
timestep 0.5 # 0.5 fs in real units; return to 1-2 fs after SHAKE-constraining bonds to H
# Early in equilibration, use cutoff Coulomb; switch back to long + pppm once the system is stable
# pair_style lj/cut/coul/cut 10.0
# (no kspace_style)
The same input runs on Windows but fails on Linux
Cause: The FFT grid or the domain decomposition is different, and the underlying cause is still a high-energy configuration in the system.
Fix: Check for overlapping atoms and large forces first. Do not just change the platform.
Dangerous builds at the end of the log is not 0
Cause: Atoms moved more than half a skin before the neighbor list was rebuilt.
Fix: Rebuild more often or enlarge the skin. If it appears together with Out of range, first confirm there are no overlaps.
# Neighbor list statistics at the end of each run in log.lammps
Neighbor list builds = 1229
Dangerous builds = 0 # non-zero: atoms moved more than half the skin before a rebuild; rebuild more often or enlarge the skin
Bond atoms X Y missing on proc P at step S
Cause: The two bonded atoms are farther apart than the communication cutoff. Most often the system has already blown up.
Fix: For force fields with short cutoffs, such as purely repulsive LJ, enlarge the communication cutoff with comm_modify cutoff. If the system has already blown up, a larger cutoff will not help, so check the structure and time step.
Temp and Press are already nan at step 0 in thermo; or Non-numeric pressure - simulation unstable; or Non-numeric atom coords - simulation unstable
Cause: Overlapping atoms. With periodic boundaries and no gap in the box, atoms on opposite sides overlap through the boundary.
Fix: Check with delete_atoms overlap on a diagnostic copy (see the code below). If the count is above 0, return to model building and leave space, or minimize first. For severe overlaps, use pair_style soft or a soft-core potential to push the structure apart, then switch back to the real force field.
# Check for overlapping atoms: run after pair_style / pair_coeff are defined
# Requirement: pair cutoff + neighbor skin >= 0.5 (distance units here); otherwise: Delete_atoms cutoff > max neighbor cutoff
# Bonded pairs with a special_bonds weight of 0 are not in the neighbor list and are not checked
# Use only on a diagnostic copy; it really deletes atoms
delete_atoms overlap 0.5 all all
# The log prints "Deleted N atoms, new total = ..."; N > 0 means the structure contains overlaps
Non-numeric pressure - simulation unstable appears when running fix npt
Cause: NaN is more likely when pressure is controlled directly with Nose-Hoover.
Fix: Control only temperature until the potential energy is stable, then add fix npt. Alternatively, equilibrate for a while and then minimize once more.
Temp and Press show nan or -nan in thermo, but the program does not stop
Cause: LAMMPS does not always stop immediately when NaN appears.
Fix: Check for overlaps as described in the NaN section above. For GPU runs, rerun in double precision.
nan appears in a GPU run, or a Non-numeric error is reported
Cause: The GPU package is built in mixed precision by default (GPU_PREC=mixed), and single or mixed precision overflows more easily.
Fix: Run the early relaxation in double precision or on CPU, then switch back to mixed precision for production runs.
ERROR: Too many neighbor bins
Cause: The box has grown too large, or the largest cutoff is too small.
Fix: Add lx ly lz to thermo to see whether the box grows quickly. If the cutoff is really small, use neigh_modify binsize to enlarge the bins.
ERROR: Unknown neigh_modify keyword: bin/hash
Cause: The bin/hash keyword in the current development docs does not exist in the 22Jul2025 stable release.
Fix: Use neigh_modify binsize to adjust the bins instead (see the previous entry).
ERROR: Domain too large for neighbor bins
Cause: Some atoms were flung far away (with s boundaries the box grows with them), or fix deform or pressure control stretched the box too much.
Fix: Check atom speeds and box size before the error, then check the fix deform rate and units.
ERROR: Cannot use neighbor bins - box size << cutoff
Cause: One box dimension is much smaller than the cutoff. This is common in monolayer or thin-film systems.
Fix: Increase the box length in that direction (add vacuum), or use neighbor 2.0 nsq, which is slower.
ERROR: Neighbor list overflow, boost neigh_modify one
Cause: One atom has more neighbors than one (default 2000). It can also come from a wrong box, or from fractional coordinates in the data file, which make the density look too high.
Fix: First confirm the density is reasonable, then increase one. page should be at least 10 times one, and 50 to 100 times is recommended.
ERROR: Did not assign all atoms correctly
Cause: With non-periodic boundaries, some atoms in the data file lie outside the box.
Fix: Check that xlo xhi, ylo yhi, and zlo zhi contain all coordinates. The official explanation is err0016.
ERROR: Invalid atom ID in Bonds section of data file
Cause: The Bonds section refers to an atom ID that is zero or negative, larger than the maximum ID, or both ends are the same atom.
Fix: Check the atoms count in the header against the number of rows in the Atoms section, and check that the converter numbers IDs from 1.
ERROR: Incorrect format in Atoms section of data file
Cause: atom_style does not match the number of columns in the data file, or the header count is larger than the actual number of rows.
Fix: Check that atom_style matches the Atoms section comment, such as # full. The official explanation is err0002.
ERROR: Unknown identifier in data file
Cause: A header keyword or section name is misspelled, or a header keyword is on the first line, which is always treated as a comment.
Fix: Check that the first line of the data file is a comment and that section names have the correct capitalization. The official explanation is err0001.
ERROR: Unrecognized pair style 'xxx' is part of the YYY package which is not enabled in this LAMMPS binary
Cause: The executable was built without the YYY package. Versions before 2019 reported Unknown pair style, for the same reason. Since 2020 the message names the package directly.
Fix: Check Installed packages with lmp -h. Add the package with -D PKG_xxx=on or make yes-xxx, then rebuild (see the code below). If the package is installed but the style is still missing, the package it depends on is not installed; see the Restrictions section of that style. If you do not rebuild after adding a package, the old executable still lacks it.
# Show which packages and styles the executable contains, and whether it has MPI
lmp -h | less # search for "Installed packages" and "pair styles"
# CMake build: add -D PKG_xxx=on for each missing package, then you must rebuild
cmake -S cmake -B build -D PKG_MANYBODY=on -D PKG_KSPACE=on -D PKG_MOLECULE=on -D BUILD_MPI=on
cmake --build build -j 8
# Traditional make: installing packages and compiling must be two separate commands
cd src
make yes-manybody yes-kspace
make mpi -j 8 # produces lmp_mpi; "make yes-manybody mpi" does not take effect
ERROR: Incorrect args for pair coefficients
Cause: The pair_coeff format does not match pair_style, for example eam mixed with eam/alloy, or a missing sub-style name in hybrid.
Fix: Compare with the pair_coeff examples in the documentation for that pair_style. The official explanation is err0021.
ERROR: Numeric index X is out of bounds
Cause: A type number in pair_coeff or bond_coeff is larger than the number of types declared in the data file.
Fix: Check atom types and bond types in the data file header. The official explanation is err0019.
XXX command before / after simulation box is defined
Cause: Commands are in the wrong order: units and atom_style must come before read_data, and pair_coeff must come after.
Fix: Check where the command sits relative to read_data or create_box. The official explanations are err0033 and err0034.
ERROR: Substitution for illegal variable
Cause: A multi-letter variable has no braces, so $cutoff is read as $c.
Fix: Write ${cutoff}. The official explanation is err0013.
ERROR: Cannot reset timestep with active dump
Cause: reset_timestep runs after the dump has been defined.
Fix: Put reset_timestep 0 before the dump definition.
ERROR: Delete_atoms cutoff > max neighbor cutoff
Cause: The sum of the pair cutoff and the neighbor skin is less than 0.5 (in distance units).
Fix: Increase the pair cutoff or the skin so that their sum is at least 0.5 (in distance units).
GPU library not compiled for this accelerator
Cause: The architecture or CUDA version used to build the GPU library does not match your card and driver.
Fix: Check the GPU_ARCH setting against the card and driver shown by nvidia-smi, then rebuild with the compute capability of your card. See Build_extras in the official docs.
make mpi fails with mpicxx: command not found or mpi.h: No such file or directory
Cause: The system has no MPI compiler wrapper, or the MPI development headers are missing.
Fix: Check with which mpicxx. If you have no MPI, use make serial, or install the OpenMPI or MPICH development package first.
job aborted: [ranks] message ... abort code 1 (MS-MPI)
Cause: This is the MS-MPI summary. LAMMPS has already exited because of an input error, and the real cause is in the ERROR line.
Fix: Remove -screen none so the ERROR line is shown, and check the last ERROR in the terminal or log.lammps. Check that the input file name includes its full extension. One forum user spent four days on this; the file was in.CHO.lmp but the command used -in in.CHO.
REM Running the MSMPI build of LAMMPS in parallel on Windows
REM First use dir to confirm the full input file name (File Explorer hides extensions by default)
dir
mpiexec -localonly 4 lmp -in in.CHO.lmp
REM Do not add -screen none, or the actual ERROR line will not appear in the terminal
The system reports that msmpi.dll cannot be found
Cause: You are running the MSMPI build of LAMMPS, but the MS-MPI runtime is not installed, or the computer was not restarted after installing it.
Fix: Install msmpisetup.exe and restart. msmpisdk.msi is needed only when you compile from source with Visual Studio. If you only want threaded speed-up, use the non-MSMPI build with -pk omp 4 -sf omp.
Screen output from the MSMPI build is slow to appear
Cause: In MPI parallel mode, screen output is block-buffered and appears only after enough bytes accumulate.
Fix: This is a documented behaviour and does not mean the program is stuck. To see progress, rerun with -nb, which slows the run noticeably and should be used only when debugging.
On Linux, one core runs normally, but several cores report Lost atoms or Out of range
Cause: A single core has no domain decomposition, so every atom is reachable and the problem is hidden. Several cores expose a dynamics problem.
Fix: Follow the Lost atoms or Out of range entries. If two decompositions give very different energies, neither result can be trusted.
MPI_ABORT appears in the OpenMPI layer
Cause: The MPI library itself has a problem, or the MPI that the executable links to does not match the local environment.
Fix: Check the linked MPI version with lmp -h. If you only need serial runs on this machine, reconfigure with -D BUILD_MPI=off.
A parallel run exits without any error, and no ERROR appears in the terminal
Cause: The error message is still in the output buffer (4096 or 8192 bytes) and has not been written out.
Fix: Rerun with the -nb option to turn off buffering. It slows the run noticeably, so use it only when debugging.
The process uses full CPU but produces no new output for a long time
Cause: thermo is not set, so only the first and last steps are printed. Output is buffered under MPI. Or the system is large and uses a method such as pppm or ewald, which does not scale linearly with atom count.
Fix: Set thermo 100. Rerun with -nb. Measure the time per step on a small system first, then extrapolate.
The program is stuck at one step
Cause: A value became NaN and a loop cannot exit, or the program has a defect.
Fix: Attach to the process with gdb -p <process id>, type where to get the call stack, and attach the result to your forum post.
Total energy drifts in one direction under NVE
Cause: The time step is too large, or the neighbor list is rebuilt too late.
Fix: Halve the step and compare the drift. Check Dangerous builds.
Temperature keeps rising
Cause: Tdamp is too small or a unit conversion is wrong; the thermostat group does not match the integration group; or the same atom is integrated by two fixes.
Fix: Check for the warning One or more atoms are time integrated more than once. Set Tdamp to about 100 steps.
Energy or pressure values are off by several orders of magnitude
Cause: metal and real units are mixed: eV and kcal/mol differ by about a factor of 23, and bar and atm also differ.
Fix: Check the units of the source of the pair_coeff parameters. If the potential file has a UNITS: tag, a mismatch causes an error; without a tag, it does not.
WARNING: Changing timestep from 2 to 1 due to changing units to real (similar warnings)
Cause: timestep was written before units, and units reset it to the default for that unit system.
Fix: Put timestep after units.
The same input gives different results with different core counts
Cause: Rounding errors make trajectories diverge after hundreds to thousands of steps. With create_atoms, atom numbering depends on the core count, so velocities assigned by velocity also change.
Fix: Compare statistical averages rather than step-by-step values. If the initial velocities must not depend on the core count, add loop geom to the velocity command.
step N: hbondchk failed or bondchk failed
Cause: ReaxFF preallocates bond and hydrogen-bond lists with a safety factor based on the system. When reactions are violent, the system is sparse, or each process has few atoms, the lists overflow.
Fix: Enlarge the preallocation with pair_style reaxff NULL safezone 1.6 mincap 100 minhbonds 50, which uses more memory. You can also use the KOKKOS version of ReaxFF. Splitting a long run into segments may not be enough. The official explanation is err0018.
# Three ways to handle hbondchk failed / bondchk failed in sparse or many-rank ReaxFF runs
# 1) Enlarge the preallocation (defaults: safezone 1.2, mincap 50, minhbonds 25); memory use grows accordingly
pair_style reaxff NULL safezone 1.6 mincap 100 minhbonds 50
pair_coeff * * ffield.reax C H O N
# 2) Use the KOKKOS version of ReaxFF (a CPU-only KOKKOS build also works); it ignores safezone and related keywords
# mpirun -np 4 lmp -k on -sf kk -in in.reaxff
# 3) When mixing with non-ReaxFF potentials, apply charge equilibration to ReaxFF atoms only
# pair_style hybrid reaxff NULL lj/cut 10.0
# pair_coeff * * reaxff ffield.reax C H O NULL
# group reax type 1 2 3
# fix qeq reax qeq/reaxff 1 0.0 10.0 1.0e-6 reaxff maxiter 500
ReaxFF reports lost atoms, which appear or disappear when the core count changes
Cause: Each core has too few atoms. A Zhihu round-up suggests at least 100 atoms per core for ReaxFF, and 300 to 500 is better. More cores do not always mean a faster run.
Fix: On a small system, measure time per step with one or two processes first, then decide whether to add cores.
Fix qeq/reaxff CG convergence failed after N iterations
Cause: Charge equilibration did not converge within maxiter iterations. The default maxiter is 200.
Fix: Add maxiter 500 at the end of the fix to allow more iterations. If the warning keeps appearing during the run, first check whether the system has become unstable.
ERROR: Illegal fix qeq/reaxff command (some Chinese round-ups suggest writing warn no)
Cause: warn no is not a valid keyword in the current version.
Fix: The keyword that suppresses the warning is nowarn. The official docs say it is for serial and parallel comparisons that need a fixed number of iterations.
No QEq parameters for atom type N provided by pair reaxff; or Fix qeq/reaxff group is not charge neutral
Cause: When fix qeq/reaxff acts on all, types without QEq parameters cause the error. A nonzero total charge in the group causes the warning.
Fix: Limit the charge equilibration to a group of ReaxFF atoms. If you do not need charge equilibration, use pair_style reaxff NULL checkqeq no, which uses the static charges in the data file. For the hybrid setup, see the code in the ReaxFF entry.
Triclinic box skew is too large (versions before 2022); newer versions show WARNING: Triclinic box skew is large.
Cause: The tilt is more than half the box length. The box command was removed in 22Dec2022.
Fix: Do not add box tilt large to the script. Newer versions only warn and the calculation proceeds. Keeping the command only prints The box command has been removed and will be ignored. If you still see skew too large, you are using a version from before 2022. Measured on this page with 22Jul2025, an xy tilt of 2.5 times the box length gave only this warning.
References
- LAMMPS docs: Errors and warnings details — Official explanations for err0001-err0039 and general troubleshooting advice
- LAMMPS docs: Common issues that are often regarded as bugs — Invalid style, -nb to disable buffering, cross-platform differences
- LAMMPS docs: Debugging crashes / appears to be stuck — Getting a stack trace with gdb; reasons a run appears stuck
- LAMMPS docs: Error messages — Short errors such as Invalid atom ID
- LAMMPS docs: thermo_modify — Values and defaults of the lost and lost/bond keywords
- LAMMPS docs: neigh_modify — Defaults for one, page and binsize
- LAMMPS docs: units — Default timestep and skin for each unit style
- LAMMPS docs: fix nvt/npt — Recommendation of about 100 steps for Tdamp and 1000 steps for Pdamp
- LAMMPS docs: Running LAMMPS on Windows — Installing MS-MPI and using mpiexec
- LAMMPS docs: Include packages in build — Rebuild after installing packages; make cannot install and build in one command
- LAMMPS source stable_22Jul2025 — Error texts, errorurl numbers, units resetting the timestep
- MatSci: Tracing atom that causes Out of range atoms — Experience post: Dangerous builds comparison and timestep guidance (developer replies)
- MatSci: Out of range atoms - cannot compute PPPM (pppm.cpp:1887) — Experience post: Out of range refers to parallel subdomains (developer reply)
- MatSci: ERROR: Lost atoms — Experience post: wall too close causing lost atoms; results differing between decompositions cannot be trusted
- MatSci: job aborted with the MSMPI build of LAMMPS — Experience post: job aborted caused by a hidden input file extension
- CSDN: Out of range atoms - cannot compute PPPM, causes and fixes (Chinese) — Experience post: handling the PPPM error in two cases by atom speed
- MatSci: Lost Atoms When I Changed the LAMMPS Version — Experience post: why lost atoms appear after a version change
- Zhihu: LAMMPS error round-up — Experience post: box tilt large, hbonds and atoms per core, qeq warning, ReaxFF hybrid entries
- keinsci forum: lost atoms in a ReaxFF simulation — Experience post: lost atoms in ReaxFF pyrolysis disappeared after changing the core count
- LAMMPS documentation: pair_style reaxff — Defaults of safezone, mincap, minhbonds; KOKKOS and run-splitting advice; checkqeq
- LAMMPS documentation: fix qeq/reaxff — maxiter default 200, nowarn keyword, zero total charge in the group
- LAMMPS documentation: Removed commands and packages — box command removed in 22Dec2022