- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想从我的 Jupyter notebook 动态启动集群以实现特定功能。虽然我可以启动集群并使引擎运行,但我有两个问题:
(1) 我无法在后台运行ipcluster 命令。当我通过笔记本运行命令时,单元一直运行到集群运行的时间,即我无法在同一个笔记本中运行更多单元。一旦引擎在不同的笔记本中启动,我就可以使用它们。如何在后台运行ipcluster?
(2) 我的代码总是启动8个引擎,不管ipcluster_config.py中的设置如何。
代码:
server_num = 3
ip_new = '10.0.1.' + str(10+server_num)
cluster_profile = "ssh" + str(server_num)
import commands
import time
commands.getstatusoutput("ipython profile create --parallel --profile=" + cluster_profile)
text = """
c.SSHEngineSetLauncher.engines = {'""" +ip_new + """' : 12}
c.LocalControllerLauncher.controller_args = ["--ip=10.0.1.163"]
c.SSHEngineSetLauncher.engine_cmd = ['/home/ubuntu/anaconda2/pkgs/ipyparallel-6.0.2-py27_0/bin/ipengine']
"""
with open("/home/ubuntu/.ipython/profile_" + cluster_profile + "/ipcluster_config.py", "a") as myfile:
myfile.write(text)
result = commands.getstatusoutput("(ipcluster start --profile='"+ cluster_profile+"' &)")
time.sleep(120)
print(result[1])
最佳答案
当我在 StackOverflow 上看到您的答案没有得到答复时,我差点心脏病发作,因为我遇到了同样的问题。
但是运行
ipcluster start --help
--daemonize
no_engines = 6
!ipcluster start -n {no_engines} --daemonize
ipcluster start --help
关于ipython - 从代码启动ipcluster,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47540186/
我已经使用设置了一个集群 ipcluster start --n=8 然后使用访问它 from IPython.parallel import Client c=Client() dview=c[:]
如何停止已启动的引擎: ipcluster 引擎 --n=8 --daemonize 当前运行的进程如下所示: /usr/bin/python /usr/local/bin/ipcluster eng
我不使用 ipcluster 命令启动我的 IPython 集群,而是使用单独的命令 ipcontroller 和 ipengine 因为我使用了多台机器一个网络。使用 ipcluster 命令启动集
我很难让 ipcluster 启动我要求的所有 ipengine。这似乎是某种超时问题。我在具有 192 个处理器的 linux 集群上使用 IPython 2.0。我运行本地 ipcontrolle
我是一名优秀的程序员,十分优秀!