Skip to content

VASP

At the point of writing (2024-01), we do not provide central installation of VASP on Vera. User with VASP licences are recommended to manage the installation themselves. If you want to manage access to VASP as a license holder, you can contact support to set up a private project directory and group.

This documenation contains recommendations about building and managing VASP modules on VERA.

Makefile.include

The following makefile.include files are tested against VASP version 6.4.3 with the standard test suite (in MPI mode); they are taken from what is published by VASP and adapted to different toolchains available on Vera, see the VASP wiki page for a more extensive list of makefiles and options.

The makefiles.include should work with the standard VASP compilation procedure, i.e., copying to the source directory and DEPS=1 make -j4. If you have multiple versions of VASP to maintain, and want to run it on different CPU architectures, EasyBuild helps to keep track of modules (see sections below).

With some internal benchmark results, we do not notice a systematic difference across toolchains. Users are always encouraged to benchmark the builds with their systems and choose optimal parallization setups.

When compiling with FOSS toolchain we recommend linking against FLexiBLAS, which allows switching BLAS implementaions without recompiling the binary, see the jobscript below for an example.

makefile.include.foss
# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Dtbdyn \
              -Dfock_dblbuf \
              -D_OPENMP

CPP         = gcc -E -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)
FC          = mpif90 -fopenmp
FCL         = mpif90 -fopenmp
FREE        = -ffree-form -ffree-line-length-none
FFLAGS      = -w -ffpe-summary=none
OFLAG       = -O2
OFLAG_IN    = $(OFLAG)
DEBUG       = -O0

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = $(FC)
CC_LIB      = gcc
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1
FREE_LIB    = $(FREE)
OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS    = g++
LLIBS       = -lstdc++

# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -march=native
FFLAGS     += $(VASP_TARGET_CPU)

# For gcc-10 and higher (comment out for older versions)
FFLAGS     += -fallow-argument-mismatch

# Mandatory numerical libs, use easybuild paths
BLASPACK    = -L$(EBROOTFLEXIBLAS)/lib -lflexiblas
SCALAPACK   = -L$(EBROOTSCALAPACK)/lib -lscalapack
FFTW        = -L$(EBROOTFFTWMPI)/lib -lfftw3 -lfftw3_omp
LLIBS      += $(SCALAPACK) $(BLASPACK) ${FFTW}
INCS       += -I$(EBROOTFFTWMPI)/include

# Those does not seem necessary as of VASP 6.4.3, uncomment for older version
# OBJECTS    = fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o
# OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
# OBJECTS_O2 += fft3dlib.o

# use the fftlib library when OMP is desired
CPP_OPTIONS+= -Dsysv
FCL        += fftlib.o
CXX_FFTLIB  = g++ -fopenmp -std=c++11 -DFFTLIB_THREADSAFE
INCS_FFTLIB = -I./include -I$(EBROOTFFTWMPI)/include
LIBS       += fftlib
LLIBS      += -ldl

If one prefers intel compiler, we recommend using the versions newer than intel/2024a with LLVM-based oneAPI compilers, as that eases the setting of optimization flags for different CPU architectures.

makefile.include.oneapi
# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxIFC\"\
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Dtbdyn \
              -Dfock_dblbuf \
              -D_OPENMP

CPP         = fpp -f_com=no -free -w0  $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)
FC          = mpiifort -fc=ifx -qopenmp
FCL         = mpiifort -fc=ifx
FREE        = -free -names lowercase
FFLAGS      = -assume byterecl -w
OFLAG       = -O2
OFLAG_IN    = $(OFLAG)
DEBUG       = -O0

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = $(FC)
CC_LIB      = icx
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1
FREE_LIB    = $(FREE)
OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS   = icpx
LLIBS      = -lstdc++

# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -march=native
FFLAGS     += $(VASP_TARGET_CPU)

# Intel MKL (FFTW, BLAS, LAPACK, and scaLAPACK)
# (Note: for Intel Parallel Studio's MKL use -mkl instead of -qmkl)
FCL        += -qmkl
MKLROOT    ?=
LLIBS      += -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -limf
INCS        =-I$(MKLROOT)/include/fftw

# Those does not seem necessary as of VASP 6.4.3, uncomment for older version
# OBJECTS    = fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o
# OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
# OBJECTS_O2 += fft3dlib.o

We provide the AMD-optimized compiler collection (aocc/2024a) and the corresponding AOCL modules (aocl/2024a) which might be better tunes for the Zen4 hardware.

makefile.include.amd
# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Dtbdyn \
              -Dfock_dblbuf \
              -D_OPENMP

CPP         = flang -E -ffree-form -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)
FC          = mpif90 -fopenmp
FCL         = mpif90 -fopenmp
FREE        = -ffree-form -ffree-line-length-none
FFLAGS      = -w -fno-fortran-main -Mbackslash
OFLAG       = -O2
OFLAG_IN    = $(OFLAG)
DEBUG       = -O0

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = $(FC)
CC_LIB      = clang
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1
FREE_LIB    = $(FREE)
OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS    = clang++
LLIBS       = -lstdc++

# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -march=native
FFLAGS     += $(VASP_TARGET_CPU)

# Mandatory numerical libs, link to AOCL
BLAS        = -lblis-mt
LAPACK      = -lflame
SCALAPACK   = -lscalapack
FFTW        = -lfftw3 -lfftw3_omp
LLIBS      += -L$(AOCLhome)/lib $(SCALAPACK) $(LAPACK) $(BLAS) ${FFTW}
INCS       += -I$(AOCLhome)/include

# Those does not seem necessary as of VASP 6.4.3, uncomment for older version
# OBJECTS    = fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o
# OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
# OBJECTS_O2 += fft3dlib.o

# Use the fftlib library when OMP is desired
CPP_OPTIONS+= -Dsysv
FCL        += fftlib.o
CXX_FFTLIB  = clang++ -fopenmp -std=c++11 -DFFTLIB_THREADSAFE
INCS_FFTLIB = -I./include -I$(AMDFFTW_ROOT)/include
LIBS       += fftlib
LLIBS      += -ldl

EasyBuild

The following shell script loads the essential modules and setup the environment variables and alias for submitting VASP bulid and test as a job.

We separate the module directories accoridng to CPU architecture here. It is not necessary (you can just use a version suffix to differentiate the builds), but this setup avoid loading the wrong module by accident.

The easyconfig files we have are not very involved, they merely selects the makefile.include and patches files to be applied. Only when building with AOCC/AOCL do we need to put extra dependencies other than the toolchain.

vasp-env-zen4.sh
# apply the easybuild config and add module path
ml purge
ml EasyBuild/5.0.x

export ARCH=zen4

# set custom module path
module_paths=(
  # custom module directory that easybuild installs into
  /cephyr/NOBACKUP/priv/c3-vasp-test/Vera/$ARCH/fmodules/all
  # base module trees on Vera
  /apps/Common/fmodules/all
  /apps/Arch/fmodules/all
)
export MODULEPATH=$(IFS=:; echo "${module_paths[*]}")

# configure easybuild to install to directory named after architecture
source_paths=(
  # paths where easybuild search for sources
  /cephyr/NOBACKUP/priv/c3-vasp-test/makefiles/
  /cephyr/NOBACKUP/priv/c3-vasp-test/patches/
  /cephyr/NOBACKUP/priv/c3-vasp-test/sources/
)
export EASYBUILD_DISABLE_RPATH="True"
export EASYBUILD_SOURCEPATH=$(IFS=:; echo "${source_paths[*]}")
export EASYBUILD_BUILDPATH="/cephyr/NOBACKUP/priv/c3-vasp-test/tmp/$ARCH"
export EASYBUILD_INSTALLPATH="/cephyr/NOBACKUP/priv/c3-vasp-test/Vera/$ARCH"
export EASYBUILD_MODULE_NAMING_SCHEME="EasyBuildMNS"
export EASYBUILD_JOB_BACKEND="Slurm"

# configure slurm to build on correpsonding direcotry
export SBATCH_CONSTRAINT="${ARCH^^}"
export SBATCH_ACCOUNT="C3SE-STAFF"
alias ebsub="eb -r --job --job-cores 4 --job-max-walltime 6"
VASP-6.4.3-foss-2024a.eb
easyblock = 'MakeCp'

local_makefile_include = 'makefile.include.foss'

name = 'VASP'
version = '6.4.3'
versionsuffix = ''
# Use a unique versionsuffix to differentiate variants, e.g:
# versionsuffix = '-vdW-DF-AH'

homepage = 'http://www.vasp.at'
description = """The Vienna Ab initio Simulation Package (VASP) is a computer
program for atomic scale materials modelling, e.g. electronic structure
calculations and quantum-mechanical molecular dynamics, from first
principles."""

toolchain = {'name': 'foss', 'version': '2024a'}
toolchainopts = {'usempi': True, 'openmp': True}

sources = [
    'vasp.6.4.3.tgz'
    # optional: installs VTST
    # 'vtstcode-204.tgz'
    # optional: include the vdw_kernel in installations
    # 'vdw_kernel.bindat.gz'
]


# List the patches you want to apply here:
patches = [
    (local_makefile_include, '%(builddir)s/%(namelower)s.%(version)s'),
    # optional: installs VTST
    # 'vasp-6.4.3_vtst-204.patch',
    # optional: replaces hardcoded path with the environment variable VDW_KERNEL
    # 'vasp-6.4.3_vdw-kernel-file.patch',
    # optional: fixes IO-related performance issues on certain filesystems
    # 'vasp-6.4.3_potcar-readonly.patch',
]

prebuildopts = (
    f'cp {local_makefile_include} makefile.include && '
    # optional: installs VTST
    # 'cp -r ../vtstcode-204/vtstcode6.4.3/* src/ && '
    'unset LIBS && '
)

buildopts = 'DEPS=1 std gam ncl'
parallel = 4 # parallel build is possible with DEPS=1, as of 6.X.X

files_to_copy = [
    (['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'], 'bin'),
    # optional: include the vdw_kernel in installations
    # (['../vdw_kernel.bindat'], '.'),
]

sanity_check_paths = {
    'files': ['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'],
    # optional: include the kernel in installations
    # 'files': ['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl', 'vdw_kernel.bindat'
    'dirs': []
}

pretestopts = (
    'export OMP_NUM_THREADS=1 &&'
    'export VASP_TESTSUITE_EXE_STD="srun -n 4 $PWD/bin/vasp_std" && '
    'export VASP_TESTSUITE_EXE_NCL="srun -n 4 $PWD/bin/vasp_ncl" && '
    'export VASP_TESTSUITE_EXE_GAM="srun -n 4 $PWD/bin/vasp_gam" && '
)

runtest = "test"  # Run make test after build to verify

modextravars = {
    # optional: include the vdw_kernel in installations
    'VDW_KERNEL': '%(installdir)s/vdw_kernel.bindat',
}

moduleclass = 'phys'
VASP-6.4.3-foss-2024a.eb
easyblock = 'MakeCp'

local_makefile_include = 'makefile.include.oneapi'

name = 'VASP'
version = '6.4.3'
versionsuffix = ''
# Use a unique versionsuffix to differentiate variants, e.g:
# versionsuffix = '-vdW-DF-AH'

homepage = 'http://www.vasp.at'
description = """The Vienna Ab initio Simulation Package (VASP) is a computer
program for atomic scale materials modelling, e.g. electronic structure
calculations and quantum-mechanical molecular dynamics, from first
principles."""

toolchain = {'name': 'intel', 'version': '2024a'}
toolchainopts = {'usempi': True, 'openmp': True}

sources = [
    'vasp.6.4.3.tgz'
    # optional: installs VTST
    # 'vtstcode-204.tgz'
    # optional: include the vdw_kernel in installations
    # 'vdw_kernel.bindat.gz'
]


# List the patches you want to apply here:
patches = [
    (local_makefile_include, '%(builddir)s/%(namelower)s.%(version)s'),
    # optional: installs VTST
    # 'vasp-6.4.3_vtst-204.patch',
    # optional: replaces hardcoded path with the environment variable VDW_KERNEL
    # 'vasp-6.4.3_vdw-kernel-file.patch',
    # optional: fixes IO-related performance issues on certain filesystems
    # 'vasp-6.4.3_potcar-readonly.patch',
]

prebuildopts = (
    f'cp {local_makefile_include} makefile.include && '
    # optional: installs VTST
    # 'cp -r ../vtstcode-204/vtstcode6.4.3/* src/ && '
    'unset LIBS && '
)

buildopts = 'DEPS=1 std gam ncl'
parallel = 4 # parallel build is possible with DEPS=1, as of 6.X.X

files_to_copy = [
    (['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'], 'bin'),
    # optional: include the vdw_kernel in installations
    # (['../vdw_kernel.bindat'], '.'),
]

sanity_check_paths = {
    'files': ['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'],
    # optional: include the kernel in installations
    # 'files': ['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl', 'vdw_kernel.bindat'
    'dirs': []
}

pretestopts = (
    'export OMP_NUM_THREADS=1 &&'
    'export VASP_TESTSUITE_EXE_STD="mpirun -np 4 $PWD/bin/vasp_std" && '
    'export VASP_TESTSUITE_EXE_NCL="mpirun -np 4 $PWD/bin/vasp_ncl" && '
    'export VASP_TESTSUITE_EXE_GAM="mpirun -np 4 $PWD/bin/vasp_gam" && '
)

runtest = "test"  # Run make test after build to verify

modextravars = {
    # optional: include the vdw_kernel in installations
    'VDW_KERNEL': '%(installdir)s/vdw_kernel.bindat',
}

moduleclass = 'phys'
VASP-6.4.3-amd-2024a.eb
easyblock = 'MakeCp'

local_makefile_include = 'makefile.include.amd'

name = 'VASP'
version = '6.4.3'
versionsuffix = 'amd-2024a'
# Use a unique versionsuffix to differentiate variants, e.g:
# versionsuffix = '-vdW-DF-AH'

homepage = 'http://www.vasp.at'
description = """The Vienna Ab initio Simulation Package (VASP) is a computer
program for atomic scale materials modelling, e.g. electronic structure
calculations and quantum-mechanical molecular dynamics, from first
principles."""

toolchain = {'name': 'GCCcore', 'version': '13.3.0'}

# Add extra dependencies for AMD compilers and numerical libs;
# ---
# Using AOCC also requires OpenMPI to be recompiled, we have not (yet) set up
# proper compiler toolchain for AMD, so the libraries are only specified
# as dependencies there.
dependencies = [
  ("OpenMPI", "5.0.3", "-aocc", ("GCC", "13.3.0")),
  ("AOCC", "4.2.0"),
  ("AOCL", "4.2.0", None, SYSTEM)
]

sources = [
    'vasp.6.4.3.tgz'
    # optional: installs VTST
    # 'vtstcode-204.tgz'
    # optional: include the vdw_kernel in installations
    # 'vdw_kernel.bindat.gz'
]


# List the patches you want to apply here:
patches = [
    (local_makefile_include, '%(builddir)s/%(namelower)s.%(version)s'),
    # optional: installs VTST
    # 'vasp-6.4.3_vtst-204.patch',
    # optional: replaces hardcoded path with the environment variable VDW_KERNEL
    # 'vasp-6.4.3_vdw-kernel-file.patch',
    # optional: fixes IO-related performance issues on certain filesystems
    # 'vasp-6.4.3_potcar-readonly.patch',
]

prebuildopts = (
    f'cp {local_makefile_include} makefile.include && '
    # optional: installs VTST
    # 'cp -r ../vtstcode-204/vtstcode6.4.3/* src/ && '
    'unset LIBS && '
)

buildopts = 'DEPS=1 std gam ncl'
parallel = 4 # parallel build is possible with DEPS=1, as of 6.X.X

files_to_copy = [
    (['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'], 'bin'),
    # optional: include the vdw_kernel in installations
    # (['../vdw_kernel.bindat'], '.'),
]

sanity_check_paths = {
    'files': ['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'],
    # optional: include the kernel in installations
    # 'files': ['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl', 'vdw_kernel.bindat'
    'dirs': []
}

pretestopts = (
    'export OMP_NUM_THREADS=1 &&'
    'export VASP_TESTSUITE_EXE_STD="srun -n 4 $PWD/bin/vasp_std" && '
    'export VASP_TESTSUITE_EXE_NCL="srun -n 4 $PWD/bin/vasp_ncl" && '
    'export VASP_TESTSUITE_EXE_GAM="srun -n 4 $PWD/bin/vasp_gam" && '
)

runtest = "test"  # Run make test after build to verify

modextravars = {
    # optional: include the vdw_kernel in installations
    'VDW_KERNEL': '%(installdir)s/vdw_kernel.bindat',
}

moduleclass = 'phys'

With the above setup you can select your environment and build vasp with EasyBuild:

# setup build environment for a architecture
source vasp-env-zen4.sh

# building vasp itself is not so expensive
eb VASP-6.4.3-foss-2024a.eb --skip-test-step

# if you want to run the test suite it is better to submit a job
eb_submit VASP-6.4.3-foss-2024a.eb

Job scripts

Below are example jobscripts for running VASP from the above modules.

Notably, the NCORE option (when running) in MPI mode has significant influence on the performance and should be benchmarked. Running in hybrid parallization (MPI x OMP) mode is usually not faster than MPI mode with optimal NCORE setting, but it might help to reduce memory usage for large simulations.

vasp-job-zen4.sh
#!/usr/bin/env bash

#SBATCH -J VASP
#SBATCH -A C3-STAFF
#SBATCH -C ZEN4
#SBATCH -t 00:20:00
#SBATCH -c 1
#SBATCH -n 128

module_paths=(
  # custom module directory that easybuild installs into
  /cephyr/NOBACKUP/priv/c3-vasp-test/Vera/zen4/fmodules/all
  # base module directories on Vera
  /apps/Common/fmodules/all
  /apps/Arch/fmodules/all
)
export MODULEPATH=$(IFS=:; echo "${module_paths[*]}")

ml VASP/6.4.3-foss-2024a # or specify your version

# uncomment below to switch the BLAS backend
# module load OpenBLAS OpenBLAS/0.3.27-GCC-13.3.0
# export FLEXIBLAS=OPENBLAS

export OMP_NUM_THREADS=1
export OMP_STACKSIZE=512m

srun vasp_std
vasp-job-zen4-omp.sh
#!/usr/bin/env bash

#SBATCH -J VASP
#SBATCH -A C3-STAFF
#SBATCH -C ZEN4
#SBATCH -t 00:20:00
#SBATCH -c 8
#SBATCH -n 32

module_paths=(
  # custom module directory that easybuild installs into
  /cephyr/NOBACKUP/priv/c3-vasp-test/Vera/zen4/fmodules/all
  # base module directories on Vera
  /apps/Common/fmodules/all
  /apps/Arch/fmodules/all
)
export MODULEPATH=$(IFS=:; echo "${module_paths[*]}")

ml VASP/6.4.3-foss-2024a # or specify your version

# uncomment below to switch the BLAS backend
# module load OpenBLAS OpenBLAS/0.3.27-GCC-13.3.0
# export FLEXIBLAS=OPENBLAS

export OMP_NUM_THREADS=8
export OMP_STACKSIZE=512m

srun vasp_std

Patches

The following patches are not necessary for running recent versions of VASP on Vera, but they might be useful for users compiling and testing VASP with older versions or extra plugins. Support are provided at a best-effort level.

The patches are arranged by VASP versions that we tested, if you have VASP source code you want to use that does not work with the patches below, you can try generating a new patch following the existing ones with your source code.

Installing VTST requires modifying VASP source. The following patches are generated following the instructions by VTST developers.

vasp-6.3.0_vtst-204.patch
diff -ruN src/main.F src.vtst/main.F
--- src/main.F
+++ src/main.F
@@ -922,7 +922,7 @@
 ! init all chains (INCAR reader)
 !-----------------------------------------------------------------------
       LCHAIN = IMAGES > 0 .AND. .NOT.AFQMC_SET % ACTIVE
-      IF (LCHAIN) CALL chain_init( T_INFO, IO)
+      CALL chain_init( T_INFO, IO)
 !-----------------------------------------------------------------------
 !xml finish copying parameters from INCAR to xml file
 ! no INCAR reading from here 
@@ -3517,7 +3517,7 @@
       ENDIF

       CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
-           LATT_CUR%A,LATT_CUR%B,IO%IU6)
+           TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)

       CALL PARALLEL_TEMPERING(NSTEP,T_INFO%NIONS,DYN%POSION,DYN%VEL,TOTEN,TIFOR,DYN%TEBEG,DYN%TEEND, &
            LATT_CUR%A,LATT_CUR%B,IO%IU6)
diff -ruN src/makefile src.vtst/makefile
--- src/makefile
+++ src/makefile
@@ -14,7 +14,7 @@
 OFLAG=$(OFLAG_2)
 OFLAG_IN=$(OFLAG)

-LIB=lib parser
+LIB=lib parser pyamff_fortran
 LLIB=-Llib -ldmy -Lparser -lparser

 SRCDIR=../../src
@@ -145,7 +145,7 @@
    $(MAKE) -C $@ -j1
 #  $(MAKE) -C $@

-dependencies: sources
+dependencies: sources libs
    $(MAKE) depend

 depend: $(F90SRC)
