##// END OF EJS Templates
Backport PR #2305: RemoteError._render_traceback_ calls self.render_traceback...
Backport PR #2305: RemoteError._render_traceback_ calls self.render_traceback rather than an alias There are two options here: 1. `_render_traceback_` should *call* render_traceback 2. any subclass that redefines render_traceback must also redefine `_render_traceback_` I went with 1., which is more efficient code-wise when subclassing RemoteError (would prevent future cases of this same mistake), but less efficient execution-wise, because it involves an extra function call. closes #2303

File last commit:

r6455:15863dc1
r8379:0e42613f
Show More
taskmap.py
36 lines | 636 B | text/x-python | PythonLexer
Brian E. Granger
Reworking parallel examples as notebooks.
r4581 # <nbformat>2</nbformat>
# <markdowncell>
# # Load balanced map and parallel function decorator
# <codecell>
Thomas Kluyver
Update print syntax in parallel examples.
r6455 from __future__ import print_function
Brian E. Granger
Reworking parallel examples as notebooks.
r4581
MinRK
translate last remaining old parallel examples
r3690 from IPython.parallel import Client
Brian E. Granger
Reworking parallel examples as notebooks.
r4581 # <codecell>
MinRK
translate last remaining old parallel examples
r3690 rc = Client()
v = rc.load_balanced_view()
Brian E. Granger
Reworking parallel examples as notebooks.
r4581 # <codecell>
MinRK
translate last remaining old parallel examples
r3690 result = v.map(lambda x: 2*x, range(10))
Thomas Kluyver
Update print syntax in parallel examples.
r6455 print("Simple, default map: ", list(result))
MinRK
translate last remaining old parallel examples
r3690
Brian E. Granger
Reworking parallel examples as notebooks.
r4581 # <codecell>
MinRK
translate last remaining old parallel examples
r3690 ar = v.map_async(lambda x: 2*x, range(10))
Thomas Kluyver
Update print syntax in parallel examples.
r6455 print("Submitted tasks, got ids: ", ar.msg_ids)
MinRK
translate last remaining old parallel examples
r3690 result = ar.get()
Thomas Kluyver
Update print syntax in parallel examples.
r6455 print("Using a mapper: ", result)
MinRK
translate last remaining old parallel examples
r3690
Brian E. Granger
Reworking parallel examples as notebooks.
r4581 # <codecell>
MinRK
translate last remaining old parallel examples
r3690 @v.parallel(block=True)
def f(x): return 2*x
result = f.map(range(10))
Thomas Kluyver
Update print syntax in parallel examples.
r6455 print("Using a parallel function: ", result)
Brian E. Granger
Reworking parallel examples as notebooks.
r4581