summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathis Rosenhauer <rosenhauer@dkrz.de>2016-09-13 10:05:39 (GMT)
committerMathis Rosenhauer <rosenhauer@dkrz.de>2016-09-14 10:30:38 (GMT)
commit97331a0147be4626e9e73fda60961b333d72e6e6 (patch)
tree2f063b6abada96f855bdead9daff580d59a9271a /src
parente3c56c9eac03ffef7098779fc5a9943e73e4052b (diff)
downloadlibaec-97331a0147be4626e9e73fda60961b333d72e6e6.zip
libaec-97331a0147be4626e9e73fda60961b333d72e6e6.tar.gz
libaec-97331a0147be4626e9e73fda60961b333d72e6e6.tar.bz2
Remove sample data from repo
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/Makefile.am9
-rwxr-xr-xsrc/bdec.sh13
-rwxr-xr-xsrc/benc.sh18
4 files changed, 44 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index be9ec35..66a04b1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,6 +21,11 @@ TARGET_LINK_LIBRARIES(aec_client aec)
IF(UNIX)
ADD_EXECUTABLE(utime EXCLUDE_FROM_ALL utime.c)
+ ADD_CUSTOM_TARGET(bench
+ COMMAND ${CMAKE_SOURCE_DIR}/src/benc.sh ${CMAKE_SOURCE_DIR}/data/typical.rz
+ COMMAND ${CMAKE_SOURCE_DIR}/src/bdec.sh
+ DEPENDS aec_client utime
+ )
ENDIF(UNIX)
IF(WIN32)
diff --git a/src/Makefile.am b/src/Makefile.am
index e2a2d44..0374d91 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,4 +15,11 @@ utime_SOURCES = utime.c
aec_LDADD = libaec.la
aec_SOURCES = aec.c
-EXTRA_DIST = CMakeLists.txt
+EXTRA_DIST = CMakeLists.txt benc.sh bdec.sh
+CLEANFILES = bench.dat bench.rz
+
+bench-local: all benc bdec
+benc-local: all
+ $(srcdir)/benc.sh $(top_srcdir)/data/typical.rz
+bdec-local: all
+ top_srcdir=$(top_srcdir) $(srcdir)/bdec.sh
diff --git a/src/bdec.sh b/src/bdec.sh
new file mode 100755
index 0000000..10da618
--- /dev/null
+++ b/src/bdec.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+if [ ! -f bench.rz ]; then
+ echo "No encoded file found. Encoding now..."
+ ${top_srcdir}/src/benc.sh ${top_srcdir}/data/typical.rz
+fi
+rm -f dec.dat
+bsize=$(wc -c bench.dat | awk '{print $1}')
+utime=$(./utime ./aec -d -n16 -j64 -r256 -m bench.rz dec.dat 2>&1)
+perf=$(echo "$bsize/1048576/$utime" | bc)
+echo "*** Decoding with $perf MiB/s user time ***"
+cmp bench.dat dec.dat
+rm -f dec.dat
diff --git a/src/benc.sh b/src/benc.sh
new file mode 100755
index 0000000..e2f8075
--- /dev/null
+++ b/src/benc.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+TEST_DATA=$1
+AEC=./aec
+if [ ! -f bench.dat ]; then
+ rm -f typical.dat
+ $AEC -d -n16 -j64 -r256 -m $TEST_DATA typical.dat
+ for i in $(seq 0 499);
+ do
+ cat typical.dat >> bench.dat
+ done
+ rm -f typical.dat
+fi
+rm -f bench.rz
+utime=$(./utime $AEC -n16 -j64 -r256 -m bench.dat bench.rz 2>&1)
+bsize=$(wc -c bench.dat | awk '{print $1}')
+perf=$(echo "$bsize/1048576/$utime" | bc)
+echo "*** Encoding with $perf MiB/s user time ***"