0% found this document useful (0 votes)
10 views

Vasp Intro

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Vasp Intro

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

VASP: Introduction

Weine Olovsson
National Supercomputer Centre (NSC)
th
@Umeå University, HPC2N, 29 Oct 2019, room UB334
https://www.vasp.at/
Introduction
• Where to find information

• VASP at different SNIC HPC centers

• Starting files

• Important parameters

• Input/output

• Examples
… clickable links are underlined

National Supercomputer Centre in Linköping Sweden


Short background
• Software license http://vasp.at/

• PAW-method

• DFT, post-DFT (HSE06, GW, …)


• Born-Oppenheimer Molecular Dynamics

• widely used in Academia/Industry

• Efforts from Intel & Nvidia for optimization

• 20-25% of Tetralith usage

• next version is VASP6


Starting advice

• Read the documentation!

• VASP default settings good starting point

• Caution: “inherited” input files

• Avoid overly messy INCAR


• Possible differences in installations & versions
refer to respective webpages / documentation
Resources
• Read all (really)!
Manual
Find the links:
• Wiki
examples,
http://vasp.at/
presentations

• Forum

• https://www.nsc.liu.se/~pla/
Peter Larsson’s old blog at NSC: info &
discussion

Questions/trouble? [email protected], [email protected], …


VASP at SNIC HPC centers

• Kebnekaise, HPC2N, UmU this course

• Tetralith / Sigma, NSC, LiU

• Beskow, PDC, KTH

• Also available at other systems/centers

- On many systems: $ module avail vasp


$ module spider vasp
VASP versions & utilities

• Latest: patch.5.4.4.16052018 for 18Apr17


- Check centre webpages for details!
• wannier90: maximally localized wannier functions

• VTST: transition state tools for VASP

• VASPsol: solvation model for VASP


• Beef: Bayesian error estimation functionals

• constrained relaxation
https://www.vasp.at/
https://cms.mpi.univie.ac.at/vasp/vasp/vasp.html
https://cms.mpi.univie.ac.at/wiki/index.php/The_VASP_Manual
https://cms.mpi.univie.ac.at/wiki/index.php/The_VASP_Manual
https://www.hpc2n.umu.se/ Systems and Support > Software > VASP
https://www.hpc2n.umu.se/resources/software/vasp
https://www.nsc.liu.se/ Software > Installed software > Tetralith & Sigma software list > VASP
https://www.nsc.liu.se/software/installed/tetralith/vasp/
Example of day-to-day tools
• less / vi reading/editing files
• grace / gnuplot plotting tools
• Bash simple scripts
• cif2cell convert from .cif
• p4vasp analysis of VASP output
• xcrysden / vesta view structure
• Schrödinger create/view structure @Kebnekaise, Tetralith

Also of interest:
• Python / R analysis etc. (check out e.g. using jupyter)
• ASE different tools and Python modules
• Matlab / Octave analysis etc.

Check out presentations for Tetralith training


Different types of calculations
• Structural relaxation (different ways)

• Regular E totscf run using PBE, HSE06, GW, …

• Density of states, bandstructure, charge density, …

• Born-Oppenheimer MD

• Used within a special framework (VTST, …)

• See VASP wiki examples


Input files
• INCAR - input parameters

• POSCAR - structure (generate using e.g. cif2cell)

• POTCAR - PAW potentials (how to select?)

• KPOINTS - k-mesh (or list)

• + job script
SLURM batch queue system &
settings used by SNIC centers
INCAR parameters

• PREC - “precision”, ENCUT and FFT grids

• ENCUT - plane wave energy cutoff

• ALGO - wf optimisation

• NBANDS - if not set, auto-determined

• NSIM - for RMM-DIIS algorithm (ALGO)

• NCORE or NPAR - bands treated in parallel

• KPAR - k-point parallel


INCAR parameters

• PREC - “precision”, ENCUT and FFT grids

accuracy / • ENCUT - plane wave energy cutoff Completeness of basis-set


Recommended to set!
method
• ALGO - wf optimisation

• NBANDS - if not set, auto-determined


Must be the same for Etot comparison!

