Skip to content

Commit 71df69c

Browse files
authored
[scoreboard] Correct efficiency/acceleration for seq version (#550)
1 parent 34f0932 commit 71df69c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

scoreboard/main.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def load_performance_data(perf_stat_file_path):
6363
return perf_stats
6464

6565

66-
def calculate_performance_metrics(perf_val, eff_num_proc):
66+
def calculate_performance_metrics(perf_val, eff_num_proc, task_type):
6767
"""Calculate acceleration and efficiency from performance value."""
6868
acceleration = "?"
6969
efficiency = "?"
@@ -73,8 +73,14 @@ def calculate_performance_metrics(perf_val, eff_num_proc):
7373
perf_float == float("inf") or perf_float != perf_float
7474
):
7575
speedup = 1.0 / perf_float
76-
acceleration = f"{speedup:.2f}"
77-
efficiency = f"{speedup / eff_num_proc * 100:.2f}%"
76+
# For sequential code, acceleration and efficiency don't make sense
77+
# as it should be the baseline (speedup = 1.0 by definition)
78+
if task_type == "seq":
79+
acceleration = "1.00" # Sequential is the baseline
80+
efficiency = "N/A"
81+
else:
82+
acceleration = f"{speedup:.2f}"
83+
efficiency = f"{speedup / eff_num_proc * 100:.2f}%"
7884
except (ValueError, TypeError):
7985
pass
8086
return acceleration, efficiency
@@ -189,7 +195,7 @@ def main():
189195

190196
# Calculate acceleration and efficiency if performance data is available
191197
acceleration, efficiency = calculate_performance_metrics(
192-
perf_val, eff_num_proc
198+
perf_val, eff_num_proc, task_type
193199
)
194200

195201
# Calculate deadline penalty points

0 commit comments

Comments
 (0)