Skip to content

Commit

Permalink
Merge pull request #61 from bibrakc/59-update-the-scripts-for-collect…
Browse files Browse the repository at this point in the history
…ing-results

59 update the scripts for collecting results
  • Loading branch information
bibrakc authored Apr 25, 2024
2 parents 0d6b6b9 + c882822 commit cce5013
Show file tree
Hide file tree
Showing 11 changed files with 393 additions and 58 deletions.
17 changes: 9 additions & 8 deletions Analytics/Animations/cca_chip_active_status_animation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
BSD 3-Clause License
Copyright (c) 2023, Bibrak Qamar
Copyright (c) 2023-2024, Bibrak Qamar
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -206,7 +206,7 @@ def update(frame):
frames_to_show = cycles - start_from
# Create the animation
ani = animation.FuncAnimation(
fig, update, frames=range(0, frames_to_show, skip_frames), interval=70
fig, update, frames=range(0, frames_to_show, skip_frames), interval=10
) # Increase the interval

# Set the grid cell size and ticks
Expand All @@ -221,9 +221,9 @@ def update(frame):
ax.set_ylabel("Rows of Compute Cells", fontsize=16)
# Add a larger second title
routing_algorithm = "Dimension Ordered Horizontal First Routing"
graph_size = "Random Directed Graph V=36K and E=0.66M"
graph_size = "RMAT Directed Graph V=65K and E=1.04M"
plt.suptitle(
"Asynchronous SSSP on a CCA Chip of "
"Asynchronous BFS on a CCA Chip of "
+ str(dim_x)
+ " x "
+ str(dim_y)
Expand All @@ -234,16 +234,17 @@ def update(frame):
fontsize=16,
)


TH="ON"
SH="ON"
output_filename = (
"SSSP_TH_OFF_" + str(dim_x) + "x" + str(dim_y) + "_" + routing_algorithm
"BFS_" + str(dim_x) + "x" + str(dim_y) + "_th_" + TH + "_SH" + SH
)
# Save the animation as an MP4 file
""" ani.save(output_filename+'.mp4', writer='ffmpeg', dpi=520) """

# Save the animation as a GIF file
""" ani.save(output_filename+'.gif', writer='pillow', dpi=100) """
ani.save(output_filename+'.gif', writer='pillow', dpi=100)
# ani.save(output_filename, writer='pillow', dpi=70, interval=50)

# Display the plot
plt.show()
#plt.show()
52 changes: 47 additions & 5 deletions Analytics/Post_Processing/post_processing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
BSD 3-Clause License
Copyright (c) 2023, Bibrak Qamar
Copyright (c) 2023-2024, Bibrak Qamar
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -119,7 +119,13 @@

# read the header line for the table and discard it
header = file.readline()
queues_configuration = file.readline().strip().split()
queues_configuration, action_queue_size, diffuse_queue_size = (
file.readline().strip().split()
)

# read the header line for the table and discard it
header = file.readline()
ghost_children_max = file.readline().strip().split()

# read the header line for the table and discard it
header = file.readline()
Expand All @@ -131,6 +137,12 @@
total_actions_created,
total_actions_performed,
total_actions_false_pred,
total_diffusions_created,
total_diffusions_performed,
total_diffusions_false_pred,
total_diffusions_filtered,
total_actions_overlaped,
total_diffusions_pruned,
operons_moved,
) = (
file.readline().strip().split()
Expand All @@ -143,6 +155,12 @@
actions_created,
actions_performed,
actions_false_pred,
diffusions_created,
diffusions_performed,
diffusions_false_pred,
diffusions_filtered,
actions_overlaped,
diffusions_pruned,
operons_moved,
) = map(
int,
Expand All @@ -152,6 +170,12 @@
total_actions_created,
total_actions_performed,
total_actions_false_pred,
total_diffusions_created,
total_diffusions_performed,
total_diffusions_false_pred,
total_diffusions_filtered,
total_actions_overlaped,
total_diffusions_pruned,
operons_moved,
],
)
Expand Down Expand Up @@ -191,10 +215,28 @@
total_actions_created,
total_actions_performed,
total_actions_false_pred,
total_diffusions_created,
total_diffusions_performed,
total_diffusions_false_pred,
)
print(
"congestion_policy: ",
congestion_policy,
", value: ",
congestion_threshold_value,
)
print(
"avg_objects_per_cc: ",
avg_objects_per_cc,
)
print(
"queues_configuration: ",
queues_configuration,
"action_queue_size: ",
action_queue_size,
", diffuse_queue_size: ",
diffuse_queue_size,
)
print("congestion_policy: ", congestion_policy, ", value: ", congestion_threshold_value)
print("avg_objects_per_cc: ", avg_objects_per_cc)
print("queues_configuration: ", queues_configuration)
# print(cc_id, cc_x, cc_y, created, pushed, invoked, performed, false_pred,
# stall_logic, stall_recv, stall_send, res_usage, inactive)

Expand Down
65 changes: 53 additions & 12 deletions Analytics/Post_Processing/post_processing_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
BSD 3-Clause License
Copyright (c) 2023, Bibrak Qamar
Copyright (c) 2023-2024, Bibrak Qamar
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -121,7 +121,13 @@

# read the header line for the table and discard it
header = file.readline()
queues_configuration = file.readline().strip().split()
queues_configuration, action_queue_size, diffuse_queue_size = (
file.readline().strip().split()
)

# read the header line for the table and discard it
header = file.readline()
ghost_children_max = file.readline().strip().split()

