diff options
author | 2017-02-08 13:36:44 -0800 | |
---|---|---|
committer | 2017-02-08 13:36:44 -0800 | |
commit | 360c0d50654716966e2ca6e96110ffd15aabfee0 (patch) | |
tree | 9f8ca93c50d6297afa91d2b7dbcbad20cd0c7300 /tools/run_tests/run_microbenchmark.py | |
parent | f74d1727917747a0cef75fa9b849aa77cfa091c4 (diff) |
Add comments, fix bug
Diffstat (limited to 'tools/run_tests/run_microbenchmark.py')
-rwxr-xr-x | tools/run_tests/run_microbenchmark.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index 7856affd8c..a5794dc9ee 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -94,7 +94,13 @@ for bm_name in sys.argv[1:]: '--source', '%s.trace' % fnize(line), '--fmt', 'simple', '--out', 'reports/%s.txt' % fnize(line)], timeout_seconds=None)) cleanup.append(jobset.JobSpec(['rm', '%s.trace' % fnize(line)])) + # periodically flush out the list of jobs: profile_analysis jobs at least + # consume upwards of five gigabytes of ram in some cases, and so analysing + # hundreds of them at once is impractical -- but we want at least some + # concurrency or the work takes too long if len(benchmarks) >= min(4, multiprocessing.cpu_count()): + # run up to half the cpu count: each benchmark can use up to two cores + # (one for the microbenchmark, one for the data flush) jobset.run(benchmarks, maxjobs=multiprocessing.cpu_count()/2, add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port}) jobset.run(profile_analysis, maxjobs=multiprocessing.cpu_count()) @@ -102,6 +108,7 @@ for bm_name in sys.argv[1:]: benchmarks = [] profile_analysis = [] cleanup = [] + # run the remaining benchmarks that weren't flushed if len(benchmarks): jobset.run(benchmarks, maxjobs=multiprocessing.cpu_count()/2, add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port}) @@ -131,4 +138,4 @@ for bm_name in sys.argv[1:]: index_html += "</body>\n</html>\n" with open('reports/index.html', 'w') as f: - w.write(index_html) + f.write(index_html) |