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