Skip to content

Troubleshooting

This page contains potential solutions to whatever may currently be troubling you. Your mileage may vary.

VASP

VASP internal routines have requested a change of the k-point set

Context

Running phonon calculations for nitrate reduction intermediates on M-BHT slabs.

Environment

  • Cluster: Cedar
  • Date: July 9, 2024
  • Software Versions: Python 3.11.9, ASE 3.23.0, VASP 5.4.4

Relevant Files

Input files for the calculation.

INCAR created by Atomic Simulation Environment
 ENCUT = 550.000000
 POTIM = 0.015000
 SIGMA = 0.040000
 SMASS = -3.000000
 EDIFF = 1.00e-10
 EDIFFG = -1.00e-02
 ALGO = Normal
 GGA = PE
 PREC = Accurate
 IBRION = 5
 ISIF = 2
 ISMEAR = 0
 ISPIN = 2
 KPAR = 4
 LDAUTYPE = 3
 LMAXMIX = 4
 LORBIT = 11
 NELM = 250
 NFREE = 2
 NSW = 1
 IVDW = 11
 NCORE = 4
 LDAU = .TRUE.
 LDIPOL = .FALSE.
 LPLANE = .TRUE.
 LREAL = Auto
 LDAUL = 2 -1 -1 -1 -1
 LDAUU = 5.200 0.000 0.000 0.000 0.000
 LDAUJ = 0.000 0.000 0.000 0.000 0.000
import logging

from ase.calculators.vasp import Vasp
import ase.io
from ccu.relaxation import run_relaxation

logging.basicConfig(level=logging.DEBUG)

ldau_luj = {
    "H": {"L": -1, "U": 0, "J": 0},
    "N": {"L": -1, "U": 0, "J": 0},
    "O": {"L": -1, "U": 0, "J": 0},
    "S": {"L": -1, "U": 0, "J": 0},
    "Ag": {"L": 2, "U": 3.87, "J": 0},
    "Co": {"L": 2, "U": 5.2, "J": 0},
    "Mn": {"L": 2, "U": 5.3, "J": 0},
    "Ni": {"L": 2, "U": 6.1, "J": 0},
}

atoms = ase.io.read("Co-BHT_on_Co_vertical_1.traj")

calc = Vasp(
    algo="Normal",
    ediff=1e-8,
    ediffg=-0.01,
    encut=550,
    gga="PE",
    gamma=False,
    ibrion=5,
    isif=2,
    ismear=0,
    ispin=2,
    isym=0,
    ivdw=11,
    kpts=(4, 4, 1),
    kpar=2,
    ldautype=3,
    ldau=True,
    ldipol=False,
    lmaxmix=4,
    lorbit=11,
    lplane=True,
    lreal="Auto",
    npar=2,
    nelm=250,
    nfree=2,
    nsw=1,
    potim=0.015,
    prec="Accurate",
    sigma=0.04,
    smass=-3,
    ldau_luj=ldau_luj,
)

atoms.calc = calc
run_relaxation(atoms, run_bader=False, run_chargemol=False)
#!/bin/bash
#SBATCH --account=def-samiras
#SBATCH --job-name=Co-BHT_on_Co_vertical_1-c7zrPZuKru
#SBATCH --mem-per-cpu=1000MB
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=24
#SBATCH --time=23:00:00
#SBATCH --mail-user=ugn@sfu.ca
#SBATCH --mail-type=BEGIN,END,FAIL,TIME_LIMIT,TIME_LIMIT_90

if test -e "/etc/profile"; then
  source "/etc/profile"
fi

if test -e "$HOME/.bash_profile"; then
  source "$HOME/.bash_profile"
fi

unset LANG

module purge
module load vasp
module load python/3.11.9

source "$COMP_CHEM_ENV"

export LC_ALL="C"
export MKL_NUM_THREADS=1
export OMP_NUM_THREADS=1

ulimit -s unlimited

ulimit -a -S
ulimit -a -H

echo " "
echo "### Creating TMP_WORK_DIR directory and changing to it ..."
echo " "

if test -e "$HOME/scratch"; then
  TMP_WORK_DIR="$HOME/scratch/${SLURM_JOB_ID}"
elif test -e /scratch/"${SLURM_JOB_ID}"; then
  TMP_WORK_DIR=/scratch/${SLURM_JOB_ID}
else
  TMP_WORK_DIR="$(pwd)"
fi

