并行64位vasp 5.2安装过程+ ifort+intel MKL+ openmpi

更新时间:2024-01-13 07:03:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

并行64位vasp 5.2安装过程+ ifort +intel MKL+ openmpi

前前后后折腾了半个月,总算把vasp安装到了自己的电脑里。很多内容是从网上百度到的,所以我认为有必要写个总结和大家分享。当然这一个月自己并没有全心投入到安装vasp上边,有空的时候就安装一下试试,没时间就把它扔一边去了。我在这里只讲一种安装方法,自己网上百度了很多安装教程,感觉方法越多对初学者看了越迷茫,不清楚该先干什么,好多安装教程写的顺利也很混乱。

新手的话,首先要补充些linux的基础知识,如果你打算用vasp做研究,估计都多少学了一点linux了,什么是linux就不介绍了。

下面我以CentOS-6.5- x86-64在Intel(R)Core(TM)i3-2100 CPU@3.10GHz电脑上的安装为例(ThinkPadx200 900元在二手电脑市场淘的)。CentOS的安装过程和windows差不多,一路下一步(或Next)基本就ok了,在您要进行哪种类型的安装?你如果是第一次安装,是新硬盘的话可以选使用所有空间,并勾选下边的查看并修改分区布局,然后下一步,你可以看下大概的分区情况,在CentOS 的默认安装是基本服务器安装。如果对Linux不太熟的话,最好选择软件开发工作站(或Software Development Workstation),这样基本上把要用的软件都安装上了,然后再选上下边的现在自定义(或 Customize now),再下一步,然后把所有能选上的软件都选上,再一路下一步。安装完以后,创建一个非root用户,比如创建一个phy用户,root和phy用户密码设的简单一些比较好,别一会儿你自己都忘了,当然将来你自己真正组建集群用于计算的时候再设置复杂一些,这样可以提高系统的安全性。

Linux下解压文件经常用的是:tar zxvf xxxx.tar.gz;(xxxx表示文件或文件夹名)创建一个文件夹用命令:mkdir xxxx;如果创建的是文件,比如创建openmpi.sh文件,就用命令:touch openmpi.sh;编辑文件用vi或vim命令;暗转rpm包一类的软件用如下的各式:

rpm -ivh libstdc++-4.4.7-4.el6.i686.rpm 更改文件或文件夹的读取权限,一般是root的权限最大,可以先切换到root下,用命令chmod 777 xxxx更改;复制命令用cp;移动文件用mv;删除文件用rm –rf xxxx;这些命令都是网上百度的,如果不清楚怎么用或用什么命令可以百度一下你用做的事情,一般都会给出比较满意的答案。

安装好系统后,用root登录,有人建议用非root账户登录,这对初学者可能带来更多的问题,所以初学者最好自己找一台破电脑先折腾,装软件一般不会把电脑折腾坏的,除非你买的电脑有质量问题,那就不好说了。

现在/home下建一个安装软件的文件夹software: cd home/ mkdir software

chmod 777 software

然后把从网上下载的vasp.5.2.12.tar.gz vasp.5.lib.tar.gz openmpi-1.8.tar.gz

parallel_studio_xe_2013_update2.tgz fftw-3.3.3.tar.gz intel.lic libstdc++-4.4.7-4.el6.i686.rpm都复制到software文件夹下边,这里的intel.lic是parallel_studio_xe_2013_update2.tgz的license,安装parallel_studio_xe_2013_update2.tgz的时候会用到;libstdc++-4.4.7-4.el6.i686.rpm软件包在CentOS6.5安装盘里可以找到,网上百度也行,默认情况下这个是不安装的。parallel_studio_xe_2013_update2可以到百度网盘下载:http://pan.http://m.wodefanwen.com//s/1o6sPd8m 。刚试过,连接还可以用,你也可以去官网下载,官网下载免费的需要学校类的邮箱注册一下才可以下载。Intel 的 Fortran、MKL、fftw都包含的这个软件包里边了。openmpi我也装了,好像用的是Intel提供的mpi;

vasp5.2.12和vasp.5.lib下载可以去小木虫下载,这些软件如果找不到,你可以给我发邮件,我有时间会发给你,不过我不太常上网,估计会比较慢些(binghe5945@qq.com)。

一.先安装libstdc++-4.4.7-4.el6.i686.rpm

cd /home/softwarew

rpm -ivh libstdc++-4.4.7-4.el6.i686.rpm

二.安装inter fortran compiler 2013

1. cd /home/software

2. tar zxvf parallel_studio_xe_2013_update2.tgz 3. cd parallel_studio_xe_2013_update2 4. ./install.sh 5. 回车

6. view license, 一路空格,最后accept

7. Alternative activation, use a license file, provide the full path, 输入:/home/software/intel.lic(具体内容可能有出入)

8.选择Typical Install全部安装。 9.安装完成。

10.加入环境路径:cd ~ ;打开:vi .bashrc 在.basgrc文件最后插入 source /opt/intel/bin/ifortvars.sh intel64

source /opt/intel/composer_xe_2013.2.146/mkl/bin/mklvars.sh intel64 10. cd ~