parallel
• NSIM - for RMM-DIIS algorithm (ALGO)
calcs.
• NCORE or NPAR - bands treated in parallel

• KPAR - k-point parallel


- We will get back to the settings in the 2nd part
INCAR defaults

• PREC = Normal Might want “Accurate”

• ENCUT = ? Always set! ENMAX x1.0 - x1.5


good tradeoff

• ALGO = Normal Can use “Fast” and “VeryFast”

• NBANDS = ? can be overridden by VASP


- sometimes extra empty states needed

• NSIM = 4 Typically OK

• NCORE = 1 Adjust (if not hybrid-functional, HSE06, etc.)

• KPAR = 1 for k-point parallel calcs.

Will discuss in more detail later on…


INCAR defaults in very brief,

• NSW = 0 max ionic steps, also MD steps


refer to
VASP wiki

• NELM = 60 max electronic selfconsistency steps


for details

• NELMIN = 2 min steps. For relaxation/MD set 4-8


converge to 4 last digits, sometimes higher
• EDIFF = 1E-4 accuracy is needed

• EDIFFG = EDIFF x10 ionic relaxation break condition,


if negative value, break if forces < |EDIFFG|
• ISMEAR = 1 how to treat partial electron occupancy:
1 = metals, 0 = bandgap, -5 = for accurate E tot

• ISPIN = 1 2 = spin-polarized calc.

• IBRION = -1 (NSW=-1,0)
no update
or
MD
0 how ions are updated & movded
=2 ionic relaxation
POSCAR
A simple case of fcc Ni, refer to the VASP wiki example

(hopefully) useful comment Ni fcc


negative value:
3.53 lattice constant (Å)
cell volume
lattice vectors 0.5 0.5 0.0
0.0 0.5 0.5
0.5 0.0 0.5
optional, useful for
Ni element symbols
number of atoms clarity & plotting
per type 1
Cartesian Cartesian or Direct coordinates
position for first atom 0 0 0 First letter is sufficient, i.e.
“C” for “Cartesian”

Direct coordinates: expressed in terms of the lattice vectors (no lattice constant, scaling)
Cartesian coordinate: expressed as (x,y,z) with the scaling factor included
POSCAR
From the course examples, H and Si on Ag(111) surface:

100% H on Si on Ag(111)
10.007900
1.000000000000000 0.000000000000000 0.000000000000000
0.500000000000000 0.866025403784439 0.000000000000000
0.000000000000000 0.000000000000000 4.352531500114909 Selective dynamics
H Si Ag
Note order of atoms always for Direct coord.
14 14 108
T = relax
Selective dynamics Relax for different directions F = fixed
Direct
first H atom 0.758338000000000 0.052881600000000 0.605945000000000 T T T
0.505244000000000 0.118231000000000 0.605945000000000 T T T
0.050784500000000 0.196017000000000 0.605945000000000 T T T
Rest of H, 0.800359000000000 0.251903000000000 0.605945000000000 T T T
Si & Ag atoms 0.333333333333333 0.338902000000000 0.605945000000000 T T T
following 0.114191000000000 0.386244000000000 0.605945000000000 T T T
0.618474000000000 0.498058000000000 0.605945000000000 T T T
0.381262000000000 0.511313000000000 0.605945000000000 T T T
0.883071000000000 0.624684000000000 0.605945000000000 T T T
POSCAR
Some useful resources:

Crystallography Open Database

Database with published structures


from experiment .cif

Bilbao Crystallographic Server

Crystallographic tools
POSCAR
A few examples on how to visualize and/or edit POSCAR:

Atomic Simulation Environment (ASE)


VESTA
Handle structures (and much more) using
python scripts

cif2cell Opens .cif displays structure, save as POSCAR


Versatile script, reads .cif
saves to many formats including
POSCAR

Commercial software: p4vasp


NanoLab
MedeA
MaterialsStudio Apart from analysis and visualization, also edit POSCAR
POTCAR
PAW potentials - non-trivial to tailor, select with care
PAW_PBE Cu 22Jun2005 type, element, date
valence 11.0000000000000
parameters from PSCTR are:
VRHFIN =Cu: d10 p1 atomic configuration
XC-type LEXCH = PE
EATOM = 1390.9808 eV, 102.2342 Ry

TITEL = PAW_PBE Cu 22Jun2005


LULTRA = F use ultrasoft PP ?
IUNSCR = 1 unscreen: 0-lin 1-nonlin 2-no
RPACOR = 2.000 partial core radius
POMASS = 63.546; ZVAL = 11.000 mass and valenz
RCORE = 2.300 outmost cutoff radius
RWIGS = 2.200; RWIGS = 1.164 wigner-seitz radius (au A)
energy cutoff ENMAX = 295.446; ENMIN = 221.585 eV smallest energy cutoff
ICORE = 3 local potential
LCOR = T correct aug charges
LPAW = T paw PP
EAUG = 586.980
DEXC = 0.000
RMAX = 2.344 core radius for proj-oper
RAUG = 1.300 factor for augmentation sphere
RDEP = 2.302 radius for radial grids
RDEPT = 1.771 core radius for aug-charge
POTCAR
• Check recommendations, LDA, PBE

• for short bonds: _h


strong pressure
Note several choices, e.g.:
Ga, Ga_d, Ga_d_GW,
• for GW: _GW Ga_GW, Ga_h, Ga_sv_GW

• States in valence: _sv, _pv, _d Useful commands:


$ grep PAW POTCAR
• “soft” (no short bonds): _s
$ grep ENMAX POTCAR

• Where?
@Kebnekaise: $ echo $VASP_PP_PATH
/hpc2n/eb/software/Core/VASP-data/5.4/potPP

@Tetralith: /software/sse/manual/vasp/POTCARs
KPOINTS
A simple case of fcc Ni, 1 atom

k-points comment
0 = automatic generation of mesh 0
Monkhorst Pack Monkhorst-Pack method (M)
k-point mesh 11 11 11 odd kmesh - includes 𝚪-point
0 0 0 optional shift of k-mesh

Course example, H and Si on Ag(111) surface, 136 atoms

Automatic mesh
0
First letter is sufficient, i.e.
Gamma Gamma method (G)
“G” for “Gamma”
2 2 1 - 𝚪-point included by default
0. 0. 0. - hexagonal structures only use this!
KPOINTS
For bandstructure calculations, provide a list of k-points, see example

k-points for bandstructure L-G-X-U K-G comment


k-points per line-segment 10
line k-points per line-segment
Reciprocal / Cartesian Reciprocal
0.50000 0.50000 0.50000 1 symmetry point + weight
0.00000 0.00000 0.00000 1

0.00000 0.00000 0.00000 1


0.00000 0.50000 0.50000 1

0.00000 0.50000 0.50000 1


0.25000 0.62500 0.62500 1

0.37500 0.7500 0.37500 1


0.00000 0.00000 0.00000 1
KPOINTS
• Metal - “many” k-pts

• Band gap materials - “few” k-pts

• Unit cell (few atoms) - more k-pts


real vs. reciprocal space

• Supercell (100s atoms) - few/one, k-pt

• No guarantee for convergence…


• MP method popular, G “safest” to apply

• 1x1x3 cell geometry 3x3x1 k-mesh


real vs. reciprocal space
VASP binaries
• vasp_std - regular version

• vasp_gam - one k-point (Gamma), faster

• vasp_ncl - noncollinear magnetism

• vasp_gpu, vasp_gpu_ncl - for GPU

• + modifications
e.g. constrained relaxation
Job script - Kebnekaise (HPC2N)
#!/bin/bash
#SBATCH -A snic2019-3-203
#SBATCH -J test
#SBATCH -t 3:59:00
#SBATCH —n 56 #SBATCH -N 2

ml icc/2017.4.196-GCC-6.4.0-2.28
ml ifort/2017.4.196-GCC-6.4.0-2.28
ml impi/2017.3.196
ml VASP/5.4.4-18Apr17-hpc2n

mpirun vasp_std

Example: running on 2 nodes (28x2 cores) @Kebnekaise

https://www.hpc2n.umu.se/resources/software/vasp running @Abisko: note differences


