Commit 507353fc authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

plot_comm_stream_nb_threads: better format size labels in plots and change x...

plot_comm_stream_nb_threads: better format size labels in plots and change x legend to "computing cores"
parent 49c56c77
import os
import re
import math
from matplotlib.ticker import FuncFormatter
HELP_OPT = "--help"
......@@ -23,6 +24,7 @@ bottom_limit = None
stream_top_limit = None
stream_bottom_limit = None
def get_title_prefix(working_directory):
for p in REMOVE_IN_PATH:
if working_directory.startswith(p):
......@@ -172,3 +174,14 @@ def get_comm_durations(lines):
previous_line = line
return results, is_bandwidth
def byte_formatter_func(x, pos):
if x / (1024 * 1024) >= 1:
return str(int(x / (1024 * 1024))) + " MB"
elif x / 1024 >= 1:
return str(int(x / 1024)) + " KB"
else:
return str(int(x)) + " B"
byte_formatter = FuncFormatter(byte_formatter_func)
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
import sys
import os
import re
......@@ -49,8 +48,8 @@ labels = {
}
x_labels = {
"byte": "Size of transmitted data (B)",
"thread": "Number of used Cores",
"byte": "Size of transmitted data",
"thread": "Number of computing Cores",
"cursor": "Arithmetic Intensity (FLOP/B)\n← Memory-bound ⇹ CPU-bound →"
}
......@@ -416,12 +415,8 @@ else:
if x_type == "byte":
ax.set_xscale("log", basex=2)
formatter = ScalarFormatter()
formatter.set_scientific(False)
formatter = FuncFormatter(byte_formatter)
ax.xaxis.set_major_formatter(formatter)
for tick in ax.get_xticklabels():
tick.set_rotation(90)
plt.subplots_adjust(bottom=0.25)
elif x_type == "cursor":
ax.set_xlim(left=x_range[0])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment