Restarting finite differences calculations: Difference between revisions

From VASP Wiki
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Available|6.6.0}}
{{Available|6.6.0}}
{{NB|important|This feature requires [[:Category:HDF5_support | HDF5 support]].}}
{{NB|important|This feature requires [[:Category:HDF5_support | HDF5 support]].}}
Since VASP 6.6.0, it has been possible to restart finite difference calculations using {{TAG|IBRION|6}} and {{TAG|CHECKPOINT}}. The displacements are written to a {{FILE|vaspcheck.h5}} file. For details of a general finite difference calculation, see the [[phonons from finite differences]] HowTo. In this HowTo, we will concern ourselves with restarting and splitting finite difference calculations.  
Since VASP 6.6.0, it has been possible to restart finite difference calculations using {{TAG|IBRION|6}} and {{TAG|CHECKPOINT_FD}}. The displacements are written to a {{FILE|vaspcheckfd.h5}} file. For details of a general finite difference calculation, see the [[phonons from finite differences]]. In this HowTo, we will concern ourselves with restarting and splitting finite difference calculations.  
{{NB|important|This can only be done using {{TAG|IBRION|6}} currently. We recommend using this generally over {{TAG|IBRION|5}}.}}
{{NB|mind|This can only be done using {{TAG|IBRION|6}} currently. We recommend using this generally over {{TAG|IBRION|5}}.}}


== Input ==
== Input ==


There are several options for the {{TAG|CHECKPOINT}} tag:
There are several options for the {{TAG|CHECKPOINT_FD}} tag:
*{{TAG|CHECKPOINT|LEGACY}} - finite difference calculation are performed as those in VASP 6.5.1. No {{FILE|vaspcheck.h5}} is written.
*{{TAG|CHECKPOINT_FD|NONE}} - disables checkpoint functionality entirely, reproducing the behavior of VASP before 6.6.0. No {{FILE|vaspcheckfd.h5}} file is written.
*{{TAG|CHECKPOINT|RESET}} ''(default)'' - The {{FILE|vaspcheck.h5}} file is overwritten or created, and the displacements are written to it.
*{{TAG|CHECKPOINT_FD|RESET}} ''(default)'' - overwrites the {{FILE|vaspcheckfd.h5}} file and then updates the file during the calculation after each displacement.
*{{TAG|CHECKPOINT|CONTINUE}} - used for restarting a finite differences calculation from a {{FILE|vaspcheck.h5}} file.
*{{TAG|CHECKPOINT_FD|CONTINUE}} - reads the existing {{FILE|vaspcheckfd.h5}} file (creating a new one if it is not present) and continues from the last completed displacement. Once all displacements are completed, it will perform a single SCF at the equilibrium structure and read all displacement data from the checkpoint file, detecting whether the calculation was done in one run or was split (all displacements must be completed otherwise, an error will be given).
*{{TAG|CHECKPOINT|PREPARE}} - used for splitting a finite differences calculation.
used for restarting a finite differences calculation from a {{FILE|vaspcheckfd.h5}} file.
*{{TAG|CHECKPOINT|SINGLE}} - used for running a single displacement after splitting with {{TAG|CHECKPOINT|PREPARE}}.
*{{TAG|CHECKPOINT_FD|PREPARE}} - creates or overwrites the {{FILE|vaspcheckfd.h5}} file. For each displacement, a {{FILE|CONTCAR_disp-N}} file is written containing the atomic positions for displacement N.
VASP then stops after completing one SCF cycle for the equilibrium structure.
used for splitting a finite differences calculation.
*{{TAG|CHECKPOINT_FD|SINGLE}} - used for running the individual displacement calculations created by {{TAG|CHECKPOINT_FD|PREPARE}}. Each run produces a local {{FILE|vaspcheckfd.h5}} file in its directory for that specific displacement.