Job script - Kebnekaise (HPC2N)
#!/bin/bash
#SBATCH -A snic2019-3-203
#SBATCH -J test
#SBATCH -t 3:59:00
#SBATCH —N 2 #SBATCH -n 56
#SBATCH --ntasks-per-node=14

ml icc/2017.4.196-GCC-6.4.0-2.28
ml ifort/2017.4.196-GCC-6.4.0-2.28
ml impi/2017.3.196
ml VASP/5.4.4-18Apr17-hpc2n

mpirun vasp_std

Example: running on 2 nodes (28x2 cores), using half the cores


for more memory @Kebnekaise
https://www.hpc2n.umu.se/resources/software/vasp running @Abisko: note differences
Job script - Kebnekaise (HPC2N)
#!/bin/bash
#SBATCH -A snic2019-3-203
#SBATCH -J test
#SBATCH -t 3:59:00
#SBATCH —n 28
GPU calc. #SBATCH --gres=gpu:v100:2,gpuexcl

ml icc/2017.4.196-GCC-6.4.0-2.28
ml ifort/2017.4.196-GCC-6.4.0-2.28
ml impi/2017.3.196
ml CUDA/9.1.85
ml VASP/5.4.4-18Apr17-p01-hpc2n

mpirun vasp_gpu

Example: running on 1 node (28 cores) with 2xV100 GPUs @Kebnekaise


https://www.hpc2n.umu.se/resources/software/vasp
Job script - Tetralith (NSC)
#!/bin/bash
#SBATCH -A snic2019-3-203
#SBATCH -J test
#SBATCH -t 3:59:00
#SBATCH -n 64 #SBATCH —N 2

module load VASP/5.4.4.16052018-nsc1-intel-2018a-eb


note “mpprun” mpprun vasp

Example: running on 2 nodes (32x2 cores) @Tetralith

To increase available memory, reduce cores/node, e.g:


#SBATCH -—ntasks-per-node=16

Alternatively, use “fat” memory nodes:


#SBATCH -C fat
https://www.nsc.liu.se/software/installed/tetralith/vasp/
Job script - Beskow (PDC)
#!/bin/bash -l
#SBATCH -A 2019-3-203
#SBATCH -J test
#SBATCH -t 3:59:00
#SBATCH —-nodes=2

module unload cray-mpich/7.0.4


module load vasp/5.4.4

aprun -n 48 -N 24 vasp
#aprun -n 64 -N 32 vasp

Example: running on 2 nodes (24x2 cores) @Beskow


# alternatively on 2 nodes (32x2 cores)
https://www.pdc.kth.se/software/software/VASP/beskow/5.4.4/index.html#running-vasp
Output files
• OUTCAR - main, detailed output

• OSZICAR - iteration summary

• slurm-***.out - stdout, iteration summary, warnings

• CONTCAR - updated structural data (at finish)


structural relaxation / MD
• XDATCAR - positions at each ionic step

• …
Output files
• DOSCAR - total, partial density of states (DOS)

• CHGCAR - charge density


output can also be switched off

• WAVECAR - plane wave coefficients (for restart)

• …
OSZICAR
Charge density
Min. residual vector
Step Total free Energy Energy diff. Eigenvalue diff.
algo
N E dE d eps ncg rms rms(c)
DAV: 1 -0.189343666468E+01 -0.18934E+01 -0.20040E+03 904 0.422E+02
DAV: 2 -0.108926039335E+02 -0.89992E+01 -0.87586E+01 1440 0.554E+01
DAV: 3 -0.109805531666E+02 -0.87949E-01 -0.87949E-01 1208 0.675E+00
DAV: 4 -0.109807517982E+02 -0.19863E-03 -0.19863E-03 1368 0.313E-01
DAV: 5 -0.109807519113E+02 -0.11307E-06 -0.11310E-06 1256 0.684E-03 0.519E+00
DAV: 6 -0.108723496529E+02 0.10840E+00 -0.69164E-02 1064 0.137E+00 0.317E+00
DAV: 7 -0.108218097854E+02 0.50540E-01 -0.13575E-01 1120 0.205E+00 0.163E-01
DAV: 8 -0.108228444695E+02 -0.10347E-02 -0.32972E-03 944 0.419E-01 0.706E-02
DAV: 9 -0.108230614389E+02 -0.21697E-03 -0.22028E-04 1312 0.111E-01 0.557E-02
DAV: 10 -0.108230846187E+02 -0.23180E-04 -0.25743E-05 560 0.381E-02
1 F= -.10823085E+02 E0= -.10823085E+02 d E =-.431458E-08
Final total free energy

