@@ -63,7 +63,7 @@ def load_performance_data(perf_stat_file_path):
63
63
return perf_stats
64
64
65
65
66
- def calculate_performance_metrics (perf_val , eff_num_proc ):
66
+ def calculate_performance_metrics (perf_val , eff_num_proc , task_type ):
67
67
"""Calculate acceleration and efficiency from performance value."""
68
68
acceleration = "?"
69
69
efficiency = "?"
@@ -73,8 +73,14 @@ def calculate_performance_metrics(perf_val, eff_num_proc):
73
73
perf_float == float ("inf" ) or perf_float != perf_float
74
74
):
75
75
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} %"
78
84
except (ValueError , TypeError ):
79
85
pass
80
86
return acceleration , efficiency
@@ -189,7 +195,7 @@ def main():
189
195
190
196
# Calculate acceleration and efficiency if performance data is available
191
197
acceleration , efficiency = calculate_performance_metrics (
192
- perf_val , eff_num_proc
198
+ perf_val , eff_num_proc , task_type
193
199
)
194
200
195
201
# Calculate deadline penalty points
0 commit comments