From fbdb434665fdf2b5380b0cf4501433a7ad818f8a Mon Sep 17 00:00:00 2001 From: Carlos Torres Date: Thu, 21 Jun 2018 18:24:04 -0700 Subject: [PATCH 1/3] [benchpress] Add GAP benchmark suite installation script --- benchpress/install_gapbs.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 benchpress/install_gapbs.sh diff --git a/benchpress/install_gapbs.sh b/benchpress/install_gapbs.sh new file mode 100755 index 0000000..721bd75 --- /dev/null +++ b/benchpress/install_gapbs.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +GAP_GIT_REPO="https://github.com/sbeamer/gapbs.git" +GAP_GIT_TAG="tags/v1.1" + +BENCHMARKS_DIR="$(pwd)/benchmarks/gapbs" +mkdir -p "$BENCHMARKS_DIR" + +rm -rf build +mkdir -p build +cd build + +git clone "$GAP_GIT_REPO" +cd gapbs +git checkout -b gapbs_benchpress "$GAP_GIT_TAG" +make + +mv tc sssp pr converter cc bfs bc "$BENCHMARKS_DIR" +cd ../../ +rm -rf build + +echo "GAP benchmark suite installed into ${BENCHMARKS_DIR}" From af4ef1fdf766340c1abd1b4bdb8b98bedb61b8e1 Mon Sep 17 00:00:00 2001 From: Carlos Torres Date: Thu, 21 Jun 2018 19:05:40 -0700 Subject: [PATCH 2/3] [benchpress] Add GAP benchmark suite parser --- benchpress/benchmarks.yml | 26 ++++++ .../benchpress/plugins/parsers/__init__.py | 2 + .../benchpress/plugins/parsers/gapbs.py | 27 ++++++ benchpress/tests/test_gapbs_parser.py | 82 +++++++++++++++++++ 4 files changed, 137 insertions(+) create mode 100644 benchpress/benchpress/plugins/parsers/gapbs.py create mode 100644 benchpress/tests/test_gapbs_parser.py diff --git a/benchpress/benchmarks.yml b/benchpress/benchmarks.yml index 5400b78..e7d7c20 100644 --- a/benchpress/benchmarks.yml +++ b/benchpress/benchmarks.yml @@ -26,3 +26,29 @@ silo: - latency: - avg_latency +gapbs_bc: + parser: gapbs + path: ./benchmarks/gapbs/bc + metrics: + - generate_time + - build_time + - trial_time + - average_time + +gapbs_bfs: + parser: gapbs + path: ./benchmarks/gapbs/bfs + metrics: + - generate_time + - build_time + - trial_time + - average_time + +gapbs_tc: + parser: gapbs + path: ./benchmarks/gapbs/tc + metrics: + - generate_time + - build_time + - trial_time + - average_time diff --git a/benchpress/benchpress/plugins/parsers/__init__.py b/benchpress/benchpress/plugins/parsers/__init__.py index 1f04b61..49dcaa1 100644 --- a/benchpress/benchpress/plugins/parsers/__init__.py +++ b/benchpress/benchpress/plugins/parsers/__init__.py @@ -7,6 +7,7 @@ # of patent rights can be found in the PATENTS file in the same directory. from .fio import FioParser +from .gapbs import GAPBSParser from .generic import JSONParser from .ltp import LtpParser from .returncode import ReturncodeParser @@ -16,6 +17,7 @@ def register_parsers(factory): factory.register('fio', FioParser) + factory.register('gapbs', GAPBSParser) factory.register('json', JSONParser) factory.register('ltp', LtpParser) factory.register('returncode', ReturncodeParser) diff --git a/benchpress/benchpress/plugins/parsers/gapbs.py b/benchpress/benchpress/plugins/parsers/gapbs.py new file mode 100644 index 0000000..8dbaa5a --- /dev/null +++ b/benchpress/benchpress/plugins/parsers/gapbs.py @@ -0,0 +1,27 @@ +# Copyright (c) 2017-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +import re + +from benchpress.lib.parser import Parser + +TIME_REGEX = r'(\w+\sTime):\s+(\d+\.?\d*)' + + +class GAPBSParser(Parser): + + def parse(self, stdout, stderr, returncode): + output = ' '.join(stdout) + metrics = {} + times = re.findall(TIME_REGEX, output) + for t in times: + key = self.snakeify_name(t[0]) + metrics[key] = float(t[1]) + return metrics + + def snakeify_name(self, s): + return '_'.join(s.strip().lower().split()) diff --git a/benchpress/tests/test_gapbs_parser.py b/benchpress/tests/test_gapbs_parser.py new file mode 100644 index 0000000..b9ad37f --- /dev/null +++ b/benchpress/tests/test_gapbs_parser.py @@ -0,0 +1,82 @@ +# Copyright (c) 2017-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +import unittest + +from benchpress.plugins.parsers.gapbs import GAPBSParser + + +class TestGAPBSParser(unittest.TestCase): + + def setUp(self): + self.parser = GAPBSParser() + + def test_bc_sample_output(self): + output = [ + 'Generate Time: 0.41289', + 'Build Time: 1.89460', + 'Graph has 1048576 nodes and 16776968 undirected edges for degree: 15', + ' a 0.00035', + 'source: 209629', + ' b 0.45253', + ' p 0.31504', + 'Trial Time: 0.76991', + 'Average Time: 0.76991', + ] + metrics = self.parser.parse(output, None, 0) + self.assertDictEqual({ + 'generate_time': 0.41289, + 'build_time': 1.89460, + 'trial_time': 0.76991, + 'average_time': 0.76991, + }, metrics) + + def test_bfs_sample_ouput(self): + output = [ + 'Generate Time: 0.41075', + 'Build Time: 1.89220', + 'Graph has 1048576 nodes and 16776968 undirected edges for degree: 15', + 'Source: 209629', + ' i 0.00086', + ' td 29 0.00003', + ' td 872 0.00002', + ' td 27534 0.00049', + ' td 579473 0.01030', + ' e 0.00445', + ' bu 440667 0.01020', + ' bu 0 0.00044', + ' c 0.00073', + 'Trial Time: 0.02800', + 'Average Time: 0.02800', + ] + metrics = self.parser.parse(output, None, 0) + self.assertDictEqual({ + 'generate_time': 0.41075, + 'build_time': 1.89220, + 'trial_time': 0.02800, + 'average_time': 0.02800, + }, metrics) + + def test_tc_sample_output(self): + output = [ + 'Generate Time: 0.40949', + 'Build Time: 1.88401', + 'Graph has 1048576 nodes and 16776968 undirected edges for degree: 15', + 'Trial Time: 2.45414', + 'Average Time: 2.45414', + ] + metrics = self.parser.parse(output, None, 0) + self.assertDictEqual({ + 'generate_time': 0.40949, + 'build_time': 1.88401, + 'trial_time': 2.45414, + 'average_time': 2.45414, + }, metrics) + + +if __name__ == '__main__': + unittest.main() From 6c16e7407799e4e8f80b2e280f8b3267e240731c Mon Sep 17 00:00:00 2001 From: Carlos Torres Date: Thu, 21 Jun 2018 19:13:50 -0700 Subject: [PATCH 3/3] [benchpress] Add GAP benchmark suite job --- benchpress/jobs/jobs.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/benchpress/jobs/jobs.yml b/benchpress/jobs/jobs.yml index e745884..ad61d0c 100644 --- a/benchpress/jobs/jobs.yml +++ b/benchpress/jobs/jobs.yml @@ -1,5 +1,5 @@ - benchmark: schbench - name: schbench default + name: schbench default description: defaults for schbench args: message-threads: 2 @@ -72,3 +72,23 @@ scale-factor: 1 runtime: 1 +- benchmark: gapbs_bc + name: gapbs_bc + description: GAP bc benchmark + args: + - -u 21 + - -n 1 + +- benchmark: gapbs_bfs + name: gapbs_bfs + description: GAP bfs benchmark + args: + - -u 21 + - -n 1 + +- benchmark: gapbs_tc + name: gapbs_tc + description: GAP tc benchmark + args: + - -u 21 + - -n 1