Commit 1b99bb2b authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

Fix plotting results in which alone comms were not executed

parent c705113c
......@@ -581,7 +581,7 @@ class CommCompGraph:
self._comp_metric = comp_metric
self._x_type = None
self._ax_right = None
self._last_used_color = None
self._current_color = next(self._colors)
self.per_core = False
self.comm_top_limit = None
self.comp_top_limit = None
......@@ -609,12 +609,16 @@ class CommCompGraph:
for i in range(0, nb_zones, 2):
self._ax.axvspan((i*x_span_zone) + 0.5, ((i+1)*x_span_zone)+0.5, facecolor="0.9", zorder=0.1)
@property
def nb_curves(self):
return self._nb_comm_curves + self._nb_comp_curves
def _add_curve(self, ax, line_values, label, curve_type, use_previous_color, min_values, max_values, display_line):
if (min_values is None and max_values is not None) or (min_values is not None and max_values is None):
raise Exception("You have to provide either both min and max values or none.")
if not use_previous_color:
self._last_used_color = next(self._colors)
if self.nb_curves > 0 and not use_previous_color:
self._current_color = next(self._colors)
line_style = "-"
if curve_type == CommCompGraphCurveType.PARALLEL:
......@@ -627,11 +631,11 @@ class CommCompGraph:
else:
curve_style = "."
ax.plot(self._x_range, line_values, curve_style, label=label, color=self._last_used_color)
ax.plot(self._x_range, line_values, curve_style, label=label, color=self._current_color)
if min_values is not None:
assert(max_values is not None)
ax.fill_between(self._x_range, min_values, max_values, linestyle=line_style, color=self._last_used_color, alpha=self._FILL_ALPHA)
ax.fill_between(self._x_range, min_values, max_values, linestyle=line_style, color=self._current_color, alpha=self._FILL_ALPHA)
def add_comm_curve(self, line_values, label, curve_type, use_previous_color=False, min_values=None, max_values=None, display_line=True):
self._add_curve(self._ax, line_values, label, curve_type, use_previous_color, min_values, max_values, display_line)
......@@ -733,7 +737,7 @@ class CommCompGraph:
self._ax_right.grid()
if self._nb_comm_curves + self._nb_comp_curves > 0 and self.display_legend:
if self.nb_curves > 0 and self.display_legend:
plt.subplots_adjust(top=shrink_plot_legend[max(self._nb_comm_curves, self._nb_comp_curves)], bottom=shrink_plot_x_label)
self._plotted = True
......
......@@ -129,7 +129,10 @@ def get_comm_durations(lines):
nb_values = 0
for line in lines:
if pattern.match(line) is not None:
if line.strip() == "# Communications with computing":
bandwidths.append([])
latencies.append([])
elif pattern.match(line) is not None:
values = line.split("-")
bandwidths[-1].append(float(values[0].split()[0].strip()))
latencies[-1].append(float(values[1].split()[0].strip()))
......
Supports Markdown
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