IPython并行计算不工作
我试图让 ipython 并行编程在 Linux 机器上工作(Rocks/CentOS 5.4、Python 2.7.2、IPython 0.11)。安装没有问题,但是,我无法使用 ipcluster
/ipython
执行任何命令。
也就是说,我尝试了以下命令。在 ipcluster
端:
/share/apps/Python-2.7/bin/ipcluster start --n=4
在 ipython
端:
[malkarouri@grid02 ~]$ /share/apps/Python-2.7/bin/ipython
Python 2.7.2 (default, Oct 18 2011, 15:35:37)
Type "copyright", "credits" or "license" for more information.
IPython 0.11 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from IPython.parallel import Client
In [2]: rc=Client()
In [3]: dview=rc[:]
In [4]: ar=dview.apply_async(lambda x: x + 3, 7)
In [5]: ar.get()
之后最后一个命令永远不会返回答案(实际上挂起)。
如何让 ipython 并行处理工作?
I am trying to get ipython parallel programming working on a Linux machine (Rocks/CentOS 5.4, Python 2.7.2, IPython 0.11). The installation had no problems, however, I am unable to execute any command using ipcluster
/ipython
.
Namely, I tried the following commands. On the ipcluster
side:
/share/apps/Python-2.7/bin/ipcluster start --n=4
On the ipython
side:
[malkarouri@grid02 ~]$ /share/apps/Python-2.7/bin/ipython
Python 2.7.2 (default, Oct 18 2011, 15:35:37)
Type "copyright", "credits" or "license" for more information.
IPython 0.11 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from IPython.parallel import Client
In [2]: rc=Client()
In [3]: dview=rc[:]
In [4]: ar=dview.apply_async(lambda x: x + 3, 7)
In [5]: ar.get()
after which the last command never comes back with an answer (effectively hangs).
How can I get ipython
parallel processing to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Ubuntu 11.10、python 2.7.2、ipython 0.11(与 pip 一起安装)上尝试了您的示例,它可以工作:
您可能想尝试为并行模块运行 ipython 测试套件,看看它在哪里失败:
在我的机器上,所有 97 个测试都通过。
tried your example on Ubuntu 11.10, python 2.7.2, ipython 0.11 (installed with pip) and it works:
you might want to try run the ipython test suite for the parallel module and see where it fails:
on my machine all 97 tests pass.
尝试定义一个函数,而不是 lambda 函数。
Try defining a function, not a lambda function.
ipcluster 关于它使用的配置文件(配置文件)说了些什么?
尝试在 Client() 创建中指定配置文件
或
What does ipcluster said about the config files (profile ) it used ?
Try specifying the profile in the Client() creation
or