Skip to content

[scoreboard] Extract performance data #492

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion scoreboard/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from collections import defaultdict
import argparse
import yaml
import csv

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

Expand Down Expand Up @@ -67,6 +68,27 @@
</tr>
"""


perf_stat_file_path = Path(__file__).parent.parent / "build" / "perf_stat_dir" / "task_run_perf_table.csv"

# Read and parse performance statistics CSV
perf_stats = dict()
if perf_stat_file_path.exists():
with open(perf_stat_file_path, 'r', newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
perf_stats[row[0]] = {
"seq": row[1],
"omp": row[2],
"tbb": row[3],
"stl": row[4],
"all": row[5],
"mpi": "N/A",
}
else:
print(f"Warning: Performance stats CSV not found at {perf_stat_file_path}")


for dir in sorted(directories.keys()):
html_content += f"<tr><td>{dir}</td>"
total_count = 0
Expand All @@ -81,7 +103,12 @@
task_count += max_sol_points
else:
html_content += '<td style="text-align: center;">0</td>'
html_content += '<td style="text-align: center;background-color: lavender;">0</td>'
html_content += '<td style="text-align: center;background-color: lavender;">'
if row[0] in perf_stats.keys():
html_content += perf_stats[row[0]][task_type]
else:
html_content += '?'
html_content += '</td>'
html_content += '<td style="text-align: center;background-color: lavender;">0</td>'
html_content += '<td style="text-align: center;">0</td>'
is_cheated = \
Expand Down
18 changes: 18 additions & 0 deletions scripts/create_perf_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import re
import xlsxwriter
import csv

parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', help='Input file path (logs of perf tests, .txt)', required=True)
Expand Down Expand Up @@ -102,3 +103,20 @@
it_i = 1
it_j += 1
workbook.close()
# Dump CSV for performance times
csv_file = os.path.join(xlsx_path, table_name + '_perf_table.csv')
with open(csv_file, 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
# Write header: Task, SEQ, OMP, TBB, STL, ALL
writer.writerow(['Task', 'SEQ', 'OMP', 'TBB', 'STL', 'ALL'])
for task_name in sorted(result_tables[table_name].keys()):
seq_time = result_tables[table_name][task_name]['seq']
row = [
task_name,
1.0 if seq_time != 0 else '?',
(result_tables[table_name][task_name]['omp'] / seq_time) if seq_time != 0 else '?',
(result_tables[table_name][task_name]['tbb'] / seq_time) if seq_time != 0 else '?',
(result_tables[table_name][task_name]['stl'] / seq_time) if seq_time != 0 else '?',
(result_tables[table_name][task_name]['all'] / seq_time) if seq_time != 0 else '?',
]
writer.writerow(row)
Loading