Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带远程IPY并行控制器的IPython笔记本电脑_Python_Ipython_Ipython Parallel - Fatal编程技术网

带远程IPY并行控制器的IPython笔记本电脑

带远程IPY并行控制器的IPython笔记本电脑,python,ipython,ipython-parallel,Python,Ipython,Ipython Parallel,我目前正在尝试使用ipyparallel库在我拥有的一组服务器上设置远程集群。我想,如果我在所有ipcontroller、ipengines和笔记本电脑之间共享$IPYTHONDIR,那么一切都将连接起来并正常工作,但我当前的设置并非如此 我试图实现的是,一个ipcontroller和ipengines坐在我的集群上,等待一个jupyter笔记本连接到控制器,并将其用于集群计算资源 目前,我无法让笔记本电脑连接到控制器,即使所有端口都已打开,服务器可以直接访问,并且IPYTHONDIR是共享的

我目前正在尝试使用ipyparallel库在我拥有的一组服务器上设置远程集群。我想,如果我在所有ipcontroller、ipengines和笔记本电脑之间共享$IPYTHONDIR,那么一切都将连接起来并正常工作,但我当前的设置并非如此

我试图实现的是,一个ipcontroller和ipengines坐在我的集群上,等待一个jupyter笔记本连接到控制器,并将其用于集群计算资源

目前,我无法让笔记本电脑连接到控制器,即使所有端口都已打开,服务器可以直接访问,并且IPYTHONDIR是共享的

当我打开笔记本并进入集群选项卡时,我会看到我的并行配置文件,但它没有启动。这很奇怪,因为ipcontroller和ipengines已经启动,正在等待来自笔记本的连接

这归结为:

  • 是否可以在不同于ipcontroller的服务器上运行笔记本
  • 如果上述情况可行,为什么我不能让笔记本电脑连接到集群,而当我在配置文件上单击“开始”时,它只是创建一个本地集群

谢谢

是,如果笔记本内核与ipcontroller运行在同一台服务器上,这是可能的。笔记本电脑本身可以通过任何浏览器显示。我经常使用这个功能

我这样做的方式是在服务器上提供ipython配置文件。在我的例子中,它是一个Windows服务器,配置文件是在
c:\users\\.ipython\
下设置的。在这种情况下,配置文件文件夹称为
profile\u my32bitcluster
,当我创建客户端时,我指定要使用的配置文件:

from ipyparallel import Client

rc = Client(profile='my32bitcluster')
dview = rc[:]

# Test it by pushing out a dataframe across some engines, modifying it
# and returning the modified dataframes...
df = pd.DataFrame(data={'x':[1,2,3,4,5], 'y':[1,4,9,16,25]})

dview.push({'df':df})

def myfunc(x):
    import sys
    import os
    import pandas as pd
    global df
    df['z'] = df['x'] * x
    return df

results = dview.map_sync(myfunc, [2,3,4])

我希望这会有所帮助。

是的,如果笔记本内核与ipcontroller运行在同一台服务器上,这是可能的。笔记本电脑本身可以通过任何浏览器显示。我经常使用这个功能

我这样做的方式是在服务器上提供ipython配置文件。在我的例子中,它是一个Windows服务器,配置文件是在
c:\users\\.ipython\
下设置的。在这种情况下,配置文件文件夹称为
profile\u my32bitcluster
,当我创建客户端时,我指定要使用的配置文件:

from ipyparallel import Client

rc = Client(profile='my32bitcluster')
dview = rc[:]

# Test it by pushing out a dataframe across some engines, modifying it
# and returning the modified dataframes...
df = pd.DataFrame(data={'x':[1,2,3,4,5], 'y':[1,4,9,16,25]})

dview.push({'df':df})

def myfunc(x):
    import sys
    import os
    import pandas as pd
    global df
    df['z'] = df['x'] * x
    return df

results = dview.map_sync(myfunc, [2,3,4])
我希望这有帮助