-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparaProficiencyWithoutIO.R
58 lines (47 loc) · 1.72 KB
/
paraProficiencyWithoutIO.R
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
library(Cairo)
CairoFonts(regular = "WenQuanYi Micro Hei",
bold = "WenQuanYi Micro Hei")
argv <- commandArgs(TRUE)
# logdata working dir
# setwd("~/workspace/R/logdata")
setwd(as.character(argv[1]))
total_casefactor_table_filename <- "cpu_casefactor_table.txt"
data <- read.table(total_casefactor_table_filename, header=TRUE)
case_num <- nrow(data)
x<-1:case_num
emax=data[,3]
emin=data[,5]
emean=data[,4]
w=data[,1]
a=min(emean)
b=max(emean)
c=emean%*%w
emax=signif(emax, digits=2)
emin=signif(emin, digits=2)
emean=signif(emean, digits=2)
c=signif(c, digits =3)
he=max(emax)
CairoSVG(paste("parallel_proficiency_without_io", ".svg", sep=""))
plot(x, type='n', xlim=c(0, case_num + 3), ylim=c(0, 1), main='并行效率分析(不含IO)', xlab='测试用例', ylab='并行效率', xaxt='n', yaxt='n')
axis(side=1, at=1:case_num)
axis(side=2, at=seq(0, he*1.1, 0.1))
rect(x-0.3,emin,x+0.3,emax,col='white')
rect(x-0.3,emean-0.005,x+0.3,emean+0.005,col='red')
rect(x-0.3,emax-0.005,x+0.3,emax+0.005,col='blue')
rect(x-0.3,emin-0.005,x+0.3,emin+0.005,col='yellow')
k=b/30
text(x,emin+k,emin,ps=0.5, cex=0.5)
text(x,emean+k,emean, cex=0.5)
text(x,emax+k,emax, cex=0.5)
abline(h=0.2,lty=1,lwd=4,col='red')
text(case_num + 1.5, 0.2,'0.2', cex=0.5)
abline(h=c,lwd=2,lty=4,col='red')
text(case_num + 1.5, c+k,'算法并行效率', cex=0.5)
text(case_num + 1.5, c-k,c, cex=0.5)
abline(h=0.5,lty=1,lwd=4,col='blue')
text(case_num + 1.5, 0.5,'0.5', cex=0.5)
rect(case_num + 1, 0.95, case_num + 0.5, 0.96,col='blue')
rect(case_num + 1, 0.99, case_num + 0.5, 1, col='red')
text(case_num + 2.2, 0.95, '合同要求的并行效率均值的最低值', cex=0.3)
text(case_num + 2.2, 0.99, '合同要求的并行效率峰值的最低值', cex=0.3)
dev.off()