##// END OF EJS Templates
Fixed example to work with python3...
zah -
Show More
@@ -90,7 +90,7 b''
90 "bcast = mpi.bcast\n",
90 "bcast = mpi.bcast\n",
91 "barrier = mpi.barrier\n",
91 "barrier = mpi.barrier\n",
92 "rank = mpi.rank\n",
92 "rank = mpi.rank\n",
93 "print \"MPI rank: %i/%i\" % (mpi.rank,mpi.size)"
93 "print(\"MPI rank: %i/%i\" % (mpi.rank,mpi.size))"
94 ],
94 ],
95 "language": "python",
95 "language": "python",
96 "metadata": {
96 "metadata": {
@@ -270,7 +270,7 b''
270 " try:\n",
270 " try:\n",
271 " Z = np.concatenate(mpi_order(view['Z']))\n",
271 " Z = np.concatenate(mpi_order(view['Z']))\n",
272 " except ValueError:\n",
272 " except ValueError:\n",
273 " print \"dimension mismatch in Z, not plotting\"\n",
273 " print(\"dimension mismatch in Z, not plotting\")\n",
274 " ax = plt.gca()\n",
274 " ax = plt.gca()\n",
275 " return ax.figure\n",
275 " return ax.figure\n",
276 " \n",
276 " \n",
@@ -361,7 +361,7 b''
361 " if not simulation_alive():\n",
361 " if not simulation_alive():\n",
362 " plot_current_results(in_place=plots_in_place)\n",
362 " plot_current_results(in_place=plots_in_place)\n",
363 " plt.close('all')\n",
363 " plt.close('all')\n",
364 " print 'Simulation has already finished, no monitoring to do.'\n",
364 " print('Simulation has already finished, no monitoring to do.')\n",
365 " return\n",
365 " return\n",
366 " \n",
366 " \n",
367 " t0 = dt.datetime.now()\n",
367 " t0 = dt.datetime.now()\n",
@@ -380,8 +380,8 b''
380 " clear_output(wait=True)\n",
380 " clear_output(wait=True)\n",
381 " plt.close('all')\n",
381 " plt.close('all')\n",
382 " display(fig)\n",
382 " display(fig)\n",
383 " print msg\n",
383 " print(msg)\n",
384 " print 'Monitored for: %s.' % tmon"
384 " print('Monitored for: %s.' % tmon)"
385 ],
385 ],
386 "language": "python",
386 "language": "python",
387 "metadata": {
387 "metadata": {
@@ -540,4 +540,4 b''
540 "metadata": {}
540 "metadata": {}
541 }
541 }
542 ]
542 ]
543 } No newline at end of file
543 }
@@ -100,7 +100,7 b''
100 "bcast = mpi.bcast\n",
100 "bcast = mpi.bcast\n",
101 "barrier = mpi.barrier\n",
101 "barrier = mpi.barrier\n",
102 "rank = mpi.rank\n",
102 "rank = mpi.rank\n",
103 "print \"MPI rank: %i/%i\" % (mpi.rank,mpi.size)"
103 "print(\"MPI rank: %i/%i\" % (mpi.rank,mpi.size))"
104 ],
104 ],
105 "language": "python",
105 "language": "python",
106 "metadata": {},
106 "metadata": {},
@@ -317,7 +317,7 b''
317 " if ar.ready():\n",
317 " if ar.ready():\n",
318 " plot_current_results(ar, in_place=plots_in_place)\n",
318 " plot_current_results(ar, in_place=plots_in_place)\n",
319 " plt.close('all')\n",
319 " plt.close('all')\n",
320 " print 'Simulation has already finished, no monitoring to do.'\n",
320 " print('Simulation has already finished, no monitoring to do.')\n",
321 " return\n",
321 " return\n",
322 " \n",
322 " \n",
323 " t0 = dt.datetime.now()\n",
323 " t0 = dt.datetime.now()\n",
@@ -336,8 +336,8 b''
336 " clear_output(wait=True)\n",
336 " clear_output(wait=True)\n",
337 " plt.close('all')\n",
337 " plt.close('all')\n",
338 " display(fig)\n",
338 " display(fig)\n",
339 " print msg\n",
339 " print(msg)\n",
340 " print 'Monitored for: %s.' % tmon"
340 " print('Monitored for: %s.' % tmon)"
341 ],
341 ],
342 "language": "python",
342 "language": "python",
343 "metadata": {},
343 "metadata": {},
@@ -409,4 +409,4 b''
409 "metadata": {}
409 "metadata": {}
410 }
410 }
411 ]
411 ]
412 } No newline at end of file
412 }
General Comments 0
You need to be logged in to leave comments. Login now