Guide · VASP · SLURM · 15 min read

How do I run my first VASP calculation, end to end?

Checked against the docs · VASP wiki and SLURM documentation 26.05 · Last checked 12 November 2026 · Spot a mistake? Tell us

Short answer

Put four input files in one folder on the cluster (INCAR for the settings, POSCAR for the structure, POTCAR for the potentials, KPOINTS for the k-point mesh), submit a job script that runs VASP there, then confirm in OUTCAR that it finished and in CONTCAR what it found.

What do I need before I start?

  • An account on a cluster where VASP is installed, and your group's VASP license. VASP is licensed software; the cluster's research computing team can tell you how it is provided there.
  • The location of your group's POTCAR library on the cluster. The potentials come with the VASP license and are not shared publicly.
  • The name of the VASP module and the run command (for example module load vasp and srun vasp_std), from your cluster's user guide.
  • A folder in your scratch space, the fast storage meant for running jobs.

vasp_std is the standard build of VASP. A VASP installation usually also has vasp_gam, the gamma-only build (for calculations that use only the Γ point), and vasp_ncl, the noncollinear build (for magnetic moments that point in any direction). A first run uses vasp_std.

What do the four input files do?

FileWhat it holdsWho writes it
INCARThe settings: what kind of calculation, how precise, when to stop.You.
POSCARThe structure: the cell and where each atom sits.You, from a database, a paper or a structure file.
POTCARThe potentials: one per element, describing how that element's core electrons and nucleus act on the rest.Assembled from your group's library, never written by hand.
KPOINTSHow finely VASP samples the electrons across the crystal (the k-point mesh).You.

VASP reads all four from the folder it starts in. The sections below build each one for silicon.

How do I write the POSCAR?

POSCAR
Si2
1.0
0.0000000 2.7150000 2.7150000
2.7150000 0.0000000 2.7150000
2.7150000 2.7150000 0.0000000
Si
2
Direct
0.0000000 0.0000000 0.0000000
0.2500000 0.2500000 0.2500000

What you are looking at Silicon in the diamond structure, the crystal the POSCAR above describes. The outlined box is the cubic cell the database records, with 8 atoms, four times the two-atom primitive cell in the POSCAR; both repeat into the same crystal. Each atom has four nearest neighbors, all 2.35 Å away, at the corners of a tetrahedron (counted from the file itself). In the picture only the atom near the middle shows all four bonds; the other atoms' neighbors sit in the next copy of the cell, outside the box, where bonds are not drawn.

Source Crystallography Open Database 9008565 · Si, measured (diffraction) · CC0 (public domain) · fetched 24 October 2026
Structure from: Wyckoff, R. W. G. Crystal Structures 1, 7 (1963). Second edition. Interscience Publishers, New York, New York Sample at T = 300 K.
Database: S. Gražulis, A. Daškevič, A. Merkys, D. Chateigner, L. Lutterotti, M. Quirós, N. R. Serebryanaya, P. Moeck, R. T. Downs and A. Le Bail, Crystallography Open Database (COD): an open-access collection of crystal structures and platform for world-wide collaboration, Nucleic Acids Research 40, D420 (2012). https://doi.org/10.1093/nar/gkr900

Line by line:

  • Si2 is a free comment, up to 40 characters.
  • 1.0 is a scaling factor that multiplies the lattice vectors (and positions given in ångströms). Leave it at 1.0 and write real lengths.
  • The next three lines are the lattice vectors, the three edges of the cell, in ångströms. These describe the primitive cell of diamond-structure silicon with a cubic lattice constant of 5.43 Å (each number is half of it). The measured structure in the figure below, COD 9008565 from Wyckoff (1963), records 5.4307 Å at 300 K.
  • Si names the elements. This line is optional: without it, VASP takes the names from POTCAR. Even when it is there, it is only a label; which potential each atom gets is decided by the order in POTCAR.
  • 2 is how many atoms of each element, in the same order as POTCAR.
  • Direct means the positions below are fractions of the lattice vectors. Cartesian would mean positions in ångströms. VASP reads only the first letter: C or K means Cartesian, anything else Direct.
  • The last two lines are the two atoms' positions.

The numbers are written with seven significant digits because the wiki recommends at least that many: VASP finds the crystal's symmetry from these positions, and too few digits is a common way to lose it.

The order of the atom counts in POSCAR must match the order of potentials in POTCAR. With one element there is nothing to get wrong; with two or more, it is the most common silent mistake in VASP.

How do I get the POTCAR?

Concatenate the potential for each element, in the same order as the POSCAR, from your group's library. For silicon alone:

Terminal
cat $HOME/potcars/PBE/Si/POTCAR > POTCAR

The path is an example; use your library's. For a two-element structure such as TiO₂ with Ti listed before O in the POSCAR, the potentials go in the same order: cat .../Ti_sv/POTCAR .../O/POTCAR > POTCAR. The files themselves are read-only: never edit a POTCAR.

The folder name inside the library says which variant of the potential it is. Plain Si is the standard one; a suffix marks a variant, such as _pv, which treats the semicore p states as valence electrons. The VASP wiki's table of available potentials marks the default recommendation for each element (for silicon, Si; for titanium, Ti_sv). Use the recommended one unless you have a reason not to, and use the same one throughout a study.

Check what you built with grep TITEL POTCAR, which prints one line per element, and grep ENMAX POTCAR, which gives each potential's recommended cutoff (see What cutoff energy (ENCUT) should I use in VASP?). The wiki suggests quoting the TITEL line in your paper, so others know exactly which potential you used.

How do I write the INCAR?

A starting point for this relaxation, with each value taken from the VASP wiki or left at VASP's documented default:

INCAR
SYSTEM   = Si relaxation
PREC     = Accurate
ENCUT    = 320
EDIFF    = 1E-6
ALGO     = Normal
ISMEAR   = 0
SIGMA    = 0.05
IBRION   = 2
ISIF     = 3
NSW      = 100
LREAL    = .FALSE.
LWAVE    = .FALSE.
LCHARG   = .FALSE.

What each line does:

  • SYSTEM: a name for the run, printed in the output.
  • PREC = Accurate: how carefully VASP sets up its internal grids; the safe choice when forces and stress matter.
  • ENCUT = 320: the energy cutoff in eV. Silicon's recommended cutoff (ENMAX) is 245.7 eV, and 1.3 × that, about 320 eV, is the wiki's lower recommended limit when the cell volume changes, as it does here. A convergence test decides the value for your material.
  • EDIFF = 1E-6: the electronic loop stops when both the energy and the band-structure energy change by less than this many eV between steps. The default is 1E-4; for well-converged results the wiki recommends 1E-6.
  • EDIFFG, left out: when to stop moving atoms. Its default is 10 × EDIFF, an energy criterion; a negative value is a force threshold in eV/Å instead, which the wiki calls usually the more convenient setting. The wiki does not suggest a force threshold for a first relaxation; to test yours, relax once more with a tighter one and see whether the structure changes.
  • ALGO = Normal: the algorithm for the electronic loop, VASP's default.
  • NELM, left at its default of 60: the most electronic steps allowed per ionic step. The wiki notes that a loop that has not converged within 40 steps probably will not, and that the mixing or the algorithm is then the thing to change.
  • ISMEAR = 0 and SIGMA = 0.05: smearing, how occupations near the highest filled level are blurred. Gaussian smearing with a small width (the wiki suggests 0.03 to 0.1 eV) is its recommended choice when you are unsure, and right for a semiconductor like silicon. Always set it: VASP's default, ISMEAR = 1 (Methfessel-Paxton), can give wrong results for semiconductors and insulators.
  • IBRION = 2: move the atoms with the conjugate-gradient algorithm.
  • ISIF = 3: relax the atom positions, the cell shape and the cell volume together. For very accurate volumes, the wiki's procedure relaxes one degree of freedom at a time (the volume alone first, with ISIF = 7); for a first run, ISIF = 3 is fine.
  • NSW = 100: the most ionic steps allowed (the default, 0, would not move the atoms at all). The wiki gives no typical value; if a run uses all its steps without converging, continue from CONTCAR (below).
  • LREAL = .FALSE.: VASP's default, which does one part of the calculation (the projection) in reciprocal space. The wiki recommends LREAL = Auto only for systems of more than about 30 atoms.
  • LWAVE and LCHARG = .FALSE.: do not write WAVECAR and CHGCAR, the wavefunction and charge-density files, which VASP writes by default and a relaxation does not need afterwards.
  • NCORE, left at its default of 1: how many processes work together on one band. The wiki's advice on choosing it for your cluster is in How do I use my cores well in VASP?

The smearing lines depend on your material. Choose it to see what to write instead of the two lines above:

