benc.sh 910 Bytes
Newer Older
1
#!/bin/sh
2
set -e
3
AEC=../src/aec
4
test_data=https://gitlab.dkrz.de/k202009/libaec/raw/master/data/typical.rz
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
5 6
if [ ! -f  typical.dat ]; then
    rm -f typical.rz
7 8 9 10 11 12 13 14
    type wget >/dev/null 2>&1 || {
        echo >&2 "wget not found. Please download $test_data by other means and place it in tests. Aborting."
        exit 1
    }
    wget $test_data || {
        echo >&2 "Could not download $test_data. Please download it by other means and place it in tests. Aborting."
        exit 1
    }
15
    $AEC -d -n16 -j64 -r256 -m typical.rz typical.dat
16
    rm -f bench.dat
17 18 19 20 21 22 23 24
fi
if [ ! -f  bench.dat ]; then
    for i in $(seq 0 499);
    do
        cat typical.dat >> bench.dat
    done
fi
rm -f bench.rz
25
utime=$(../src/utime $AEC -n16 -j64 -r256 -m bench.dat bench.rz 2>&1)
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
26
bsize=$(wc -c bench.dat | awk '{print $1}')
27 28
perf=$(echo "$bsize/1048576/$utime" | bc)
echo "*** Encoding with $perf MiB/s user time ***"