diff -ruN src/.objects src.vtst/.objects
--- src/.objects
+++ src/.objects
@@ -115,6 +115,10 @@
    dos.o \
    elf.o \
    hamil_rot.o \
+        bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \
+        fire.o lanczos.o neb.o qm.o \
+        pyamff_fortran/*.o ml_pyamff.o \
+        opt.o \
    chain.o \
    dyna.o \
    fileio.o \
vasp-6.4.3_vtst-204.patch
diff -ruN src/.objects src.vtst/.objects
--- src/.objects
+++ src/.objects
@@ -127,6 +127,10 @@
    dos.o \
    elf.o \
    hamil_rot.o \
+        bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \
+        fire.o lanczos.o neb.o qm.o \
+        pyamff_fortran/*.o ml_pyamff.o \
+        opt.o \
    chain.o \
    dyna.o \
    fileio.o \
diff -ruN src/main.F src.vtst/main.F
--- src/main.F
+++ src/main.F
@@ -963,7 +963,7 @@
 ! init all chains (INCAR reader)
 !-----------------------------------------------------------------------
       LCHAIN = IMAGES > 0 .AND. .NOT.AFQMC_SET % ACTIVE
-      IF (LCHAIN) CALL chain_init( T_INFO, IO)
+      CALL chain_init( T_INFO, IO)
 !-----------------------------------------------------------------------
 !xml finish copying parameters from INCAR to xml file
 ! no INCAR reading from here
@@ -3699,7 +3699,7 @@
          CALL CHAIN_STRESS( TSIF )
       END IF
       CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
-           LATT_CUR%A,LATT_CUR%B,IO%IU6)
+           TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)

       CALL PARALLEL_TEMPERING(NSTEP,T_INFO%NIONS,DYN%POSION,DYN%VEL,TOTEN,TIFOR,DYN%TEBEG,DYN%TEEND, &
            LATT_CUR%A,LATT_CUR%B,IO%IU6)
diff -ruN src/makefile src.vtst/makefile
--- src/makefile
+++ src/makefile
@@ -16,7 +16,7 @@
 OFLAG=$(OFLAG_2)
 OFLAG_IN=$(OFLAG)

-LIB=lib parser
+LIB=lib parser pyamff_fortran
 LLIB=-Llib -ldmy -Lparser -lparser

 SRCDIR=../../src
@@ -150,7 +150,7 @@
    $(MAKE) -C $@ -j1
 #  $(MAKE) -C $@

-dependencies: sources
+dependencies: sources libs
    $(MAKE) depend

 depend: $(F90SRC)

Since version 6.4.x the generation of vdW kernel should be significantly faster so this patch is no longer necessary.

vasp-6.3.0_vdw-kernel-file.patch
--- src/vdw_nl.F
+++ src/vdw_nl.F
@@ -445,12 +445,18 @@
     !generate the interpolation table for the kernel using phi
     logical :: lkern
     integer :: nmesh, IOstatus
+    character(len=255) :: vdwkernel

     !ok if the kernel table is here read it
-    inquire( file='vdw_kernel.bindat', exist=lkern)
+    vdwkernel = 'vdw_kernel.bindat'
+    inquire( file=vdwkernel, exist=lkern)
+    IF (.NOT. lkern) then
+      call get_environment_variable("VDW_KERNEL", vdwkernel)
+      inquire( file=trim(vdwkernel), exist=lkern)
+    ENDIF
     IF (lkern) then
-      open (unit=10, file='vdw_kernel.bindat', form='unformatted')
       read(10,IOSTAT=IOstatus) nmesh
+      open (unit=10, file=trim(vdwkernel), form='unformatted', action='READ')
       IF (nmesh .NE. nd) THEN
         IF (IU0>=0) WRITE(IU0,*)  'nmesh ', nmesh
         IF (IU0>=0) WRITE(IU0,*)  'nd ', nd
vasp-6.4.3_vdw-kernel-file.patch
--- src/vdw_nl.F
+++ src/vdw_nl.F
@@ -449,5 +449,6 @@
   SUBROUTINE PHI_GENERATE(GRIDC,IVDW_NL,GAMMA_VDW,ALPHA_VDW)
     logical :: lkern,lkern_new
     integer :: IVDW_NL,IVDW_NL_TMP,NINTG_TMP,nmesh,IOstatus
+    character(len=255) :: vdwkernel
     real(q) :: GAMMA_VDW,GAMMA_VDW_TMP,ALPHA_VDW,ALPHA_VDW_TMP
     TYPE (grid_3d) GRIDC

     !ok if the kernel table is here read it
-    inquire( file='vdw_kernel.bindat', exist=lkern)
+    vdwkernel = 'vdw_kernel.bindat'
+    inquire( file=vdwkernel, exist=lkern)
+    IF (.NOT. lkern) then
+       call get_environment_variable("VDW_KERNEL", vdwkernel)
+       inquire( file=trim(vdwkernel), exist=lkern)
+    ENDIF
     IF (lkern) then
-       open (unit=10, file='vdw_kernel.bindat', form='unformatted')
+       open (unit=10, file=trim(vdwkernel), form='unformatted', action='READ')
        read(10,IOSTAT=IOstatus) IVDW_NL_TMP,GAMMA_VDW_TMP,ALPHA_VDW_TMP,NINTG_TMP,nmesh
        IF (IOstatus.EQ.0) THEN
           lkern_new=.true.

Older VASP implementation might not work with the latest Intel LLVM-based compilers. We recommend users to use the latest version of VASP to get their bug fixes. Known workarounds are provided below.

One case we noticed is the usage of short-circuit evaluation which could trigger divide-by-zero error with the new compiler.

vasp-6.3.0.patch
--- src/main_mpi.F
+++ src/main_mpi.F
@@ -242,7 +242,9 @@
 ! COMM%NCPU/NCORE
       NPAR = 0
       CALL PROCESS_INCAR(IO%LOPEN,IO%IU0,IO%IU5, 'NPAR',NPAR,IERR)
-      IF ((NPAR < 1).OR.(NPAR > COMM_KIN%NCPU).OR.(MOD(COMM_KIN%NCPU, NPAR) /= 0)) THEN
+      IF ((NPAR < 1).OR.(NPAR > COMM_KIN%NCPU)) THEN
+         NPAR = MAX(COMM_KIN%NCPU / NCORE, 1)
+      ELSEIF (MOD(COMM_KIN%NCPU, NPAR) /= 0) THEN
          NPAR = MAX(COMM_KIN%NCPU / NCORE, 1)
       ELSE
          NCORE = COMM_KIN%NCPU / NPAR

VASP tires to open input files with write access, which might affect performance on certain parallel file systems. The patch was provided by LUMI, see also the original post. We do not notice similar issue with the file systems on Vera so this shall not be necessary.

vasp-6.4.3_potcar-readonly.patch
From 5d47890a612e414915034ddba52629f00428a867 Mon Sep 17 00:00:00 2001
From: Peter Larsson <egplar@gmail.com>
Date: Wed, 7 Jun 2023 16:02:18 +0300
Subject: [PATCH] Open POTCAR files read-only

---
 src/pseudo.F | 4 ++--
 src/string.F | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/pseudo.F b/src/pseudo.F
index f7e31f0..16b3b7c 100644
--- a/src/pseudo.F
+++ b/src/pseudo.F
@@ -231,9 +231,9 @@ MODULE PSEUDO
 !        END IF
       END IF
 #endif
-      OPEN(UNIT=10,FILE=DIR_APP(1:DIR_LEN)//'POTCAR',STATUS='OLD',IOSTAT=IERR)
+      OPEN(UNIT=10,FILE=DIR_APP(1:DIR_LEN)//'POTCAR',ACTION='READ',STATUS='OLD',IOSTAT=IERR)
       IF (IERR/=0) THEN
-         OPEN(UNIT=10,FILE='POTCAR',STATUS='OLD')
+         OPEN(UNIT=10,FILE='POTCAR',ACTION='READ',STATUS='OLD')
       ENDIF

       LPAW = .FALSE.
diff --git a/src/string.F b/src/string.F
index 3a708f4..fd11f88 100644
--- a/src/string.F
+++ b/src/string.F
@@ -94,7 +94,7 @@ contains
         integer, intent(out) :: ierr  !< error flag that will be set if accessing the file fails
         character(len=:), allocatable :: content
         integer file_unit
-        open(newunit=file_unit,file=filename,status='old',form='unformatted',access='stream',iostat=ierr)
+        open(newunit=file_unit,file=filename,status='old',form='unformatted',access='stream',action='read',iostat=ierr)
         if (ierr /= 0) then
             content = ""
             return
-- 
2.35.3