##// END OF EJS Templates
Moving parallel->Parallel
Moving parallel->Parallel

File last commit:

r16057:a34981d9
r16057:a34981d9
Show More
helloworld.ipynb
101 lines | 2.1 KiB | text/plain | TextLexer
Brian E. Granger
Converting notebooks to JSON format.
r4634 {
MinRK
regenerate example notebooks to remove transformed output
r5981 "metadata": {
Thomas Kluyver
Update parallel example notebooks for Python 3
r13997 "name": ""
Brian Granger
Updating example notebooks to v3 format.
r6035 },
"nbformat": 3,
MinRK
rebuild example notebooks...
r7739 "nbformat_minor": 0,
MinRK
regenerate example notebooks to remove transformed output
r5981 "worksheets": [
{
"cells": [
{
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "markdown",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
MinRK
regenerate example notebooks to remove transformed output
r5981 "source": [
MinRK
rebuild example notebooks...
r7739 "# Distributed hello world\n",
"\n",
MinRK
regenerate example notebooks to remove transformed output
r5981 "Originally by Ken Kinder (ken at kenkinder dom com)"
]
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
Thomas Kluyver
Update parallel example notebooks for Python 3
r13997 "from __future__ import print_function\n",
MinRK
regenerate example notebooks to remove transformed output
r5981 "from IPython.parallel import Client"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 1
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
MinRK
rebuild example notebooks...
r7739 "rc = Client()\n",
MinRK
regenerate example notebooks to remove transformed output
r5981 "view = rc.load_balanced_view()"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 2
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
MinRK
rebuild example notebooks...
r7739 "def sleep_and_echo(t, msg):\n",
" import time\n",
" time.sleep(t)\n",
MinRK
regenerate example notebooks to remove transformed output
r5981 " return msg"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 3
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": true,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
MinRK
rebuild example notebooks...
r7739 "world = view.apply_async(sleep_and_echo, 3, 'World!')\n",
MinRK
regenerate example notebooks to remove transformed output
r5981 "hello = view.apply_async(sleep_and_echo, 2, 'Hello')"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
regenerate example notebooks to remove transformed output
r5981 "prompt_number": 4
Brian Granger
Updating example notebooks to v3 format.
r6035 },
MinRK
regenerate example notebooks to remove transformed output
r5981 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "cell_type": "code",
"collapsed": false,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
Thomas Kluyver
Update parallel example notebooks for Python 3
r13997 "print(\"Submitted tasks:\", hello.msg_ids + world.msg_ids)\n",
"print(hello.get(), world.get())"
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
MinRK
regenerate example notebooks to remove transformed output
r5981 "outputs": [
{
Brian Granger
Updating example notebooks to v3 format.
r6035 "output_type": "stream",
"stream": "stdout",
MinRK
regenerate example notebooks to remove transformed output
r5981 "text": [
MinRK
rebuild example notebooks...
r7739 "Submitted tasks: ['04670c2d-b2fd-4b6b-a5ac-dee15e533683', 'fc802284-507b-4c29-a526-67396e17718c']\n",
"Hello World!\n"
MinRK
regenerate example notebooks to remove transformed output
r5981 ]
}
Brian Granger
Updating example notebooks to v3 format.
r6035 ],
MinRK
rebuild example notebooks...
r7739 "prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
MinRK
regenerate example notebooks to remove transformed output
r5981 }
MinRK
rebuild example notebooks...
r7739 ],
"metadata": {}
MinRK
regenerate example notebooks to remove transformed output
r5981 }
]
Brian E. Granger
Converting notebooks to JSON format.
r4634 }