Your materialSmearing to start withWhy
Semiconductor or insulatorISMEAR = 0, SIGMA = 0.05Gaussian smearing with a small width; the wiki suggests 0.03 to 0.1 eV. Right for silicon.
MetalISMEAR = 1, SIGMA about 0.2The wiki recommends ISMEAR = 1 or 2 for relaxing metals. Never relax a metal with tetrahedron smearing (ISMEAR = -5): its forces and stress are wrong for metals. The wiki: pick SIGMA so the entropy term stays under 1 meV per atom; the default 0.2 eV is often reasonable for metals. More in Which smearing should I use?
Not sure yetISMEAR = 0, SIGMA = 0.05Gaussian smearing is the wiki's recommended choice when you are unsure. Set it either way: VASP's default, ISMEAR = 1, can be wrong for semiconductors and insulators.

Every value here is a starting point, never the answer. The tags most worth reading about first are ENCUT, the k-points and the smearing.

How do I write the KPOINTS file?

KPOINTS
Automatic mesh, spacing 0.3 1/A
0
Gamma
  7 7 7
  0 0 0
  • The first line is a comment.
  • 0 tells VASP to generate the points itself from the mesh below.
  • Gamma means a mesh centered on the Γ point, the center of the reciprocal cell; the alternative, Monkhorst-Pack, is shifted for even numbers of points. Silicon's lattice is face-centered cubic, and the wiki says to use only Γ-centered meshes for fcc and hexagonal lattices.
  • 7 7 7 is the number of points along each of the three reciprocal lattice vectors. This is what a spacing of 0.3 Å⁻¹ gives for this silicon cell. The wiki does not suggest a starting spacing (the KSPACING default is 0.5 Å⁻¹); a convergence test on your own system decides the mesh.
  • 0 0 0 is an optional extra shift, normally left at zero.

This "regular mesh" form is the one the wiki recommends for most production calculations. The KSPACING tag in the INCAR is an alternative that builds a mesh from a spacing when there is no KPOINTS file.

A k-point is one of the points at which VASP works out the electrons' behavior across the crystal. More points sample it more finely and cost more. How do I test convergence for ENCUT and k-points? explains how to choose the mesh.

How do I submit it?

Before you submit, take a minute over the settings that go wrong without an error: the POTCAR order, NSW, the smearing and spin.

Put the four files and a job script in one folder in your scratch space, then submit from that folder with sbatch job.sh. A minimal job script:

Job script
#!/bin/bash
#SBATCH --job-name=Si-relax
#SBATCH --partition=standard
#SBATCH --account=mygroup
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=32
#SBATCH --time=01:00:00
#SBATCH --output=slurm-%j.out
#SBATCH --error=slurm-%j.err
module load vasp
srun vasp_std

The partition, account and module names are placeholders. A two-atom silicon relaxation is small; a short walltime and one node are plenty, and your cluster's debug or short partition may start it sooner. How do I submit a job on a SLURM cluster? explains every line and how to read the queue.

How do I follow it while it runs?

VASP writes several files as it goes. Two are worth watching:

  • OSZICAR, a short log: a line per electronic step, then a summary line per ionic step. For a relaxation, each summary line starts with the step number and shows F= (the total free energy), E0= (the energy extrapolated to zero smearing) and d E (the change since the last step). tail OSZICAR shows the latest.
  • OUTCAR, the long, detailed log: settings, forces, stress, timings.

In a relaxation, the energy should fall step by step and level off. If it climbs steadily or jumps around, something is wrong with the structure or the settings.

How do I know it worked?

  1. The job ended normally. sacct -j <job id> says COMPLETED, and the end of OUTCAR has the timing summary that begins General timing and accounting informations for this job (VASP's own spelling). The wiki does not document this line, so compare it with the end of a finished run on your own VASP version.
  2. The relaxation converged. VASP prints the line reached required accuracy - stopping structural energy minimisation when the relaxation meets its criterion; the wiki shows it, with this wording, at the end of the screen output (with the script above, slurm-<job id>.out) in its O dimer tutorial and on its page on universal machine-learned force fields, a VASP 6.5 feature. If it is missing, the run stopped because it used up NSW steps, not because the forces became small. Look for it in the screen output; the wiki does not say whether OUTCAR carries it too.
  3. The forces are small. The last block headed TOTAL-FORCE in OUTCAR lists the force on each atom; all should be small, and below your threshold if you set a force threshold in EDIFFG. In perfect diamond silicon, symmetry makes them zero from the start. Under the block, the total drift line should be smaller than the forces you care about; the wiki treats a large drift as a sign the FFT grid is too coarse.
  4. The stress is near zero. For a cell relaxation, the last line in OUTCAR that begins external pressure = (the value is in kB) should be close to 0 kB. A positive pressure means the cell wants to expand, a negative one that it wants to shrink. The wiki gives no number for close enough, since it depends on how accurate a volume you need; if the pressure is clearly not near zero, relax again from CONTCAR (step 6).
  5. The result makes sense. The relaxed cell is in CONTCAR, in the same format as POSCAR. Compare its lattice constant with the experimental value (5.43 Å): it should be close, though not identical, because every functional has its own small error. The wiki gives no PBE value for silicon to compare with.
  6. Relax once more. For a cell relaxation, start a second relaxation from CONTCAR (copy it to POSCAR). VASP keeps the same number of plane waves throughout a cell relaxation, so a fresh start rebuilds the basis for the new cell and corrects a small error in it. If you restart from the wavefunctions instead, the wiki says to set ISTART = 1, never ISTART = 2, which keeps the old basis. If the second run barely changes anything, you are done.

What usually goes wrong on a first run?

MistakeWhat you would seeWhat to do
Elements in POSCAR and POTCAR in different ordersVASP may run and give nonsense, because each atom gets the wrong potential.Build POTCAR in exactly the POSCAR order; check with grep TITEL POTCAR.
"Fixing" the order by editing the element names in POSCARNothing changes: the names line is only a label, and VASP takes the species from the POTCAR order.Rebuild POTCAR in the right order instead.
Direct and Cartesian confusedAtoms in impossible places: two atoms nearly on top of each other, and electronic steps that never settle.Fractions go under Direct, ångströms under Cartesian.
A wrong scaling factorA cell many times too large or too small, and a run that fails or relaxes wildly.Use 1.0 and write real lengths.
A typo in an INCAR tagVASP may carry on with the default, so the run is not what you asked for.VASP writes its reading of the INCAR near the top of OUTCAR; the wiki advises checking it against what you intended.
POTCAR not found, or emptyThe job stops at once.Check the library path and that POTCAR has the right TITEL lines.
The relaxation ran out of ionic stepsNo "reached required accuracy" line; the energy may still be falling.Continue from CONTCAR with another relaxation. If it never settles, see the planned guide on relaxations that won't converge.
Running VASP on the login nodeEverything slows for everyone; an email from the administrators.Always submit through sbatch.

Try it

Try it: find the three problems

An INCAR meant to relax the volume of iron, with the PBE Fe potential, had three problems. Each version below has one of them left in. Choose the line you think it is. The lines that are right follow the VASP wiki's volume-relaxation example for metals.

Script 1.

SYSTEM = Fe volume relaxation
ENCUT  = 250
ISPIN  = 2
ISMEAR = 1
SIGMA  = 0.2
IBRION = 2
ISIF   = 3
NSW    = 20

The problem is line 2, ENCUT = 250: The wiki's list of potentials gives the PBE Fe potential (potpaw.64) an ENMAX of 267.882 eV, and ENCUT defaults to the largest ENMAX: 250 eV is below even that. For a relaxation that changes the volume, the wiki gives 1.3 × the default cutoff as the lower recommended limit, about 348 eV here. ENCUT = 350 or more, then check that your result is converged with respect to ENCUT.

Script 2.

SYSTEM = Fe volume relaxation
ENCUT  = 350
ISPIN  = 2
ISMEAR = -5
SIGMA  = 0.2
IBRION = 2
ISIF   = 3
NSW    = 20

The problem is line 4, ISMEAR = -5: ISMEAR = -5 is the tetrahedron method with Blöchl corrections. The wiki says that in metals it can make the forces and the stress wrong by 5 to 10%, and that relaxations in metals should use ISMEAR = 1 or 2. ISMEAR = 1, as in the wiki's example for metals, with SIGMA = 0.2.

Script 3.

SYSTEM = Fe volume relaxation
ENCUT  = 350
ISPIN  = 2
ISMEAR = 1
SIGMA  = 0.2
IBRION = 0
ISIF   = 3
NSW    = 20

The problem is line 6, IBRION = 0: IBRION = 0 is molecular dynamics, not a relaxation: VASP would run NSW time steps of length POTIM. POTIM has no default for molecular dynamics, so with none set, VASP crashes right after it starts. Leaving IBRION out does the same here, because with NSW above 0 its default is 0. IBRION = 2, conjugate gradient.

In Verlet you import or paste the structure in Build (or pick one from the library, with its source cited), choose what the run is for in Set up, where every tag shows its plain name and an explanation, and read the exact INCAR, POSCAR, KPOINTS and job script in Script & files. Pre-flight checks the structure, the settings and the cluster resources before you submit, Monitor follows the job, and Continue from here starts the second relaxation from its CONTCAR.