[CT414]: Assignment 2 results

This commit is contained in:
2025-03-24 00:47:26 +00:00
parent a5bb33e012
commit be4f004bcd
11 changed files with 378 additions and 290 deletions

View File

@ -0,0 +1,27 @@
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv('performance_results.csv')
def save_heatmap(metric, title, filename):
pivot = df.pivot(index='MapLines', columns='ReduceWords', values=metric)
plt.figure(figsize=(8, 6))
sns.heatmap(
pivot,
annot=True,
fmt="d",
cmap="RdYlGn_r",
cbar_kws={'label': 'Time (ms)'}
)
plt.title(title)
plt.ylabel("Lines per Map Thread")
plt.xlabel("Words per Reduce Thread")
plt.tight_layout()
plt.savefig(filename)
plt.close()
print(f"Saved: {filename}")
save_heatmap('TotalTime', 'Total Time (ms)', '../latex/images/total_time_heatmap.png')
save_heatmap('MapTime', 'Map Time (ms)', '../latex/images/map_time_heatmap.png')
save_heatmap('ReduceTime', 'Reduce Time (ms)', '../latex/images/reduce_time_heatmap.png')