首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法设置MPI名称服务器?

无法设置MPI名称服务器?
EN

Stack Overflow用户
提问于 2021-04-29 20:08:11
回答 1查看 44关注 0票数 0

虽然我找到了I_MPI_HYDRA_NAMESERVER环境变量,但我无法成功地使用它。我需要启动一个服务器守护进程吗?

代码语言:javascript
复制
char port_name[] = "exmplport",
    service_name[] = "exmplservice";
  if (world_p==0) 
 {
    MPI_Comm intercomm;
    MPI_Publish_name( service_name, MPI_INFO_NULL, port_name );
    printf("Published Name\n");
    MPI_Unpublish_name( service_name, MPI_INFO_NULL, port_name );
  } else
 {
    MPI_Lookup_name( service_name,MPI_INFO_NULL,port_name );
  }

错误:

代码语言:javascript
复制
[c210-008 c:3] export I_MPI_HYDRA_NAMESERVER=`hostname`:8000
[c210-008 c:4] make publishbug && mpiexec.hydra -n 2 publishbug
make: `publishbug' is up to date.
[mpiexec@c210-008.frontera.tacc.utexas.edu] HYD_sock_connect (../../../../../src/pm/i_hydra/libhydra/sock/hydra_sock_intel.c:228): Retrying connection, retry_count=1, retries=0
[mpiexec@c210-008.frontera.tacc.utexas.edu] HYD_sock_connect (../../../../../src/pm/i_hydra/libhydra/sock/hydra_sock_intel.c:243): unable to connect from "c210-008.frontera.tacc.utexas.edu" to "c210-008.frontera.tacc.utexas.edu" (Connection refused)
[mpiexec@c210-008.frontera.tacc.utexas.edu] mpiexec_connect_to_nameserver (../../../../../src/pm/i_hydra/mpiexec/mpiexec_utils.c:425): unable to connect to nameserver
[mpiexec@c210-008.frontera.tacc.utexas.edu] mpiexec_publish_name (../../../../../src/pm/i_hydra/mpiexec/mpiexec_utils.c:499): unable to connect to nameserver
[mpiexec@c210-008.frontera.tacc.utexas.edu] control_cb (../../../../../src/pm/i_hydra/mpiexec/mpiexec.c:1484): error publishing service
[mpiexec@c210-008.frontera.tacc.utexas.edu] HYDI_dmx_poll_wait_for_event (../../../../../src/pm/i_hydra/libhydra/demux/hydra_demux_poll.c:80): callback returned error status
[mpiexec@c210-008.frontera.tacc.utexas.edu] main (../../../../../src/pm/i_hydra/mpiexec/mpiexec.c:2019): error waiting for event
EN

回答 1

Stack Overflow用户

发布于 2021-08-10 11:29:34

我尝试使用命令~$ hydra_nameserver来启动hydra名称服务器,然后我使用MPI_Open_port()来获取端口号,并在MPI_Publish_name()中使用它,而不是直接提供端口号。

后来我试过了

~$发布错误&& I_MPI_HYDRA_NAMESERVER=hostname mpiexec.hydra -n 2发布错误

我点击下面的链接获得了一个示例代码(client.cpp & server.cpp) https://github.com/SteffenSeckler/MPI_Connect_Test

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67317053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档