From 4fd0780442885acb319f1cf6af0ee0732762dfbb Mon Sep 17 00:00:00 2001 From: Stephen Mardson McQuay Date: Wed, 30 Mar 2011 18:36:28 -0600 Subject: [PATCH] the 'submit' script now times and reports things correctly --- bin/submit.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/submit.py b/bin/submit.py index e386e53..1ba55f7 100644 --- a/bin/submit.py +++ b/bin/submit.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import sys +import os import time @@ -34,14 +35,13 @@ def run_queries(count, order = 3, extra_points = 8): if __name__ == '__main__': server = 'localhost' - expected_participants = 6 m = QueueManager(address=(server, 50000), authkey='asdf') m.connect() - count = int(sys.argv[1]) + expected_participants, count = (int(i) for i in sys.argv[1:]) - inq = m.get_inqueue() + inq = m.get_inqueue() outq = m.get_outqueue() # wait for all participants to be loaded up @@ -49,14 +49,17 @@ if __name__ == '__main__': print outq.get() # run codes - r, submit, receive = run_queries(count, order=3, extra_points = 64) + results, submit, receive = run_queries(count, order=3, extra_points = 64) + # shut down all participants for i in xrange(expected_participants): - inq.put([None] * expected_participants) + inq.put([None] * 4) - results = {} - results['submit' ] = float(submit) - results['receive'] = float(receive) + stats = {} + stats['submit' ] = float(submit) + stats['receive' ] = float(receive) + stats['count' ] = count + stats['expected_participants'] = expected_participants - print "submit time: %(submit)0.2f seconds, results time: %(receive)0.2f" % results - log.error(results) + print "submit time for %(count)s interps, %(expected_participants)d participants: %(submit)0.2f seconds, results time: %(receive)0.2f" % stats + log.error("stats: %s", stats)