Step 1. Configure
This guide is intended to help users build VASP* (Vienna Ab-Initio Package Simulation) using Intel® oneAPI Base and HPC Toolkit on Linux* platforms.
VASP is a package for performing ab-initio quantum-mechanical molecular dynamics (MD) using pseudopotentials and a plane wave basis set. The approach implemented in VAMP/VASP is based on:
- A finite-temperature local-density approximation (with the free energy as a variational quantity)
- An exact evaluation of the instantaneous electronic ground state at each MD step using efficient matrix diagonalization schemes
- An efficient Pulay mixing
These techniques avoid all problems occurring in the original Car-Parrinello method, which is based on the simultaneous integration of electronic and ionic equations of motion. The interaction between ions and electrons is described using ultrasoft Vanderbilt pseudopotentials (US-PP) or the projector augmented wave (PAW) method. Both techniques allow a considerable reduction of the necessary number of plane waves per atom for transition metals and first-row elements. Forces and stress can be easily calculated with VAMP/VASP and used to relax atoms into their instantaneous ground state.
Version Information
These instructions are designed to help users build or implement VASP on a Linux platform with oneAPI. This application note is verified with VASP 6.4.3 and Intel oneAPI Base and HPC Toolkit. For more information, see VASP.
Note This is an update for VASP 6.x with oneAPI.
Prerequisites
Download Intel® oneAPI Base Toolkit and Intel® HPC Toolkit from Intel® Toolkits.
Step 2. Extract VASP Files
To extract the VASP files, use the following command:
$tar –xvzf vasp.6.4.3.tgz
This creates vasp.6.4.3 directories.
Set the Intel® software tools environment variables by running the following command (assuming the default path installation and building for the Intel® 64 platform):
$source /opt/intel/oneAPI/2024.2/setvars.sh
Note This application note is written specifically for use with the Intel® compilers and MPI.
Step 3. Build VASP
-
Build libfftw3xf_intel.a.
This is a highly optimized performance library of FFTW that can speed up the FFTW part of VASP.
Change the directory to Intel® oneAPI Math Kernel Library (oneMKL) fftw3xf library:
cd /opt/intel/oneAPI/mkl/latest/share/mkl/interfaces/fftw3xf
Build fftw3xf in the oneMKL directory:
make libintel64
After a successful compilation, libfftw3xf_intel.a is built in the same directory.
-
Build VASP.
Change the directory to vasp.6.4.3:cd vasp.6.4.3
Copy the arch/makefile.include.linux_intel file to the current directory:
cp arch/makefile.include.linux_intel ./makefile.include
Edit makefile.linux to link with the oneMKL FFTW library:
OBJECTS = fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d.o /opt/intel/oneAPI/mkl/latest/share/mkl/interfaces/fftw3xf/libfftw3xf_intel.a
Check that the Fortran and C++ compiler commands are correctly assigned for mpiifort, icc, and icpc:
FC = mpiifort FCL = mpiifort -mkl=sequential …… …… CC_LIB = icc …… …… CXX_PARS = icpc
Check that the Fortran flags section is as follows:
FFLAGS = -assume byterecl -w -xHOST
If you are building and running VASP on the same platform, use -xHOST to enable the highest available Single Instruction Multiple Data (SIMD).
Check that the MKL section includes oneMKL libraries that link with oneMKL BLAS, LAPACK, FFT, BLACS, and ScaLAPACK functions that are used in VASP, which are as follows:
MKL_PATH = $(MKLROOT)/lib/intel64 BLAS = LAPACK = BLACS = -lmkl_blacs_intelmpi_lp64 SCALAPACK = $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)
To build VASP, run the following command:
$make std gam ncl
This creates the vasp_std, vasp_gam, and vasp_ncl executables in the bin directory.
Step 4. Run VASP
Run VASP by running the mpiexec command with your required parameters. For example, the following code example runs 48 processes with your workloads and hostnames are mentioned in the machine file.
$mpiexec.hydra –np 48 -f machinefile ./vasp_std
Step 5: Check Whether VASP Is Linked with oneMKL
To confirm that oneMKL is successfully linked with VASP, run the following:
[vasp.6.2.0]$ ldd bin/vasp_std
inux-vdso.so.1 => (0x00007ffff3bd2000)
libmkl_intel_lp64.so.1 => /opt/intel/oneAPI/mkl/2024.2.0/lib/intel64/libmkl_intel_lp64.so.1 (0x00002ac6f2a46000)
libmkl_cdft_core.so.1 => /opt/intel/oneAPI/mkl/2024.2.0/lib/intel64/libmkl_cdft_core.so.1 (0x00002ac6f37ab000)
libmkl_scalapack_lp64.so.1 => /opt/intel/oneAPI/mkl/2024.2.0/lib/intel64/libmkl_scalapack_lp64.so.1 (0x00002ac6f39d3000)
libmkl_blacs_intelmpi_lp64.so.1 => /opt/intel/oneAPI/mkl/2024.2.0/lib/intel64/libmkl_blacs_intelmpi_lp64.so.1 (0x00002ac6f42fe000)
libmkl_sequential.so.1 => /opt/intel/oneAPI/mkl/2024.2.0/lib/intel64/libmkl_sequential.so.1 (0x00002ac6f4544000)
libmkl_core.so.1 => /opt/intel/oneAPI/mkl/2024.2.0/lib/intel64/libmkl_core.so.1 (0x00002ac6f6142000)
libiomp5.so => /opt/intel/oneAPI/compiler/2024.2.0/linux/compiler/lib/intel64_lin/libiomp5.so (0x00002ac6ff6dd000)
……
libmpifort.so.12 => /opt/intel/oneAPI/mpi/2021.12.0/lib/libmpifort.so.12 (0x00002ac6ffdfb000)
libmpi.so.12 => /opt/intel/oneAPI/mpi/2021.12.0/lib/release/libmpi.so.12 (0x00002ac7001b9000)
……
……
libfabric.so.1 => /opt/intel/oneAPI/mpi/2021.12.0/libfabric/lib/libfabric.so.1 (0x00002ac70238d000)