From cea750e4aa73b3b2c80bc77fea039d3d2862d21f Mon Sep 17 00:00:00 2001 From: Nick Aerts Date: Tue, 24 Apr 2018 21:20:15 +0200 Subject: experimentation: Fixed ordering of DT-flows The ordering of the DT-flows was causing issues when using full-mesh mode due to creating a disconnected graph of DT-flows. Changed the implementation to first create the MST-based flows and then augmenting these flows with the full-mesh flows. --- rumba/elements/experimentation.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rumba/elements/experimentation.py b/rumba/elements/experimentation.py index e8e3c27..da81c6c 100644 --- a/rumba/elements/experimentation.py +++ b/rumba/elements/experimentation.py @@ -307,6 +307,7 @@ class Experiment(object): # breadth-first traversal. enrolled = {first} frontier = {first} + dt_connected = set() while len(frontier): cur = frontier.pop() for edge in dif_graphs[dif][cur]: @@ -323,9 +324,9 @@ class Experiment(object): 'lower_dif': edge[1]}) self.mgmt_flows[-1].append({'src': enrollee, 'dst': enroller}) - if self.dt_strategy == 'minimal': - self.dt_flows[-1].append({'src': enrollee, - 'dst': enroller}) + self.dt_flows[-1].append({'src': enrollee, + 'dst': enroller}) + dt_connected.add((enrollee, enroller)) frontier.add(edge[0]) if len(dif.members) != len(enrolled): raise Exception("Disconnected DIF found: %s" % (dif,)) @@ -344,8 +345,10 @@ class Experiment(object): 'enroller': enroller, 'lower_dif': edge[1]}) if self.dt_strategy == 'full-mesh': - self.dt_flows[-1].append({'src': enrollee, - 'dst': enroller}) + if ((enrollee, enroller) not in dt_connected and + (enroller, enrollee) not in dt_connected): + self.dt_flows[-1].append({'src': enrollee, + 'dst': enroller}) if not (self.dt_strategy == 'minimal' or self.dt_strategy == 'full-mesh') \ -- cgit v1.2.3