diff --git a/codes/doitgen/data.bin b/codes/doitgen/data.bin new file mode 100644 index 0000000000000000000000000000000000000000..b00bdf4be0255a987ab2d2769a6837c03847ea46 Binary files /dev/null and b/codes/doitgen/data.bin differ diff --git a/codes/doitgen/data.o b/codes/doitgen/data.o new file mode 100644 index 0000000000000000000000000000000000000000..2a6f2150c17bc05414780d5077e64b20fc1136fc Binary files /dev/null and b/codes/doitgen/data.o differ diff --git a/collect_data.sh b/collect_data.sh old mode 100644 new mode 100755 index 3259ed6beaaa8c5ca1d6d4914d3b1372cef7a589..679b9bcbc74a4d67957fdaff294f3910c0ff4598 --- a/collect_data.sh +++ b/collect_data.sh @@ -1,5 +1,6 @@ #!/bin/sh +LOG=$(date +%F_%T).log PERF=./perforate.sh INFO=./build/info @@ -10,11 +11,23 @@ get_scop() { } get_info() { - $INFO "$1" > $tmpfile + $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" } perforate() { - $PERF -a -o "$3_$4_$2" -s "$3" -l "$4" "$1" + $PERF -a -o "$2" -s "$3" -l "$4" "$1" +} + +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" @@ -24,14 +37,128 @@ perforate() { # perforate "codes/heat-3d/heat-3d.c" "heat-3d_perf.c" "$x" "$y" #done < $tmpfile -file= -target=codes/correlation/correlation +correlation() { + target=codes/correlation/correlation + + # accurate + 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" + + 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}" "-O3" + printf "correlation,%d,%d," "${x}" "${y}" >> ${LOG} + ./${output} >> ${LOG} + done < $tmpfile + + rm "$tmpfile" +} + +jacobi() { + target=codes/jacobi-2d/jacobi-2d + + # accurate + output="$(dirname ${target})/$(basename ${target})" + compile "${output}.c" "${output}" "codes/jacobi-2d/data.o" + printf "jacobi-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/jacobi-2d/data.o" + printf "jacobi-2d,%d,%d," "${x}" "${y}" >> ${LOG} + ./${output} >> ${LOG} + done < $tmpfile + + rm "$tmpfile" +} + +deriche() { + target=codes/deriche/deriche + + # accurate + output="$(dirname ${target})/$(basename ${target})" + compile "${output}.c" "${output}" "codes/deriche/data.o" + printf "deriche,,," >> ${LOG} + ./${output} >> ${LOG} -get_scop "${target}.c" "${target}_perf.c" -get_info "${target}.openscop" + get_scop "${target}.c" "${target}_perf.c" + get_info "${target}.c.openscop" -while read x y; do - perforate "${target}.c" "${target}_perf.c" "$x" "$y" -done < $tmpfile + 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/deriche/data.o" + printf "deriche,%d,%d," "${x}" "${y}" >> ${LOG} + ./${output} >> ${LOG} + done < $tmpfile + + rm "$tmpfile" +} + +floyd_warshall() { + target=codes/floyd-warshall/floyd-warshall + + # accurate + output="$(dirname ${target})/$(basename ${target})" + compile "${output}.c" "${output}" "codes/floyd-warshall/data.o" + printf "floyd_warshall,,," >> ${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/floyd-warshall/data.o" + printf "floyd_warshall,%d,%d," "${x}" "${y}" >> ${LOG} + ./${output} >> ${LOG} + done < $tmpfile + + rm "$tmpfile" +} + + +hotspot() { + target=codes/hotspot/hotspot_openmp + + # accurate + output="$(dirname ${target})/$(basename ${target})" + g++ -fopenmp -o "${output}" "${target}.cpp" codes/hotspot/data.o + printf "hotspot,,," >> ${LOG} + ./${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" + + 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" +} -rm "$tmpfile" +correlation +jacobi +deriche +floyd_warshall +hotspot