# read the header line for the table and discard it
header = file.readline()
Expand All @@ -133,6 +139,12 @@
total_actions_created,
total_actions_performed,
total_actions_false_pred,
total_diffusions_created,
total_diffusions_performed,
total_diffusions_false_pred,
total_diffusions_filtered,
total_actions_overlaped,
total_diffusions_pruned,
operons_moved,
) = (
file.readline().strip().split()
Expand All @@ -145,6 +157,12 @@
actions_created,
actions_performed,
actions_false_pred,
diffusions_created,
diffusions_performed,
diffusions_false_pred,
diffusions_filtered,
actions_overlaped,
diffusions_pruned,
operons_moved,
) = map(
int,
Expand All @@ -154,6 +172,12 @@
total_actions_created,
total_actions_performed,
total_actions_false_pred,
total_diffusions_created,
total_diffusions_performed,
total_diffusions_false_pred,
total_diffusions_filtered,
total_actions_overlaped,
total_diffusions_pruned,
operons_moved,
],
)
Expand All @@ -171,7 +195,7 @@

# read the per cycle active status data
active_status_per_cycle = [] # stores the active status
for i in range(0, 3): # cycles all cycles
for i in range(0, cycles): # cycles all cycles
line = file.readline()
line = line.strip().split("\t")
cycle = int(line[0])
Expand All @@ -193,9 +217,26 @@
total_actions_created,
total_actions_performed,
total_actions_false_pred,
total_diffusions_created,
total_diffusions_performed,
total_diffusions_false_pred,
)
print(
"congestion_policy: ",
congestion_policy,
", value: ",
congestion_threshold_value,
)
print(
"avg_objects_per_cc: ",
avg_objects_per_cc,
)
print(
"action_queue_size: ",
action_queue_size,
", diffuse_queue_size: ",
diffuse_queue_size,
)
print("congestion_policy: ", congestion_policy, ", value: ", congestion_threshold_value)
print("avg_objects_per_cc: ", avg_objects_per_cc)
# print(cc_id, cc_x, cc_y, created, pushed, invoked, performed, false_pred,
# stall_logic, stall_recv, stall_send, res_usage, inactive)

Expand Down Expand Up @@ -228,7 +269,7 @@ def congestion_charts():
# Flatten the axes array to easily iterate over subplots
axes = axes.flatten()

bins = 30
bins = 15

# blue: '#2F5597'
# red: '#B00002'
Expand All @@ -238,27 +279,27 @@ def congestion_charts():
x="left_send_contention_total",
bins=bins,
ax=axes[0],
color="#2F5597",
color="#B00002",
)
axes[0].set_xlabel("") # Remove x-axis label for the second subplot
sns.histplot(
data=stats, x="up_send_contention_total", bins=bins, ax=axes[1], color="#2F5597"
data=stats, x="up_send_contention_total", bins=bins, ax=axes[1], color="#B00002"
)
axes[1].set_xlabel("") # Remove x-axis label for the second subplot
sns.histplot(
data=stats,
x="right_send_contention_total",
bins=bins,
ax=axes[2],
color="#2F5597",
color="#B00002",
)
axes[2].set_xlabel("") # Remove x-axis label for the second subplot
sns.histplot(
data=stats,
x="down_send_contention_total",
bins=bins,
ax=axes[3],
color="#2F5597",
color="#B00002",
)
axes[3].set_xlabel("") # Remove x-axis label for the second subplot

Expand All @@ -276,8 +317,8 @@ def congestion_charts():
for ax in axes:
ax.xaxis.set_major_formatter(FuncFormatter(thousands_formatter))
ax.yaxis.set_major_formatter(FuncFormatter(thousands_formatter))
ax.set_xlim(0, 400000) # Set the x-axis limit
ax.set_ylim(0, 5900) # Set the y-axis limit
# ax.set_xlim(0, 400000) # Set the x-axis limit
ax.set_ylim(0, 2500) # Set the y-axis limit

# Adjust spacing between subplots
plt.tight_layout()
Expand Down
10 changes: 8 additions & 2 deletions Include/CCASimulator.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
BSD 3-Clause License
Copyright (c) 2023, Bibrak Qamar
Copyright (c) 2023-2024, Bibrak Qamar
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -269,11 +269,14 @@ class CCASimulator
<< "\t" << curently_congested_threshold << "\n";

std::string queues_text = "single";
u_int32_t size_of_diffuse_queue = 0;
if (split_queues) {
queues_text = "split";
size_of_diffuse_queue = diffuse_queue_size;
}

os << "queues_configuration\n" << queues_text << "\n";
os << "queues_configuration\n"
<< queues_text << "\t" << action_queue_size << "\t" << size_of_diffuse_queue << "\n";

os << "ghost_children_max\n" << ghost_children_max << "\n";
}
Expand All @@ -295,8 +298,11 @@ class CCASimulator
os << "Cycle#\tCells_Active_Percent\tHtree_Active_Percent\n";
if constexpr (active_percent_switch) {
for (size_t i = 0; i < this->cca_statistics.active_status.size(); i++) {
// Print to output file for every output_skip_cycles-th cycle.
// if (i % output_skip_cycles == 0) {
os << i << "\t" << this->cca_statistics.active_status[i].cells_active_percent
<< "\t" << this->cca_statistics.active_status[i].htree_active_percent << "\n";
//}
}
} else {
// Invalid values just to preserve format.
Expand Down
Loading

0 comments on commit cce5013

Please sign in to comment.