Kar*_*Man 5 ipython sungridengine ipython-parallel
我正在尝试将IPython Parallel用于一个非常常见的场景,我想在运行Sun Grid Engine的集群上运行模拟,我找不到可行的方法来执行此操作.
这是我想要做的:
我想用几个不同的参数值运行数值模拟(使用Numpy数组) - 这些任务显然是''令人尴尬'并行.我有权(通过ssh)访问运行Grid Engine的集群的头节点.直到现在,我使用QSUB命令运行shell脚本,但这非常笨拙(处理节点崩溃等),我正在寻找一种方法来解决所有这些问题.
IPython似乎非常适合这种情况,但是让设置顺利运行变得非常麻烦.我在头节点上使用IPCLUSTER启动n(比方说20个)引擎,然后将.json文件复制到我使用IPython.parallel.Client连接的本地机器.
我已 IPClusterStart.controller_launcher_class = 'SGEControllerLauncher'
和IPClusterEngines.engine_launcher_class = 'SGEEngineSetLauncher'
IPCLUSTER似乎运行良好; 我从ssh终端的头节点获得此输出:
-- [IPClusterStart] Starting Controller with SGEControllerLauncher
-- [IPClusterStart] Job submitted with job id: '143396'
-- [IPClusterStart] Starting 4 Engines with SGEEngineSetLauncher
-- [IPClusterStart] Job submitted with job id: '143397'
-- [IPClusterStart] Engines appear to have started successfully
Run Code Online (Sandbox Code Playgroud)
但是,我有这些问题:
很多时候,即使我看到上面的消息说发动机已成功启动,许多发动机也无法向控制器注册.当我用20个引擎启动IPCLUSTER时,我可以看到10-15个引擎出现在Grid Engine队列上.我不知道其他引擎会发生什么 - 没有输出文件.在这些10-15个引擎中,只有一些引用了控制器注册,我在输出文件中看到了这个:
... [IPEngineApp] Using existing profile dir: .../.ipython/profile_sge'
... [IPEngineApp] Loading url_file ... .ipython/profile_sge/security/ipcontroller-engine.json'
... [IPEngineApp] Registering with controller at tcp://192.168.87.106:63615
... [IPEngineApp] Using existing profile dir: .../.ipython/profile_sge'
... [IPEngineApp] Completed registration with id 0
Run Code Online (Sandbox Code Playgroud)
在其他人看来这个:
... [IPEngineApp] Using existing profile dir: .../.ipython/profile_sge'
... [IPEngineApp] Loading url_file .../.ipython/profile_sge/security/ipcontroller-engine.json'
... [IPEngineApp] Registering with controller at tcp://192.168.87.115:64909
... [IPEngineApp] Registration timed out after 2.0 seconds
Run Code Online (Sandbox Code Playgroud)
知道为什么会这样吗?
有时,引擎启动并注册成功,但是当我让它们运行非常简单的时候它们开始死亡,view.execute('%pylab')我得到的唯一例外是:
[引擎异常]回溯(最近一次调用最后一次):文件"/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/IPython/parallel/client/client.py",第708行,在_handle_stranded_msgs中引发error.EngineError("引擎%r在运行任务%r时死亡"%(eid,msg_id))EngineError:引擎1在运行任务时死亡'b9601e8a-cff5-4037-b9d9-a0b93ca2f256'
以这种方式启动引擎意味着只要引擎正在运行,我就占用节点和队列,即使它们没有执行任何操作.有没有一种简单的方法来启动引擎,只有当你想运行一些脚本时它们才会产生,一旦它们返回计算结果就会关闭它们?
Grid Engine似乎每次都在不同的节点上启动控制器,因此IPCLUSTER配置文件中的--ruse标志没有用; 每次我使用IPCLUSTER时都必须复制JSON文件.有办法避免这种情况吗?
如果有人可以为这个常见场景提供简单的工作流程,那将非常有用:使用IPython parallel通过SSH连接向SGE集群提交明显的并行作业.应该有一些处理引擎崩溃重新提交的方法,如果有一种方法只在模拟期间使用群集资源,那也很好.