Pārlūkot izejas kodu

Sort formal parameters in export to resolve non-determinism in order

Yentl Van Tendeloo 7 gadi atpakaļ
vecāks
revīzija
923d13fe79

+ 5 - 0
kernel/modelverse_jit/jit.py

@@ -448,6 +448,11 @@ class ModelverseJit(object):
                 #NOTE Patch up strange links...
                 param_names = [i for i in param_names if i is not None]
                 param_vars = yield [("RD", [param_set_id, k]) for k in param_names]
+
+                #NOTE that variables might not be in the correct order, as we just read them out!
+                lst = sorted([(name, var) for name, var in zip(param_names, param_vars)])
+                param_vars = [i[1] for i in lst]
+                param_names = [i[0] for i in lst]
                 self.jitted_parameters[body_id] = (param_vars, param_names, is_mutable)
 
         raise primitive_functions.PrimitiveFinished(self.jitted_parameters[body_id])

+ 0 - 3
state/modelverse_state/main.py

@@ -176,8 +176,6 @@ class ModelverseState(object):
 
     def create_dict(self, source, data, destination):
         if source not in self.nodes and source not in self.edges:
-            if destination is not None:
-                print("CREATE DICT FAILED FOR " + str(locals()))
             return None
         elif destination not in self.nodes and destination not in self.edges:
             return None
@@ -230,7 +228,6 @@ class ModelverseState(object):
             del self.cache[node][value]
         except KeyError:
             # Didn't exist
-            #print("No such entry: " + str(locals()))
             pass
         except:
             raise

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Tue Apr 24 07:27:14 2018
+Date:   Tue Apr 24 09:20:59 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server