在OpenMPI中使用rankfiles

时间:2017-04-08 04:27:59

标签: mpi distributed-computing openmpi

我正在尝试在集群中使用MPI,并且希望能够控制在哪些节点中调度哪些排名。

注意:我使用的是OpenMPI 2.1.0。

为此我使用的是rankfile。如果我使用以下rankfile:

#

我明白了:

ubuntu@ip-172-31-8-16:~/dist_log_reg$ cat rankfile 
rank 0=localhost slots=1
rank 1=54.153.103.12 slots=1

如果我在rankfile中只使用一个条目:

ubuntu@ip-172-31-8-16:~/dist_log_reg$ mpirun -v -np 1 -rankfile rankfile hostname
--------------------------------------------------------------------------
The rankfile that was used claimed that a host was either not
allocated or oversubscribed its slots.  Please review your rank-slot
assignments and your host allocation to ensure a proper match.  Also,
some systems may require using full hostnames, such as
"host1.example.com" (instead of just plain "host1").

  Host: ip-172-31-8-16

我明白了:

ubuntu@ip-172-31-8-16:~/dist_log_reg$ cat rankfile 
rank 0=localhost slots=1

我已经尝试了所有我能想到的东西(例如,安装其他MPI发行版并在rankfile中尝试不同的选项)但是却无法完成这项工作。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我设法将localhost作为hostname传递来创建您的错误。但是当我使用实际的系统名称时,我设法运行它。

rank X=myPC slot=Y

我相信Open MPI探测主机名并执行gethostname调用。