Skip to content
Permalink
97d0f7dc81
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
74 lines (57 sloc) 3.79 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_big_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), ]
# Find which combination of blocks and threads works best
five_hundred_trials$thread = as.factor(five_hundred_trials$thread)
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
five_hundred_trials$thread = as.factor(five_hundred_trials$thread)
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
# Find which combination of blocks and threads works best
five_hundred_trials$thread = as.factor(five_hundred_trials$thread)
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
# Create Scatter plot (Blocks vs Threads)
five_hundred_trials$block = as.factor(five_hundred_trials$block)
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("Blocks") + ylab("Time (seconds)") + labs(colour = "Implementation", size="Time")
base_plot <- base_plot + ggtitle("Blocks vs Time vs Implementation") + 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" & five_hundred_trials$block ==1 & five_hundred_trials$thread < 64 ), ]
ours_five_hundred_trials$thread <- as.factor(ours_five_hundred_trials$thread)
ours_five_hundred_trials <- ours_five_hundred_trials[which(!is.na(ours_five_hundred_trials$thread)), ]
bar_base <- ggplot(ours_five_hundred_trials, aes(x=thread, y=value, fill=thread)) + geom_col(width=0.5)
bar_base <- bar_base + xlab("Threads") + ylab("Time (seconds)")
bar_base <- bar_base + ggtitle("Big Data Threads vs Time (1 Block)") + theme(plot.title = element_text(hjust = 0.5))
bar_base <- bar_base + theme(legend.position="none")
bar_base