aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-07-25 12:45:31 +0200
committerAdrian Kummerlaender2019-07-25 12:45:31 +0200
commit5033ada1807b9adf605839f0e0e03c9844a6fd65 (patch)
tree2186d1918ada7954726e86f92ca8931fb95b9ae3 /template
parent6e6624e5f90565e6b022f26fca1f32c5b28abed9 (diff)
downloadsymlbm_playground-5033ada1807b9adf605839f0e0e03c9844a6fd65.tar
symlbm_playground-5033ada1807b9adf605839f0e0e03c9844a6fd65.tar.gz
symlbm_playground-5033ada1807b9adf605839f0e0e03c9844a6fd65.tar.bz2
symlbm_playground-5033ada1807b9adf605839f0e0e03c9844a6fd65.tar.lz
symlbm_playground-5033ada1807b9adf605839f0e0e03c9844a6fd65.tar.xz
symlbm_playground-5033ada1807b9adf605839f0e0e03c9844a6fd65.tar.zst
symlbm_playground-5033ada1807b9adf605839f0e0e03c9844a6fd65.zip
Print MLUPS in standalone code
Diffstat (limited to 'template')
-rw-r--r--template/standalone.mako9
1 files changed, 9 insertions, 0 deletions
diff --git a/template/standalone.mako b/template/standalone.mako
index 6750de9..32763a3 100644
--- a/template/standalone.mako
+++ b/template/standalone.mako
@@ -1,6 +1,8 @@
#include <array>
#include <cstdint>
#include <memory>
+#include <chrono>
+#include <iostream>
<%
def pop_offset(i):
@@ -91,6 +93,8 @@ int main()
equilibrilize(f_prev, f_next, iCell);
}
+ const auto start = std::chrono::high_resolution_clock::now();
+
for (std::size_t iStep = 0; iStep < ${steps}; ++iStep) {
if (iStep % 2 == 0) {
f_next = f_a.get();
@@ -105,5 +109,10 @@ int main()
}
}
+ auto duration = std::chrono::duration_cast<std::chrono::duration<double>>(
+ std::chrono::high_resolution_clock::now() - start);
+
+ std::cout << "MLUPS: " << ${steps*geometry.volume}/(10e6*duration.count()) << std::endl;
+
return 0;
}