Selaa lähdekoodia

Minor tweaks to add all performance benchmarks in

Yentl Van Tendeloo 7 vuotta sitten
vanhempi
commit
953439a5e2
3 muutettua tiedostoa jossa 14 lisäystä ja 3 poistoa
  1. 11 0
      model/run_real.py
  2. 2 2
      scripts/sim_loop.py
  3. 1 1
      wrappers/modelverse_SCCD.py

+ 11 - 0
model/run_real.py

@@ -0,0 +1,11 @@
+from subprocess import call
+import time
+
+with open("real_execution_time", 'w') as f:
+    for _ in range(100):
+        start = time.time()
+        call(["pypy", "-m", "pytest", "integration/test_powerwindow.py", "-k", "fast", "-x"])
+        print("Time to execute: " + str(time.time() - start))
+        f.write(str(time.time() - start))
+        f.write("\n")
+        f.flush()

+ 2 - 2
scripts/sim_loop.py

@@ -19,12 +19,12 @@ def run_simulation(latency):
     from model import simulate
     latency_mvi, latency_mvs = latency
     print("SIMULATE for " + str(latency))
-    results[(latency_mvi, latency_mvs)] = result = simulate({"mvi2mvk_latency": 0.0, "mvk2mvs_latency": 0.0})
+    result = simulate({"mvi2mvk_latency": 0.0, "mvk2mvs_latency": 0.0})
     print("(%s, %s) --> %s" % (latency_mvi, latency_mvs, result))
     return result
 
 from multiprocessing import Pool
-pool = Pool(processors=4)
+pool = Pool(processes=4)
 results = pool.map(run_simulation, to_run)
 
 print(dict(to_run, results))

+ 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:   Thu Jan  4 15:47:25 2018
+Date:   Fri Jan  5 08:43:03 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server