尝试使用用户名运行MPI程序时出错

时间:2014-03-19 11:31:02

标签: c multiprocessing mpi mpich

当我通过以下方式运行程序时:

myshell$] mpirun --hosts localhost,192.168.1.4 ./a.out

程序成功执行。现在,当我尝试运行时:

myshell$] mpirun --hosts localhost,myac@192.168.1.4 ./a.out

openssh提示输入密码。我明白了:

Fatal error in MPI_Init: Other MPI error, error stack:
MPIR_Init_thread(433)..............: 
MPID_Init(176).....................: channel initialization failed
MPIDI_CH3_Init(70).................: 
MPID_nem_init(286).................: 
MPID_nem_tcp_init(108).............: 
MPID_nem_tcp_get_business_card(354): 
MPID_nem_tcp_init(313).............: gethostbyname failed, myac@192.168.1.4 (errno 1)

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   EXIT CODE: 1
=   CLEANING UP REMAINING PROCESSES
=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
[proxy:0:0@myac] HYD_pmcd_pmip_control_cmd_cb (./pm/pmiserv/pmip_cb.c:886): assert (!closed) failed
[proxy:0:0@myac] HYDT_dmxu_poll_wait_for_event (./tools/demux/demux_poll.c:77): callback returned error status
[proxy:0:0@myac] main (./pm/pmiserv/pmip.c:206): demux engine error waiting for event
[mpiexec@myac] HYDT_bscu_wait_for_completion (./tools/bootstrap/utils/bscu_wait.c:76): one of the processes terminated badly; aborting
[mpiexec@myac] HYDT_bsci_wait_for_completion (./tools/bootstrap/src/bsci_wait.c:23): launcher returned error waiting for completion
[mpiexec@myac] HYD_pmci_wait_for_completion (./pm/pmiserv/pmiserv_pmci.c:217): launcher returned error waiting for completion
[mpiexec@myac] main (./ui/mpich/mpiexec.c:331): process manager error waiting for completion

为什么我在提供用户名时收到错误?

2 个答案:

答案 0 :(得分:0)

您可以尝试在ssh配置文件(http://www.cyberciti.biz/faq/create-ssh-config-file-on-linux-unix/)中而不是在mpirun命令行中指定用户名。这样也许mpirun不会被额外的用户名部分混淆,就我从它不​​支持的文档中看到的那样。但是ssh可以在幕后使用您在ssh配置文件中指定的用户名。当然,您需要设置SSH密钥,这样您就不必输入密码。

答案 1 :(得分:0)

我不相信MPICH支持在命令行的--hosts值中提供用户名。您应该尝试在wiki上描述的基于主机文件的方法。 http://wiki.mpich.org/mpich/index.php/Using_the_Hydra_Process_Manager#Using_Hydra_on_Machines_with_Different_User_Names

例如:

shell$ cat hosts
donner  user=foo
foo     user=bar
shakey  user=bar
terra   user=foo