Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks: Add Benchmark - Add IB Loopback performance benchmark. #112

Merged
merged 19 commits into from
Jul 23, 2021
Merged
28 changes: 12 additions & 16 deletions superbench/benchmarks/micro_benchmarks/ib_loopback_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""Module of the IB loopback benchmarks."""

import os
import re
from pathlib import Path

from superbench.common.utils import logger
Expand Down Expand Up @@ -181,13 +180,11 @@ def _process_raw_result(self, cmd_idx, raw_output):

valid = False
content = raw_output.splitlines()
try:
metric_set = set()
for line in content:

metric_set = set()
for line in content:
try:
values = list(filter(None, line.split(' ')))
# Filter useless line
if len(values) != 5 or not re.match(r'\d+', values[0]) or not re.match(r'\d+.\d+', values[-2]):
cp5555 marked this conversation as resolved.
Show resolved Hide resolved
continue
# Extract value from the line
size = int(values[0])
avg_bw = float(values[-2])
Expand All @@ -197,16 +194,15 @@ def _process_raw_result(self, cmd_idx, raw_output):
metric_set.add(metric)
self._result.add_result(metric, avg_bw)
valid = True
except BaseException:
valid = False
finally:
if valid is False:
logger.error(
'The result format is invalid - round: {}, benchmark: {}, raw output: {}.'.format(
self._curr_run_index, self._name, raw_output
)
except BaseException:
pass
if valid is False:
logger.error(
'The result format is invalid - round: {}, benchmark: {}, raw output: {}.'.format(
self._curr_run_index, self._name, raw_output
)
return False
)
return False

return True

Expand Down