diff options
author | Nick Aerts <nick.aerts@ugent.be> | 2018-04-24 21:20:15 +0200 |
---|---|---|
committer | Nick Aerts <nick.aerts@ugent.be> | 2018-04-24 21:39:56 +0200 |
commit | cea750e4aa73b3b2c80bc77fea039d3d2862d21f (patch) | |
tree | 7a2db345aab4432bfecd296a512280703679b92b | |
parent | 865596357af3d8ea20333c756881e00c4a6106fb (diff) | |
download | rumba-cea750e4aa73b3b2c80bc77fea039d3d2862d21f.tar.gz rumba-cea750e4aa73b3b2c80bc77fea039d3d2862d21f.zip |
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.
-rw-r--r-- | rumba/elements/experimentation.py | 13 |
1 files 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') \ |