##// END OF EJS Templates
Cleaned up release tools directory....
Cleaned up release tools directory. Converted almost all to python scripts and made toollib to collect common functions and avoid repetition. Properly commented and documented what each script does. The run_ipy_in_profiler one seems broken, I'm not sure what to do with it. We need to either fix it or remove it later, but it's not critical for 0.10.

File last commit:

r1338:72652d65
r2118:ec9810f7
Show More
multiengine2.ipy
38 lines | 1.0 KiB | text/plain | TextLexer
#-------------------------------------------------------------------------------
# Imports
#-------------------------------------------------------------------------------
import time
import numpy
import IPython.kernel.magic
from IPython.kernel import client
from IPython.kernel.error import *
mec = client.MultiEngineClient()
#-------------------------------------------------------------------------------
# Setup
#-------------------------------------------------------------------------------
mec.reset()
# print mec.keys()
mec.activate()
# mec.block=True
mec.get_ids()
n = len(mec)
assert n >= 4, "Not Enough Engines: %i, 4 needed for this script"%n
mec.block=False
pr1 = mec.execute('import time')
pr2 = mec.execute('time.sleep(5)')
pr3 = mec.push(dict(a=10,b=30,c=range(20000),d='The dog went swimming.'))
pr4 = mec.pull(('a','b','d'))
print "Try a non-blocking get_result"
assert pr4.get_result(block=False, default='not done')=='not done'
print "Now wait for all the results"
mec.barrier((pr1,pr2,pr3,pr4))
print "The last pull got:", pr4.r