Skip to content
Permalink
master
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
# 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)
data_path <- '/home/reynaldo/Documents/School/Spring2017/HPC/project/parallel_mcmc/parallel/complete_analysisSmallFast.csv'
fast_perf_data <- read.csv(file=data_path, header=TRUE, sep=",")
fast_melted_data <- melt(fast_perf_data, id=c("trial", "block", "thread"))
fast_five_hundred_trials <- fast_melted_data[which(fast_melted_data$trial == 500), ]
fast_five_hundred_trials$thread = as.factor(fast_five_hundred_trials$thread)
# Generate Plots
# Create Scatter plot (Blocks vs Threads)
base_plot <- ggplot(fast_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("Faster Blocks vs Time") + theme(plot.title = element_text(hjust = 0.5))
base_plot
# Find which combination of blocks and threads works best
fast_ours_five_hundred_trials <- fast_five_hundred_trials[which(fast_five_hundred_trials$variable == "our_time"), ]
fast_ours_five_hundred_trials <- fast_ours_five_hundred_trials[which(!is.na(fast_ours_five_hundred_trials$thread)), ]
line_base <- ggplot(fast_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("Faster Blocks vs Time vs Threads") + theme(plot.title = element_text(hjust = 0.5))
line_base
# Merge two datasets
our_fast_time_melted = fast_melted_data[(which(fast_melted_data$variable == "our_fast_time")), ]
all_melted_data <- rbind(melted_data, our_fast_time_melted)
all_five_hundred_trials <- all_melted_data[which(all_melted_data$trial == 500), ]
# Best Number of threads vs The other implementations for Blocks vs Time
one_threads_500_trials <- all_five_hundred_trials[which(all_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
# Trials vs Time vs Implementation
one_thread_one_block <- all_melted_data[which(all_melted_data$thread == 1 & all_melted_data$block == 1), ]
line_base <- ggplot(one_thread_one_block, aes(x=trial, y=value, group=variable, shape=variable, color=variable)) +
geom_line() +
geom_point()
line_base <- line_base + xlab("Trials") + ylab("Time (seconds)") + labs(colour = "Implementations", shape="Implementations")
line_base <- line_base + ggtitle("Small Data Trials vs Time 1 Block 1 Thread") + theme(plot.title = element_text(hjust = 0.5))
line_base