Show More
@@ -455,9 +455,9 b' class AsyncResult(object):' | |||
|
455 | 455 | targets, stdouts, stderrs, output_lists, results, pyouts |
|
456 | 456 | ): |
|
457 | 457 | if stdout: |
|
458 |
print '[stdout:% |
|
|
458 | print '[stdout:%i]' % eid, stdout | |
|
459 | 459 | if stderr: |
|
460 |
print >> sys.stderr, '[stderr:% |
|
|
460 | print >> sys.stderr, '[stderr:%i]' % eid, stderr | |
|
461 | 461 | |
|
462 | 462 | try: |
|
463 | 463 | get_ipython() |
@@ -475,12 +475,12 b' class AsyncResult(object):' | |||
|
475 | 475 | # republish stdout: |
|
476 | 476 | if any(stdouts): |
|
477 | 477 | for eid,stdout in zip(targets, stdouts): |
|
478 |
print '[stdout:% |
|
|
478 | print '[stdout:%i]' % eid, stdout | |
|
479 | 479 | |
|
480 | 480 | # republish stderr: |
|
481 | 481 | if any(stderrs): |
|
482 | 482 | for eid,stderr in zip(targets, stderrs): |
|
483 |
print >> sys.stderr, '[stderr:% |
|
|
483 | print >> sys.stderr, '[stderr:%i]' % eid, stderr | |
|
484 | 484 | |
|
485 | 485 | try: |
|
486 | 486 | get_ipython() |
@@ -119,8 +119,8 b' class ExecuteReply(object):' | |||
|
119 | 119 | normal = TermColors.Normal |
|
120 | 120 | |
|
121 | 121 | p.text( |
|
122 |
u'[% |
|
|
123 |
out + u'Out[% |
|
|
122 | u'[%i] ' % self.metadata['engine_id'] + | |
|
123 | out + u'Out[%i]: ' % self.execution_count + | |
|
124 | 124 | normal + text_out |
|
125 | 125 | ) |
|
126 | 126 |
@@ -415,17 +415,17 b' specified by the :attr:`targets` attribute of the :class:`DirectView` instance:' | |||
|
415 | 415 | |
|
416 | 416 | In [28]: %px numpy.linalg.eigvals(a) |
|
417 | 417 | Parallel execution on engines: [0, 1, 2, 3] |
|
418 |
[ |
|
|
419 |
[ |
|
|
420 |
[ |
|
|
421 |
[ |
|
|
418 | [0] Out[68]: array([ 0.77120707, -0.19448286]) | |
|
419 | [1] Out[68]: array([ 1.10815921, 0.05110369]) | |
|
420 | [2] Out[68]: array([ 0.74625527, -0.37475081]) | |
|
421 | [3] Out[68]: array([ 0.72931905, 0.07159743]) | |
|
422 | 422 | |
|
423 | 423 | In [29]: %px print 'hi' |
|
424 | 424 | Parallel execution on engine(s): [0, 1, 2, 3] |
|
425 |
[stdout: |
|
|
426 |
[stdout: |
|
|
427 |
[stdout: |
|
|
428 |
[stdout: |
|
|
425 | [stdout:0] hi | |
|
426 | [stdout:1] hi | |
|
427 | [stdout:2] hi | |
|
428 | [stdout:3] hi | |
|
429 | 429 | |
|
430 | 430 | |
|
431 | 431 | Since engines are IPython as well, you can even run magics remotely: |
@@ -434,16 +434,16 b' Since engines are IPython as well, you can even run magics remotely:' | |||
|
434 | 434 | |
|
435 | 435 | In [28]: %px %pylab inline |
|
436 | 436 | Parallel execution on engine(s): [0, 1, 2, 3] |
|
437 |
[stdout: |
|
|
437 | [stdout:0] | |
|
438 | 438 | Welcome to pylab, a matplotlib-based Python environment... |
|
439 | 439 | For more information, type 'help(pylab)'. |
|
440 |
[stdout: |
|
|
440 | [stdout:1] | |
|
441 | 441 | Welcome to pylab, a matplotlib-based Python environment... |
|
442 | 442 | For more information, type 'help(pylab)'. |
|
443 |
[stdout: |
|
|
443 | [stdout:2] | |
|
444 | 444 | Welcome to pylab, a matplotlib-based Python environment... |
|
445 | 445 | For more information, type 'help(pylab)'. |
|
446 |
[stdout: |
|
|
446 | [stdout:3] | |
|
447 | 447 | Welcome to pylab, a matplotlib-based Python environment... |
|
448 | 448 | For more information, type 'help(pylab)'. |
|
449 | 449 | |
@@ -459,10 +459,10 b' if it suports the inline figures (e.g. notebook or qtconsole):' | |||
|
459 | 459 | <plot1> |
|
460 | 460 | <plot2> |
|
461 | 461 | <plot3> |
|
462 |
[ |
|
|
463 |
[ |
|
|
464 |
[ |
|
|
465 |
[ |
|
|
462 | [0] Out[79]: [<matplotlib.lines.Line2D at 0x10a6286d0>] | |
|
463 | [1] Out[79]: [<matplotlib.lines.Line2D at 0x10b9476d0>] | |
|
464 | [2] Out[79]: [<matplotlib.lines.Line2D at 0x110652750>] | |
|
465 | [3] Out[79]: [<matplotlib.lines.Line2D at 0x10c6566d0>] | |
|
466 | 466 | |
|
467 | 467 | |
|
468 | 468 | ``%%px`` Cell Magic |
@@ -486,14 +486,14 b' engines are presented.' | |||
|
486 | 486 | ....: ev.max() |
|
487 | 487 | ....: |
|
488 | 488 | Parallel execution on engine(s): [0, 1, 2, 3] |
|
489 |
[stdout: |
|
|
490 |
[ |
|
|
491 |
[stdout: |
|
|
492 |
[ |
|
|
493 |
[stdout: |
|
|
494 |
[ |
|
|
495 |
[stdout: |
|
|
496 |
[ |
|
|
489 | [stdout:0] [ 0.60640442 0.95919621] | |
|
490 | [0] Out[73]: 0.9591962130899806 | |
|
491 | [stdout:1] [ 0.38501813 1.29430871] | |
|
492 | [1] Out[73]: 1.2943087091452372 | |
|
493 | [stdout:2] [-0.85925141 0.9387692 ] | |
|
494 | [2] Out[73]: 0.93876920456230284 | |
|
495 | [stdout:3] [ 0.37998269 1.24218246] | |
|
496 | [3] Out[73]: 1.2421824618493817 | |
|
497 | 497 | |
|
498 | 498 | ``%result`` Magic |
|
499 | 499 | ***************** |
@@ -510,10 +510,10 b' just as is done when ``%px`` is blocking:' | |||
|
510 | 510 | Async parallel execution on engine(s): [0, 1, 2, 3] |
|
511 | 511 | |
|
512 | 512 | In [41]: %result |
|
513 |
[stdout: |
|
|
514 |
[stdout: |
|
|
515 |
[stdout: |
|
|
516 |
[stdout: |
|
|
513 | [stdout:0] hi | |
|
514 | [stdout:1] hi | |
|
515 | [stdout:2] hi | |
|
516 | [stdout:3] hi | |
|
517 | 517 | |
|
518 | 518 | ``%result`` simply calls :meth:`.AsyncResult.display_outputs` on the most recent request. |
|
519 | 519 | You can pass integers as indices if you want a result other than the latest, |
@@ -543,10 +543,10 b' on the engines until you do ``%autopx`` again.' | |||
|
543 | 543 | ....: |
|
544 | 544 | |
|
545 | 545 | In [34]: print "Average max eigenvalue is: %f" % (sum(max_evals)/len(max_evals)) |
|
546 |
[stdout: |
|
|
547 |
[stdout: |
|
|
548 |
[stdout: |
|
|
549 |
[stdout: |
|
|
546 | [stdout:0] Average max eigenvalue is: 10.193101 | |
|
547 | [stdout:1] Average max eigenvalue is: 10.064508 | |
|
548 | [stdout:2] Average max eigenvalue is: 10.055724 | |
|
549 | [stdout:3] Average max eigenvalue is: 10.086876 | |
|
550 | 550 | |
|
551 | 551 | In [35]: %autopx |
|
552 | 552 | Auto Parallel Disabled |
General Comments 0
You need to be logged in to leave comments.
Login now