##// END OF EJS Templates
Merge branch 'glut-rebased' of git://github.com/fperez/ipython into glut...
Merge branch 'glut-rebased' of git://github.com/fperez/ipython into glut * 'glut-rebased' of git://github.com/fperez/ipython: Added the command line option Fix code in disable_glut which was not tested and quite buggy Tried to fix the CTRL-C problem (https://github.com/ipython/ipython/pull/742) and take other comments/typos into account Replaced deprecated raise call Fixed typos in comments Canceled window reshape to 1x1 since the idea is now for the user to use this window as the main one because of weird seg-faults problem after user creates its own window (any subsequent gl error would lead to a segfault, even a simple one line requiring a non existent function Event loop integration example Added code for the GLUT interactive session

File last commit:

r4581:3ec3b243
r4818:89161a5b merge
Show More
taskmap.py
35 lines | 594 B | text/x-python | PythonLexer
# <nbformat>2</nbformat>
# <markdowncell>
# # Load balanced map and parallel function decorator
# <codecell>
from IPython.parallel import Client
# <codecell>
rc = Client()
v = rc.load_balanced_view()
# <codecell>
result = v.map(lambda x: 2*x, range(10))
print "Simple, default map: ", list(result)
# <codecell>
ar = v.map_async(lambda x: 2*x, range(10))
print "Submitted tasks, got ids: ", ar.msg_ids
result = ar.get()
print "Using a mapper: ", result
# <codecell>
@v.parallel(block=True)
def f(x): return 2*x
result = f.map(range(10))
print "Using a parallel function: ", result