*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 09d27cb0 authored by android172's avatar android172
Browse files

Added BVH build times to report.

parent 81dbafa1
No related branches found
No related tags found
No related merge requests found
......@@ -228,10 +228,10 @@
\newpage
\section{Render Times}
\begin{tabular}{l|c|c}%
\bfseries Scene & \bfseries Time (sec) & \bfseries Timeout (sec)% specify table head
\csvreader[no head]{times.csv}{1=\one,2=\two,3=\three}% use head of csv as column names
{\\\hline \one & \two & \three}% specify your coloumns here
\begin{tabular}{l|c|c|c}%
\bfseries Scene & \bfseries BVH Build (sec) & \bfseries Render (sec) & \bfseries Timeout (sec)% specify table head
\csvreader[no head]{times.csv}{1=\one,2=\two,3=\three,4=\four}% use head of csv as column names
{\\\hline \one & \two & \three & \four}% specify your columns here
\end{tabular}
\end{document}
......@@ -42,6 +42,19 @@ def find_build_directory():
return os.path.join(root, "../build")
return os.path.join(root, "build")
def extract_times(text_log):
import regex as re
pattern_1 = r'# benchmark # Building the acceleration structure took: (.*) s'
pattern_2 = r'# benchmark # Rendering took: (.*) s'
match_1 = re.search(pattern_1, text_log)
match_2 = re.search(pattern_2, text_log)
build_time = match_1.group(1) if match_1 else "-"
render_time = match_2.group(1) if match_2 else "-"
return build_time, render_time
def test_warps_and_scenes():
total = len(TEST_SCENES) + len(TEST_WARPS)
......@@ -54,22 +67,25 @@ def test_warps_and_scenes():
for t, to, skip, skip_to in RENDER_SCENES:
if (skip and os.path.exists(skip)) or (skip_to and os.path.exists(skip_to)):
times_output.write(t.replace("_", "\_") + ", skipped, " + str(round(to, 2)) + "\n")
times_output.write(t.replace("_", "\_") + ", -, skipped, " + str(round(to, 2)) + "\n")
continue
path = t
try:
start_time = time.time()
ret = subprocess.call([os.path.join(build_dir, "nori"), path, "--no-gui"], timeout=to)
end_time = time.time()
elapsed_time = end_time - start_time
#elapsed_time_ms = elapsed_time * 1000
if ret == 0:
times_output.write(t.replace("_", "\_") + ", " + str(round(elapsed_time, 2)) + ", " + str(round(to, 2)) + "\n")
ret: subprocess.CompletedProcess = subprocess.run(
[os.path.join(build_dir, "nori"), path, "--no-gui"],
timeout=to,
capture_output=True,
text=True
)
if ret.returncode == 0:
build_time, render_time = extract_times(ret.stdout)
times_output.write(t.replace("_", "\_") + ", " + build_time + ", " + str(round(render_time, 2)) + ", " + str(round(to, 2)) + "\n")
else:
times_output.write(t.replace("_", "\_") + ", error, " + str(round(to, 2)) + "\n")
times_output.write(t.replace("_", "\_") + ", -, error, " + str(round(to, 2)) + "\n")
except subprocess.TimeoutExpired:
times_output.write(t.replace("_", "\_") + ", timeout, " + str(round(to, 2)) + "\n")
times_output.write(t.replace("_", "\_") + ", -, timeout, " + str(round(to, 2)) + "\n")
with open("to_" + t, 'w') as fp:
pass
......
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