diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..51e0bffda0b3b51b805adc43302cc6812a365e42 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "packages/algpath"] + path = packages/adaptive + url = https://gitlab.inria.fr/numag/algpath.git + branch = dev diff --git a/packages/adaptive b/packages/adaptive deleted file mode 100755 index a8d36a327954e29dd2daca108cf9f2e7bbaa9679..0000000000000000000000000000000000000000 Binary files a/packages/adaptive and /dev/null differ diff --git a/packages/adaptive b/packages/adaptive new file mode 160000 index 0000000000000000000000000000000000000000..68b4c4a6be8c3d30920a080fd638cd398de57ecf --- /dev/null +++ b/packages/adaptive @@ -0,0 +1 @@ +Subproject commit 68b4c4a6be8c3d30920a080fd638cd398de57ecf diff --git a/packages/adaptive.py b/packages/adaptive.py index 6388b03271e316fd11c50bd9b8920d5fa9567014..9e368230847400028f564d576df65cb64d9dd09d 100644 --- a/packages/adaptive.py +++ b/packages/adaptive.py @@ -1,12 +1,34 @@ import argparse +from pathlib import Path +import os +import subprocess parser = argparse.ArgumentParser() -parser.add_argument("file", help = "A file containing data test") -parser.add_argument("algpath_path", help = "A algpath binary that supports --arithmetic arb-reckless") +parser.add_argument("file", help="A file containing data test") +parser.add_argument( + "algpath_path", help="A algpath binary that supports --arithmetic arb-reckless") args = parser.parse_args() +# Build adaptive if not already built +algpath_bin_path = Path(args.algpath_path) / "target" / "release" / "algpath" +if not algpath_bin_path.exists(): + current_dir = os.getcwd() + print("Building algpath adaptive...") + print("Moving to " + str(Path(args.algpath_path).with_suffix(""))) + os.chdir(Path(args.algpath_path).with_suffix("")) + try: + _, _ = subprocess.Popen(["cargo", "build", "--release"]).communicate() + except: + print("Algpath build failure") + exit(1) + + print("Moving back to " + str(current_dir)) + os.chdir(current_dir) + +assert algpath_bin_path.exists() + command = open("command.sh", "w") command.write(f"""#!/bin/sh -{args.algpath_path} {args.file} --diff backward --homogenize --arithmetic arb-reckless --jobs 1""") -command.close() \ No newline at end of file +{algpath_bin_path} {args.file} --diff backward --homogenize --arithmetic arb-reckless --jobs 1""") +command.close() diff --git a/synthesize.py b/synthesize.py index 6a9858fec9c63ec03467310a40fccc81aa1ecb65..0e80059f0fcfcfa0da22ecc0765298d4ee55eb54 100644 --- a/synthesize.py +++ b/synthesize.py @@ -178,7 +178,9 @@ result_stats = { "q3steps": lambda res: steps_format(round(numpy.quantile([int(p) for p in res["steplist"] if p is not None], 0.75), 1)), "maxprec": lambda res: str(max([int(p) for p in res["maxpreclist"]])), "meanprec": lambda res: steps_format(numpy.mean([int(p) for p in res["meanpreclist"]])), + "maxmeanprec": lambda res: steps_format(max([int(p) for p in res["meanpreclist"]])), "wmeanprec": lambda res: steps_format(numpy.mean([int(p) for p in res["weightedmeanpreclist"]])), + "maxwmeanprec": lambda res: steps_format(max([int(p) for p in res["weightedmeanpreclist"]])), } def _table(data, branch, node):