We will describe the restart procedure and splitting a calculation below. As an example, we take a 3x3x1 graphene supercell {{FILE|POSCAR}} file from the [https://www.vasp.at/tutorials/latest/phonon/part1/#phonon-e02 phonon tutorials]:
We will describe the restart procedure and splitting a calculation below. As an example, we take a 3x3x1 graphene supercell {{FILE|POSCAR}} file from the [https://www.vasp.at/tutorials/latest/phonon/part1/#phonon-e02 phonon tutorials]:
Line 54: Line 57:
</syntaxhighlight>
</syntaxhighlight>


and <code>PAW C_s 04May1998</code> {{FILE|POTCAR}}. We can use the following {{FILE|INCAR}} file:
and <code>PAW C_s 04May1998</code> {{FILE|POTCAR}}.  
 
The following {{FILE|INCAR}} file with modifications will be used thoughout:


  {{TAGBL|SYSTEM}} = graphene
  {{TAGBL|SYSTEM}} = graphene
Line 86: Line 91:
  slurmstepd-test01: error: *** STEP 254054.0 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***
  slurmstepd-test01: error: *** STEP 254054.0 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***


If you look in the directory, you will see the {{FILE|vaspcheck.h5}} file. Inside, it will contain the displacement calculations that have been completed up to the point of the crash:
If you look in the directory, you will see the {{FILE|vaspcheckfd.h5}} file. Inside, it will contain the displacement calculations that have been completed up to the point of the crash:


  h5ls vaspcheck.h5
  h5ls vaspcheckfd.h5
   
   
  data-1                  Group
  data-1                  Group
Line 94: Line 99:
  symmetry                Group
  symmetry                Group


The calculation can then be restarted by adding {{TAG|CHECKPOINT|CONTINUE}} to the {{FILE|INCAR}}:
The calculation can then be restarted by adding {{TAG|CHECKPOINT_FD|CONTINUE}} to the {{FILE|INCAR}}:


  {{TAGBL|SYSTEM}} = graphene
  {{TAGBL|SYSTEM}} = graphene
Line 112: Line 117:
  {{TAGBL|IBRION}} = 6
  {{TAGBL|IBRION}} = 6
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|CHECKPOINT}} = CONTINUE
  {{TAGBL|CHECKPOINT_FD}} = CONTINUE


You can resubmit your calculation in the directory, e.g., with a job script: <code>sbatch job.sh</code>, and the finite differences calculation will continue from there after an SCF step has been done:
You can resubmit your calculation in the directory, e.g., with a job script: <code>sbatch job.sh</code>, and the finite differences calculation will continue from there after an SCF step has been done:
Line 120: Line 125:
The calculation will then continue as normal until all displacements have been completed and the phonon modes calculated:
The calculation will then continue as normal until all displacements have been completed and the phonon modes calculated:


  h5ls vaspcheck.h5
  h5ls vaspcheckfd.h5
   
   
  data-1                  Group
  data-1                  Group
Line 131: Line 136:
=== Splitting a finite difference calculation ===
=== Splitting a finite difference calculation ===


For some large structures, it may be easier to split the displacements into separate calculations. This can be done with the {{TAG|CHECKPOINT|PREPARE}} tag:
For some large structures, it may be easier to split the displacements into separate calculations. This is done in three steps:
 
# Preparing the separate displacements - {{TAG|CHECKPOINT_FD|PREPARE}}
# Single displacement calculations - {{TAG|CHECKPOINT_FD|SINGLE}}
# Collected finite differences - {{TAG|CHECKPOINT_FD|CONTINUE}}
 
==== 1. Preparing the displacements ====
The displacements can be prepared using the {{TAG|CHECKPOINT_FD|PREPARE}} tag:


  {{TAGBL|SYSTEM}} = graphene
  {{TAGBL|SYSTEM}} = graphene
Line 149: Line 161:
  {{TAGBL|IBRION}} = 6
  {{TAGBL|IBRION}} = 6
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|CHECKPOINT}} = PREPARE
  {{TAGBL|CHECKPOINT_FD}} = PREPARE
 
This will create {{FILE|CONTCAR_disp-N}} files containing each of the displacements in the parent directory as you can see in the ''stdout'':
 
Creating CONTCAR files for finite difference displacements


This will create {{TAGBL|CONTCAR}}_disp-N files containing each of the displacements in the parent directory:
and the {{FILE|vaspcheckfd.h5}} file:


  h5ls vaspcheck.h5
  h5ls vaspcheckfd.h5
   
   
  displacements            Group
  metadata                Group
  subdir_prefix            Dataset {SCALAR}
  subdir_prefix            Dataset {SCALAR}
symmetry                Group
  total_count              Dataset {SCALAR}
  total_count              Dataset {SCALAR}


You can then create different directories for each of these calculations and run them separately. For this, you will need to set {{TAGBL|CHECKPOINT|SINGLE}}:
==== 2. Single displacement calculations ====
You can then create different directories for each of these {{FILE|CONTCAR_disp-N}} and run them separately. For this, you will need to set {{TAG|CHECKPOINT_FD|SINGLE}}:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 191: Line 207:
  {{TAGBL|IBRION}} = 6
  {{TAGBL|IBRION}} = 6
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|CHECKPOINT}} = SINGLE
  {{TAGBL|CHECKPOINT_FD}} = SINGLE
 
{{NB|important|You can set different {{TAG|NCORE}} settings in these calculations, offering parallelization that is not otherwise currently possible for finite differences.}}
In each individual directory, you can see a single displacement has been recorded to the  
In each subdirectory, you can see that a single displacement has been recorded in the ''stdout'':
 
 
 
 
We assume that this calculation has failed after a certain point or accidentally been cancelled:
 
<syntaxhighlight>
DAV:   9    -0.181350430125E+03  -0.25600E-06  -0.38452E-08  848  0.118E-03    0.774E-04
DAV:  10    -0.181350430581E+03  -0.45554E-06  -0.20686E-08  864  0.738E-04    0.208E-04
DAV:  11    -0.181350430676E+03  -0.94857E-07  -0.22346E-09  704  0.354E-04    0.207E-04
srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
slurmstepd-test01: error: *** JOB 254054 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***
slurmstepd-test01: error: *** STEP 254054.0 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***
</syntaxhighlight>


Computing single independent displacement for finite differences


and to the {{FILE|vaspcheckfd.h5}} file:


If you look in the directory, you will see the {{FILE|vaspcheck.h5}} file. Inside it will contain the displacement calculations that have been completed up to the point of the crash:
  h5ls vaspcheckfd.h5
 
 
  h5ls vaspcheck.h5
  data-1                  Group
  data-1                  Group
displacements            Group
symmetry                Group


The calculation can then be restarted by adding {{TAG|CHECKPOINT|CONTINUE}} to the {{FILE|INCAR}}:
==== 3. Collected finite differences ====
Returning to the parent directory, you can combine these separate displacements into one finite difference calculation using the {{TAG|CHECKPOINT_FD|CONTINUE}} tag:


  {{TAGBL|SYSTEM}} = graphene
  {{TAGBL|SYSTEM}} = graphene
Line 237: Line 238:
  {{TAGBL|IBRION}} = 6
  {{TAGBL|IBRION}} = 6
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|POTIM}} = 0.015
  {{TAGBL|CHECKPOINT}} = CONTINUE
  {{TAGBL|CHECKPOINT_FD}} = CONTINUE
{{NB|warning|You can do this calculation in a different directory but you must include the {{FILE|vaspcheckfd.h5}} from the '''prepare''' step there as it contains important metadata.}}
Running this calculation, you can see that each of the '''single''' displacements are combined into one calculation in the ''stdout'':


You can resubmit your calculation in the directory, e.g., with a job script: <code>sbatch job.sh</code>, and the finite differences calculation will continue from there after an SCF step has been done:
  Combining displacements from subdirectories


Found    2 degrees of freedom:
and {{FILE|vaspcheckfd.h5}} file:
Finite differences POTIM= 0.01500 DOF=  2
Continuing from previous run


The calculation will then continue as normal until all displacements have been completed and the phonon modes calculated:
h5ls vaspcheckfd.h5
metadata                Group
subdir_prefix            Dataset {SCALAR}
total_count              Dataset {SCALAR}


