From e12ba0e3d6491a693ce63fe07f26b8d17ad5da5c Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Thu, 1 Jun 2017 22:56:07 +0200 Subject: rumba: take into account DIFs that don't use nor are used by other DIFs These DIFs needs to be considered for the Kahn algorithm and computation of IPCPs. Closes #11. --- rumba/model.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rumba') diff --git a/rumba/model.py b/rumba/model.py index ccd60df..eee8fac 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -328,6 +328,10 @@ class Experiment: difsdeps_inc = dict() for node in self.nodes: + for dif in node.difs: + if dif not in difsdeps_adj: + difsdeps_adj[dif] = set() + for upper in node.dif_registrations: for lower in node.dif_registrations[upper]: if upper not in difsdeps_inc: @@ -349,6 +353,14 @@ class Experiment: difsdeps_inc_cnt[dif] = len(difsdeps_inc[dif]) del difsdeps_inc + # Init difsdeps_inc_cnt for those DIFs that do not + # act as lower IPCPs nor upper IPCPs for registration + # operations + for node in self.nodes: + for dif in node.difs: + if dif not in difsdeps_inc_cnt: + difsdeps_inc_cnt[dif] = 0 + # Run Kahn's algorithm to compute topological # ordering on the DIFs graph. frontier = set() -- cgit v1.2.3