forked from katelaan/harrsh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-benchmarks.py
41 lines (35 loc) · 1.5 KB
/
run-benchmarks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import sys
from pathlib import Path
from datetime import datetime
out_dir = sys.argv[1].rstrip("/")
directory = "examples/GSL/benchmarks/"
timeout_hour = 1
timeout_seconds = timeout_hour * 60 * 60
cases = [ "acyc-dll_dll.hrs",
"acyc-tll_tll.hrs",
"acyc-tll_tll_invalid.hrs",
"concat.hrs",
"concat_invalid.hrs",
"almost_linear_tree.hrs",
"almost_linear_tree_invalid.hrs",
"almost-linear-treep_treep.hrs",
"almost-linear-treep_treep_invalid.hrs",
"concat_simple.hrs",
"concat_simple_invalid.hrs",
"even-sll_sll.hrs",
"even-sll_sll_invalid.hrs",
"odd-or-even-sll_sll.hrs",
"sll_acyclic-sll.hrs",
"sll_acyclic-sll_invalid.hrs",
"sll_odd-or-even-sll.hrs",
"tree-depthtwo_tree.hrs",
"tree_tree-depthtwo.hrs" ]
Path(out_dir).mkdir(exist_ok=False)
print(f"Out dir: {out_dir}")
print(f"Timeout hours: {timeout_hour}\n")
for case in cases:
print(f"[{datetime.now().time()}] Running Harrsh '{case}'")
os.system(f"bash -c \"busybox time -v timeout {timeout_seconds} java -Xmx1000G -jar target/scala-2.13/harrsh-assembly-1.0.jar --entailment {directory}{case} &> {out_dir}/{case}_harrsh_log.txt\"")
print(f"[{datetime.now().time()}] Running GSL '{case}'")
os.system(f"bash -c \"busybox time -v timeout {timeout_seconds} java -Xmx1000G -jar target/scala-2.13/harrsh-assembly-1.0.jar --gsl {directory}{case} &> {out_dir}/{case}_gsl_log.txt\"")