more verbose minion

This commit is contained in:
Stephen Mardson McQuay 2011-05-08 20:43:43 -06:00
parent 3628f2cea4
commit a54bccb2d0

View File

@ -17,13 +17,6 @@ from interp.tools import baker_exact_3D as exact
from interp.cluster import QueueManager, get_qs
def keep_working(controls):
pass
def work(inq, outq, g, myname):
pass
if __name__ == '__main__':
parser = OptionParser(usage = "usage: %s [options] <server> <gmsh file>")
@ -43,29 +36,36 @@ if __name__ == '__main__':
server, input_file = args
myname = "%s-%d" % (os.uname()[1], os.getpid())
if options.verbose:
print "%s: started" % myname
m = QueueManager(address=(server, options.port), authkey='asdf')
m.connect()
tasksq, resultsq, masterq, minionsq = get_qs(m)
if options.verbose:
print "%s: starting parse input file" % myname
g = ggrid(input_file)
g.q = np.array([exact(x) for x in g.verts])
myname = "%s-%d" % (os.uname()[1], os.getpid())
if options.verbose:
print myname
print "%s: done parsing input file" % myname
while True:
# indicate that I am loaded up, and ready for workload
if options.verbose:
print "%s: letting master know that I am ready" % myname
masterq.put(myname)
# wait for master's start signal
if options.verbose:
print "%s: waiting for master to tell me to start" % myname
action = minionsq.get()
if action == "teardown":
# I take it back; I'm not ready!
masterq.get()
break
elif action == "slay":
if action in ('teardown', 'slay'):
# take back one name ?
# masterq.get()
break
while not tasksq.empty():