##// END OF EJS Templates
Updating example notebooks to v3 format.
Brian Granger -
Show More
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "00_notebook_tour"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "01_notebook_introduction"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "display_protocol"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "formatting"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "sympy"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "sympy_quantum_computing"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "trapezoid_rule"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "helloworld"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "parallel_mpi"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
@@ -1,87 +1,116 b''
1 1 {
2 "nbformat": 2,
3 2 "metadata": {
4 "name": "task_1"
3 "name": "task1"
5 4 },
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
9 9 {
10 "source": "# Simple task farming example",
11 "cell_type": "markdown"
10 "cell_type": "markdown",
11 "source": [
12 "# Simple task farming example"
13 ]
12 14 },
13 15 {
14 16 "cell_type": "code",
17 "collapsed": true,
18 "input": [
19 "from IPython.parallel import Client"
20 ],
15 21 "language": "python",
16 22 "outputs": [],
17 "collapsed": true,
18 "prompt_number": 3,
19 "input": "from IPython.parallel import Client"
23 "prompt_number": 3
20 24 },
21 25 {
22 "source": "A `Client.load_balanced_view` is used to get the object used for working with load balanced tasks.",
23 "cell_type": "markdown"
26 "cell_type": "markdown",
27 "source": [
28 "A `Client.load_balanced_view` is used to get the object used for working with load balanced tasks."
29 ]
24 30 },
25 31 {
26 32 "cell_type": "code",
33 "collapsed": true,
34 "input": [
35 "rc = Client()",
36 "v = rc.load_balanced_view()"
37 ],
27 38 "language": "python",
28 39 "outputs": [],
29 "collapsed": true,
30 "prompt_number": 4,
31 "input": "rc = Client()\nv = rc.load_balanced_view()"
40 "prompt_number": 4
32 41 },
33 42 {
34 "source": "Set the variable `d` on all engines:",
35 "cell_type": "markdown"
43 "cell_type": "markdown",
44 "source": [
45 "Set the variable `d` on all engines:"
46 ]
36 47 },
37 48 {
38 49 "cell_type": "code",
50 "collapsed": true,
51 "input": [
52 "rc[:]['d'] = 30"
53 ],
39 54 "language": "python",
40 55 "outputs": [],
41 "collapsed": true,
42 "prompt_number": 5,
43 "input": "rc[:]['d'] = 30"
56 "prompt_number": 5
44 57 },
45 58 {
46 "source": "Define a function that will be our task:",
47 "cell_type": "markdown"
59 "cell_type": "markdown",
60 "source": [
61 "Define a function that will be our task:"
62 ]
48 63 },
49 64 {
50 65 "cell_type": "code",
66 "collapsed": true,
67 "input": [
68 "def task(a):",
69 " return a, 10*d, a*10*d"
70 ],
51 71 "language": "python",
52 72 "outputs": [],
53 "collapsed": true,
54 "prompt_number": 6,
55 "input": "def task(a):\n return a, 10*d, a*10*d"
73 "prompt_number": 6
56 74 },
57 75 {
58 "source": "Run the task once:",
59 "cell_type": "markdown"
76 "cell_type": "markdown",
77 "source": [
78 "Run the task once:"
79 ]
60 80 },
61 81 {
62 82 "cell_type": "code",
83 "collapsed": true,
84 "input": [
85 "ar = v.apply(task, 5)"
86 ],
63 87 "language": "python",
64 88 "outputs": [],
65 "collapsed": true,
66 "prompt_number": 7,
67 "input": "ar = v.apply(task, 5)"
89 "prompt_number": 7
68 90 },
69 91 {
70 "source": "Print the results:",
71 "cell_type": "markdown"
92 "cell_type": "markdown",
93 "source": [
94 "Print the results:"
95 ]
72 96 },
73 97 {
74 98 "cell_type": "code",
99 "collapsed": false,
100 "input": [
101 "print \"a, b, c: \", ar.get()"
102 ],
75 103 "language": "python",
76 104 "outputs": [
77 105 {
78 106 "output_type": "stream",
79 "text": "a, b, c: [5, 300, 1500]"
107 "stream": "stdout",
108 "text": [
109 "a, b, c: [5, 300, 1500]"
110 ]
80 111 }
81 112 ],
82 "collapsed": false,
83 "prompt_number": 8,
84 "input": "print \"a, b, c: \", ar.get()"
113 "prompt_number": 8
85 114 }
86 115 ]
87 116 }
@@ -2,7 +2,7 b''
2 2 "metadata": {
3 3 "name": "taskmap"
4 4 },
5 "nbformat": 2,
5 "nbformat": 3,
6 6 "worksheets": [
7 7 {
8 8 "cells": [
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now