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.
- The potentials are in the same order as the atoms. The wiki's
POTCARpage 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 ofPOSCARwith whatgrep TITEL POTCARprints, one line per element, in order. (What are VASP's input files?) ENCUTis set, and high enough. If it is left out, the default is the largestENMAXin thePOTCARfile (theENCUTpage). Find those values withgrep 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?)- The smearing suits the material. The wiki's smearing page says to "always set a smearing method in the
INCARfile because the default choice may lead to incorrect results for some materials". Its two warnings to check for: avoidISMEAR> 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 smallSIGMA. (Which smearing should I use?) - A relaxation has ionic steps.
NSWis the maximum number of ionic steps and defaults to 0 (theNSWpage), and withNSW = 0the defaultIBRIONis −1, no ionic update (theIBRIONpage). AnINCARthat asks for a relaxation withIBRION = 2but leaves outNSWtherefore runs a single static calculation and stops: the job "works", and the atoms never moved. For molecular dynamics the wiki saysNSW"has to be supplied, otherwise VASP exits immediately after having started". (Why won't my relaxation converge?) - Spin is on for a magnetic material.
ISPINdefaults to 1, no spin polarization (theISPINpage), so a magnetic material run with the defaults is run as non-magnetic. WithISPIN = 2,MAGMOMdefaults to 1.0 on every ion (theMAGMOMpage), a ferromagnetic start; an antiferromagnet needsMAGMOMset by hand, with opposite signs on the two sublattices. (How do I set up a magnetic calculation?) - 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?
- The units match the potential file. The
pair_style eampage says its potential files "are parameterized in terms of LAMMPS metal units". Theunitspage adds that a potential file may carry aUNITS: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 yourunitscommand agrees. (How do I choose an interatomic potential?) - The time step is in the units you think.
timestepis in the time unit of yourunitsstyle, and its default depends on that style: 0.005 τ forlj, 1.0 fs forreal, 0.001 ps (1 fs) formetal, 1.0e-8 s forsi(thetimesteppage). If you settimestepfor one style and then changeunits, the same number means a different step:timestep 0.001is 1 fs withmetalunits and 0.001 fs withrealunits. (What time step should I use?) - 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 (thepair_style eampage). If your data file numbers the types differently, the wrong atoms get the wrong element, and nothing stops. Compare the list with theMassessection or the type numbers in your data file. - Every atom type has a mass. The
masspage says all masses "must be defined before a simulation is run". A missing one stops LAMMPS withAll 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. - 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
minimizepage 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. - 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
-skipruncommand-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". Runlmp -skiprun -in in.myrunin a short job before you submit the real one. - The starting state looks sane. A
run 0computes and prints the thermodynamic output "without taking a timestep" (therunpage). 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?
- Ask Slurm to check the request without running it.
sbatch --test-only job.shwill "validate the batch script and return an estimate of when a job would be scheduled to run"; "no job is actually submitted" (thesbatchmanual). A partition, account or time limit Slurm would refuse shows up here. - 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.
- 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.
- The program gets the cores you asked for. The tasks you request and the processes your
mpirunorsrunline 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)
POTCARis 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.NELMdefaults to 60, and the wiki'sNELMpage 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
sacctreport 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
POTCARruns 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 yourunits; with-skiprunit 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?
| Mistake | You see | Fix |
|---|---|---|
POTCAR built in a different order from POSCAR | Nothing: the run finishes, with every atom on the wrong potential | Compare grep TITEL POTCAR with the element line of POSCAR before you submit |
A relaxation INCAR with no NSW | The job finishes quickly; the final structure is the starting one | Set NSW to the maximum number of ionic steps you will allow |
ISMEAR > 0 for a semiconductor or an insulator | Ordinary-looking energies that may be wrong | Use ISMEAR = 0 with a small SIGMA, or the tetrahedron method for a static run |
A magnetic material with the default ISPIN | A non-magnetic result, without a warning | Set ISPIN = 2 and a MAGMOM that matches the order you expect |
pair_coeff elements in a different order from the atom types | A stable run of the wrong material | List the elements in the order of your data file's types |
units changed after timestep was set | A step 1,000 times longer or shorter than you meant | Set timestep explicitly, in the time unit of your units style |
| A typo at the end of a long LAMMPS script | The job dies hours in, at the command | Read the whole script with -skiprun before you submit |
| A walltime longer than the partition allows | sbatch refuses the job | Check 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.