TMP_BASE_DIR="$(dirname "$TMP_WORK_DIR")"
JOB_WORK_DIR="$(basename "$TMP_WORK_DIR")"

# Creating a symbolic link to temporary directory holding work files while job running

if ! test -e "${TMP_WORK_DIR}"; then
  mkdir "${TMP_WORK_DIR}"
fi
ln -s "${TMP_WORK_DIR}" scratch_dir
cd "${TMP_WORK_DIR}" || exit

cp -v "$SLURM_SUBMIT_DIR"/{*py,*.traj} "$TMP_WORK_DIR"/

echo " "

# Preemptively end job if getting close to time limit

export AUTOJOB_SLURM_SCRIPT="vasp.sh"

# run ase calculation and time
python3 run.py "$SLURM_SUBMIT_DIR" > "$SLURM_SUBMIT_DIR"/out.txt


AUTOJOB_FILES_TO_DELETE="EIGENVAL IBZKPT PCDAT PROCAR ELFCAR LOCPOT PROOUT TMPCAR vasp.dipcor"
rm -vf "$AUTOJOB_FILES_TO_DELETE"
sleep 10 # Sleep some time so potential stale nfs handles can disappear.

cd "${TMP_BASE_DIR}" || exit
mkdir -vp "${SLURM_SUBMIT_DIR}" # if user has deleted or moved the submit dir

tar -zcvf "${SLURM_SUBMIT_DIR}/${JOB_WORK_DIR}.tgz" "${JOB_WORK_DIR}" \
  || { echo "ERROR: Failed to create tgz-file. Please cleanup TMP_WORK_DIR $TMP_WORK_DIR on host '$HOSTNAME' manually (if not done automatically by queueing system)."; exit 102; }

rm -rvf "${TMP_WORK_DIR}"

cd "${SLURM_SUBMIT_DIR}" || exit
tar -xzf "${JOB_WORK_DIR}".tgz
mv "${JOB_WORK_DIR}"/* .
rm -r "${JOB_WORK_DIR}".tgz "${JOB_WORK_DIR}"

rm "${SLURM_SUBMIT_DIR}/scratch_dir"

The Error

vasp.out
 -----------------------------------------------------------------------------
|                                                                             |
|     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     ###     ###     ###     |
|                                                                             |
|      VASP internal routines  have requested a change of the k-point set.    |
|      Unfortunately this is only possible if NPAR=number of nodes.           |
|      Please remove the tag NPAR from the INCAR file and restart the         |
|      calculations.                                                          |
|                                                                             |
|      ---->  I REFUSE TO CONTINUE WITH THIS SICK JOB ..., BYE!!! <----       |
|                                                                             |
 -----------------------------------------------------------------------------

This is an error due to symmetry breaking (see here).

The Solution

Set ISYM=0. in your INCAR file.

ASE is not copying the vdw-kernel.bindat to the job directory (WIP)

Context

Running any calculation with VDW corrections.

Environment

  • Cluster: Cedar
  • Date: July 9, 2024
  • Software Versions: Python 3.11.9, ASE 3.23.0, VASP 5.4.4

The Error

You set the ivdw keyword argument when configuring a VASP calculator in ASE, but you notice that the vdw-kernel.bindat file is not copied to the calculation directory.

The Solution

As of ASE 3.23.0, the vdw-kernel.bindat is only copied if you also set the keyword argument luse_vdw=True for the VASP calculator.

Gaussian

Frequency Calculations

Watch out for internal rotations! If performing frequency calculations in Gaussian, you may get the following warning:

Warning -- explicit consideration of  23 degrees of freedom as
        vibrations may cause significant error

See here for a resolution.

General

Property Calculation

When calculating zero-point energies using computational codes, it is worth it to examine whether there is an internal routine. In the case of VASP, one can use the INCAR tag IBRION=5 (or 6) to perform such a calculation using finite differences. The benefit in this case over using the ASE reliant method ccu.thermo.vibration.run_vibration is that all code-specific data is retained. For example, one can also go back and collect IR frequency data from the calculated dipoles of each image.

Additionally, one should also check whether IR frequency data is any more expensive than ZPE data. For example, in VASP, dipole moments are calculated at every optimization point during a phonon frequency calculation. This means that if the phonon calculation is executed in VASP, IR frequencies are obtained for free. This benefit highlights a major advantage to executing frequency calculations in VASP as opposed to with an external routine like ASE’s ase.vibration.vibration.Vibration. ASE does not archive all calculated results for each image, but instead, only records calculated forces.