aboutsummaryrefslogtreecommitdiff
path: root/rumba/elements/experimentation.py
diff options
context:
space:
mode:
Diffstat (limited to 'rumba/elements/experimentation.py')
-rw-r--r--rumba/elements/experimentation.py63
1 files changed, 20 insertions, 43 deletions
diff --git a/rumba/elements/experimentation.py b/rumba/elements/experimentation.py
index 5a86b6f..92d39f5 100644
--- a/rumba/elements/experimentation.py
+++ b/rumba/elements/experimentation.py
@@ -114,7 +114,7 @@ class Experiment(object):
log_dir=None,
prototype_logs=None,
enrollment_strategy='minimal',
- dt_strategy='full-mesh',
+ flows_strategy='full-mesh',
server_decorator=None):
"""
:param testbed: The testbed of the experiment.
@@ -144,18 +144,17 @@ class Experiment(object):
self.enrollment_strategy = enrollment_strategy # 'full-mesh', 'manual'
# the strategy employed for setting up the data transfer
# network in the DIFs after enrollment
- self.dt_strategy = dt_strategy
+ self.flows_strategy = flows_strategy
self.dif_ordering = []
self.enrollments = [] # a list of per-DIF lists of enrollments
- self.dt_flows = [] # a list of per-DIF lists of data transfer flows
- self.mgmt_flows = [] # a list of per-DIF lists of management flows
+ self.flows = [] # a list of per-DIF lists of flows
if self.enrollment_strategy not in ['full-mesh', 'minimal', 'manual']:
raise Exception('Unknown enrollment strategy "%s"'
% self.enrollment_strategy)
- if self.dt_strategy not in ['full-mesh', 'minimal', 'manual']:
- raise Exception('Unknown dt strategy "%s"'
- % self.dt_strategy)
+ if self.flows_strategy not in ['full-mesh', 'minimal', 'manual']:
+ raise Exception('Unknown flows strategy "%s"'
+ % self.flows_strategy)
# Determine log directory
if log_dir is None:
@@ -272,8 +271,7 @@ class Experiment(object):
def compute_enrollments(self):
dif_graphs = dict()
self.enrollments = []
- self.mgmt_flows = []
- self.dt_flows = []
+ self.flows = []
for dif in self.dif_ordering:
neighsets = dict()
@@ -303,8 +301,7 @@ class Experiment(object):
dif_graphs[dif][node1].append((node2, lower_dif))
self.enrollments.append([])
- self.dt_flows.append([])
- self.mgmt_flows.append([])
+ self.flows.append([])
if first is None:
# This is a shim DIF, nothing to do
@@ -318,8 +315,8 @@ class Experiment(object):
edge[0].name))
logger.debug("DIF graph for %s: %s", dif, ', '.join(er))
- # To generate the list of mgmt flows, minimal enrollments
- # and minimal dt flows, we simulate it, using
+ # To generate the list of minimal enrollments
+ # and minimal flows, we simulate it, using
# breadth-first traversal.
enrolled = {first}
frontier = {first}
@@ -338,10 +335,8 @@ class Experiment(object):
'enrollee': enrollee,
'enroller': enroller,
'lower_dif': edge[1]})
- self.mgmt_flows[-1].append({'src': enrollee,
- 'dst': enroller})
- self.dt_flows[-1].append({'src': enrollee,
- 'dst': enroller})
+ self.flows[-1].append({'src': enrollee,
+ 'dst': enroller})
frontier.add(edge[0])
if len(dif.members) != len(enrolled):
raise Exception("Disconnected DIF found: %s" % (dif,))
@@ -361,13 +356,13 @@ class Experiment(object):
'enrollee': enrollee,
'enroller': enroller,
'lower_dif': edge[1]})
- if self.dt_strategy == 'full-mesh':
- self.dt_flows[-1].append({'src': enrollee,
+ if self.flows_strategy == 'full-mesh':
+ self.flows[-1].append({'src': enrollee,
'dst': enroller})
edges_covered.add((enrollee, enroller))
- if not (self.dt_strategy == 'minimal'
- or self.dt_strategy == 'full-mesh') \
+ if not (self.flows_strategy == 'minimal'
+ or self.flows_strategy == 'full-mesh') \
or not (self.enrollment_strategy == 'full-mesh'
or self.enrollment_strategy == 'minimal'):
# This is a bug
@@ -383,16 +378,8 @@ class Experiment(object):
e['lower_dif']))
logger.debug(log_string)
- log_string = "Mgmt flows:\n"
- for el in self.mgmt_flows:
- for e in el:
- log_string += (" %s --> %s \n"
- % (e['src'].name,
- e['dst'].name))
- logger.debug(log_string)
-
- log_string = "Dt flows:\n"
- for el in self.dt_flows:
+ log_string = "Flows:\n"
+ for el in self.flows:
for e in el:
log_string += (" %s --> %s \n"
% (e['src'].name,
@@ -647,9 +634,8 @@ class Experiment(object):
return
try:
- for enroll, mgmt, dt in zip(self.enrollments,
- self.mgmt_flows,
- self.dt_flows):
+ for enroll, dt in zip(self.enrollments,
+ self.flows):
for e in enroll:
if e['dif'] is not dif:
continue
@@ -659,15 +645,6 @@ class Experiment(object):
color='black')
gvizg.add_edge(edge)
- for e in mgmt:
- if e['src'].dif is not dif:
- continue
-
- edge = pydot.Edge(e['src'].node.name,
- e['dst'].node.name,
- color='blue')
- gvizg.add_edge(edge)
-
for e in dt:
if e['src'].dif is not dif:
continue