Skip to content

Commit 6b56527

Browse files
committed
Extract acceleration data from perf tests table
1 parent 0f36edb commit 6b56527

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

scoreboard/main.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from collections import defaultdict
33
import argparse
44
import yaml
5+
import csv
56

67
task_types = ['all', 'mpi', 'omp', 'seq', 'stl', 'tbb']
78

@@ -64,6 +65,27 @@
6465
</tr>
6566
"""
6667

68+
69+
perf_stat_file_path = Path(__file__).parent.parent / "build" / "perf_stat_dir" / "task_run_perf_table.csv"
70+
71+
# Read and parse performance statistics CSV
72+
perf_stats = dict()
73+
if perf_stat_file_path.exists():
74+
with open(perf_stat_file_path, 'r', newline='') as csvfile:
75+
reader = csv.DictReader(csvfile)
76+
for row in reader:
77+
perf_stats[row[0]] = {
78+
"seq": row[1],
79+
"omp": row[2],
80+
"tbb": row[3],
81+
"stl": row[4],
82+
"all": row[5],
83+
"mpi": "N/A",
84+
}
85+
else:
86+
print(f"Warning: Performance stats CSV not found at {perf_stat_file_path}")
87+
88+
6789
for dir in sorted(directories.keys()):
6890
html_content += f"<tr><td>{dir}</td>"
6991
total_count = 0
@@ -78,7 +100,12 @@
78100
task_count += max_sol_points
79101
else:
80102
html_content += '<td style="text-align: center;">0</td>'
81-
html_content += '<td style="text-align: center;background-color: lavender;">0</td>'
103+
html_content += '<td style="text-align: center;background-color: lavender;">'
104+
if row[0] in perf_stats.keys():
105+
html_content += perf_stats[row[0]][task_type]
106+
else:
107+
html_content += '?'
108+
html_content += '</td>'
82109
html_content += '<td style="text-align: center;background-color: lavender;">0</td>'
83110
html_content += '<td style="text-align: center;">0</td>'
84111
is_cheated = \

scripts/create_perf_table.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import re
44
import xlsxwriter
5+
import csv
56

67
parser = argparse.ArgumentParser()
78
parser.add_argument('-i', '--input', help='Input file path (logs of perf tests, .txt)', required=True)
@@ -102,3 +103,20 @@
102103
it_i = 1
103104
it_j += 1
104105
workbook.close()
106+
# Dump CSV for performance times
107+
csv_file = os.path.join(xlsx_path, table_name + '_perf_table.csv')
108+
with open(csv_file, 'w', newline='') as csvfile:
109+
writer = csv.writer(csvfile)
110+
# Write header: Task, SEQ, OMP, TBB, STL, ALL
111+
writer.writerow(['Task', 'SEQ', 'OMP', 'TBB', 'STL', 'ALL'])
112+
for task_name in sorted(result_tables[table_name].keys()):
113+
seq_time = result_tables[table_name][task_name]['seq']
114+
row = [
115+
task_name,
116+
1.0 if seq_time != 0 else '?',
117+
(result_tables[table_name][task_name]['omp'] / seq_time) if seq_time != 0 else '?',
118+
(result_tables[table_name][task_name]['tbb'] / seq_time) if seq_time != 0 else '?',
119+
(result_tables[table_name][task_name]['stl'] / seq_time) if seq_time != 0 else '?',
120+
(result_tables[table_name][task_name]['all'] / seq_time) if seq_time != 0 else '?',
121+
]
122+
writer.writerow(row)

0 commit comments

Comments
 (0)