From 645e316ce5997b4e0c57535e096b583a38736d48 Mon Sep 17 00:00:00 2001
From: Daniel Maier <daniel.maier@tu-berlin.de>
Date: Tue, 2 Oct 2018 14:08:25 +0200
Subject: [PATCH] collect data for fdtd-2d

---
 collect_data.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/collect_data.sh b/collect_data.sh
index 8746d98..b6db562 100755
--- a/collect_data.sh
+++ b/collect_data.sh
@@ -181,6 +181,31 @@ seidel_2d() {
     rm "$tmpfile"
 }
 
+fdtd_2d() {
+    target=codes/fdtd-2d/fdtd-2d
+
+    # accurate
+    output="$(dirname ${target})/$(basename ${target})"
+    compile "${output}.c" "${output}" "codes/fdtd-2d/data.o"
+    printf "fdtd-2d,,," >> ${LOG}
+    ./${output} >> ${LOG}
+
+    get_scop "${target}.c" "${target}_perf.c"
+    get_info "${target}.c.openscop"
+
+    while read x y; do
+        output="$(dirname ${target})/${x}_${y}_$(basename ${target})"
+        perforate "${target}.c" "${output}.c" "$x" "$y"
+        echo compile "${output}.c" "${output}"
+        compile "${output}.c" "${output}" "codes/fdtd-2d/data.o"
+        printf "fdtd-2d,%s,%s," "${x}" "${y}" >> ${LOG}
+        ./${output} >> ${LOG}
+    done < $tmpfile
+
+    rm "$tmpfile"
+}
+
+
 hotspot() {
     target=codes/hotspot/hotspot_openmp
 
@@ -211,3 +236,4 @@ floyd_warshall
 hotspot
 doitgen
 seidel_2d
+fdtd_2d
-- 
GitLab