some error detection: make sure the set of reported workers has no duplicate entries

This commit is contained in:
Stephen McQuay 2011-05-24 13:46:07 -06:00
parent d7aebc7be0
commit 4d60ca0c3c

View File

@ -59,12 +59,15 @@ if __name__ == '__main__':
tasksq, resultsq, masterq, minionsq = get_qs(m)
workers = []
if not options.participants:
print "wait on all announced participants"
participants = 0
while not masterq.empty():
participants += 1
worker = masterq.get()
workers.append(worker)
print "%d: %s is ready" % (participants, worker)
if participants == 0:
print "nobody found"
@ -74,8 +77,14 @@ if __name__ == '__main__':
print "wait on %d participants" % participants
for i in xrange(participants):
worker = masterq.get()
workers.append(worker)
print "%d of %d: %s is ready" % (i+1, participants, worker)
if len(set(workers)) != len(workers):
for i in workers:
minionsq.put("slay")
raise Exception("duplicate workers reported")
results = []
widgets = ['submit jobs: ', Percentage(), ' ', Bar(), ' ', ETA()]