|||
单机4核 32位vasp并行安装
采用IFC编译器,MKL数据库mpich2-1.0.8对VASP编译的过程
1. 准备
系统为 suse linux enterprise Desktop service Pack2 For x86
VASP源代码(vasp.4.6.tar.gz和vasp.4.lib.tar.gz),mkl数据库(l_mkl_p_9.1.023.tar),ifc编译器(l_fc__pl_9.1.036.tar.gz),mpich2-1.0.8。我们将以上安装所需文件都放在/root/vasp目录下并解压。测试成功效率在95%以上
2. Ifc编译器安装
先解压tar –zxvf l_fc_c_9.1.036.tar.gz 得到l_fc_c_9.1.036.文件夹
进入l_fc__pl_9.1.036文件夹找到install.sh文件
执行./install.sh开始安装ifc,安装过程都选用默认的路径(/opt/intel/fc/9.1.036)安装
安装完毕,进入/opt/intel/fc/9.1.036/bin目录
执行cp ifort /bin
ifc安装完成
3. mkl的安装
进入l_mkl_p_9.1.023.tar所在目录
tar –zxvf l_mkl_p_9.1.023.tar
进入解压得到的目录l_mkl_p_9.1.023
进入install文件夹,可以看到一个可执行的文件install
./install.sh
默认安装即可,默认目录为/opt/intel/mkl/9.1.023
三 ,设置环境变量 编辑root下的 .bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
PATH="$PATH:/usr/local/bin" (安装mpich2要添加的路径)
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export LD_LIBRARY_PATH=/opt/intel/mkl/9.1.023/lib/32:/opt/intel/fc/9.1.036/lib
. /opt/intel/fc/9.1.036/bin/ifortvars.sh (新添加路径)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/mkl/9.1.023/lib/32 (新添加路径)
二、安装MPICH2(在节点root目录下)
1、解压缩
#tar -zxvf mpich2-1.0.1.tar.gz
或者 #gunzip -c mpich2-1.0.1.tar.gz|tar xf mpich2-1.0.1.tar
2、创建安装目录
#mkdir /usr/MPICH-instsll
3、进入mpich2解压目录
#cd mpich2-1.0.1
4、默认安装目录
#./configure
5、编译
#make
6、安装
#make install
7、退出到root目录
#cd ..
8、通过编辑.bashrc文件修改环境变量
#vi .bashrc
修改后的.bashrc文件如下:
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
PATH="$PATH:/usr/local/bin" (新增加的mpich2的路径)
#Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export LD_LIBRARY_PATH=/opt/intel/mkl/9.1.023/lib/32:/opt/intel/fc/9.1.036/lib
. /opt/intel/fc/9.1.036/bin/ifortvars.sh (新添加路径)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/mkl/9.1.023/lib/32 (新添加路径)
9、测试环境变量设置
#which mpd
#which mpicc
#which mpiexec
#which mpirun
10、修改/etc/mpd.conf文件,添加内容为secretword=myword
#vi /etc/mpd.conf
添加 secretword=myword
设置文件读取权限和修改时间
#touch /etc/mpd.conf
#chmod 600 /etc/mpd.conf
1、本地测试
#mpd & 启动
#mpdtrace 观看启动机器
#mpdallexit 退出
三。
6.进入vasp.4.lib所在目录
cd /root/vasp/vasp.4.lib
cp makefile.linux_ifc_P4 makefile 根据自己机子的情况选择合适的makefile
编辑makfile
19行的 FC=ifc 修改为 FC=ifort
make
如果编译通过,说明前面安装的数学库和编译器等都是正确的
7.进入vasp.4.6所在目录
cd /root/vasp/vasp.4.6
cp makefile.linux_ifc_P4 makefile
编辑 makefile
对makefile做如下修改:
50行, 52行 前加 #
80行前加 #
128行 的 #BLAS=-L/opt/intel/mkl/lib/32 -lmkl_p4 -lpthread
修改为 BLAS=-L/opt/intel/mkl/9.1.023/lib/32 -lmkl_p4 -lsvml -lvml -lguide -lpthread
136行前加 #
145 行 的 #LAPACK= -lmkl_lapack
修改為LAPACK= -lmkl_lapack
或
LAPACK=-L/opt/intel/mkl/9.1.023/lib/32 -lmkl_lapack -lsvml -lvml -lguide –lpthread 也可以
149行 前 加 #
166行 前 加 #
201行 的 #FC=mpif77
修改為 FC=mpif90
202行的 #FCL=$(FC)
修改為 FCL=$(FC)
211-214行 前面的 # 去掉 修改為
CPP = $(CPP_) -DMPI -DHOST=\"LinuxIFC\" -DIFC \
-Dkind8 -DNGZhalf -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc \
-DMPI_BLOCK=500 \
-DRPROMU_DGEMV -DRACCMU_DGEMV
224行 前 加 #
227行 前 加 #
233-235行 前 的 # 去掉
238行 前 的 # 去掉
343行 的 -e95 去掉
保存退出后
编译make
编译通过则 cp vasp /bin 在任何目录下vasp命令都可以调用了
这时编译的vasp只能在root用户下使用
四.重启电脑,以普通用户(XXX代表普通用户名)的身份登陆
1. 进入 /home/XXX目录找到隐藏的 .bashrc文件(在窗口的工具栏中点击“查看”,选择显示隐藏文件)
.bashrc 文件如下
# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg
# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
# settings made here will also take effect in a login shell.
#
# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.
# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit
# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.server
# If you want to use a Palm device with Linux, uncomment the two lines below.
# For some (older) Palm Pilots, you might need to set a lower baud rate
# e.g. 57600 or 38400; lowest is 9600 (very slow!)
#
#export PILOTPORT=/dev/pilot
#export PILOTRATE=115200
test -s ~/.alias && . ~/.alias || true
修改后变为
# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg
# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
# settings made here will also take effect in a login shell.
#
# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.
# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit
# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.server
# If you want to use a Palm device with Linux, uncomment the two lines below.
# For some (older) Palm Pilots, you might need to set a lower baud rate
# e.g. 57600 or 38400; lowest is 9600 (very slow!)
#
#export PILOTPORT=/dev/pilot
#export PILOTRATE=115200
test -s ~/.alias && . ~/.alias || true 以下为增加内容
export LD_LIBRARY_PATH=/opt/intel/mkl/9.1.023/lib/32:/opt/intel/fc/9.1.036/lib
. /opt/intel/fc/9.1.036/bin/ifortvars.sh (新添加路径)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/mkl/9.1.023/lib/32 (新添加路径)
保存,
2. 配置mpd
在普通用户下
执行 cd $HOME
vi .mpd.conf
添加 MPD_SECRETWORD=mr45-j9z
保存,
设置文件读取权限和修改时间
touch .mpd.conf
chmod 600 .mpd.conf
设置完成。
上述编译通过的vasp还不能运行,会提示找不到目标文件libsvml.so
1. locate libsvml.so可以找到libsvml.so所在目录/opt/intel_fc_80/lib中
2. 在root目录下找到.bash_profile和.bashrc文件(ls –a 显示当前目录下所有内容
3.在root目录下运行env看环境变量LD_LIBRARY_PATH是否为
LD_LIBRARY_PATH=/opt/intel/mkl/8.0.2/lib/32: /opt/intel/fce/9.1.036/lib
若不是则执行如下命令
export LD_LIBRARY_PATH=/opt/intel/mkl/8.0.2/lib/32: /opt/intel/fce/9.1.036/lib
4.reboot后即可以使用vasp 计算了
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-5 05:23
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社