-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate-power-results.sh
executable file
·52 lines (44 loc) · 1.92 KB
/
generate-power-results.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
#!/usr/bin/env bash
cat << EOF > /tmp/summarise.R
# Import data results
testName <- "$1"
dataResults <- read.csv('~/BT-Results/results-power.csv', header = FALSE)
colnames(dataResults) <- c("Benchmark", "Label", "Distro", "Kernel", "Date", "Test", "Result", "Validation", "EPsys", "EPkg", "ECores", "EGPU", "ERam")
Merged <- paste(dataResults\$Benchmark, dataResults\$Label, dataResults\$Distro, dataResults\$Kernel, dataResults\$Date, dataResults\$Test)
dataResults <- cbind(dataResults, Merged)
dataUnique <- unique(dataResults\$Merged)
for( index in 1:length(dataUnique) )
{
tmp <- subset(dataResults, Merged == dataUnique[index])
tmpSubset <- tmp[1,c("Benchmark", "Label", "Distro", "Kernel", "Date", "Test", "Merged")]
tmpSubset\$Result <- round(mean(tmp\$Result), digits=2)
tmpSubset\$EPsys <- round(mean(tmp\$EPsys), digits=2)
tmpSubset\$EPkg <- round(mean(tmp\$EPkg), digits=2)
tmpSubset\$ECores <- round(mean(tmp\$ECores), digits=2)
tmpSubset\$EGPU <- round(mean(tmp\$EGPU), digits=2)
tmpSubset\$ERam <- round(mean(tmp\$ERam), digits=2)
if ( length(unique(tmp\$Validation)) == 1 ){
tmpSubset\$Valid <- unique(tmp\$Validation)
} else {
tmpSubset\$Valid <- NA
}
Variables <- c("Benchmark", "Label", "Distro", "Kernel", "Date", "Test", "Result", "EPsys", "EPkg", "ECores", "EGPU", "ERam", "Valid")
if( exists("dataCombined") ) {
dataCombined <- rbind(dataCombined, tmpSubset[, Variables])
} else {
dataCombined <- tmpSubset[, Variables]
}
}
if ( testName != "" )
{
dataCombined <- subset(dataCombined, Benchmark == testName)
}
write.csv(dataCombined[order(dataCombined\$Benchmark, dataCombined\$Test, dataCombined\$Label),], '/tmp/summarise.csv', row.names = FALSE)
options(width=1000)
print(dataCombined[order(dataCombined\$Benchmark, dataCombined\$Test, dataCombined\$Label),])
EOF
Rscript /tmp/summarise.R
echo ""
echo ""
echo ""
cat /tmp/summarise.csv