Skip to content
Permalink
b53e550f4b
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
43 lines (36 sloc) 1.93 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/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), ]
# 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
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
# Line Plot
line_base <- ggplot(five_hundred_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)")
line_base <- line_base + ggtitle("Blocks vs Time") + theme(plot.title = element_text(hjust = 0.5))
line_base