Skip to content
Permalink
ae4f00b9fd
Go to file
 
 
Cannot retrieve contributors at this time
50 lines (37 sloc) 2.17 KB
# Plot the data
# Imports
library(reshape2)
library(ggplot2)
# Load the data
# Change path to file
# data_path <- '../parallel/analysis.csv' # You can use this instead
data_path <- '/home/reynaldo/Documents/School/Spring2017/HPC/project/parallel_mcmc/parallel/complete_analysis.csv'
perf_data <- read.csv(file=data_path, header=TRUE, sep=",")
melted_data <- melt(perf_data, id=c("trial", "block", "thread"))
five_hundred_trials <- melted_data[which(melted_data$trial == 500), ]
five_hundred_trials$thread = as.factor(five_hundred_trials$thread)
# Generate Plots
# Create Scatter plot (Blocks vs Threads)
base_plot <- ggplot(five_hundred_trials, aes(x=block, y=time, color=variable))
base_plot <- base_plot + geom_point(aes(x=block, y=thread, size=value, color=variable))
base_plot <- base_plot + scale_size(range = c(0, 10))
base_plot <- base_plot + xlab("Threads") + ylab("Time (seconds)")
base_plot <- base_plot + ggtitle("Blocks vs Time") + theme(plot.title = element_text(hjust = 0.5))
base_plot
# Find which combination of blocks and threads works best
ours_five_hundred_trials <- five_hundred_trials[which(five_hundred_trials$variable == "our_time"), ]
ours_five_hundred_trials <- ours_five_hundred_trials[which(!is.na(ours_five_hundred_trials$thread)), ]
line_base <- ggplot(ours_five_hundred_trials, aes(x=block, y=value, group=thread, shape=thread, color=thread)) +
geom_line() +
geom_point()
line_base <- line_base + xlab("Blocks") + ylab("Time (seconds)") + labs(colour = "Num Threads", shape="Num Threads")
line_base <- line_base + ggtitle("Blocks vs Time vs Threads") + theme(plot.title = element_text(hjust = 0.5))
line_base
# Best Number of threads vs The other implementations for Blocks vs Time
one_threads_500_trials <- five_hundred_trials[which(five_hundred_trials$thread == 1), ]
line_base <- ggplot(one_threads_500_trials, aes(x=block, y=value, group=variable, shape=variable, color=variable)) +
geom_line() +
geom_point()
line_base <- line_base + xlab("Blocks") + ylab("Time (seconds)") + labs(colour = "Implementations", shape="Implementations")
line_base <- line_base + ggtitle("Blocks vs Time vs Implementation") + theme(plot.title = element_text(hjust = 0.5))
line_base
You can’t perform that action at this time.