-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-benchmark.sh
executable file
·59 lines (51 loc) · 1.64 KB
/
run-benchmark.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
#!/bin/bash
#ARGUMENTS: ./run-benchmark.sh [Output File name][Min_CORE][-g (for gpu) | -c confidence level]
#----SETUP DEFAULT CONFIGURATION
OUTPUT_FILE=./statistics/test.csv
MIN_CORE=6
WL=0
EXEC=./caliper
#EXEC=./gpu_exec
EXTRA_ARG=-x
VERSION=1
BLOCKS=32
#EXTRA_ARG=-c\ 0.95\ 0.005
#---ARG0: OUTPUT FILE---------------
if [ -z "$1" ]
then
echo "Default Output"
else
OUTPUT_FILE=./statistics/$1
fi
echo "OUTPUT: $OUTPUT_FILE"
#---ARG1: MINCORE---------------
if [ -z "$2" ]
then
echo "Default MinCore"
else
MIN_CORE=$2
fi
echo "MINCORE: $MIN_CORE"
#---ARG2: EXEC FILE---------------
#TODO GPU ARG
#--------------ACTUAL SCRIPT----------------------------------------------
> $OUTPUT_FILE #Empty file content
echo "ROWS,COLS,NUM OF CORES,MIN_CORE,WORKLOAD,NUM_OF_TEST,CONFIDENCE,EXECUTION TIME,MTTF[Hours],MTTF[Years]" >> $OUTPUT_FILE
#Mettere meta dei core come MinCore
#$MIN_CORE = $(echo "ciao")
#Set workload to $MIN_CORE / ($num_cores * $num_cores)
#This grant that distributed load for this configuration never goes above 1
execute_caliper(){
#num_cores = $1
MAX_CORE=`echo "scale=0; ($1 * $1)" | bc`
MIN_CORE=`echo "scale=0; ($MAX_CORE)/2" | bc`
WORKLOAD=`echo "scale=4; $MIN_CORE / ($1 * $1)" | bc`
echo "COMPUTING $MAX_CORE with mincore = $MIN_CORE"
echo $EXEC $1 $1 $MIN_CORE $WORKLOAD $EXTRA_ARG $VERSION $BLOCKS
$EXEC $1 $1 $MIN_CORE $WORKLOAD $EXTRA_ARG $VERSION $BLOCKS>> $OUTPUT_FILE
}
#for num_cores in 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 24 26 28 30 32 34 36 38 40 42 44 45
for num_cores in 4 28 30 32 34 36 38 40 42 44 45
do
execute_caliper "$num_cores"
done