From fb1f5f668d2ac21e64cd8ae4b853dfd63d59b4d3 Mon Sep 17 00:00:00 2001 From: Daniel Maier <daniel.maier@tu-berlin.de> Date: Mon, 22 Oct 2018 14:34:22 +0200 Subject: [PATCH] new codes, adapt to perf2/info2 --- collect_data.sh | 152 +++++++++++++++++++++++++++++------------------- 1 file changed, 91 insertions(+), 61 deletions(-) diff --git a/collect_data.sh b/collect_data.sh index b6db562..9444841 100755 --- a/collect_data.sh +++ b/collect_data.sh @@ -1,25 +1,19 @@ #!/bin/sh -LOG=$(date +%F_%T).log +LOG=data_$(date +%F_%T).log PERF=./perforate.sh -INFO=./build/info - -tmpfile=$(mktemp) +INFO=./build/info2 get_scop() { $PERF -e "$1" } get_info() { + IFS=";" $INFO "$1"| \ - while read x y; do - echo "$x" "$y" - if [ "$y" -gt 0 ]; then - for yy in $(seq 0 "$y"); do - echo $x ${y}_${yy} - done - fi - done > "$tmpfile" + while read a x y; do + printf "%s %s\n" $x $y + done } perforate() { @@ -30,25 +24,18 @@ compile() { gcc -s -O3 -I../polybench-c-4.2.1-beta/utilities -I. -DPOLYBENCH_TIME -o "$2" ../polybench-c-4.2.1-beta/utilities/polybench.c "$1" -lm "$3" } -#get_scop "codes/heat-3d/heat-3d.c" "codes/heat-3d/heat-3d_perf.c" -#get_info "codes/heat-3d/heat-3d.c.openscop" -# -#while read x y; do -# perforate "codes/heat-3d/heat-3d.c" "heat-3d_perf.c" "$x" "$y" -#done < $tmpfile - correlation() { target=codes/correlation/correlation - # accurate + # accurate baseline + # FIXME: baseline is currently without pluto, we need also accurate+pluto output="$(dirname ${target})/$(basename ${target})" compile "${output}.c" "${output}" "-O3" printf "correlation,,," >> ${LOG} ./${output} >> ${LOG} get_scop "${target}.c" "${target}_perf.c" - get_info "${target}.c.openscop" - + get_info "${target}.c.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.c" "${output}.c" "$x" "$y" @@ -56,12 +43,10 @@ correlation() { compile "${output}.c" "${output}" "-O3" printf "correlation,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} >> ${LOG} - done < $tmpfile - - rm "$tmpfile" + done } -jacobi() { +jacobi_2d() { target=codes/jacobi-2d/jacobi-2d # accurate @@ -71,8 +56,7 @@ jacobi() { ./${output} >> ${LOG} get_scop "${target}.c" "${target}_perf.c" - get_info "${target}.c.openscop" - + get_info "${target}.c.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.c" "${output}.c" "$x" "$y" @@ -80,9 +64,7 @@ jacobi() { compile "${output}.c" "${output}" "codes/jacobi-2d/data.o" printf "jacobi-2d,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} >> ${LOG} - done < $tmpfile - - rm "$tmpfile" + done } deriche() { @@ -95,8 +77,7 @@ deriche() { ./${output} >> ${LOG} get_scop "${target}.c" "${target}_perf.c" - get_info "${target}.c.openscop" - + get_info "${target}.c.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.c" "${output}.c" "$x" "$y" @@ -104,9 +85,7 @@ deriche() { compile "${output}.c" "${output}" "codes/deriche/data.o" printf "deriche,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} >> ${LOG} - done < $tmpfile - - rm "$tmpfile" + done } floyd_warshall() { @@ -119,8 +98,7 @@ floyd_warshall() { ./${output} >> ${LOG} get_scop "${target}.c" "${target}_perf.c" - get_info "${target}.c.openscop" - + get_info "${target}.c.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.c" "${output}.c" "$x" "$y" @@ -128,9 +106,7 @@ floyd_warshall() { compile "${output}.c" "${output}" "codes/floyd-warshall/data.o" printf "floyd_warshall,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} >> ${LOG} - done < $tmpfile - - rm "$tmpfile" + done } doitgen() { @@ -143,8 +119,7 @@ doitgen() { ./${output} >> ${LOG} get_scop "${target}.c" "${target}_perf.c" - get_info "${target}.c.openscop" - + get_info "${target}.c.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.c" "${output}.c" "$x" "$y" @@ -152,9 +127,7 @@ doitgen() { compile "${output}.c" "${output}" "codes/doitgen/data.o" printf "doitgen,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} >> ${LOG} - done < $tmpfile - - rm "$tmpfile" + done } seidel_2d() { @@ -167,8 +140,7 @@ seidel_2d() { ./${output} >> ${LOG} get_scop "${target}.c" "${target}_perf.c" - get_info "${target}.c.openscop" - + get_info "${target}.c.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.c" "${output}.c" "$x" "$y" @@ -176,9 +148,7 @@ seidel_2d() { compile "${output}.c" "${output}" "codes/seidel-2d/data.o" printf "seidel-2d,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} >> ${LOG} - done < $tmpfile - - rm "$tmpfile" + done } fdtd_2d() { @@ -191,8 +161,7 @@ fdtd_2d() { ./${output} >> ${LOG} get_scop "${target}.c" "${target}_perf.c" - get_info "${target}.c.openscop" - + get_info "${target}.c.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.c" "${output}.c" "$x" "$y" @@ -200,9 +169,70 @@ fdtd_2d() { compile "${output}.c" "${output}" "codes/fdtd-2d/data.o" printf "fdtd-2d,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} >> ${LOG} - done < $tmpfile + done +} + +adi() { + target=codes/adi/adi + + # accurate + output="$(dirname ${target})/$(basename ${target})" + compile "${output}.c" "${output}" "codes/adi/data.o" + printf "adi,,," >> ${LOG} + ./${output} >> ${LOG} - rm "$tmpfile" + 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/adi/data.o" + printf "adi,%s,%s," "${x}" "${y}" >> ${LOG} + ./${output} >> ${LOG} + done +} + +heat_3d() { + target=codes/heat-3d/heat-3d + + # accurate + output="$(dirname ${target})/$(basename ${target})" + compile "${output}.c" "${output}" "codes/heat-3d/data.o" + printf "heat-3d,,," >> ${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/heat-3d/data.o" + printf "heat-3d,%s,%s," "${x}" "${y}" >> ${LOG} + ./${output} >> ${LOG} + done +} + +jacobi_1d() { + target=codes/jacobi-1d/jacobi-1d + + # accurate + output="$(dirname ${target})/$(basename ${target})" + compile "${output}.c" "${output}" "codes/jacobi-1d/data.o" + printf "jacobi-1d,,," >> ${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/jacobi-1d/data.o" + printf "jacobi-1d,%s,%s," "${x}" "${y}" >> ${LOG} + ./${output} >> ${LOG} + done } @@ -216,24 +246,24 @@ hotspot() { ./${output} 1024 1024 100 1 ~/rodinia_3.1/data/hotspot/temp_1024 ~/rodinia_3.1/data/hotspot/power_1024 /dev/null >> ${LOG} get_scop "${target}.cpp" "${target}_perf.cpp" - get_info "${target}.cpp.openscop" - + get_info "${target}.cpp.openscop" | \ while read x y; do output="$(dirname ${target})/${x}_${y}_$(basename ${target})" perforate "${target}.cpp" "${output}.cpp" "$x" "$y" g++ -fopenmp -o "${output}" "${output}.cpp" codes/hotspot/data.o printf "hotspot,%s,%s," "${x}" "${y}" >> ${LOG} ./${output} 1024 1024 100 1 ~/rodinia_3.1/data/hotspot/temp_1024 ~/rodinia_3.1/data/hotspot/power_1024 /dev/null >> ${LOG} - done < $tmpfile - - rm "$tmpfile" + done } correlation -jacobi deriche floyd_warshall hotspot doitgen seidel_2d fdtd_2d +adi +heat_3d +jacobi_2d +jacobi_1d -- GitLab