Commit 67e194b3 authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas

Add R script to print bsize plot.

Add information in the wrap for each different plot (add bsize)
parent 16d02f1c
......@@ -31,22 +31,22 @@ get_data_subset <- function(f, n, h, p)
return (d)
}
# OMP Compiler/runtime breaks, colors...
get_breaks_runtime <- function()
{
return (c('implicit', 'explicit', 'implicit limited'))
return (c('implicit', 'explicit', 'implicit limited', 'simple-mpi'))
}
get_labels_runtime <- function()
{
return (c('Implicit', 'Explicit', 'Implicit Limited'))
return (c('Implicit', 'Explicit', 'Implicit Limited', 'Simple MPI'))
}
get_colors_runtime <- function()
{
return (c('implicit' = "#266d83",
'explicit' = "#e20025",
'implicit limited' = "#bd02b6"))
'implicit limited' = "#bd02b6",
'simple-mpi' = "#9aff4f"))
}
# Scheme breaks, colors ...
......@@ -109,3 +109,11 @@ height_labeller <- function(value)
{
return (paste("h =", value))
}
group_size_labeller <- function(value)
{
return (paste("bs =", value))
}
nnode_labeller <- function(value)
{
return (paste("node =", value))
}
......@@ -7,9 +7,10 @@ gen_comm_plot <- function(db, d_breaks, model_wanted)
g <- ggplot(data=db,aes_string(x="nnode", y="communication_vol", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
g <- g + facet_wrap(npart ~ height ~ bsize, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
bsize = as_labeller(group_size_labeller),
.default=label_both,
.multi_line=FALSE))
......
......@@ -8,9 +8,10 @@ gen_efficiencies_plot <- function(output, data)
color="event", group="event"))
g <- g + geom_line()
g <- g + geom_point(aes_string(color="event"), size=2)
g <- g + facet_wrap(npart ~ height, scales="free",
g <- g + facet_wrap(npart ~ height ~ bsize, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
bsize = as_labeller(group_size_labeller),
.default=label_both,
.multi_line=FALSE))
# Set colors.
......@@ -23,7 +24,7 @@ gen_efficiencies_plot <- function(output, data)
g <- g + xlab("Number of node")
g <- g + ylab("Efficiency")
g <- g + scale_x_continuous(breaks=c(1, 2, 3, 4, 6, 9, 12, 16, 20, 24))
#g <- g + scale_x_continuous(breaks=c(1, 2, 3, 4, 6, 9, 12, 16, 20, 24))
# Set y-axis range
g <- g + ylim(c(0.0, 1.10))
......@@ -40,9 +41,12 @@ compute_efficiency <- function(data, n)
# Compute task efficiency
#tt_1 <- subset(sdata, event == "task_time" & nthreads == 1)
tt_1 <- subset(sdata, event == "task_time" & nnode == 1)
et <- subset(sdata, event == "task_time")
if(nrow(tt_1))
{
print("There is no one node reference for this algorithm")
}
et$efficiency <- tt_1$duration / et$duration
# Compute scheduling efficiency
......
......@@ -107,10 +107,10 @@ read_trace <- function(file, nnode, nthreads, start_profiling, stop_profiling)
#Return
df
}
gen_simple_gantt_plot <- function(data, model, algo, nnode, npart)
gen_simple_gantt_plot <- function(data, model, algo, nnode, npart, bsize, height)
{
output <- paste(get_output_directory(), "/", model, "-", algo, "-", nnode, "N-", npart/1000000, "M-simple-gantt.pdf", sep="")
title <- paste(model, " ", algo, " ", nnode, "N ", npart/1000000, "M", sep="")
output <- paste(get_output_directory(), "/", model, "-", algo, "-", nnode, "N-", npart/1000000, "M-h", height, "-bs", bsize, "-simple-gantt.pdf", sep="")
title <- paste(model, " ", algo, " ", nnode, "N ", npart/1000000, "M", " h = ", height, " bs = ", bsize, sep="")
breaks <- c('Sleeping', 'Far Field', 'Near Field')
labels <- c('Sleeping', 'Far Field', 'Near Field')
colors <- c(
......@@ -128,10 +128,10 @@ gen_simple_gantt_plot <- function(data, model, algo, nnode, npart)
g <- g + scale_y_discrete(breaks=NULL)
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
gen_gantt_plot <- function(data, model, algo, nnode, npart)
gen_gantt_plot <- function(data, model, algo, nnode, npart, bsize, height)
{
output <- paste(get_output_directory(), "/", model, "-", algo, "-", nnode, "N-", npart/1000000, "M-gantt.pdf", sep="")
title <- paste(model, " ", algo, " ", nnode, "N ", npart/1000000, "M", sep="")
output <- paste(get_output_directory(), "/", model, "-", algo, "-", nnode, "N-", npart/1000000, "M-h", height, "-bs", bsize, "-gantt.pdf", sep="")
title <- paste(model, " ", algo, " ", nnode, "N ", npart/1000000, "M", " h = ", height, " bs = ", bsize, sep="")
g <- ggplot(data,aes(x=Start,xend=End, y=factor(ResourceId), yend=factor(ResourceId),color=Value))
g <- g + theme_bw()
g <- g + geom_segment(size=8)
......@@ -167,30 +167,38 @@ gen_gantt <- function(dbfile)
all_model <- unique(df$model)
all_nnode <- unique(df$nnode)
all_npart <- unique(df$npart)
for (mod in 1:length(all_model))
all_bsize <- unique(df$bsize)
all_height <- unique(df$height)
for (bsi in 1:length(all_bsize))
{
for (alg in 1:length(all_algorithm))
for (hei in 1:length(all_height))
{
for (nno in 1:length(all_nnode))
for (mod in 1:length(all_model))
{
for (npa in 1:length(all_npart))
for (alg in 1:length(all_algorithm))
{
#Get the corresponding line
tmp_df <- subset(df, model == all_model[mod] & algo == all_algorithm[alg] & nnode == all_nnode[nno] & npart == all_npart[npa])
if(nrow(tmp_df) > 0)
for (nno in 1:length(all_nnode))
{
look <- paste("Grab data ", all_model[mod],all_algorithm[alg], all_nnode[nno], "N", all_npart[npa], sep="-")
#Print something so I know were is the script
print(look)
data <- gen_gantt_grab_data(tmp_df)
gen_gantt_plot(data, all_model[mod], all_algorithm[alg], all_nnode[nno], all_npart[npa])
gen_simple_gantt_plot(data, all_model[mod], all_algorithm[alg], all_nnode[nno], all_npart[npa])
#rm(data)
#gc()
for (npa in 1:length(all_npart))
{
#Get the corresponding line
tmp_df <- subset(df, model == all_model[mod] & algo == all_algorithm[alg] & nnode == all_nnode[nno] & npart == all_npart[npa] & bsize == all_bsize[bsi] & height == all_height[hei])
if(nrow(tmp_df) > 0)
{
look <- paste("Grab data ", all_model[mod],all_algorithm[alg], all_nnode[nno], "N", all_npart[npa], all_height[hei], all_bsize[bsi], sep="-")
#Print something so I know were is the script
print(look)
data <- gen_gantt_grab_data(tmp_df)
gen_gantt_plot(data, all_model[mod], all_algorithm[alg], all_nnode[nno], all_npart[npa], all_bsize[bsi], all_height[hei])
gen_simple_gantt_plot(data, all_model[mod], all_algorithm[alg], all_nnode[nno], all_npart[npa], all_bsize[bsi], all_height[hei])
rm(data)
gc()
}
}
}
}
}
}
}
}
library(plyr)
library(ggplot2)
library(scales)
gen_group_size_plot <- function(d, model_wanted)
{
d <- subset(d, model == model_wanted)
d$global_time <- d$global_time/1000
g <- ggplot(data=d,aes_string(x="bsize", y="global_time", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height ~ nnode, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
nnode = as_labeller(nnode_labeller),
.default=label_both,
.multi_line=FALSE))
# Set our own colors, linetypes and point shapes.
g <- g + scale_color_manual(name="Algorithm",
breaks=get_breaks_runtime(),
labels=get_labels_runtime(),
values=get_colors_runtime())
# Set X/Y labels.
g <- g + xlab("bsize")
g <- g + ylab("Time (s)")
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-bsize.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
gen_group_size <- function(dbfile)
{
data <- get_data_subset(dbfile, 0L, 0L, "False")
data <- subset(data, algo != get_one_node_reference_algorithm())
all_model <- unique(data$model)
for (i in 1:length(all_model))
{
gen_group_size_plot(data, all_model[i])
}
}
......@@ -32,9 +32,10 @@ gen_normalized_time_plot <- function(db, d_breaks, model_wanted)
g <- ggplot(data=db,aes_string(x="nnode", y="efficiency", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
g <- g + facet_wrap(npart ~ height ~ bsize, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
bsize = as_labeller(group_size_labeller),
.default=label_both,
.multi_line=FALSE))
......
......@@ -31,9 +31,10 @@ gen_pareff_plot <- function(db, d_breaks, model_wanted)
g <- ggplot(data=db,aes_string(x="nnode", y="efficiency", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
g <- g + facet_wrap(npart ~ height ~ bsize, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
bsize = as_labeller(group_size_labeller),
.default=label_both,
.multi_line=FALSE))
......
......@@ -5,11 +5,13 @@ library(scales)
gen_speed_plot <- function(d, model_wanted)
{
d <- subset(d, model == model_wanted)
d$global_time <- d$global_time/1000
g <- ggplot(data=d,aes_string(x="nnode", y="global_time", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
g <- g + facet_wrap(npart ~ height ~ bsize, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
bsize = as_labeller(group_size_labeller),
.default=label_both,
.multi_line=FALSE))
......@@ -21,7 +23,7 @@ gen_speed_plot <- function(d, model_wanted)
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Speed")
g <- g + ylab("Time (s)")
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-speed.pdf", sep="")
......
......@@ -16,12 +16,13 @@ calc_speedup <- function(data, ref_algo)
gen_speedup_taskdep_plot <- function(d, model_wanted)
{
d <- subset(d, model == model_wanted)
d <- calc_speedup(d, "explicit")
d <- calc_speedup(d, "simple-mpi")
g <- ggplot(data=d,aes_string(x="nnode", y="speedup", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
g <- g + facet_wrap(npart ~ height ~ bsize, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
bsize = as_labeller(group_size_labeller),
.default=label_both,
.multi_line=FALSE))
......
......@@ -17,9 +17,10 @@ gen_times_taskdep_plot <- function(data, algo_wanted, model_wanted)
g <- g + geom_bar(stat="identity", position="fill")
#Pour le titre
g <- g + facet_wrap(npart ~ height, scales="free",
g <- g + facet_wrap(npart ~ height ~ bsize, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
bsize = as_labeller(group_size_labeller),
.default=label_both,
.multi_line=FALSE))
# Set colors.
......
......@@ -7,22 +7,27 @@ source("gen_normalized_time_plots.R")
source("gen_comm.R")
source("gen_gantt.R")
source("gen_speed_plots.R")
source("gen_group_size_plots.R")
###
# Generate display of bars with the time spent in Task, Runtime and Idle.
###
print("Generate Communication volume plot")
gen_comm("loutre.db")
print("Generate Group size plot")
gen_group_size("loutre.db")
print("Generate Speed plot")
gen_speed("loutre.db")
print("Generate times task plot")
gen_times_taskdep("loutre.db")
print("Generate Gantt")
gen_gantt("canard.db")
print("Generate Efficiency plot")
gen_efficiencies("loutre.db")
print("Generate Normalized time plot")
gen_normalized_time("loutre.db")
print("Generate Gantt")
gen_gantt("canard.db")
print("Generate Efficiency plot")
gen_efficiencies("loutre.db")
print("Generate Parrallel efficiency plot")
gen_pareff("loutre.db")
print("Generate Speedup plot")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment