In my previous post, I explained how to build VASP using the GNU compilers. Here, I will show you how you can build VASP using the Intel Compilers. In principle, the Intel Compilers should give better performance for VASP on Intel processors.
Install the Intel Compiler Suite in /opt/intel
(this is the default setting). Please refer to the installation instructions given by Intel.
source /opt/intel/composer_xe_2013_sp1/bin/compilervars.sh intel64
cd /opt/intel/composer_xe_2013_sp1/mkl/interfaces/fftw3xf
make libintel64
tar -xvzf vasp.4.lib.tar.gz
cd vasp.4.lib
cp makefile.linux_ifc_P4 Makefile
and change the file so that FC is linking to ifort
.SUFFIXES: .inc .f .F
#-----------------------------------------------------------------------
# Makefile for Portland Group F90/HPF compiler
# the makefile was tested only under Linux on Intel platforms
# however it might work on other platforms as well
#
# this release of vasp.4.lib contains lapack v2.0
# this can be compiled with pgf90 compiler if the option -O1 is used
#
# Mind: one user reported that he had to copy preclib.F diolib.F
# dlexlib.F and drdatab.F to the directory vasp.4.4, compile the files
# there and link them directly into vasp
# for no obvious reason these files could not be linked from the library
#
#-----------------------------------------------------------------------
# C-preprocessor
CPP = gcc -E -P -C $*.F >$*.f
FC=ifort
CFLAGS = -O
FFLAGS = -O0 -FI
FREE = -FR
DOBJ = preclib.o timing_.o derrf_.o dclock_.o diolib.o dlexlib.o drdatab.o
and type
make
source /opt/intel/impi/4.1.1.036/bin64/mpivars.sh
tar -xvzf vasp.4.6.tar.gz
cd vasp.4.6
cp makefile.linux_ifc_P4 Makefile
Alter the Makefile on the following points
and finally run make
make
when you get this error
mpif77 -fc=ifort -FR -names lowercase -assume byterecl -O3 -xAVX -c fftmpiw.f90
fftmpiw.f90(55): error #5102: Cannot open include file 'fftw3.f'
include 'fftw3.f'
--------------^
fftmpiw.f90(89): error #5102: Cannot open include file 'fftw3.f'
include 'fftw3.f'
--------------^
fftmpiw.f90(110): error #5102: Cannot open include file 'fftw3.f'
include 'fftw3.f'
--------------^
fftmpiw.f90(220): error #5102: Cannot open include file 'fftw3.f'
include 'fftw3.f'
--------------^
compilation aborted for fftmpiw.f90 (code 1)
make: *** [fftmpiw.o] Error 1
copy the header file
cp /opt/intel/mkl/include/fftw/fftw3.f .
and run make again
make
We have used three different models to check the computational efficiency of the Intel Compilations versus that of the GNU compilation:
The results are the following:
System | gcc-4.8.4 VASP 4.6.38 | Intel VASP 4.6.38 |
---|---|---|
CO | 240.483 | 240.683 |
Cu | 54.623 | 34.994 |
Fe5C2 | 907.617 | 656.705 |
Interestingly, the Intel compiler does not give significantly different result for the gamma-point calculation (CO molecule). However, the speed improvement for the other calculations is roughly 30%!