Guide · VASP · LAMMPS · SLURM · 12 min read

How do I avoid a failed VASP or LAMMPS run from bad settings?

Checked against the docs · VASP wiki and LAMMPS stable release 30 Sep 2026 update 1 and SLURM 26.05 · Last checked 18 November 2026 · Spot a mistake? Tell us

Short answer

Check by hand the few settings that go wrong without an error, such as the POTCAR order, ENCUT, the smearing, NSW and spin in VASP, and the units, masses and pair_coeff mapping in LAMMPS, then check the job script against your partition's limits. Then run a short test job on the debug or short partition: it shows that the input is read, that the first steps behave, and how much time and memory the full run needs.

Which mistakes waste a run?

A run can be lost to a bad setting in three ways, and they cost very different amounts.

  • The code stops at once. A missing file, a misspelled command, a setting the program cannot read. The job ends in its first seconds with an error message. Annoying, but cheap: you lose a place in the queue, not compute time.
  • The cluster stops the job. The walltime ran out, the job used more memory than it asked for, or the scheduler refused the request. Slurm tells you why (see Why did my job stop? and its neighbors). A job killed at its time limit can cost hours.
  • The run finishes, and the result is wrong. Each atom got the wrong potential, the smearing was wrong for the material, a relaxation never moved the atoms, a magnetic material was run without spin. Nothing stops and no error is printed. This is the expensive kind, because you may only find out weeks later, or never.

Checking before you submit is mostly about the third kind. The first kind announces itself, and a short test job catches most of it; the second you prevent by estimating the job's needs. The settings below are the ones the official documentation warns about, and each one can be checked by hand in a minute.

What should I check in a VASP job before I submit?

Read your four input files against this list. Each line names the check, the command or file to look at, and the guide that explains the setting.

  1. The potentials are in the same order as the atoms. The wiki's POTCAR page says the file contains a pseudopotential for each species "in the same order as in the POSCAR". VASP has no way to know you mixed them up, so it runs and gives every atom the wrong potential. Compare the element line of POSCAR with what grep TITEL POTCAR prints, one line per element, in order. (What are VASP's input files?)
  2. ENCUT is set, and high enough. If it is left out, the default is the largest ENMAX in the POTCAR file (the ENCUT page). Find those values with grep ENMAX POTCAR. Never go below the largest; go higher when the cell changes size, and use one value for every run you will compare. (What cutoff energy should I use?)
  3. The smearing suits the material. The wiki's smearing page says to "always set a smearing method in the INCAR file because the default choice may lead to incorrect results for some materials". Its two warnings to check for: avoid ISMEAR > 0 (Methfessel-Paxton) for semiconductors and insulators, "since this often leads to incorrect results", and do not relax a metal with the tetrahedron method (ISMEAR = -5), because its forces and stress "can be wrong by up to 5 to 10% for metals". If you are not sure what the material is, the page recommends Gaussian smearing (ISMEAR = 0) with a small SIGMA. (Which smearing should I use?)
  4. A relaxation has ionic steps. NSW is the maximum number of ionic steps and defaults to 0 (the NSW page), and with NSW = 0 the default IBRION is −1, no ionic update (the IBRION page). An INCAR that asks for a relaxation with IBRION = 2 but leaves out NSW therefore runs a single static calculation and stops: the job "works", and the atoms never moved. For molecular dynamics the wiki says NSW "has to be supplied, otherwise VASP exits immediately after having started". (Why won't my relaxation converge?)
  5. Spin is on for a magnetic material. ISPIN defaults to 1, no spin polarization (the ISPIN page), so a magnetic material run with the defaults is run as non-magnetic. With ISPIN = 2, MAGMOM defaults to 1.0 on every ion (the MAGMOM page), a ferromagnetic start; an antiferromagnet needs MAGMOM set by hand, with opposite signs on the two sublattices. (How do I set up a magnetic calculation?)
  6. The k-points and the cutoff are converged for this system. Nothing in the input files can tell you this, and a test job cannot either; it takes a convergence test on your own structure.

What should I check in a LAMMPS script before I submit?

  1. The units match the potential file. The pair_style eam page says its potential files "are parameterized in terms of LAMMPS metal units". The units page adds that a potential file may carry a UNITS: tag on its first line, and if it does, "LAMMPS will stop with an error message if there is a mismatch". A file without the tag is not checked, so read its header or its documentation, and make sure your units command agrees. (How do I choose an interatomic potential?)
  2. The time step is in the units you think. timestep is in the time unit of your units style, and its default depends on that style: 0.005 τ for lj, 1.0 fs for real, 0.001 ps (1 fs) for metal, 1.0e-8 s for si (the timestep page). If you set timestep for one style and then change units, the same number means a different step: timestep 0.001 is 1 fs with metal units and 0.001 fs with real units. (What time step should I use?)
  3. Each atom type maps to the right element. In pair_coeff * * NiAlH_jea.eam.alloy Ni Ni Ni Al, the element names after the file map LAMMPS atom types 1, 2 and 3 to Ni and type 4 to Al, in that order (the pair_style eam page). If your data file numbers the types differently, the wrong atoms get the wrong element, and nothing stops. Compare the list with the Masses section or the type numbers in your data file.
  4. Every atom type has a mass. The mass page says all masses "must be defined before a simulation is run". A missing one stops LAMMPS with All masses are not set, which is the cheap kind of failure; it is worth checking anyway, because a mass that is set but wrong for the element is not caught.
  5. No atoms overlap at the start. A structure built by hand, or two structures put together, can place atoms almost on top of each other; the forces are then huge, and the run tends to end in lost atoms within a few steps. The minimize page notes that the minimizers can "relax systems with highly overlapped atoms (large energies and forces) by pushing the atoms off of each other", so minimize before you start the dynamics.
  6. The whole script parses, not only the first part. A typo near the end of a long script is found only when LAMMPS reaches it, possibly hours in. The -skiprun command-line option reads the whole input script "without executing actual run or minimize and similar commands", which the manual describes as a way "to test input scripts of long running calculations for correctness to avoid having them crash after a long time due to a typo or syntax error". Run lmp -skiprun -in in.myrun in a short job before you submit the real one.
  7. The starting state looks sane. A run 0 computes and prints the thermodynamic output "without taking a timestep" (the run page). Put it after your setup and read the first line: a potential energy that is far off for your material, or an enormous pressure, points at the units, the mapping or overlapping atoms before any time is spent.

What should I check in the job script?

  1. Ask Slurm to check the request without running it. sbatch --test-only job.sh will "validate the batch script and return an estimate of when a job would be scheduled to run"; "no job is actually submitted" (the sbatch manual). A partition, account or time limit Slurm would refuse shows up here.
  2. The walltime fits the partition and the job. Too long for the partition and Slurm refuses the job (Invalid time limit); too short and it is killed at the limit (Time limit). Estimate it from a test job.
  3. The memory request matches what the run needs. Too little ends in OUT_OF_MEMORY. The test job below tells you how much it used.
  4. The program gets the cores you asked for. The tasks you request and the processes your mpirun or srun line starts should agree; How do I submit a job on Slurm? and Am I using my cores well? show how to line them up.

What does a short test job tell you?

A test job is the real job made small: the same inputs, the same modules and the same job script, on the debug or short partition, stopped after a few steps. It costs minutes, and it answers the questions no amount of reading can:

  • Does the job start? The modules load, the program is found, the input files are where the script expects them, and (for VASP) POTCAR is there. Many first jobs on a new cluster fail here, in the first seconds.
  • Is the input read? An input error stops VASP at once, before the first electronic step (What does this VASP error mean?); an unknown command or style stops LAMMPS when it reaches it.
  • Do the first steps behave? In VASP, count the electronic steps in each ionic step in OSZICAR. NELM defaults to 60, and the wiki's NELM page says that "if the self-consistency loop does not converge within 40 steps, it will probably not converge at all"; a first ionic step that runs to the limit is a reason to fix the electronic settings before the long run. In LAMMPS, read the first thermo lines: a temperature or energy that shoots up in the first steps, or lost atoms, means something is wrong with the structure, the potential or the time step.
  • How much time and memory will the full run need? Time a few steps and read the memory the job used, then scale up; How do I estimate time and memory? shows where VASP, LAMMPS and sacct report each number.

What can a test job not tell you?

A test job proves that the run is set up to run; it does not prove that the result will be right. It cannot tell you:

  • whether the cutoff and the k-points are converged for your system: that is a convergence test;
  • whether the smearing, the functional or the potential suits your material: a wrong choice gives numbers that look entirely ordinary;
  • whether a molecular dynamics run will reach equilibrium, or stay stable over millions of steps: see How do I know when it is equilibrated? and How do I spot an MD run gone wrong?;
  • whether the potentials are in the right order: a swapped POTCAR runs as smoothly as a correct one. That check is yours, before you submit.

Which software checks job settings before submission?

Some of the checking is already done for you, by the programs themselves:

  • VASP stops at once on an input error it can detect, and on a molecular dynamics run without NSW.
  • LAMMPS stops on a command or style it does not know, on missing masses, and on a potential file whose UNITS: tag disagrees with your units; with -skiprun it reads the whole script without running it.
  • Slurm checks the request itself with sbatch --test-only.

What none of them checks is whether a setting suits your material and your question: the POTCAR order, the smearing for a metal or an insulator, spin for a magnetic material, a relaxation with no ionic steps, the mapping of atom types to elements. Those are the checks on this page, and they are the ones worth making by hand, or with a tool built on the same documentation.

What goes wrong most often?

MistakeYou seeFix
POTCAR built in a different order from POSCARNothing: the run finishes, with every atom on the wrong potentialCompare grep TITEL POTCAR with the element line of POSCAR before you submit
A relaxation INCAR with no NSWThe job finishes quickly; the final structure is the starting oneSet NSW to the maximum number of ionic steps you will allow
ISMEAR > 0 for a semiconductor or an insulatorOrdinary-looking energies that may be wrongUse ISMEAR = 0 with a small SIGMA, or the tetrahedron method for a static run
A magnetic material with the default ISPINA non-magnetic result, without a warningSet ISPIN = 2 and a MAGMOM that matches the order you expect
pair_coeff elements in a different order from the atom typesA stable run of the wrong materialList the elements in the order of your data file's types
units changed after timestep was setA step 1,000 times longer or shorter than you meantSet timestep explicitly, in the time unit of your units style
A typo at the end of a long LAMMPS scriptThe job dies hours in, at the commandRead the whole script with -skiprun before you submit
A walltime longer than the partition allowssbatch refuses the jobCheck with sbatch --test-only, or look up the limit with sinfo

Pre-flight reads your structure, your settings and your job script before you press Submit, and lists what it finds with a plain title and a next step for each: a problem blocks Submit, a warning does not. To try it on a file you already have, paste an INCAR or a LAMMPS script into the free checker, with no account. Everything above works without either.

Updated
18 November 2026
Applies to
VASP 5.4 and 6.x; LAMMPS stable release 30 Sep 2026; SLURM 26.05
Source check
Checked against the docs, 18 November 2026

Where can I read more?

What was this page checked against?

Checked against the VASP wiki, the LAMMPS manual's stable release (git info "30Sep2026 update1") and the SLURM documentation, version 26.05, 18 November 2026. The VASP wiki, with the date each page was last edited: POTCAR (28 October 2026), ENCUT (17 October 2024), Smearing technique (22 July 2026), NSW (21 January 2026), IBRION (18 June 2026), ISPIN (1 June 2026), MAGMOM (11 June 2026) and NELM (20 June 2024). The LAMMPS pages listed above, and the SLURM sbatch manual page (generated 10 November 2026). The documents say which settings fail and how; they do not say how long a test job should be, which is with an expert reviewer.