我想在以下代码的帮助下,通过MPI在不同的Google云计算实例上显示"hello world“:
from mpi4py import MPI
size = MPI.COMM_WORLD.Get_size()
rank = MPI.COMM_WORLD.Get_rank()
name = MPI.Get_processor_name()
print("Hello, World! I am process/rank {} of {} on {}.\n".format(rank, size, name)) 。
问题是,即使这样,我也可以在所有这些实例之间进行ssh连接,而不会遇到任何问题,当我试图运行我的脚本时,我会得到一条拒绝权限的错误消息。我使用以下命令来启用我的脚本:
mpirun -宿主本地主机,instance_1,instance_2 python hello_world.py
。
并获得以下错误消息:
Permission denied (publickey).
--------------------------------------------------------------------------
ORTE was unable to reliably start one or more daemons.
This usually is caused by:
* not finding the required libraries and/or binaries on
one or more nodes. Please check your PATH and LD_LIBRARY_PATH
settings, or configure OMPI with --enable-orterun-prefix-by-default
* lack of authority to execute on one or more specified nodes.
Please verify your allocation and authorities.
* the inability to write startup files into /tmp (--tmpdir/orte_tmpdir_base).
Please check with your sys admin to determine the correct location to use.
* compilation of the orted with dynamic libraries when static are required
(e.g., on Cray). Please check your configure cmd line and consider using
one of the contrib/platform definitions for your system type.
* an inability to create a connection back to mpirun due to a
lack of common network interfaces and/or no route found between
them. Please check network connectivity (including firewalls
and network routing requirements).
--------------------------------------------------------------------------。
其他信息:
。
感谢你的帮助:-)
。
新信息:
(谢谢@ Zulan指出我应该编辑上一篇文章,而不是为新信息创建一个新的答案)
所以,我试着用mpich来代替openmpi。但是,我遇到了类似的错误消息。
命令:
mpirun -宿主本地主机,instance_1,instance_2 python hello_world.py
。
错误消息:
Host key verification failed.。
我可以在两个实例之间进行ssh连接,没有问题,并且通过gcloud命令,ssh-键应该自动正确地设置。
有人知道问题出在哪里了吗?我还检查了路径、防火墙规则以及在临时文件夹中编写启动脚本的能力。有人能尝试重现这个问题吗?+我应该向谷歌提出这个问题吗?(我以前从未做过这样的事,我很不确定。)
感谢您的帮助:)
发布于 2016-03-17 13:23:32
所以我终于找到了解决办法。哇问题快把我逼疯了。
因此,我需要手动生成ssh键,这样脚本才能工作。我不知道为什么,因为google服务已经通过使用gcloud compute ssh设置了密钥,但是它成功了:)
我采取了以下步骤:
instance_1 $ ssh-keygen -t rsa
instance_1 $ cd .ssh
instance_1 $ cat id_rsa.pub >> authorized_keys
instance_1 $ gcloud compute copy-files id_rsa.pub
instance_1 $ gcloud compute ssh instance_2
instance_2 $ cd .ssh
instance_2 $ cat id_rsa.pub >> authorized_keys。
我将打开另一个主题,并问为什么我不能使用ssh instance_2,即使gcloud compute ssh instance_2正在工作。请参阅:Difference between the commands "gcloud compute ssh" and "ssh"
https://stackoverflow.com/questions/35819556
复制相似问题