11. source .bashrc (以后若出现 make:找不到ifort命令、文件之类的,再source .bashrc一下就好了) 12. 验证:which ifort显示路径。

三.安装fftw

(奔腾4以上机子可以提速,具体请自行测试;这里提供安装方法,也可不用,vasp中已包含fft,安装的inter fortran compiler 2013里边也有fftw,但是好多安装教程里边都有一个把fftw3.f放到vasp.5.lib文件夹里编译vasp源文件,所以还是安装一下比较好,在inter fortran compiler 2013安装里边我也找到fftw3.f这个文件了,怕出错还没尝试) 1.cd /home/software

2.tar zxvf fftw-3.3.3.tar.gz 3.cd fftw-3.3.3

4. ./configure --prefix=/home/software/fftw 5.make

6.make install

7.把fftw-3.3.3/api/fftw3.f拷贝到VASP.5.2文件夹下

四.安装openmpi

1. cd /home/software 2. tar openmpi-1.8.tar.gz 3.cd ~

4.source .bashrc

5.cd /home/software/openmpi-1.8

4. ./configure --prefix=/home/software/openmpi1.8 CC=icc CXX=icpc F77=ifort FC=ifort (若不加 CC=icc CXX=icpc F77=ifort FC=ifort ,则用gcc编译) 5.make

6.make install6.

7.在openmpi1.8目录下新建一个openmpi.sh ,内容如下,目录自改 export PATH=/home/software/openmpi1.8/bin:$PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: /home/software/openmpi1.8/lib:$LD_LIBRARY_PATH export MANPATH=/home/software/openmpi1.8/share/man:$MANPATH 8.然后在.bashrc最后插入source /home/software/openmpi1.8/openmpi.sh 9.cd ~

10.source .bashrc 11.which mpirun

应显示/home/software/openmpi1.8/bin/mpirun 之类 12. cd /home/software/openmpi-1.8/examples make

mpirun -np 2 hello_c (2为双核) 应出现:

Hello, world, I am 0 of 2 Hello, world, I am 1 of 2

五.安装vasp 5.2

1.cd /home/software

2.tar zxvf vasp.5.lib.tar.gz 3.cd vasp.5.lib

4.把fftw/api/fftw3.f拷贝到VASP.5.2文件夹下

5.修改 vasp.5.lib 下的makefile.linux_ifc_P4文件,FC=ifc改为 FC=ifort FFLAGS = -O0 -FI 改为 FFLAGS = -O2 –FI 6.cd ~

7.source .bashrc

8. cp makefile.linux_ifc_P4 makefile 9. make(成功应生成libdmy.a) 10.修改5.2的makefile.linux_ifc_P4 在最上边添加mkl和fftw的绝对路径

MKLROOT=/opt/intel/composer_xe_2013.2.146/mkl

FFTWROOT=/opt/intel/composer_xe_2013.2.146/mkl/include/fftw

(没有提到的可保持原样,同个位置的blas 和lapack注意注释掉其它的同类项) FC=ifc 改为 FC=ifort

OFLAG=-O3 改为 OFLAG=-O3 -xhost -ip –funroll -loops BLAS=$(MKLROOT)/lib/intel64/libmkl_blas95_lp64.a

LAPACK=$(MKLROOT)/lib/intel64/libmkl_lapack95_lp64.a

FFT3D = fftw3d.o fft3dlib.o /home/txc/install/fftw-3.3.4/lib/libfftw3.a FC=mpif77 改为 FC=mpif90 去掉以下代码的# FCL=$(FC)

CPP = $(CPP_) -DMPI -DHOST=\\\

-Dkind8 -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DNGZhalf \\ 改为 -DCACHE_SIZE=16000 -DPGF90 -Davoidalloc \\

LIB = -L../vasp.5.lib -ldmy \\ ../vasp.5.lib/linpack_double.o \\ $(SCA) $(LAPACK) $(BLAS)

FFT3D = fftmpi.o fftmpi_map.o fftw3d.o fft3dlib.o /home/software/ fftw/lib/libfftw3.a

cp makefile.linux_ifc_P4 makefile

make(成功应生成名为 vasp 的可执行程序)

六.vasp5.2的makefile

MKLROOT=/opt/intel/composer_xe_2013.2.146/mkl

FFTWROOT=/opt/intel/composer_xe_2013.2.146/mkl/include/fftw #

.SUFFIXES: .inc .f .f90 .F

#----------------------------------------------------------------------- # Makefile for Intel Fortran compiler for Pentium/Athlon/Opteron # bases systems

# we recommend this makefile for both Intel as well as AMD systems # for AMD based systems appropriate BLAS and fftw libraries are # however mandatory (whereas they are optional for Intel platforms) #

# The makefile was tested only under Linux on Intel and AMD platforms # the following compiler versions have been tested: # - ifc.7.1 works stable somewhat slow but reliably # - ifc.8.1 fails to compile the code properly # - ifc.9.1 recommended (both for 32 and 64 bit)

