Show More
@@ -275,19 +275,22 b' class IPClusterEngines(BaseParallelApplication):' | |||||
275 | self.init_launchers() |
|
275 | self.init_launchers() | |
276 |
|
276 | |||
277 | def init_launchers(self): |
|
277 | def init_launchers(self): | |
278 | self.engine_launcher = self.build_launcher(self.engine_launcher_class) |
|
278 | self.engine_launcher = self.build_launcher(self.engine_launcher_class, 'EngineSet') | |
279 | self.engine_launcher.on_stop(lambda r: self.loop.stop()) |
|
279 | self.engine_launcher.on_stop(lambda r: self.loop.stop()) | |
280 |
|
280 | |||
281 | def init_signal(self): |
|
281 | def init_signal(self): | |
282 | # Setup signals |
|
282 | # Setup signals | |
283 | signal.signal(signal.SIGINT, self.sigint_handler) |
|
283 | signal.signal(signal.SIGINT, self.sigint_handler) | |
284 |
|
284 | |||
285 | def build_launcher(self, clsname): |
|
285 | def build_launcher(self, clsname, kind=None): | |
286 | """import and instantiate a Launcher based on importstring""" |
|
286 | """import and instantiate a Launcher based on importstring""" | |
287 | if '.' not in clsname: |
|
287 | if '.' not in clsname: | |
288 | # not a module, presume it's the raw name in apps.launcher |
|
288 | # not a module, presume it's the raw name in apps.launcher | |
|
289 | if kind and kind not in clsname: | |||
|
290 | # doesn't match necessary full class name, assume it's | |||
|
291 | # just 'PBS' or 'MPIExec' prefix: | |||
|
292 | clsname = clsname + kind + 'Launcher' | |||
289 | clsname = 'IPython.parallel.apps.launcher.'+clsname |
|
293 | clsname = 'IPython.parallel.apps.launcher.'+clsname | |
290 | # print repr(clsname) |
|
|||
291 | try: |
|
294 | try: | |
292 | klass = import_item(clsname) |
|
295 | klass = import_item(clsname) | |
293 | except (ImportError, KeyError): |
|
296 | except (ImportError, KeyError): | |
@@ -422,8 +425,8 b' class IPClusterStart(IPClusterEngines):' | |||||
422 | aliases = Dict(start_aliases) |
|
425 | aliases = Dict(start_aliases) | |
423 |
|
426 | |||
424 | def init_launchers(self): |
|
427 | def init_launchers(self): | |
425 | self.controller_launcher = self.build_launcher(self.controller_launcher_class) |
|
428 | self.controller_launcher = self.build_launcher(self.controller_launcher_class, 'Controller') | |
426 | self.engine_launcher = self.build_launcher(self.engine_launcher_class) |
|
429 | self.engine_launcher = self.build_launcher(self.engine_launcher_class, 'EngineSet') | |
427 | self.controller_launcher.on_stop(self.stop_launchers) |
|
430 | self.controller_launcher.on_stop(self.stop_launchers) | |
428 |
|
431 | |||
429 | def start_controller(self): |
|
432 | def start_controller(self): |
General Comments 0
You need to be logged in to leave comments.
Login now