全部博文(77)
分类: LINUX
2009-06-20 14:59:09
在LINUX上安装和配置MPICH-2
• Step 1: MPICH-2的下载
–
目前最新的版本是mpich2-1.1.tar.gz (linux source code) .
– tar zxvf mpich2-1.1.tar.gz
• Step 2: MPICH2的安装
– ./configure --prefix=/home/xuyc/mpi-dist
– make
– make install
Step 3: MPICH-2的配置与验证
• 需要Python软件
• 设置主目录下的mpd.hosts文件
– $HOME/mpd.hosts文件中加入了一行:sv168 /*计算机名称*/
• 配置SSH无密码登录
– 在各个节点上运行命令:ssh-keygen -t rsa
• 命令和手册页路径的配置
– export PATH=/home/xuyc/mpi-dist/bin:$PATH
– export MANPATH=/home/xuyc/mpi-dist/man:$MANPATH
• Step 4: 启动MPD
– 可启动mpd进程,创建mpi运行时环境 :mpdboot 改成 mpd &
[xuyc@sv168 examples_collchk]$ configuration file /home/xuyc /.mpd.conf not found
A file named .mpd.conf file must be present in the user's home
directory (/etc/mpd.conf if root) with read and write access
only for the user, and must contain at least a line with:
MPD_SECRETWORD=
One way to safely create this file is to do the following:
cd $HOME
touch .mpd.conf
chmod 600 .mpd.conf
and then use an editor to insert a line like
MPD_SECRETWORD=mr45-j9z
into the file. (Of course use some other secret word than mr45-j9z.)
当出现以上错误提示时,按照上面的操作即可。MPD_SECRETWORD填写当前用户的登录密码。
• Step 5:应用程序的编译、链接
– mpicc –o mypi cpi.c
在/home/xuyc/mpi-dist/share/examples_collchk 下有example,直接make即可。
• Step 6: MPI程序的运行
– mpiexec -n 4 ./time_bcast_nochk
– 该命令为mypi程序启动4个进程
[xuyc@sv168 examples_collchk]$ mpiexec -n 4 ./time_bcast_nochk
time taken by 1X1 MPI_Bcast() at rank 0 = 0.000005
time taken by 1X1 MPI_Bcast() at rank 1 = 0.000002
time taken by 1X1 MPI_Bcast() at rank 3 = 0.000007
time taken by 1X1 MPI_Bcast() at rank 2 = 0.000004