LAMMPS from scratch · 20 min

Reading the log and the error messages

Everything LAMMPS prints after a run, explained and recomputed by hand from the loop time and the neighbour count; then eleven common mistakes in the melt script, each run live with its real error message, what it means and how to fix it.

1 · Understand: what the log contains

Everything LAMMPS prints goes to the screen and to log.lammps in the directory where it ran. In order:

PartWhat it showsPage
bannerthe version: LAMMPS (22 Jul 2025 - Update 6)0.3
echo of commandswhat each command created: lattice spacing, box, "Created 4000 atoms"A.5
setupneighbour list settings, units, timestep, memoryA.7
thermo tableone line every thermo N stepsA.3
Loop timewall-clock seconds for the run, and speedbelow
timing breakdownwhere the time went: Pair, Neigh, Comm, Output, Modify, OtherC.8
neighbour statisticsowned atoms, ghost atoms, pairs in the list, rebuildsA.7, D.3

2 · Observe: run melt and read the end of the log

The times are measured on your device, so your numbers will differ from anyone else's. The hand checks use your numbers.

3 · Match: every derived number, by hand

Only three things are measured: the loop time, the time in each section, and the number of pairs. Everything else is arithmetic.

PrintedFormula
timesteps/ssteps ÷ loop time
tau/daytimesteps/s × timestep × 86400 (seconds in a day). In real units: ns/day, with dt in fs
Matom-step/stimesteps/s × atoms ÷ 10⁶
%total100 × section time ÷ loop time
Ave neighs/atomNeighs ÷ Nlocal

Run melt above to fill in this table.

Ave neighs/atom is 37.9, not the 39 counted around a perfect lattice on page A.7: the list was built at the last rebuild, when the crystal had already melted. Nghost (5506) is the number of copies of atoms near the box faces that this processor keeps so that every atom sees all its neighbours across the periodic boundary (page D.2).

4 · Modify: eleven mistakes, run live

Each changes one line of in.melt. Predict what LAMMPS says, then run it.

A typo in a command name

− pair_style lj/cut 2.5 + pair_stlye lj/cut 2.5

A style from a package that is not built in

− pair_style lj/cut 2.5 + pair_style tersoff

A timestep 10 times too large

− (default timestep 0.005) + timestep 0.05

pair_coeff missing

− pair_coeff 1 1 1.0 1.0 2.5 + (deleted)

A word where a number is expected

− pair_coeff 1 1 1.0 1.0 2.5 + pair_coeff 1 1 1.0 one 2.5

A command with too few arguments

− fix 1 all nve + fix 1 all nvt

A file that is not there

− lattice … create_atoms (4 lines) + read_data melt.data

A warning, not an error

− neigh_modify every 20 delay 0 check no + neigh_modify every 20 delay 0 check yes

Commands in the wrong order

− create_box before create_atoms + create_atoms moved above create_box

A type that does not exist

− pair_coeff 1 1 1.0 1.0 2.5 + pair_coeff 1 2 1.0 1.0 2.5

A mass missing

− mass 1 1.0 + (deleted)

How to read any error

Your turn

1. A run of 1000 steps with 32000 atoms and timestep 0.005 takes 40 s. What does the Performance line say?

2. Pair takes 85 % of the time in melt. If you change the cutoff from 2.5 to 5.0, roughly how much longer does the run take?

3. A run stops with "Lost atoms" at step 3000, after running fine. What do you check first?