Revision 1097

branches/threaded2/examples/threaded/multisimple/do_time.sh (revision 1097)
1
#!/bin/bash
2
# collects run time for msimple with different numbers of threads
3
cp -v msimple.dat msimple.dat.save
4
rm -vf time.out
5
for T in 1 2 3  4 5 6 7 8 9 10 11 12 50
6
do
7
  echo 1000003 $T  > msimple.dat
8
  echo $T >> time.out
9
  /usr/bin/X11/time -ao time.out -f "%E " msimple -nohess
10
done
11
cp -v msimple.dat.save msimple.dat
12

  
0 13

  
branches/threaded2/examples/threaded/multisimple/timings.R (revision 1097)
1
#plot.speedup<-function()
2
#{
3
#   ref <- 1
4
#
5
#   file="timings.csv"
6
#   t<-read.csv(file=file,header=TRUE)
7
#   a <- t$real[ref]/t$real
8
#   file="timings-prime.csv"
9
#   tp<-read.csv(file=file,header=TRUE)
10
#   ap <- tp$real[ref]/tp$real
11
#   plot(t$n,a,type='b',xlab="# of threads",ylab="Speedup over single thread (laptop)",
12
#            xlim=c(0,t$n[nrow(t)]), ylim=c(0,t$n[nrow(t)]))
13
#   points(tp$n,ap,type='b',col="blue")
14
#   lines(c(0,t$n[nrow(t)]),c(0,t$n[nrow(t)]),lty="dotted")
15
#
16
#
17
#   x11()
18
#   file="katsuo-msimple-timings.csv"
19
#   t<-read.table(file=file,header=TRUE)
20
#   a <- t$real[ref]/t$real
21
#   plot(t$n,a,type='b',xlab="# of threads",ylab="Speedup over single thread (katsuo)",
22
#            xlim=c(0,t$n[nrow(t)]), ylim=c(0,t$n[nrow(t)]))
23
#   lines(c(0,t$n[nrow(t)]),c(0,t$n[nrow(t)]),lty="dotted")
24
#   
25
#}
26

  
27
plot.speedup<-function(file)
28
{
29
   ref <- 1
30

  
31
   t<-read.table(file=file,header=TRUE)
32
   a <- t$real[ref]/t$real
33
   plot(t$n,a,type='b',xlab="# of threads",ylab="Speedup over single thread",
34
            xlim=c(0,t$n[nrow(t)]), ylim=c(0,t$n[nrow(t)]),main=file)
35
   lines(c(0,t$n[nrow(t)]),c(0,t$n[nrow(t)]),lty="dotted",lwd=2)
36
}

Also available in: Unified diff