Skip to content

Commit 631932d

Browse files
committed
update remote iteration example
1 parent f9d7313 commit 631932d

File tree

2 files changed

+26
-149
lines changed

2 files changed

+26
-149
lines changed

notebooks/P51 Example - Remote Iteration.ipynb renamed to notebooks/Parallel Example - Remote Iteration.ipynb

Lines changed: 25 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"metadata": {
3-
"name": "P51 Example - Remote Iteration"
3+
"name": "Parallel Example - Remote Iteration"
44
},
55
"nbformat": 3,
66
"nbformat_minor": 0,
@@ -36,8 +36,7 @@
3636
],
3737
"language": "python",
3838
"metadata": {},
39-
"outputs": [],
40-
"prompt_number": 1
39+
"outputs": []
4140
},
4241
{
4342
"cell_type": "markdown",
@@ -63,8 +62,7 @@
6362
],
6463
"language": "python",
6564
"metadata": {},
66-
"outputs": [],
67-
"prompt_number": 2
65+
"outputs": []
6866
},
6967
{
7068
"cell_type": "heading",
@@ -97,8 +95,7 @@
9795
],
9896
"language": "python",
9997
"metadata": {},
100-
"outputs": [],
101-
"prompt_number": 3
98+
"outputs": []
10299
},
103100
{
104101
"cell_type": "markdown",
@@ -125,27 +122,7 @@
125122
],
126123
"language": "python",
127124
"metadata": {},
128-
"outputs": [
129-
{
130-
"ename": "RemoteError",
131-
"evalue": "NameError(name 'barbarbar' is not defined)",
132-
"output_type": "pyerr",
133-
"traceback": [
134-
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
135-
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)\u001b[1;32m<ipython-input-7-0b69f8403738>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m",
136-
"\u001b[1;32m----> 1\u001b[1;33m \u001b[0mfoo\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mbarbarbar\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m",
137-
"\u001b[0m\u001b[1;31mNameError\u001b[0m: name 'barbarbar' is not defined"
138-
]
139-
},
140-
{
141-
"output_type": "stream",
142-
"stream": "stdout",
143-
"text": [
144-
"Oops! Didn't catch <Remote[3]:NameError(name 'barbarbar' is not defined)>\n"
145-
]
146-
}
147-
],
148-
"prompt_number": 4
125+
"outputs": []
149126
},
150127
{
151128
"cell_type": "markdown",
@@ -181,8 +158,7 @@
181158
],
182159
"language": "python",
183160
"metadata": {},
184-
"outputs": [],
185-
"prompt_number": 5
161+
"outputs": []
186162
},
187163
{
188164
"cell_type": "markdown",
@@ -206,17 +182,7 @@
206182
],
207183
"language": "python",
208184
"metadata": {},
209-
"outputs": [
210-
{
211-
"output_type": "stream",
212-
"stream": "stdout",
213-
"text": [
214-
"caught NameError\n",
215-
"safe and sound\n"
216-
]
217-
}
218-
],
219-
"prompt_number": 48
185+
"outputs": []
220186
},
221187
{
222188
"cell_type": "markdown",
@@ -262,8 +228,7 @@
262228
],
263229
"language": "python",
264230
"metadata": {},
265-
"outputs": [],
266-
"prompt_number": 49
231+
"outputs": []
267232
},
268233
{
269234
"cell_type": "markdown",
@@ -280,8 +245,7 @@
280245
],
281246
"language": "python",
282247
"metadata": {},
283-
"outputs": [],
284-
"prompt_number": 50
248+
"outputs": []
285249
},
286250
{
287251
"cell_type": "markdown",
@@ -298,8 +262,7 @@
298262
],
299263
"language": "python",
300264
"metadata": {},
301-
"outputs": [],
302-
"prompt_number": 6
265+
"outputs": []
303266
},
304267
{
305268
"cell_type": "markdown",
@@ -317,16 +280,7 @@
317280
],
318281
"language": "python",
319282
"metadata": {},
320-
"outputs": [
321-
{
322-
"output_type": "stream",
323-
"stream": "stdout",
324-
"text": [
325-
"Engine IDs: [0, 1, 2, 3]\n"
326-
]
327-
}
328-
],
329-
"prompt_number": 8
283+
"outputs": []
330284
},
331285
{
332286
"cell_type": "code",
@@ -337,8 +291,7 @@
337291
],
338292
"language": "python",
339293
"metadata": {},
340-
"outputs": [],
341-
"prompt_number": 9
294+
"outputs": []
342295
},
343296
{
344297
"cell_type": "code",
@@ -348,16 +301,7 @@
348301
],
349302
"language": "python",
350303
"metadata": {},
351-
"outputs": [
352-
{
353-
"output_type": "pyout",
354-
"prompt_number": 10,
355-
"text": [
356-
"<AsyncMapResult: load_data>"
357-
]
358-
}
359-
],
360-
"prompt_number": 10
304+
"outputs": []
361305
},
362306
{
363307
"cell_type": "code",
@@ -367,16 +311,7 @@
367311
],
368312
"language": "python",
369313
"metadata": {},
370-
"outputs": [
371-
{
372-
"output_type": "pyout",
373-
"prompt_number": 11,
374-
"text": [
375-
"['data', 'data', 'data', 'data']"
376-
]
377-
}
378-
],
379-
"prompt_number": 11
314+
"outputs": []
380315
},
381316
{
382317
"cell_type": "code",
@@ -389,40 +324,7 @@
389324
],
390325
"language": "python",
391326
"metadata": {},
392-
"outputs": [
393-
{
394-
"output_type": "stream",
395-
"stream": "stdout",
396-
"text": [
397-
"[4, 5, 6, 7]\n",
398-
"[3, 5, 7, 9, 11, 13, 15, 17]"
399-
]
400-
},
401-
{
402-
"output_type": "stream",
403-
"stream": "stdout",
404-
"text": [
405-
"\n",
406-
"[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35]"
407-
]
408-
},
409-
{
410-
"output_type": "stream",
411-
"stream": "stdout",
412-
"text": [
413-
"\n",
414-
"[1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61]"
415-
]
416-
},
417-
{
418-
"output_type": "stream",
419-
"stream": "stdout",
420-
"text": [
421-
"\n"
422-
]
423-
}
424-
],
425-
"prompt_number": 12
327+
"outputs": []
426328
},
427329
{
428330
"cell_type": "markdown",
@@ -442,24 +344,7 @@
442344
],
443345
"language": "python",
444346
"metadata": {},
445-
"outputs": [
446-
{
447-
"output_type": "stream",
448-
"stream": "stdout",
449-
"text": [
450-
"Locally merge the remote sets:\n",
451-
"[1, 2, 3, 4, 5, 5, 5, 5, 6, 7, 7, 8, 9, 9, 11, 11, 13, 13, 14, 15, 17, 17, 17, 20, 21, 23, 25, 26, 29, 29, 32, 33, 35, 37, 41, 45, 49, 53, 57, 61]"
452-
]
453-
},
454-
{
455-
"output_type": "stream",
456-
"stream": "stdout",
457-
"text": [
458-
"\n"
459-
]
460-
}
461-
],
462-
"prompt_number": 13
347+
"outputs": []
463348
},
464349
{
465350
"cell_type": "heading",
@@ -492,23 +377,15 @@
492377
],
493378
"language": "python",
494379
"metadata": {},
495-
"outputs": [
496-
{
497-
"output_type": "stream",
498-
"stream": "stdout",
499-
"text": [
500-
"Local data:\n",
501-
"[4, 5, 6, 7]\n",
502-
"[3, 5, 7, 9, 11, 13, 15, 17]\n",
503-
"[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35]\n",
504-
"[1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61]\n",
505-
"Sorted:\n",
506-
"[1, 2, 3, 4, 5, 5, 5, 5, 6, 7, 7, 8, 9, 9, 11, 11, 13, 13, 14, 15, 17, 17, 17, 20, 21, 23, 25, 26, 29, 29, 32, 33, 35, 37, 41, 45, 49, 53, 57, 61]\n",
507-
"local == remote: True\n"
508-
]
509-
}
510-
],
511-
"prompt_number": 14
380+
"outputs": []
381+
},
382+
{
383+
"cell_type": "code",
384+
"collapsed": false,
385+
"input": [],
386+
"language": "python",
387+
"metadata": {},
388+
"outputs": []
512389
}
513390
],
514391
"metadata": {}

notebooks/soln/remote_iter_hint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from IPython import display
1+
from IPython.display import display
22

33
t_minus = range(10,0,-1)
44

0 commit comments

Comments
 (0)