Skip to content

Commit 7c8bd08

Browse files
committed
[scoreboard] Fix for '?' in A and E columns
1 parent 63a5666 commit 7c8bd08

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

scoreboard/main.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
task_types = ["all", "mpi", "omp", "seq", "stl", "tbb"]
1515

16-
tasks_dir = Path("tasks")
16+
script_dir = Path(__file__).parent
17+
tasks_dir = script_dir.parent / "tasks"
1718

1819
directories = defaultdict(dict)
1920

@@ -46,7 +47,7 @@
4647

4748

4849
perf_stat_file_path = (
49-
Path(__file__).parent.parent / "build" / "perf_stat_dir" / "task_run_perf_table.csv"
50+
script_dir.parent / "build" / "perf_stat_dir" / "task_run_perf_table.csv"
5051
)
5152

5253
# Read and parse performance statistics CSV
@@ -93,12 +94,14 @@
9394

9495
perf_val = perf_stats.get(dir, {}).get(task_type, "?")
9596

96-
# Calculate efficiency if performance data is available
97+
# Calculate acceleration and efficiency if performance data is available
98+
acceleration = "?"
9799
efficiency = "?"
98100
try:
99101
perf_float = float(perf_val)
100102
if perf_float > 0:
101103
speedup = 1.0 / perf_float
104+
acceleration = f"{speedup:.2f}"
102105
efficiency = f"{speedup / eff_num_proc * 100:.2f}"
103106
except (ValueError, TypeError):
104107
pass
@@ -114,7 +117,11 @@
114117
"log",
115118
"-1",
116119
"--format=%ct",
117-
str(tasks_dir / (dir + ("_disabled" if status == "disabled" else "")) / task_type),
120+
str(
121+
tasks_dir
122+
/ (dir + ("_disabled" if status == "disabled" else ""))
123+
/ task_type
124+
),
118125
]
119126
result = subprocess.run(git_cmd, capture_output=True, text=True)
120127
if result.stdout.strip().isdigit():
@@ -130,6 +137,7 @@
130137
"solution_points": sol_points,
131138
"solution_style": solution_style,
132139
"perf": perf_val,
140+
"acceleration": acceleration,
133141
"efficiency": efficiency,
134142
"deadline_points": deadline_points,
135143
"plagiarised": is_cheated,

scoreboard/templates/index.html.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<td>{{ row.task }}</td>
3737
{% for cell in row.types %}
3838
<td style="text-align: center{% if cell.solution_style %};{{ cell.solution_style }}{% endif %}">{{ cell.solution_points }}</td>
39-
<td style="text-align: center;background-color: lavender;">{{ cell.perf }}</td>
39+
<td style="text-align: center;background-color: lavender;">{{ cell.acceleration }}</td>
4040
<td style="text-align: center;background-color: lavender;">{{ cell.efficiency }}</td>
4141
<td style="text-align: center;">{{ cell.deadline_points }}</td>
4242
<td style="text-align: center{% if cell.plagiarised %}; background-color: pink{% endif %}">{{ cell.plagiarism_points }}</td>

0 commit comments

Comments
 (0)