h5ls vaspcheck.h5
You can find information about the computed phonon modes under <code>Eigenvectors and eigenvalues of the dynamical matrix</code> as usual.
data-1                  Group
data-2                  Group
data-3                  Group
data-4                  Group
displacements            Group
symmetry                Group


== Practical hints ==
== Practical hints ==
* The phonon frequencies will differ slightly between one run and the split calculation, on the order of the 4th or 5th significant figure. We do not expect this to be significant.
* You can use this method for any [[:Category:electron-phonon interactions | electron-phonon]] calculations.
* You can set different {{TAG|NCORE}} settings in these calculations, offering parallelization that is not otherwise currently possible for finite differences.
* Make sure to check that you are using the correct {{FILE|vaspcheckfd.h5}} file with each calculation, particularly the split calculation. If data is read from an inappropriate {{FILE|vaspcheckfd.h5}} file, you will see it with the following warning:


The computation of the second-order force constants requires accurate [[:Category:Forces|forces]].
  -----------------------------------------------------------------------------
Therefore, the tag {{TAG|PREC}}=Accurate is recommended in the {{FILE|INCAR}}.
|                                                                            |
The {{TAG|ADDGRID}}=TRUE should '''not''' be set without careful testing.
|    EEEEEEE  RRRRRR  RRRRRR  OOOOOOO  RRRRRR      ###    ###    ###    |
 
|    E        R    R  R    R  O    O  R    R    ###    ###    ###    |
A practical way to check for convergence is to monitor the Γ point ('''q'''=0) optical mode frequencies while varying the {{TAG|ENCUT}}, {{TAG|PREC}}, and '''k''' point density ({{FILE|KPOINTS}}). Additionally, compare the result to [[Phonons from density-functional-perturbation theory|phonons from density-functional-perturbation theory (DFPT)]].
|    E        R    R  R    R  O    O  R    R    ###    ###    ###    |
 
|    EEEEE    RRRRRR  RRRRRR  O    O  RRRRRR      #      #      #      |
To get the phonon frequencies quickly on the command line, simply type the following:
|    E        R  R    R  R    O    O  R  R                              |
  grep THz OUTCAR
|     E        R    R  R    R  O    O  R    R      ###    ###    ###    |
 
|    EEEEEEE  R    R  R    R  OOOOOOO  R    R    ###    ###    ###    |
To get an accurate phonon dispersion, perform the force-constants calculation in a large enough supercell.
|                                                                            |
When increasing the size of the supercell, we recommend decreasing the '''k'''-point density in the {{FILE|KPOINTS}} file to yield the same resolution.
|    Checkpoint file vaspcheckfd.h5 is incompatible: NIONS mismatch            |
For example, for the primitive cell of silicon, a 12x12x12 Gamma-centered '''k'''-point mesh is needed to obtain accurate phonon frequencies at the Gamma point. When replicating the unit cell to a 2x2x2 supercell, a 6x6x6 '''k''' point mesh will produce an equivalent sampling. For a 4x4x4 supercell, a 3x3x3 '''k''' point mesh will suffice.
|    (file=54, current=128). Ensure that your calculational settings are    |
 
|     identical between runs. In particular, check POSCAR, KPOINTS,           |
It is possible to use phonopy{{cite|phonopy}} to post-process the results of a finite differences calculation done with VASP.{{cite|phonopy_dfpt}}
|     POTCAR, and INCAR files.                                                |
{{NB|tip|In contrast to [[Phonons from density-functional-perturbation theory|computing phonons within DFPT]], the finite difference approach can be used in combination with any [[Exchange-correlation functional]].}}
|                                                                            |
{{TAG|IBRION}}{{=}}5, is available as of VASP.4.5, {{TAG|IBRION}}{{=}}6 starting from VASP.5.1.
|       ---->  I REFUSE TO CONTINUE WITH THIS SICK JOB ... BYE!!! <----       |
In some older versions (pre VASP.5.1), {{TAG|NSW}} (number of ionic steps) must be set to 1 in the {{FILE|INCAR}} file, since {{TAG|NSW}}{{=}}0 sets the {{TAG|IBRION}}{{=}}&minus;1 regardless of the value supplied in the {{FILE|INCAR}} file.
  |                                                                            |
