Skip to content
Snippets Groups Projects
Commit 14e30cca authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Use relative paths for costmodel verification logging

We do this from multiple subdirs
parent 1c3a8a27
No related branches found
No related tags found
No related merge requests found
...@@ -271,8 +271,7 @@ def level1_optimal_vectorization_strategy(sumfacts, width): ...@@ -271,8 +271,7 @@ def level1_optimal_vectorization_strategy(sumfacts, width):
print("The score in 'target' logic was: {}".format(strategy_cost((qp, optimal_strategies[qp])))) print("The score in 'target' logic was: {}".format(strategy_cost((qp, optimal_strategies[qp]))))
# Print the employed vectorization strategy into a file # Print the employed vectorization strategy into a file
from os.path import join filename = "targetstrat_{}.txt".format(int(float(get_form_option("vectorization_target"))))
filename = join(get_option("project_basedir"), "costmodel-verification", "targetstrat_{}.txt".format(int(float(get_form_option("vectorization_target")))))
with open(filename, 'w') as f: with open(filename, 'w') as f:
f.write("\n".join(stringify_vectorization_strategy((qp, optimal_strategies[qp])))) f.write("\n".join(stringify_vectorization_strategy((qp, optimal_strategies[qp]))))
...@@ -280,10 +279,9 @@ def level1_optimal_vectorization_strategy(sumfacts, width): ...@@ -280,10 +279,9 @@ def level1_optimal_vectorization_strategy(sumfacts, width):
from dune.testtools.parametertree.parser import parse_ini_file from dune.testtools.parametertree.parser import parse_ini_file
inifile = parse_ini_file(get_option("ini_file")) inifile = parse_ini_file(get_option("ini_file"))
identifier = inifile["identifier"] identifier = inifile["identifier"]
filename = join(get_option("project_basedir"), "costmodel-verification", "mapping.csv")
# TODO: Depending on the number of samples, we might need a file lock here. # TODO: Depending on the number of samples, we might need a file lock here.
with open(filename, 'a') as f: with open("mapping.csv", 'a') as f:
f.write(" ".join((identifier, str(cost), short_stringify_vectorization_strategy((qp, optimal_strategies[qp])))) + "\n") f.write(" ".join((identifier, str(cost), short_stringify_vectorization_strategy((qp, optimal_strategies[qp])))) + "\n")
return qp, optimal_strategies[qp] return qp, optimal_strategies[qp]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment