Micro and Nano Mechanics Group
Revision as of 23:40, 23 September 2008 by Caiwei (Talk)

In this document, we describe how to compile VASP program on several computer clusters in the Mechanical Engineering Department of Stanford University. These include mc-cc, wcr, and su-ahpcrc, all of which are linux clusters. We then give an example of how to use VASP to compute the bulk modulus of Au.

Compile VASP on MC-CC

In general we follow the instructions given in http://cms.mpi.univie.ac.at/vasp/vasp/node16.html

First, go to vasp.4.lib/ directory, copy the vasp.4.lib/makefile.su-ahpcrc file to makefile and then type

rm -f *.o *.a
make

This will create libdmy.a in this directory.



MISC

Next, go to vasp.4.6/ directory, copy the vasp.4.6/makefile.su-ahpcrc file to makefile and then type

rm -f *.o vasp
cp base.f base.F
make

This will create executable vasp in this directory.

Notice that in both cases, we use the mpif90 compiler. Do not use make clean. It may delete some important files and you may regret it.

Finally, you need to add the following lines in your ~/.bash_profile file. The most important part is the last section on the mpi libraries.

LD_LIBRARY_PATH=/opt/intel/mkl/10.0.1.014/lib/em64t:/opt/intel/itac/7.1/itac/slib_impi3:
/opt/intel/fce/10.1.011/lib:/opt/intel/cce/10.1.011/lib:/usr/mpi/intel/mvapich-0.9.9/lib/shared

export LD_LIBRARY_PATH

Unfortunately, the executable vasp does not work for the case provided in the example directory.

In the following, we give an example of how to use VASP to compute the bulk modulus of LDA-Au. We performed this calculation in the runs/Au/LDA/perfect.21x21x21 directory. This directory contains the following files.

INCAR
ENCUT  =  400
ISMEAR  = 1
SIGMA = 0.1
<pre>

 KPOINTS

<pre>
21x21x21
0        0 = automatic generation of k-points
Monkhorst
21 21 21
0 0 0
POSCAR
POSCAR for FCC Au (created manually)
   4.068 
   0    0.5  0.5
   0.5  0    0.5
   0.5  0.5  0
   1 
Cartesian  (real coordinates r)
   0    0    0

To do this calculation, you also need to put the LDA pseudopotential file as POTCAR in this directory.

Now we are ready to run

vasp

To compute the equilibrium lattice constant, cohesive energy and bulk modulus, we use the following script auto.B.serial to run vasp repeated with different lattice constants.

#!/bin/bash
rm WAVECAR 
for a in 4.056 4.058 4.060 4.062 4.064 4.066 4.068
do
cat > POSCAR << FIN
POSCAR for FCC Au (created manually)
   $a 
   0    0.5  0.5
   0.5  0    0.5
   0.5  0.5  0
   1 
Cartesian  (real coordinates r)
   0    0    0
FIN

echo "a=$a"
./vasp

E=`tail -1 OSZICAR`
echo $a $E | sed -s 's/F=//; s/E0=//; s/d E =//;' >> Elatt.B.dat

p=`grep pressure OUTCAR | cut -b 25-34`
echo $a $p >> platt.B.dat

done

After running it as ./auto.B.serial, it will create data files Elatt.B.dat and platt.B.dat.

Launch octave and run the following functions fit_a0EB.m and fit_a0B.m,

fit_a0EB('Elatt.B.dat');
fit_a0B ('platt.B.dat');

The first line fits the energy data to a quadratic curve and computes the equilibrium lattice constant, cohesive energy and bulk modulus. The second line fits the pressure data to a linear curve and computes the equilibrium lattice constant and bulk modulus. In this example, the result is a0 = 4.60 angstrom, Ecoh = -4.39 eV, B = 190 GPa.

To run vasp in parallel, you need to submit vasp.pbs as

qsub vasp.pbs