Skip to content
Browse files

allow launcher specification by prefix alone

e.g. ipcluster start --engines=SGE
  • Loading branch information...
1 parent d24b9a6 commit 9937d3caf7b35afa217a9c72050642d925f4e64b @minrk committed Sep 16, 2011
Showing with 8 additions and 5 deletions.
  1. +8 −5 IPython/parallel/apps/ipclusterapp.py
View
13 IPython/parallel/apps/ipclusterapp.py
@@ -275,19 +275,22 @@ def initialize(self, argv=None):
self.init_launchers()
def init_launchers(self):
- self.engine_launcher = self.build_launcher(self.engine_launcher_class)
+ self.engine_launcher = self.build_launcher(self.engine_launcher_class, 'EngineSet')
self.engine_launcher.on_stop(lambda r: self.loop.stop())
def init_signal(self):
# Setup signals
signal.signal(signal.SIGINT, self.sigint_handler)
- def build_launcher(self, clsname):
+ def build_launcher(self, clsname, kind=None):
"""import and instantiate a Launcher based on importstring"""
if '.' not in clsname:
# not a module, presume it's the raw name in apps.launcher
+ if kind and kind not in clsname:
+ # doesn't match necessary full class name, assume it's
+ # just 'PBS' or 'MPIExec' prefix:
+ clsname = clsname + kind + 'Launcher'
clsname = 'IPython.parallel.apps.launcher.'+clsname
- # print repr(clsname)
try:
klass = import_item(clsname)
except (ImportError, KeyError):
@@ -422,8 +425,8 @@ def _classes_default(self,):
aliases = Dict(start_aliases)
def init_launchers(self):
- self.controller_launcher = self.build_launcher(self.controller_launcher_class)
- self.engine_launcher = self.build_launcher(self.engine_launcher_class)
+ self.controller_launcher = self.build_launcher(self.controller_launcher_class, 'Controller')
+ self.engine_launcher = self.build_launcher(self.engine_launcher_class, 'EngineSet')
self.controller_launcher.on_stop(self.stop_launchers)
def start_controller(self):

0 comments on commit 9937d3c

Please sign in to comment.
Something went wrong with that request. Please try again.