added sleep to try to fix bug

This commit is contained in:
Stephen McQuay 2011-03-30 23:09:10 -06:00
parent 1401f5b2ec
commit 16bfca3bd5

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys
import time
from multiprocessing.managers import BaseManager from multiprocessing.managers import BaseManager
@ -18,13 +19,14 @@ QueueManager.register('get_inqueue' )
QueueManager.register('get_outqueue') QueueManager.register('get_outqueue')
def work(inq, outq, g, myname): def work(inq, outq, g, myname):
print "%s about to send my name: %s" % (datetime.datetime.now(), myname) # print "%s about to send my name: %s" % (datetime.datetime.now(), myname)
outq.put((myname, "ready")) outq.put((myname, "ready"))
while True: while True:
i, o, e, X = inq.get() i, o, e, X = inq.get()
if i == None: if i == None:
return o shutdown = o
return shutdown
a = g.run_baker(X, order = o, extra_points = e) a = g.run_baker(X, order = o, extra_points = e)
outq.put((i, myname, a['qlin'], a['error'], a['final'], exact(X))) outq.put((i, myname, a['qlin'], a['error'], a['final'], exact(X)))
@ -58,6 +60,8 @@ if __name__ == '__main__':
g.q = np.array([exact(x) for x in g.verts]) g.q = np.array([exact(x) for x in g.verts])
myname = options.label myname = options.label
shutdown = False shutdown = False
while not shutdown: while not shutdown:
time.sleep(5)
shutdown = work(inq, outq, g, myname) shutdown = work(inq, outq, g, myname)