# - ifc.10.1 partially recommended (both for 32 and 64 bit) # tested build 20080312 Package ID: l_fc_p_10.1.015 # the gamma only mpi version can not be compiles # using ifc.10.1 #

# it might be required to change some of library pathes, since # LINUX installation vary a lot

# Hence check ***ALL*** options in this makefile very carefully

#----------------------------------------------------------------------- #

# BLAS must be installed on the machine # there are several options: # 1) very slow but works:

# retrieve the lapackage from ftp.netlib.org

# and compile the blas routines (BLAS/SRC directory)

# please use g77 or f77 for the compilation. When I tried to # use pgf77 or pgf90 for BLAS, VASP hang up when calling

# ZHEEV (however this was with lapack 1.1 now I use lapack 2.0) # 2) more desirable: get an optimized BLAS #

# the two most reliable packages around are presently:

# 2a) Intels own optimised BLAS (PIII, P4, PD, PC2, Itanium) # http://developer.intel.com/software/products/mkl/ # this is really excellent, if you use Intel CPU's

#

# 2b) probably fastest SSE2 (4 GFlops on P4, 2.53 GHz, 16 GFlops PD, # around 30 GFlops on Quad core) # Kazushige Goto's BLAS

# http://www.cs.utexas.edu/users/kgoto/signup_first.html # http://www.tacc.utexas.edu/resources/software/ #

#-----------------------------------------------------------------------

# all CPP processed fortran files have the extension .f90 SUFFIX=.f90

#----------------------------------------------------------------------- # fortran compiler and linker

#----------------------------------------------------------------------- FC=mpiifort -I${FFTWROOT} # fortran linker FCL=$(FC)

#----------------------------------------------------------------------- # whereis CPP ?? (I need CPP, can't use gcc with proper options) # that's the location of gcc for SUSE 5.3 #

# CPP_ = /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -P -C #

# that's probably the right line for some Red Hat distribution: #

# CPP_ = /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/cpp -P -C #

# SUSE X.X, maybe some Red Hat distributions:

CPP_ = ./preprocess <$*.F |/usr/bin/cpp -P -C -traditional >$*$(SUFFIX)

#----------------------------------------------------------------------- # possible options for CPP:

# NGXhalf charge density reduced in X direction # wNGXhalf gamma point only reduced in X direction # avoidalloc avoid ALLOCATE if possible

# PGF90 work around some for some PGF90 / IFC bugs

# CACHE_SIZE 1000 for PII,PIII, 5000 for Athlon, 8000-12000 P4, PD # RPROMU_DGEMV use DGEMV instead of DGEMM in RPRO (depends on used BLAS) # RACCMU_DGEMV use DGEMV instead of DGEMM in RACC (depends on used BLAS) # tbdyn MD package of Tomas Bucko

lattice.o: lattice.inc lattice.F setex.o: setexm.inc setex.F pseudo.o: pseudo.inc pseudo.F poscar.o: poscar.inc poscar.F

mkpoints.o: mkpoints.inc mkpoints.F wave.o: wave.F

nonl.o: nonl.inc nonl.F nonlr.o: nonlr.inc nonlr.F

$(OBJ_HIGH): $(CPP)

$(FC) $(FFLAGS) $(OFLAG_HIGH) $(INCS) -c $*$(SUFFIX) $(OBJ_NOOPT): $(CPP)

$(FC) $(FFLAGS) $(INCS) -c $*$(SUFFIX)

fft3dlib_f77.o: fft3dlib_f77.F $(CPP)

$(F77) $(FFLAGS_F77) -c $*$(SUFFIX)

.F.o:

$(CPP)

$(FC) $(FFLAGS) $(OFLAG) $(INCS) -c $*$(SUFFIX) .F$(SUFFIX): $(CPP) $(SUFFIX).o:

$(FC) $(FFLAGS) $(OFLAG) $(INCS) -c $*$(SUFFIX)

# special rules

#----------------------------------------------------------------------- # these special rules are cummulative (that is once failed # in one compiler version, stays in the list forever) # -tpp5|6|7 P, PII-PIII, PIV

# -xW use SIMD (does not pay of on PII, since fft3d uses double prec) # all other options do no affect the code performance since -O1 is used

fft3dlib.o : fft3dlib.F $(CPP)

$(FC) -FR -lowercase -O2 -c $*$(SUFFIX)

fft3dfurth.o : fft3dfurth.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

fftw3d.o : fftw3d.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

wave_high.o : wave_high.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

radial.o : radial.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

symlib.o : symlib.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

symmetry.o : symmetry.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

wave_mpi.o : wave_mpi.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

wave.o : wave.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

dynbr.o : dynbr.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

asa.o : asa.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

broyden.o : broyden.F $(CPP)

$(FC) -FR -lowercase -O2 -c $*$(SUFFIX)

us.o : us.F $(CPP)

$(FC) -FR -lowercase -O1 -c $*$(SUFFIX)

LDApU.o : LDApU.F $(CPP)

$(FC) -FR -lowercase -O2 -c $*$(SUFFIX)

本文来源:https://www.bwwdw.com/article/1feo.html

Top