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