Bläddra i källkod

Monitor other parts as well for calibration

Yentl Van Tendeloo 7 år sedan
förälder
incheckning
2c69169496
3 ändrade filer med 42 tillägg och 37 borttagningar
  1. 17 17
      calibration/averages
  2. 17 17
      calibration/plot
  3. 8 3
      model/model.py

+ 17 - 17
calibration/averages

@@ -1,17 +1,17 @@
-           read_root: 0.00001406669616699
-           read_dict: 0.00000460127038355
-      read_dict_keys: 0.00001678063432883
-          read_value: 0.00000388661630500
-      read_dict_node: 0.00001020808859528
-     rule_generation: 0.00001543215873893
-      read_dict_edge: 0.00000642558526942
-         create_node: 0.00000379181167487
-    create_nodevalue: 0.00000501364247391
-         create_dict: 0.00001028065706205
-         delete_edge: 0.00000683382081240
-         delete_node: 0.00004755891187096
-   read_reverse_dict: 0.00002557890755790
-         create_edge: 0.00000601282282066
-       read_outgoing: 0.00000520600098073
-       read_incoming: 0.00000645903181994
-           read_edge: 0.00000449162172644
+           read_root: 0.00000500679016113
+           read_dict: 0.00000324786201673
+      read_dict_keys: 0.00002278351202244
+          read_value: 0.00000223726274447
+      read_dict_node: 0.00000884923806336
+     rule_generation: 0.00001658272065641
+      read_dict_edge: 0.00000503007239812
+         create_node: 0.00000235550958786
+    create_nodevalue: 0.00000342790120932
+         create_dict: 0.00000898999470544
+         delete_edge: 0.00000574856703713
+         delete_node: 0.00005147345229607
+   read_reverse_dict: 0.00002517559631071
+         create_edge: 0.00000452628852102
+       read_outgoing: 0.00000310150921679
+       read_incoming: 0.00000545786254067
+           read_edge: 0.00000285873549026

+ 17 - 17
calibration/plot

@@ -1,7 +1,7 @@
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=4.2200088501e-05
+max=1.50203704834e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -14,7 +14,7 @@ plot 'calibration/distribution_read_root' u (rounded($1)):(1) smooth freq w boxe
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.38038111507e-05
+max=9.74358605018e-06
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -27,7 +27,7 @@ plot 'calibration/distribution_read_dict' u (rounded($1)):(1) smooth freq w boxe
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=5.03419029865e-05
+max=6.83505360673e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -40,7 +40,7 @@ plot 'calibration/distribution_read_dict_keys' u (rounded($1)):(1) smooth freq w
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.1659848915e-05
+max=6.7117882334e-06
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -53,7 +53,7 @@ plot 'calibration/distribution_read_value' u (rounded($1)):(1) smooth freq w box
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=3.06242657858e-05
+max=2.65477141901e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -66,7 +66,7 @@ plot 'calibration/distribution_read_dict_node' u (rounded($1)):(1) smooth freq w
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=4.62964762168e-05
+max=4.97481619692e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -79,7 +79,7 @@ plot 'calibration/distribution_rule_generation' u (rounded($1)):(1) smooth freq
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.92767558082e-05
+max=1.50902171944e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -92,7 +92,7 @@ plot 'calibration/distribution_read_dict_edge' u (rounded($1)):(1) smooth freq w
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.13754350246e-05
+max=7.06652876357e-06
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -105,7 +105,7 @@ plot 'calibration/distribution_create_node' u (rounded($1)):(1) smooth freq w bo
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.50409274217e-05
+max=1.02837036279e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -118,7 +118,7 @@ plot 'calibration/distribution_create_nodevalue' u (rounded($1)):(1) smooth freq
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=3.08419711862e-05
+max=2.69699841163e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -131,7 +131,7 @@ plot 'calibration/distribution_create_dict' u (rounded($1)):(1) smooth freq w bo
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=2.05014624372e-05
+max=1.72457011114e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -144,7 +144,7 @@ plot 'calibration/distribution_delete_edge' u (rounded($1)):(1) smooth freq w bo
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=0.000142676735613
+max=0.000154420356888
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -157,7 +157,7 @@ plot 'calibration/distribution_delete_node' u (rounded($1)):(1) smooth freq w bo
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=7.67367226737e-05
+max=7.55267889321e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -170,7 +170,7 @@ plot 'calibration/distribution_read_reverse_dict' u (rounded($1)):(1) smooth fre
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.8038468462e-05
+max=1.3578865563e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -183,7 +183,7 @@ plot 'calibration/distribution_create_edge' u (rounded($1)):(1) smooth freq w bo
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.56180029422e-05
+max=9.30452765038e-06
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -196,7 +196,7 @@ plot 'calibration/distribution_read_outgoing' u (rounded($1)):(1) smooth freq w
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.93770954598e-05
+max=1.6373587622e-05
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder
@@ -209,7 +209,7 @@ plot 'calibration/distribution_read_incoming' u (rounded($1)):(1) smooth freq w
 set terminal postscript enhanced colour portrait size 6,6
 set xtics rotate by -45
 n = 20
-max=1.34748651793e-05
+max=8.57620647079e-06
 width=max/n
 set boxwidth width absolute
 set style fill solid 1.0 noborder

+ 8 - 3
model/model.py

@@ -100,8 +100,9 @@ class ModelverseState(AtomicDEVS):
             self.state.output = []
             self.state.timer = 0.0
             for v in self.state.queue[0]:
+                f = getattr(self.state.mvs, translate(v[0]))
                 start = time.time()
-                self.state.output.append(getattr(self.state.mvs, translate(v[0]))(*v[1]))
+                self.state.output.append(f(*v[1]))
                 if PROFILE:
                     print("%s: %.17f" % (translate(v[0]), time.time() - start))
                 self.state.timer += self.timings[translate(v[0])]
@@ -121,7 +122,11 @@ class ModelverseState(AtomicDEVS):
             # Value contains a list of operations to do
             # So do them and calculate how long it takes
             for v in self.state.queue[0]:
-                self.state.output.append(getattr(self.state.mvs, translate(v[0]))(*v[1])[0])
+                f = getattr(self.state.mvs, translate(v[0]))
+                start = time.time()
+                self.state.output.append(f(*v[1]))
+                if PROFILE:
+                    print("%s: %.17f" % (translate(v[0]), time.time() - start))
                 self.state.timer += self.timings[translate(v[0])]
         else:
             self.state.timer = float("inf")
@@ -235,7 +240,7 @@ class ModelverseKernel(AtomicDEVS):
                     commands = [("RV", [self.state.tasks[0]])]
                 else:
                     self.state.current_task = self.state.reply[0]
-                    print("Processing task %s at time %s" % (self.state.current_task, self.time_last))
+                    #print("Processing task %s at time %s" % (self.state.current_task, self.time_last))
                     self.state.start_task_time = self.state.current_time
                     if self.state.current_task.startswith("__"):
                         # Don't process this task and force termination of task