##// END OF EJS Templates
Updated basics notebook for pydata2014
Updated basics notebook for pydata2014

File last commit:

r16120:24b93a1d
r17493:53f19bbe
Show More
Parallel Decorator and map.ipynb
119 lines | 2.9 KiB | text/plain | TextLexer
/ examples / Parallel Computing / Parallel Decorator and map.ipynb
Brian E. Granger
Converting notebooks to JSON format.
r4634 {
MinRK
regenerate example notebooks to remove transformed output
r5981 "metadata": {
Brian E. Granger
Lots of documentation work.
r16115 "name": "",
"signature": "sha256:8781781d8835d77bf0f71b535b72ee2718405543c48e87ad0408242119cdb3cc"
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": [
"# Load balanced map and parallel function decorator"
]
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": false,
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 "v = 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
rebuild example notebooks...
r7739 "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": false,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
MinRK
rebuild example notebooks...
r7739 "result = v.map(lambda x: 2*x, range(10))\n",
Thomas Kluyver
Update parallel example notebooks for Python 3
r13997 "print(\"Simple, default map: \", list(result))"
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": [
Brian E. Granger
Lots of documentation work.
r16115 "Simple, default map: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]\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": 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": false,
MinRK
regenerate example notebooks to remove transformed output
r5981 "input": [
MinRK
rebuild example notebooks...
r7739 "ar = v.map_async(lambda x: 2*x, range(10))\n",
Thomas Kluyver
Update parallel example notebooks for Python 3
r13997 "print(\"Submitted tasks, got ids: \", ar.msg_ids)\n",
MinRK
rebuild example notebooks...
r7739 "result = ar.get()\n",
Thomas Kluyver
Update parallel example notebooks for Python 3
r13997 "print(\"Using a mapper: \", result)"
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": [
Brian E. Granger
Lots of documentation work.
r16115 "Submitted tasks, got ids: ['b4d86123-967a-4f21-b9c5-8a77a69a3ced', '97401998-891d-4729-8288-ae1b97c28235', '1586cf7e-32c7-4864-bd0e-6aab16e07a3f', 'f6770223-59c3-4344-a69a-5d555d1dfb7f', '0ebb71da-6e16-44ac-917a-be978fd3787d', '582443c5-937e-45b0-9f13-5607c53cba60', '8d453d87-d70d-4fbd-a2c4-994ab3a8b6c7', '0a680757-1a59-4826-969c-523a45f3d76f', '63a3e983-a205-4f07-b494-ec86b2cdd004', '79b34cbb-aa93-4d11-8746-28969dbdd3ec']\n",
MinRK
rebuild example notebooks...
r7739 "Using a mapper: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]\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": 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": [
MinRK
rebuild example notebooks...
r7739 "@v.parallel(block=True)\n",
"def f(x): return 2*x\n",
"\n",
"result = f.map(range(10))\n",
Thomas Kluyver
Update parallel example notebooks for Python 3
r13997 "print(\"Using a parallel function: \", result)"
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 "Using a parallel function: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]\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": 5
},
{
"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 }