NPAR = 4 # Number of bands groups (tune) LPLANE = .TRUE. # Planar FFT decomposition Example run_vasp.slurm script for a cluster:
FC = mpiifort FCL = mpiifort
sudo apt update sudo apt install build-essential gfortran wget perl libssl-dev For RHEL/CentOS: vasp 5.4.4 installation
#!/bin/bash #SBATCH --job-name=VASP #SBATCH --nodes=2 #SBATCH --ntasks-per-node=16 #SBATCH --cpus-per-task=2 #SBATCH --time=48:00:00 module load intel/2023.0 mkl/2023.0 export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
Adjust the MKLROOT path to your actual Intel MKL installation. Step 4: Compilation – The Two-Step Process VASP 5.4.4 has a two-stage build: first the preprocess executable, then the main code. Clean previous builds make veryclean Build the standard version (production) make std This creates vasp_std in the parent directory. Wait 5–30 minutes depending on your CPU. Build additional variants (optional but useful) make gam # For gamma-only calculations (faster for molecules/clusters) make ncl # For non-collinear magnetism / spin-orbit coupling After successful compilation, you should see: NPAR = 4 # Number of bands groups (tune) LPLANE =
mkdir ~/vasp_test cd ~/vasp_test cp ../vasp.5.4.4/vasp_std . Copy example input files from the VASP tarball testsuite/ :
export OMP_NUM_THREADS=2 mpirun -np 16 vasp_std # 16 MPI ranks, each with 2 OpenMP threads Adjust for your node's core count. Ensure your makefile.include uses fft3dlib.o from VASP’s own library, not generic FFTW. The template above already uses the optimized internal FFT. 3. Memory optimization For large systems (>100 atoms), add to INCAR : Clean previous builds make veryclean Build the standard
ls ../vasp_std, gam, ncl Quick test with a simple NaCl calculation Create a test directory: