Header Ads Widget

Ab initio Calculations Using Vasp Code

Last Posts

10/recent/ticker-posts

How to install the Vasp code using Ifort compiler

 


 

Vasp code is a non free code and to get the license click here

 

First of all we need to add the path to the  ~/.bashrc  file


VASPROOT=/home/algerien1970/abinitio/vasp.5.4.1
export PATH=$PATH:$VASPROOT
export VASPBIN=$VASPROOT/bin
export VASPTOOLS=$VASPROOT/tools

 or 

VASPBIN=/home/algerien1970/abinitio/vasp.5.4.1/bin
export PATH=$PATH:$VASPBIN
VASPTOOLS=/home/algerien1970/abinitio/vasp.5.4.1/tools
export PATH=$PATH:$VASPTOOLS

Needed packages

 Before compiling the code we need to install the following packages:

* gcc compiler

* gfortran compiler

* parallel studio

 

NB: The parallel studio package includes the C and Fortran compilers and the necessary libraries


Installing gcc and gfortran from terminal

For Ubuntu

sudo apt-get install gcc gfortran

 

For Opensuse 

sudo zypper install gcc gcc-fortran


Install parallel studio (Intel Parallel Studio XE Cluster Edition 2020)

To get the compiler download the 4 following parts:

 Part-01-1GB

 Part-02-1GB

 Part-03-1GB

Part-04-123MB 

You have to select the parts and extract them in 1 directory

To install the compiler do as follows:

 * change to the parallel_studio directory and run install script


Intel_2020 /parallel_studio_xe_2020_update4_cluster_edition> ./install.sh


We need to use this license file

The intel compiler will be installed in the home directory with intel name 

We need to add the following lines in  ~/.bashrc file


source /home/algerien-1970/intel/bin/compilervars.sh intel64
source /home/algerien-1970/intel/bin/iccvars.sh intel64
source /home/algerien-1970/intel/bin/ifortvars.sh intel64
source /home/algerien-1970/intel/mkl/bin/mklvars.sh intel64
source /home/algerien-1970/intel/impi/2019.9.304/intel64/bin/mpivars.sh intel64

 

and source the file

algerien1970@linux-huzz:~/abinitio> source ~/.bashrc


Compiling
 

To compile the code vasp using ifort compiler we proceeds as follows:
tar -xvzf vasp.5.4.1.tar.gz
cd vasp.5.4.1

 

We will choose the ifort compiler

For parallel mode

cp arch/makefile.include.linux_intel ./makefile.include 
  

For seriall mode

cp arch/makefile.include.linux_intel_serial ./makefile.include 

 

makefile.include for parallel mode

# Precompiler options
CPP_OPTIONS= -DMPI -DHOST=\"IFC91_ompi\" -DIFC \
-DCACHE_SIZE=4000 -DPGF90 -Davoidalloc \
-DMPI_BLOCK=8000 -DscaLAPACK -Duse_collective \
-DnoAugXCmeta -Duse_bse_te \
-Duse_shmem -Dtbdyn

CPP = fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)

FC = mpiifort
FCL = mpiifort -mkl

FREE = -free -names lowercase

FFLAGS = -assume byterecl
OFLAG = -O2
OFLAG_IN = $(OFLAG)
DEBUG = -O0
MKLROOT =/home/alkhawarizmi/intel/mkl
MKL_PATH = $(MKLROOT)/lib/intel64
BLAS =
LAPACK =
BLACS = -lmkl_blacs_intelmpi_lp64
SCALAPACK = $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)

OBJECTS = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o \
$(MKLROOT)/interfaces/fftw3xf/libfftw3xf_intel.a
INCS =-I$(MKLROOT)/include/fftw

LLIBS = $(SCALAPACK) $(LAPACK) $(BLAS)

OBJECTS_O1 += fft3dfurth.o fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

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

OBJECTS_LIB= linpack_double.o getshmem.o

# Normally no need to change this
SRCDIR = ../../src
BINDIR = ../../bin

 

makefile.include for serial mode

# Precompiler options
CPP_OPTIONS= -DHOST=\"IFC91_ompi\" -DIFC \
-DCACHE_SIZE=4000 -DPGF90 -Davoidalloc \
-DnoAugXCmeta -Duse_bse_te

CPP = fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)

FC = ifort
FCL = ifort -mkl

FREE = -free -names lowercase

FFLAGS = -assume byterecl
OFLAG = -O2
OFLAG_IN = $(OFLAG)
DEBUG = -FR -O0
MKLROOT =/home/alkhawarizmi/intel/mkl
MKL_PATH = $(MKLROOT)/lib/intel64
BLAS =
LAPACK = $(MKL_PATH)/libmkl_intel_lp64.a
BLACS =
SCALAPACK = $(BLACS)

OBJECTS = fft3dfurth.o fft3dlib.o

INCS =

LLIBS = $(SCALAPACK) $(LAPACK) $(BLAS)

OBJECTS_O1 += fft3dfurth.o fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

# For what used to be vasp.5.lib
CPP_LIB = gcc -E -P -C $*$(FUFFIX) >$*$(SUFFIX)
FC_LIB = ifort
CC_LIB = icc
CFLAGS_LIB = -O
FFLAGS_LIB = -O1 -FI
FREE_LIB = -FR

OBJECTS_LIB= linpack_double.o

# Normally no need to change this
SRCDIR = ../../src
BINDIR = ../../bin
 

Compiling with the command

vasp.5.4.1> make all

 

If the compilation succeeds we will get 3 executables in the bin directory

vasp.5.4.1/bin> ls
vasp_gam vasp_ncl vasp_std

The bin repertory will be full of 3 executable files.

 

If there is an error compilation you can delete it using the command

make veryclean

 

 

Post a Comment

0 Comments