##// END OF EJS Templates
add delay configurable to EngineSetLaunchers...
MinRK -
Show More
@@ -56,7 +56,7 b' from zmq.eventloop import ioloop'
56 56 from IPython.config.application import Application
57 57 from IPython.config.configurable import LoggingConfigurable
58 58 from IPython.utils.text import EvalFormatter
59 from IPython.utils.traitlets import Any, Int, List, Unicode, Dict, Instance
59 from IPython.utils.traitlets import Any, Int, CFloat, List, Unicode, Dict, Instance
60 60 from IPython.utils.path import get_ipython_module_path
61 61 from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError
62 62
@@ -364,6 +364,12 b' class LocalEngineSetLauncher(BaseLauncher):'
364 364 ['--log-to-file','--log-level=%i'%logging.INFO], config=True,
365 365 help="command-line arguments to pass to ipengine"
366 366 )
367 delay = CFloat(0.1, config=True,
368 help="""delay (in seconds) between starting each engine after the first.
369 This can help force the engines to get their ids in order, or limit
370 process flood when starting many engines."""
371 )
372
367 373 # launcher class
368 374 launcher_class = LocalEngineLauncher
369 375
@@ -381,6 +387,8 b' class LocalEngineSetLauncher(BaseLauncher):'
381 387 self.profile_dir = unicode(profile_dir)
382 388 dlist = []
383 389 for i in range(n):
390 if i > 0:
391 time.sleep(self.delay)
384 392 el = self.launcher_class(work_dir=self.work_dir, config=self.config, log=self.log)
385 393 # Copy the engine args over to each engine launcher.
386 394 el.engine_args = copy.deepcopy(self.engine_args)
@@ -603,6 +611,8 b' class SSHEngineSetLauncher(LocalEngineSetLauncher):'
603 611 else:
604 612 user=None
605 613 for i in range(n):
614 if i > 0:
615 time.sleep(self.delay)
606 616 el = self.launcher_class(work_dir=self.work_dir, config=self.config, log=self.log)
607 617
608 618 # Copy the engine args over to each engine launcher.
General Comments 0
You need to be logged in to leave comments. Login now