Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 9516da56eca7dd3ad63d98588d8ad261 > files > 2647

ipython-1.1.0-3.mga4.noarch.rpm

#!/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()