0

我在两台机器上执行 MPI 程序时遇到困难。操作系统是 Ubuntu 12.04。MPI实现是MPICH2

ssh 工作正常:

  root@ubuntu:/home# ssh 192.168.1.9
root@gpuguy's password: 
Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.8.0-29-generic i686)

 * Documentation:  https://help.ubuntu.com/

131 packages can be updated.
67 updates are security updates.

Last login: Thu Oct 24 17:36:25 2013 from ubuntu.local
root@gpuguy:~# 

但是当我运行我的 MPI 程序时,它失败了:

root@ubuntu:/home# mpiexec -f hosts.cfg -n 4 hello
root@192.168.1.9's password:
[proxy:0:0@gpuguy] HYDU_sock_connect (./utils/sock/sock.c:171): unable to get host address for ubuntu (1)
[proxy:0:0@gpuguy] main (./pm/pmiserv/pmip.c:209): unable to connect to server ubuntu at port 42104 (check for firewalls!)

我已经在两台机器上禁用了防火墙,这就是我可以成功执行 ssh 的原因。但是如何解决这个问题呢?

我的 MPI 代码在单台机器上成功运行。

4

2 回答 2

2

要使 MPICH(或任何 MPI 实现)工作,您需要设置无密码 SSH。我还应该提到,你真的不应该以 root 身份登录来完成这项工作。始终以 root 身份登录通常是一个非常糟糕的主意。

于 2013-10-24T14:22:13.847 回答
0

/etc/hosts文件中,添加每个服务器的 IP 地址及其主机名。您应该为所有服务器执行此操作。

例如:

10.10.0.5    server1
10.10.0.6    server2
10.10.0.7    server3

只需签入/etc/hosts文件,不要使用制表符(\t) 代替空格来分隔ip addresshostname

这是错误的:

10.10.0.5 \t server1

这是真实的:

10.10.0.5    server1

注意不要删除或修改/etc/hosts文件中的现有行。仅在文件末尾添加新行。

此外,您无需禁用防火墙即可解决此问题。

于 2021-09-21T12:28:05.177 回答