yt.inline-intercomm / yt_recv.py

from yt.mods import *
from mpi4py import MPI
import pylab
pylab.ion()

my_info = MPI.Info()

port = MPI.Lookup_name("enzo_server", my_info)
comm = MPI.COMM_WORLD.Connect(port, my_info, 0)

while 1:
    print "NOTIFYING ENZO"
    comm.send(None, dest = 0, tag = 104)
    print "RECEIVING"
    image = comm.recv(source = 0)
    print "UPDATING", image.min(), image.max()
    pylab.clf()
    pylab.imshow(image)
    pylab.clim(image.min(), image.max())
    pylab.draw()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.