Although VASP.4.6 supports {{TAG|IBRION}}{{=}}5-6, VASP.4.6 does not change the set of '''k''' points automatically (often the displaced configurations require a different '''k'''-point grid). Hence, the finite difference routine might yield incorrect results in VASP.4.6.
  -----------------------------------------------------------------------------
* We recommend using the {{FILE|WAVECAR}} file from the parent directory of the split calculation for the indiviudal displacements to speed up the calculation. This can easily result in large file sizes. We recommend removing them after each displacement is calculated. E.g., for a finite differences calculation on [https://www.vasp.at/tutorials/latest/transition_states/part2/#transition_states-e07 chabazite], there are 42 atoms, resulting in 126 phonon modes, and so 252 total displacements. If loose settings and the &Gamma;-point only are used for an ab initio calculation, the {{FILE|CHG}}, {{FILE|CHGCAR}}, and {{FILE|WAVECAR}} files for the equilibrium structure are 11 MB, 16 MB, and 16 MB, respectively. This already sums to 11 GB for a relatively small calculation.


== Related tags and sections ==
== Related tags and sections ==
{{TAG|IBRION}},
{{TAG|CHECKPOINT_FD}},
{{TAG|ISIF}},
{{FILE|vaspcheckfd.h5}},
{{TAG|POTIM}},
{{TAG|IBRION}},  
{{FILE|CONTCAR_disp-N}}


[[Phonons: Theory]]
[[Phonons: Theory]]


[[Phonons from density-functional-perturbation theory]], [[Computing the phonon dispersion and DOS]]
<!--[[Category:Phonons]][[Category:Electron-phonon interactions]][[Category:Howto]]-->
 
== References==
<references/>
 
[[Category:Phonons]][[Category:Howto]]

Latest revision as of 15:07, 4 March 2026

Mind: Available as of VASP 6.6.0
Important: This feature requires HDF5 support.

Since VASP 6.6.0, it has been possible to restart finite difference calculations using IBRION = 6 and CHECKPOINT_FD. The displacements are written to a vaspcheckfd.h5 file. For details of a general finite difference calculation, see the phonons from finite differences. In this HowTo, we will concern ourselves with restarting and splitting finite difference calculations.

Mind: This can only be done using IBRION = 6 currently. We recommend using this generally over IBRION = 5.

Input

There are several options for the CHECKPOINT_FD tag:

  • CHECKPOINT_FD = NONE - disables checkpoint functionality entirely, reproducing the behavior of VASP before 6.6.0. No vaspcheckfd.h5 file is written.
  • CHECKPOINT_FD = RESET (default) - overwrites the vaspcheckfd.h5 file and then updates the file during the calculation after each displacement.
  • CHECKPOINT_FD = CONTINUE - reads the existing vaspcheckfd.h5 file (creating a new one if it is not present) and continues from the last completed displacement. Once all displacements are completed, it will perform a single SCF at the equilibrium structure and read all displacement data from the checkpoint file, detecting whether the calculation was done in one run or was split (all displacements must be completed otherwise, an error will be given).

used for restarting a finite differences calculation from a vaspcheckfd.h5 file.

VASP then stops after completing one SCF cycle for the equilibrium structure. used for splitting a finite differences calculation.

  • CHECKPOINT_FD = SINGLE - used for running the individual displacement calculations created by CHECKPOINT_FD = PREPARE. Each run produces a local vaspcheckfd.h5 file in its directory for that specific displacement.

We will describe the restart procedure and splitting a calculation below. As an example, we take a 3x3x1 graphene supercell POSCAR file from the phonon tutorials:

C18
1.0
   7.3521657209830806    0.0000000000000000    0.0000000000000000
  -3.6760828604915403    6.3671622872044793    0.0000000000000000
   0.0000000000000000    0.0000000000000000    8.0000000000000000
C
18
direct
   0.1111111111111133    0.2222222222222200    0.0000000000000000 C
   0.1111111111111133    0.5555555555555532    0.0000000000000000 C
   0.1111111111111133    0.8888888888888866    0.0000000000000000 C
   0.4444444444444466    0.2222222222222200    0.0000000000000000 C
   0.4444444444444466    0.5555555555555532    0.0000000000000000 C
   0.4444444444444466    0.8888888888888866    0.0000000000000000 C
   0.7777777777777801    0.2222222222222200    0.0000000000000000 C
   0.7777777777777799    0.5555555555555532    0.0000000000000000 C
   0.7777777777777799    0.8888888888888866    0.0000000000000000 C
   0.2222222222222200    0.1111111111111133    0.0000000000000000 C
   0.2222222222222200    0.4444444444444466    0.0000000000000000 C
   0.2222222222222199    0.7777777777777799    0.0000000000000000 C
   0.5555555555555532    0.1111111111111133    0.0000000000000000 C
   0.5555555555555534    0.4444444444444466    0.0000000000000000 C
   0.5555555555555532    0.7777777777777799    0.0000000000000000 C
   0.8888888888888866    0.1111111111111133    0.0000000000000000 C
   0.8888888888888866    0.4444444444444466    0.0000000000000000 C
   0.8888888888888866    0.7777777777777799    0.0000000000000000 C

along with a 4x4x1 k-mesh in our KPOINTS file:

K points
 0
Gamma
4  4  1
0  0  0

and PAW C_s 04May1998 POTCAR.

The following INCAR file with modifications will be used thoughout:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015

Calculations

Restarting a finite difference calculation

We assume that this calculation has failed after a certain point or accidentally been cancelled:

DAV:   9    -0.181350430125E+03   -0.25600E-06   -0.38452E-08   848   0.118E-03    0.774E-04
DAV:  10    -0.181350430581E+03   -0.45554E-06   -0.20686E-08   864   0.738E-04    0.208E-04
DAV:  11    -0.181350430676E+03   -0.94857E-07   -0.22346E-09   704   0.354E-04    0.207E-04
srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
slurmstepd-test01: error: *** JOB 254054 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***
slurmstepd-test01: error: *** STEP 254054.0 ON test01 CANCELLED AT 2026-01-19T16:25:49 ***

If you look in the directory, you will see the vaspcheckfd.h5 file. Inside, it will contain the displacement calculations that have been completed up to the point of the crash:

h5ls vaspcheckfd.h5

data-1                   Group
displacements            Group
symmetry                 Group

The calculation can then be restarted by adding CHECKPOINT_FD = CONTINUE to the INCAR:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = CONTINUE

You can resubmit your calculation in the directory, e.g., with a job script: sbatch job.sh, and the finite differences calculation will continue from there after an SCF step has been done:

Continuing from previous run

The calculation will then continue as normal until all displacements have been completed and the phonon modes calculated:

h5ls vaspcheckfd.h5

data-1                   Group
data-2                   Group
data-3                   Group
data-4                   Group
displacements            Group
symmetry                 Group

Splitting a finite difference calculation

For some large structures, it may be easier to split the displacements into separate calculations. This is done in three steps:

  1. Preparing the separate displacements - CHECKPOINT_FD = PREPARE
  2. Single displacement calculations - CHECKPOINT_FD = SINGLE
  3. Collected finite differences - CHECKPOINT_FD = CONTINUE

1. Preparing the displacements

The displacements can be prepared using the CHECKPOINT_FD = PREPARE tag:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = PREPARE

This will create CONTCAR_disp-N files containing each of the displacements in the parent directory as you can see in the stdout:

Creating CONTCAR files for finite difference displacements

and the vaspcheckfd.h5 file:

h5ls vaspcheckfd.h5

metadata                 Group
subdir_prefix            Dataset {SCALAR}
total_count              Dataset {SCALAR}

2. Single displacement calculations

You can then create different directories for each of these CONTCAR_disp-N and run them separately. For this, you will need to set CHECKPOINT_FD = SINGLE:

max=$(printf "%s\n" CONTCAR_disp-* | sed 's/.*-//' | sort -n | tail -1)

for i in $(seq 1 $max); do
  mkdir -p disp-$i
  cp CONTCAR_disp-$i disp-$i/POSCAR
  cp INCAR POTCAR KPOINTS CHG CHGCAR WAVECAR vasp.run disp-$i/
  sed -i 's/PREPARE/SINGLE/g' disp-$i/INCAR
done

Each INCAR file in the directories will then look like:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = SINGLE
Important: You can set different NCORE settings in these calculations, offering parallelization that is not otherwise currently possible for finite differences.

In each subdirectory, you can see that a single displacement has been recorded in the stdout:

Computing single independent displacement for finite differences

and to the vaspcheckfd.h5 file:

h5ls vaspcheckfd.h5
 
data-1                   Group

3. Collected finite differences

Returning to the parent directory, you can combine these separate displacements into one finite difference calculation using the CHECKPOINT_FD = CONTINUE tag:

SYSTEM = graphene
ENCUT = 400

# electronic
PREC = Accurate
NELMIN = 5
EDIFF = 1e-8
ISMEAR = -1
SIGMA = 0.2
LREAL = .FALSE.
LWAVE = .FALSE.
LCHARG = .FALSE.

# ionic (finite differences)
IBRION = 6
POTIM = 0.015
CHECKPOINT_FD = CONTINUE
Warning: You can do this calculation in a different directory but you must include the vaspcheckfd.h5 from the prepare step there as it contains important metadata.

Running this calculation, you can see that each of the single displacements are combined into one calculation in the stdout:

 Combining displacements from subdirectories

and vaspcheckfd.h5 file:

h5ls vaspcheckfd.h5

metadata                 Group
subdir_prefix            Dataset {SCALAR}
total_count              Dataset {SCALAR}

You can find information about the computed phonon modes under Eigenvectors and eigenvalues of the dynamical matrix as usual.

Practical hints

  • The phonon frequencies will differ slightly between one run and the split calculation, on the order of the 4th or 5th significant figure. We do not expect this to be significant.
  • You can use this method for any electron-phonon calculations.
  • You can set different NCORE settings in these calculations, offering parallelization that is not otherwise currently possible for finite differences.
  • Make sure to check that you are using the correct vaspcheckfd.h5 file with each calculation, particularly the split calculation. If data is read from an inappropriate vaspcheckfd.h5 file, you will see it with the following warning:
 -----------------------------------------------------------------------------
|                                                                             |
|     EEEEEEE  RRRRRR   RRRRRR   OOOOOOO  RRRRRR      ###     ###     ###     |
|     E        R     R  R     R  O     O  R     R     ###     ###     ###     |
|     E        R     R  R     R  O     O  R     R     ###     ###     ###     |
|     EEEEE    RRRRRR   RRRRRR   O     O  RRRRRR       #       #       #      |
|     E        R   R    R   R    O     O  R   R                               |
|     E        R    R   R    R   O     O  R    R      ###     ###     ###     |
|     EEEEEEE  R     R  R     R  OOOOOOO  R     R     ###     ###     ###     |
|                                                                             |
|     Checkpoint file vaspcheckfd.h5 is incompatible: NIONS mismatch            |
|     (file=54, current=128). Ensure that your calculational settings are     |
|     identical between runs. In particular, check POSCAR, KPOINTS,           |
|     POTCAR, and INCAR files.                                                |
|                                                                             |
|       ---->  I REFUSE TO CONTINUE WITH THIS SICK JOB ... BYE!!! <----       |
|                                                                             |
 -----------------------------------------------------------------------------
  • We recommend using the WAVECAR file from the parent directory of the split calculation for the indiviudal displacements to speed up the calculation. This can easily result in large file sizes. We recommend removing them after each displacement is calculated. E.g., for a finite differences calculation on chabazite, there are 42 atoms, resulting in 126 phonon modes, and so 252 total displacements. If loose settings and the Γ-point only are used for an ab initio calculation, the CHG, CHGCAR, and WAVECAR files for the equilibrium structure are 11 MB, 16 MB, and 16 MB, respectively. This already sums to 11 GB for a relatively small calculation.

Related tags and sections

CHECKPOINT_FD, vaspcheckfd.h5, IBRION, CONTCAR_disp-N

Phonons: Theory