##// END OF EJS Templates
Merge pull request #2808 from minrk/parallel_wait...
Merge pull request #2808 from minrk/parallel_wait improve patience for slow Hub in client tests adds a first step in `_wait_for_idle`, where it waits for all tasks to arrive before waiting for no tasks to be running. On a super slow machine, it was possible for `_wait_for_idle` to return prematurely, before tasks had even started. closes #2807

File last commit:

r4910:0dc49390
r9181:9db88115 merge
Show More
job_wrapper.py
25 lines | 542 B | text/x-python | PythonLexer
#!/usr/bin/env python
"""Python wrapper around a submitted workflow job.
In reality this would be a more sophisticated script, here we only illustrate
the basic idea by considering that a submitted 'job' is a Python string to be
executed.
"""
import sys
argv = sys.argv
from IPython.parallel.engine import EngineFactory
from IPython.parallel.ipengineapp import launch_new_instance
ns = {}
# job
exec sys.argv[1] in ns
# this should really use Config:
EngineFactory.user_ns = ns
# start engine with job namespace
launch_new_instance()