-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchpress.sh
77 lines (62 loc) · 1.39 KB
/
benchpress.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
usage="$0 perform a scan of compression levels and threads
Usage: $0 [options] FILE DATASET
FILE: name of input data file in HDF5 format
DATASET: name of dataset in FILE to use as input
Options are:
-h print this help text
-t maximum number of threads in scan
"
black='\E[30m'
red='\E[31m'
green='\E[32m'
yellow='\E[33m'
blue='\E[34m'
magenta='\E[35m'
cyan='\E[36m'
white='\E[37m'
cecho ()
{
local default_msg="No message passed."
message=${1:-$default_msg}
color=${2:-$white}
echo -e "$color$message"
#echo "$message"
tput sgr0 # Reset to normal.
return
}
threads="1"
iterations="1"
algorithm="blosclz"
while getopts "ht:i:a:" opt
do
case $opt in
h) echo "$usage"; exit;;
t) threads="${OPTARG}";;
i) iterations="${OPTARG}";;
a) algorithm="${OPTARG}";;
# Unknown option. No need for an error, getopts informs
# the user itself.
\?) exit 1;;
esac
done
shift $(( $OPTIND -1 ))
if [ $# -lt 2 ]
then
cecho "### ERROR ### Not enough arguments." $red
echo "$usage"
exit
fi
input_file=$1
input_dset=$2
echo ${input_file}
echo ${input_dset}
for thread in `seq ${threads} -2 1`
do
for level in `seq 1 6`
do
cmd="./Release/benchpress --level ${level} --threads ${thread} --iterations ${iterations} --algorithm=${algorithm} ${input_file} ${input_dset}"
echo ${cmd} 1>&2
${cmd}
done
done