1.配置环境
(1) 在两台机器上分别配置/etc/hosts (root用户)
192.168.100.37 amao991 (主节点)
192.168.100.50 amao992 (从节点)
(2) 在两台机器上分别创建amao用户
(3) 配置NFS
从amao992上mount主节点amao991上/home目录,设为开机挂载
(4) 配置无密码登录(在amao991上用amao用户)
ssh-keygen -t rsa cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
2. 安装mpich2 (amao用户在amao991节点上)
(0)预备
在/home/amao下创建
program/mpich2-install目录
soft目录(放置mpich2-1.4.1p1.tar.gz)
study/mpi-study目录
(1) 解压
tar -zxvf mpich2-1.4.1p1.tar.gz
(2) 安装
./configure -prefix=/home/amao/program/mpich2-install/ make make install
(3) 简单配置
[amao@amao991 ~]$ vi .bashrc
[amao@amao991 ~]$ source .bashrcexport PATH=/home/amao/program/mpich2-install/bin:$PATH(4)验证
[amao@amao991 ~]$ which mpicc ~/program/mpich2-install/bin/mpicc [amao@amao991 ~]$ which mpiexec ~/program/mpich2-install/bin/mpiexec
3. 测试
(1) machinefile //还是用ip把,用机器名时在测试例子时遇到了错误
[amao@amao991 ~]$ vi machinefile
202.117.10.37:4 202.117.10.50:2
(2) 测试[amao@amao991 ~]$ mpiexec -f machinefile -n 6 ./soft/mpich2-1.4.1p1/examples/cpi Process 0 of 6 is on amao991 Process 1 of 6 is on amao991 Process 3 of 6 is on amao991 Process 2 of 6 is on amao991 Process 4 of 6 is on amao992 Process 5 of 6 is on amao992 pi is approximately 3.1415926544231239, Error is 0.0000000008333307 wall clock time = 0.001708
4. 增强的配置
(1)把machinefile加入环境变量
(2) 测试 (即不用在命令行声明machinefile了,缺省按照环境变量中的HYDRA_HOST_FILE进行)cp ~/machinefile ~/program/mpich2-install/
[amao@amao991 mpich2-install]$ vi ~/.bashrcexport MPI_USEP4SSPORT=yes export MPI_P4SSPORT=22 export P4_RSHCOMMAND=ssh export PATH=/home/amao/program/mpich2-install/bin:$PATH export HYDRA_HOST_FILE=/home/amao/program/mpich2-install/machinefile
[amao@amao991 mpich2-install]$ source ~/.bashrc
[amao@amao991 ~]$ mpiexec -n 6 ./soft/mpich2-1.4.1p1/examples/cpi Process 1 of 6 is on amao991 Process 2 of 6 is on amao991 Process 3 of 6 is on amao991 Process 0 of 6 is on amao991 Process 4 of 6 is on amao992 Process 5 of 6 is on amao992 pi is approximately 3.1415926544231239, Error is 0.0000000008333307 wall clock time = 0.001440
本文档详细介绍了在Redhat5.4系统上安装和测试mpich2-1.4.1p1的步骤,包括配置主机文件、创建用户、设置NFS无密码登录、安装mpich2以及验证安装和测试MPI程序。
98

被折叠的 条评论
为什么被折叠?



