Skip to content

Commit 10ebcf1

Browse files
committed
Extract acceleration data from perf tests table
1 parent 0bb9995 commit 10ebcf1

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

@@ -67,6 +68,27 @@
6768
</tr>
6869
"""
6970

71+
72+
perf_stat_file_path = Path(__file__).parent.parent / "build" / "perf_stat_dir" / "task_run_perf_table.csv"
73+
74+
# Read and parse performance statistics CSV
75+
perf_stats = dict()
76+
if perf_stat_file_path.exists():
77+
with open(perf_stat_file_path, 'r', newline='') as csvfile:
78+
reader = csv.DictReader(csvfile)
79+
for row in reader:
80+
perf_stats[row[0]] = {
81+
"seq": row[1],
82+
"omp": row[2],
83+
"tbb": row[3],
84+
"stl": row[4],
85+
"all": row[5],
86+
"mpi": "N/A",
87+
}
88+
else:
89+
print(f"Warning: Performance stats CSV not found at {perf_stat_file_path}")
90+
91+
7092
for dir in sorted(directories.keys()):
7193
html_content += f"<tr><td>{dir}</td>"
7294
total_count = 0
@@ -81,7 +103,12 @@
81103
task_count += max_sol_points
82104
else:
83105
html_content += '<td style="text-align: center;">0</td>'
84-
html_content += '<td style="text-align: center;background-color: lavender;">0</td>'
106+
html_content += '<td style="text-align: center;background-color: lavender;">'
107+
if row[0] in perf_stats.keys():
108+
html_content += perf_stats[row[0]][task_type]
109+
else:
110+
html_content += '?'
111+
html_content += '</td>'
85112
html_content += '<td style="text-align: center;background-color: lavender;">0</td>'
86113
html_content += '<td style="text-align: center;">0</td>'
87114
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)