Skip to content

Commit efc4951

Browse files
committed
<bug>[OMC script]: fixed time measurements
1 parent dabe73e commit efc4951

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/causalize/RLTest/omc/omc_script.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def run_omc_benchmarks(filename, valores_n, runs=10):
2727
print(f"Values of N: {valores_n}")
2828
print(f"Number of runs: {runs}\n")
2929

30-
omc_stages = ["Tearing", "Solve"]
30+
omc_stages = ["Causalize", "Tearing", "Solve"]
3131
resultados_totales = {}
3232

3333
for n in valores_n:
@@ -42,7 +42,6 @@ def run_omc_benchmarks(filename, valores_n, runs=10):
4242
f.write(modified_content);
4343

4444
command = ["omc", "-s", "--newBackend", "-d=dumpBackendClocks", temp_filename]
45-
#pattern = re.compile(r"^(.+?):\s*([\d.]+)\s*ms", re.MULTILINE)
4645
pattern = re.compile(r"^\s*([\w\s\d]+?)\.+\s*([\d.e+-]+)", re.MULTILINE)
4746
fases_tiempos = defaultdict(list)
4847

@@ -54,6 +53,8 @@ def run_omc_benchmarks(filename, valores_n, runs=10):
5453
try:
5554
result = subprocess.run(command, capture_output=True, text=True, check=True)
5655
output = result.stdout + result.stderr
56+
lineas = output.splitlines()
57+
output = "\n".join(lineas[19:])
5758

5859
matches = pattern.findall(output)
5960
for fase, tiempo_str in matches:
@@ -107,7 +108,7 @@ def run_omc_benchmarks(filename, valores_n, runs=10):
107108

108109
input_runs = int(sys.argv[1])
109110

110-
lista_n = [10**i for i in range(2, 5)]
111+
lista_n = [10**i for i in range(2, 3)]
111112

112113
model_list = ["TestRL1.mo", "TestRL2.mo", "TestRL3.mo"]
113114
for model in model_list:

0 commit comments

Comments
 (0)