-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathget-inputs
executable file
·48 lines (48 loc) · 1.23 KB
/
get-inputs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
set -eux
sim=true
verbose=''
native=false
while getopts nSv OPT; do
case "$OPT" in
S)
sim=false
;;
n)
native=true
;;
v)
verbose=-v
;;
esac
done
shift "$(($OPTIND - 1))"
download_dir="${1:-.}"
outdir="${2:-.}"
url_base=https://github.com/cirosantilli/parsec-benchmark/releases/download/3.0
basenames=''
basenames="$basenames parsec-3.0-core.tar.gz"
if "$sim"; then
basenames="$basenames parsec-3.0-input-sim.tar.gz"
fi
mkdir -p "$outdir"
for basename in $basenames; do
if [ ! -f "${download_dir}/${basename}" ]; then
wget -nc -P "$download_dir" $verbose "${url_base}/${basename}"
fi
tar -xz $verbose -f "${download_dir}/${basename}" -C "$outdir" --skip-old-files --strip-components=1
done
if "$native"; then
basename="parsec-3.0-input-native.tar.gz"
native_out="$download_dir/$basename"
if [ ! -f "$native_out" ]; then
# Huge. Impractical for simulators, intended for real silicon.
rm -f "$native_out"
i=0
while [ "$i" -lt 5 ]; do
wget -O- -nc -P "$download_dir" $verbose "${url_base}/${basename}.$i" >> "$native_out"
i="$((i + 1))"
done
fi
tar -xz $verbose -f "$native_out" -C "$outdir" --skip-old-files --strip-components=1
fi