diff --git a/IPython/parallel/client/asyncresult.py b/IPython/parallel/client/asyncresult.py index 1ce171f..1bae6f6 100644 --- a/IPython/parallel/client/asyncresult.py +++ b/IPython/parallel/client/asyncresult.py @@ -455,9 +455,9 @@ class AsyncResult(object): targets, stdouts, stderrs, output_lists, results, pyouts ): if stdout: - print '[stdout:%2i]' % eid, stdout + print '[stdout:%i]' % eid, stdout if stderr: - print >> sys.stderr, '[stderr:%2i]' % eid, stderr + print >> sys.stderr, '[stderr:%i]' % eid, stderr try: get_ipython() @@ -475,12 +475,12 @@ class AsyncResult(object): # republish stdout: if any(stdouts): for eid,stdout in zip(targets, stdouts): - print '[stdout:%2i]' % eid, stdout + print '[stdout:%i]' % eid, stdout # republish stderr: if any(stderrs): for eid,stderr in zip(targets, stderrs): - print >> sys.stderr, '[stderr:%2i]' % eid, stderr + print >> sys.stderr, '[stderr:%i]' % eid, stderr try: get_ipython() diff --git a/IPython/parallel/client/client.py b/IPython/parallel/client/client.py index c16a31d..0d35303 100644 --- a/IPython/parallel/client/client.py +++ b/IPython/parallel/client/client.py @@ -119,8 +119,8 @@ class ExecuteReply(object): normal = TermColors.Normal p.text( - u'[%2i] ' % self.metadata['engine_id'] + - out + u'Out[%2i]: ' % self.execution_count + + u'[%i] ' % self.metadata['engine_id'] + + out + u'Out[%i]: ' % self.execution_count + normal + text_out ) diff --git a/docs/source/parallel/parallel_multiengine.txt b/docs/source/parallel/parallel_multiengine.txt index a9ca6f7..adb8771 100644 --- a/docs/source/parallel/parallel_multiengine.txt +++ b/docs/source/parallel/parallel_multiengine.txt @@ -415,17 +415,17 @@ specified by the :attr:`targets` attribute of the :class:`DirectView` instance: In [28]: %px numpy.linalg.eigvals(a) Parallel execution on engines: [0, 1, 2, 3] - [ 0] Out[68]: array([ 0.77120707, -0.19448286]) - [ 1] Out[68]: array([ 1.10815921, 0.05110369]) - [ 2] Out[68]: array([ 0.74625527, -0.37475081]) - [ 3] Out[68]: array([ 0.72931905, 0.07159743]) + [0] Out[68]: array([ 0.77120707, -0.19448286]) + [1] Out[68]: array([ 1.10815921, 0.05110369]) + [2] Out[68]: array([ 0.74625527, -0.37475081]) + [3] Out[68]: array([ 0.72931905, 0.07159743]) In [29]: %px print 'hi' Parallel execution on engine(s): [0, 1, 2, 3] - [stdout: 0] hi - [stdout: 1] hi - [stdout: 2] hi - [stdout: 3] hi + [stdout:0] hi + [stdout:1] hi + [stdout:2] hi + [stdout:3] hi Since engines are IPython as well, you can even run magics remotely: @@ -434,16 +434,16 @@ Since engines are IPython as well, you can even run magics remotely: In [28]: %px %pylab inline Parallel execution on engine(s): [0, 1, 2, 3] - [stdout: 0] + [stdout:0] Welcome to pylab, a matplotlib-based Python environment... For more information, type 'help(pylab)'. - [stdout: 1] + [stdout:1] Welcome to pylab, a matplotlib-based Python environment... For more information, type 'help(pylab)'. - [stdout: 2] + [stdout:2] Welcome to pylab, a matplotlib-based Python environment... For more information, type 'help(pylab)'. - [stdout: 3] + [stdout:3] Welcome to pylab, a matplotlib-based Python environment... For more information, type 'help(pylab)'. @@ -459,10 +459,10 @@ if it suports the inline figures (e.g. notebook or qtconsole): - [ 0] Out[79]: [] - [ 1] Out[79]: [] - [ 2] Out[79]: [] - [ 3] Out[79]: [] + [0] Out[79]: [] + [1] Out[79]: [] + [2] Out[79]: [] + [3] Out[79]: [] ``%%px`` Cell Magic @@ -486,14 +486,14 @@ engines are presented. ....: ev.max() ....: Parallel execution on engine(s): [0, 1, 2, 3] - [stdout: 0] [ 0.60640442 0.95919621] - [ 0] Out[73]: 0.9591962130899806 - [stdout: 1] [ 0.38501813 1.29430871] - [ 1] Out[73]: 1.2943087091452372 - [stdout: 2] [-0.85925141 0.9387692 ] - [ 2] Out[73]: 0.93876920456230284 - [stdout: 3] [ 0.37998269 1.24218246] - [ 3] Out[73]: 1.2421824618493817 + [stdout:0] [ 0.60640442 0.95919621] + [0] Out[73]: 0.9591962130899806 + [stdout:1] [ 0.38501813 1.29430871] + [1] Out[73]: 1.2943087091452372 + [stdout:2] [-0.85925141 0.9387692 ] + [2] Out[73]: 0.93876920456230284 + [stdout:3] [ 0.37998269 1.24218246] + [3] Out[73]: 1.2421824618493817 ``%result`` Magic ***************** @@ -510,10 +510,10 @@ just as is done when ``%px`` is blocking: Async parallel execution on engine(s): [0, 1, 2, 3] In [41]: %result - [stdout: 0] hi - [stdout: 1] hi - [stdout: 2] hi - [stdout: 3] hi + [stdout:0] hi + [stdout:1] hi + [stdout:2] hi + [stdout:3] hi ``%result`` simply calls :meth:`.AsyncResult.display_outputs` on the most recent request. You can pass integers as indices if you want a result other than the latest, @@ -543,10 +543,10 @@ on the engines until you do ``%autopx`` again. ....: In [34]: print "Average max eigenvalue is: %f" % (sum(max_evals)/len(max_evals)) - [stdout: 0] Average max eigenvalue is: 10.193101 - [stdout: 1] Average max eigenvalue is: 10.064508 - [stdout: 2] Average max eigenvalue is: 10.055724 - [stdout: 3] Average max eigenvalue is: 10.086876 + [stdout:0] Average max eigenvalue is: 10.193101 + [stdout:1] Average max eigenvalue is: 10.064508 + [stdout:2] Average max eigenvalue is: 10.055724 + [stdout:3] Average max eigenvalue is: 10.086876 In [35]: %autopx Auto Parallel Disabled