Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/lamont/test/sum-reduction/pvt.r
ViewVC logotype

View of /branches/lamont/test/sum-reduction/pvt.r

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (download) (annotate)
Wed Feb 26 14:22:24 2014 UTC (5 years, 7 months ago) by lamonts
File size: 1484 byte(s)
Fixed global reduction block
#Load the data file with information 
mydata = read.table('parallel.dat',header=FALSE)

#Labels for the axis which are the processors 
xValues = c(4,8,16,32,64)

#Colors for the lines 
plot_colors = c("red","chartreuse2","blue","orange","purple")

#The number of lines to plot 
linesCount = length(mydata) 

# Start PNG device driver to save output to figure.png
#png(filename="PvT.png", height=800, width=800, 
 #   bg="white")
  
for (col  in 1:5) {
  lineYVals = c()
  for (row in seq(1:(nrow(mydata)-1))){
    lineYVals = c(lineYVals, mydata[row,col])
  }  
  if(col == 1){
    # Plot the sequntiel time for 
    plot(xValues, lineYVals,type="b", col=plot_colors[1], xaxt='n', ann=FALSE)
    # Make x axis using Mon-Fri labels
  }else {
    lines(xValues, lineYVals, type="b",lty=1,
          col=plot_colors[col])
  } 
}
axis(1, at=xValues, lab=xValues)
# Create box around plot
box()

# Create a title with a red, bold/italic font
title(main="Processors vs Execution Time", col.main="black", font.main=4)
# Label the x and y axes with dark green text
title(xlab= "Number of Processors", col.lab=rgb(0,0,0))
title(ylab= "Execution Time", col.lab=rgb(0,0,0))

# Create a legend at (1, max_y) that is slightly smaller 
# (cex) and uses the same line colors and points used by 
# the actual plots
legend("topleft", title="Number of Strands", c("6mil","7mil","8mil","9mil","10mil"), pch=15, col=plot_colors,horiz=FALSE);

# Turn off device driver (to flush output to png)
#dev.off()

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0