diff --git a/docs/examples/parallel/Parallel Magics.ipynb b/docs/examples/parallel/Parallel Magics.ipynb index be3bac0..1768b1a 100644 --- a/docs/examples/parallel/Parallel Magics.ipynb +++ b/docs/examples/parallel/Parallel Magics.ipynb @@ -36,7 +36,7 @@ { "cell_type": "markdown", "source": [ - "Creating a Client registers the parallel magics `%px`, `%%px`, `%pxresult`, and `%autopx`. \n", + "Creating a Client registers the parallel magics `%px`, `%%px`, `%pxresult`, `pxconfig`, and `%autopx`. \n", "These magics are initially associated with a DirectView always associated with all currently registered engines." ] }, @@ -115,13 +115,13 @@ "cell_type": "markdown", "source": [ "But you will notice that this didn't output the result of the last command.\n", - "For this, we have `%result`, which displays the output of the latest request:" + "For this, we have `%pxresult`, which displays the output of the latest request:" ] }, { "cell_type": "code", "input": [ - "%result" + "%pxresult" ], "language": "python", "outputs": [] @@ -174,7 +174,7 @@ { "cell_type": "code", "input": [ - "%result" + "%pxresult" ], "language": "python", "outputs": [] @@ -212,14 +212,14 @@ "source": [ "When you specify 'order', then individual display outputs (e.g. plots) will be interleaved.\n", "\n", - "`%result` takes the same output-ordering arguments as `%%px`, \n", - "so you can view the previous result in a variety of different ways with a few sequential calls to `%result`:" + "`%pxresult` takes the same output-ordering arguments as `%%px`, \n", + "so you can view the previous result in a variety of different ways with a few sequential calls to `%pxresult`:" ] }, { "cell_type": "code", "input": [ - "%result --group-outputs=order" + "%pxresult --group-outputs=order" ], "language": "python", "outputs": [] @@ -323,6 +323,56 @@ "outputs": [] }, { + "cell_type": "heading", + "level": 2, + "source": [ + "Parallel Exceptions" + ] + }, + { + "cell_type": "markdown", + "source": [ + "When you raise exceptions with the parallel exception,\n", + "the CompositeError raised locally will display your remote traceback." + ] + }, + { + "cell_type": "code", + "input": [ + "%%px\n", + "from numpy.random import random\n", + "A = random((100,100,'invalid shape'))" + ], + "language": "python", + "outputs": [] + }, + { + "cell_type": "heading", + "level": 2, + "source": [ + "Remote Cell Magics" + ] + }, + { + "cell_type": "markdown", + "source": [ + "Remember, Engines are IPython too, so the cell that is run remotely by %%px can in turn use a cell magic." + ] + }, + { + "cell_type": "code", + "input": [ + "%%px\n", + "%%timeit\n", + "from numpy.random import random\n", + "from numpy.linalg import norm\n", + "A = random((100,100))\n", + "norm(A, 2) " + ], + "language": "python", + "outputs": [] + }, + { "cell_type": "code", "input": [], "language": "python",