Total steps: NELMIN to NELM


Need to check if convergence is reached!
In particular if NELM was reached (default = 60 steps)
Stdout (slurm-***.out)
running on 2 total cores
distrk: each k-point on 2 cores, 1 groups
distr: one band on 1 cores, 2 groups
using from now: INCAR
vasp.5.4.4.18Apr17-6-g9f103f2a35 (build Sep 13 2019 06:30:52) complex

POSCAR found type information on POSCAR Si


POSCAR found : 1 types and 2 ions
scaLAPACK will be used
LDA part: xc-table for Pade appr. of Perdew
POSCAR, INCAR and KPOINTS ok, starting setup - Check for warnings!
FFT: planning ...
WAVECAR not read
entering main loop
N E dE d eps ncg rms rms(c)
DAV: 1 -0.189343666468E+01 -0.18934E+01 -0.20040E+03 904 0.422E+02
DAV: 2 -0.108926039335E+02 -0.89992E+01 -0.87586E+01 1440 0.554E+01
DAV: 3 -0.109805531666E+02 -0.87949E-01 -0.87949E-01 1208 0.675E+00
DAV: 4 -0.109807517982E+02 -0.19863E-03 -0.19863E-03 1368 0.313E-01
DAV: 5 -0.109807519113E+02 -0.11307E-06 -0.11310E-06 1256 0.684E-03 0.519E+00
DAV: 6 -0.108723496529E+02 0.10840E+00 -0.69164E-02 1064 0.137E+00 0.317E+00
DAV: 7 -0.108218097854E+02 0.50540E-01 -0.13575E-01 1120 0.205E+00 0.163E-01
DAV: 8 -0.108228444695E+02 -0.10347E-02 -0.32972E-03 944 0.419E-01 0.706E-02
DAV: 9 -0.108230614389E+02 -0.21697E-03 -0.22028E-04 1312 0.111E-01 0.557E-02
DAV: 10 -0.108230846187E+02 -0.23180E-04 -0.25743E-05 560 0.381E-02
1 F= -.10823085E+02 E0= -.10823085E+02 d E =-.431458E-08
writing wavefunctions
Warning/advice output
-----------------------------------------------------------------------------
| |
Check stdout (slurm-***.out) | W W AA RRRRR N N II N N GGGG !!! |
for warnings! | W W A A R R NN N II NN N G G !!! |
| W W A A R R N N N II N N N G !!! |
| W WW W AAAAAA RRRRR N N N II N N N G GGG ! |
| WW WW A A R R N NN II N NN G G |
| W W A A R R N N II N N GGGG !!! |
Typical warnings: | |
| For optimal performance we recommend to set |
| NCORE= 4 - approx SQRT( number of cores) |
| NCORE specifies how many cores store one orbital (NPAR=cpu/NCORE). |
| This setting can greatly improve the performance of VASP for DFT. |
Reminder to set (if applicable): | The default, NCORE=1 might be grossly inefficient |
NCORE | on modern multi-core architectures or massively parallel machines. |
| Do your own testing !!!! |
typically = used cores/nodes | Unfortunately you need to use the default for GW and RPA calculations. |
| (for HF NCORE is supported but not extensively tested yet) |
| |
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
| |
| ADVICE TO THIS USER RUNNING 'VASP/VAMP' (HEAR YOUR MASTER'S VOICE ...): |
| |
| You have a (more or less) 'large supercell' and for larger cells |
For high accuracy (default) keep: | it might be more efficient to use real space projection operators |
LREAL=.FALSE. | So try LREAL= Auto in the INCAR file. |
| Mind: If you want to do a very accurate calculations keep the |
| reciprocal projection scheme (i.e. LREAL=.FALSE.) |
| |
-----------------------------------------------------------------------------

You might also like