Commit 9f7eafc9 authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas

Change R script.

parent d8413337
......@@ -35,21 +35,23 @@ get_data_subset <- function(f, n, h, p, b)
get_breaks_runtime <- function()
{
return (c('implicit', 'explicit', 'implicit limited', 'simple-mpi', 'implicit-two-by'))
return (c('implicit-variable-bsize', 'explicit-variable-bsize', 'implicit limited', 'simple-mpi', 'implicit-two-by', 'implicit', 'explicit'))
}
get_labels_runtime <- function()
{
return (c('Implicit', 'Explicit', 'Implicit Limited', 'Simple MPI', 'Implicit two by'))
return (c('Implicit (STF)', 'Explicit (Hybrid STF+MPI)', 'Implicit Limited', 'Native MPI+OpenMP', 'Implicit two by', 'Implicit (2000)', 'Explicit (2000)'))
}
get_colors_runtime <- function()
{
return (c('implicit' = "#266d83",
'explicit' = "#e20025",
'implicit limited' = "#bd02b6",
'simple-mpi' = "#9aff4f",
'implicit-two-by' = "#50de11"))
return (c('implicit' = "#96007d", # --> violet
'explicit' = "#00af1b",# --> Vert
'implicit limited' = "#f85c00", # --> orange
'simple-mpi' = "#266d83", #--> bleu
'implicit-two-by' = "#50de11",
'implicit-variable-bsize' = "#e2aa00", #--> jaune
'explicit-variable-bsize' = "#e20025")) #--> rouge
}
get_bsize_reference <- function()
......@@ -101,3 +103,17 @@ nnode_labeller <- function(value)
{
return (paste("node =", value))
}
data_distribution_labeller <- function(value)
{
return (value)
}
get_theme <- function()
{
(theme(legend.text = element_text(size = 14)) +
theme(legend.title = element_text(size = 16)) +
theme(axis.title.x = element_text(size = 13)) +
theme(axis.title.y = element_text(size = 13)) +
theme(strip.text.x = element_text(size = 13)) +
theme(strip.text.y = element_text(size = 13)) +
theme(text = element_text(size = 13)))
}
......@@ -26,8 +26,7 @@ gen_comm_plot <- function(db, d_breaks, model_wanted)
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Volume of Communication (MB)")
g <- g + scale_x_continuous(breaks=c(1, 2, 3, 4, 5, 6, 9, 12, 16, 20, 24))
g <- g + get_theme()
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-comm.pdf", sep="")
......
......@@ -23,6 +23,7 @@ gen_efficiencies_plot <- function(output, data)
# Set title and X/Y labels.
g <- g + xlab("Number of node")
g <- g + ylab("Efficiency")
g <- g + get_theme()
# Set y-axis range
g <- g + ylim(c(0.0, 1.10))
......
......@@ -4,17 +4,19 @@ library(scales)
gen_group_size_plot_comm <- function(d, model_wanted)
{
d <- subset(d, model == model_wanted)
if (is.character(model_wanted))
d <- subset(d, model == model_wanted)
d$global_time <- d$global_time/1000
d <- d[d$communication_vol >= 0,]
if(nrow(d) > 0)
{
g <- ggplot(data=d,aes_string(x="bsize", y="communication_vol", color="algo", group="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height ~ nnode, scales="free",
g <- g + facet_wrap(model ~ npart ~ height ~ nnode, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
nnode = as_labeller(nnode_labeller),
model = as_labeller(data_distribution_labeller),
.default=label_both,
.multi_line=FALSE))
......@@ -27,42 +29,49 @@ gen_group_size_plot_comm <- function(d, model_wanted)
# Set X/Y labels.
g <- g + xlab("bsize")
g <- g + ylab("Communication volume (MB)")
g <- g + get_theme()
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-bsize-volume.pdf", sep="")
if (!exists("output"))
output <- paste(get_output_directory(), "/", model_wanted, "-bsize-volume.pdf", sep="")
print(output)
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
}
gen_group_size_plot_speed <- function(d, model_wanted)
{
d <- subset(d, model == model_wanted)
if (is.character(model_wanted))
d <- subset(d, model == model_wanted)
d$global_time <- d$global_time/1000
d <- d[d$global_time > 0,]
if(nrow(d) > 0)
{
g <- ggplot(data=d,aes_string(x="bsize", y="global_time", color="algo", group="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))
g <- ggplot(data=d,aes_string(x="bsize", y="global_time", color="algo", group="algo"))
g <- g + geom_line()
g <- g + facet_wrap(model ~ npart ~ height ~ nnode, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
nnode = as_labeller(nnode_labeller),
model = as_labeller(data_distribution_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 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)")
#g <- g + scale_x_continuous(breaks=c(8, 16, 32, 64, 128, 512, 1024, 2048, 4096))
# Set X/Y labels.
g <- g + xlab("bsize")
g <- g + ylab("Time (s)")
g <- g + get_theme()
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-bsize-speed.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
# Save generated plot.
if (!exists("output"))
output <- paste(get_output_directory(), "/", model_wanted, "-bsize-speed.pdf", sep="")
print(output)
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
}
......@@ -70,7 +79,7 @@ gen_group_size <- function(dbfile)
{
data <- get_data_subset(dbfile, 0L, 0L, "False", 0L)
data <- subset(data, algo != get_one_node_reference_algorithm() & algo != "simple-mpi")
data <- subset(data, algo != get_one_node_reference_algorithm() & algo != "simple-mpi" & algo != "implicit-variable-bsize")
all_nnode <- unique(subset(data, bsize != get_bsize_reference())$nnode)
data <- subset(data, nnode %in% all_nnode)
......
......@@ -36,7 +36,8 @@ calc_normalized_time <- function(data, ref_name)
gen_normalized_time_plot <- function(db, d_breaks, model_wanted)
{
db <- subset(db, model == model_wanted)
if (is.character(model_wanted))
db <- subset(db, model == model_wanted)
#Compute normalized time with one node reference
db <- calc_normalized_time(db, d_breaks)
#Then remove one node reference because it's only available on one node
......@@ -47,9 +48,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(model ~ npart ~ height, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
model = as_labeller(data_distribution_labeller),
.default=label_both,
.multi_line=FALSE))
......@@ -62,10 +64,13 @@ gen_normalized_time_plot <- function(db, d_breaks, model_wanted)
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Normalized time")
g <- g + get_theme()
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-normalized-time.pdf", sep="")
if (!exists("output"))
output <- paste(get_output_directory(), "/", model_wanted, "-normalized-time.pdf", sep="")
print(output)
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
}
......
......@@ -58,6 +58,7 @@ gen_pareff_plot <- function(db, d_breaks, model_wanted)
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Parallel efficiency")
g <- g + get_theme()
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-parallel-efficiency.pdf", sep="")
......
......@@ -23,9 +23,11 @@ gen_speed_plot <- function(d, model_wanted)
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Time (s)")
g <- g + get_theme()
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-speed.pdf", sep="")
print(output)
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
......
......@@ -48,6 +48,7 @@ gen_speedup_taskdep_plot <- function(d, model_wanted)
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Speedup")
g <- g + get_theme()
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-speedup.pdf", sep="")
......
......@@ -39,6 +39,7 @@ gen_times_taskdep_plot <- function(data, algo_wanted, model_wanted)
# Set title and X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("% of time")
g <- g + get_theme()
output <- paste(get_output_directory(), "/", model_wanted, "-", algo_wanted, "-times.pdf", sep="")
......
......@@ -14,8 +14,8 @@ source("gen_group_size_plots.R")
###
print("Generate Communication volume plot")
gen_comm("loutre.db")
#print("Generate Group size plot")
#gen_group_size("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")
......@@ -28,5 +28,6 @@ print("Generate Parrallel efficiency plot")
gen_pareff("loutre.db")
print("Generate Speedup plot")
gen_speedup("loutre.db")
warnings()
#print("Generate Gantt")
#gen_gantt("canard.db")
source("common.R")
source("gen_times_taskdep.R")
source("gen_efficiencies_taskdep.R")
source("gen_speedup_plots.R")
source("gen_parallel_efficiency_plots.R")
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")
data <- get_data_subset("loutre.db", 0L, 0L, "False", get_bsize_reference())
data <- subset(data, global_time >= 0)
# plot normalized time : simple mpi, implicit optimaux, explicit optimaux
output <- "output/normalized-time-final.pdf"
all_algo <- list("implicit-variable-bsize", "explicit-variable-bsize", "simple-mpi", "starpu")
d1 <- subset(data, algo %in% all_algo)
gen_normalized_time_plot(d1, all_algo, 0L)
# plot speed : implicit, implicit limited, explicit
output <- "output/normalized-time-limited.pdf"
all_algo <- list("implicit", "explicit", "implicit limited", "starpu")
d1 <- subset(data, algo %in% all_algo)
gen_normalized_time_plot(d1, all_algo, 0L)
# plot normalized time : implicit, explicit, implicit optimaux, explicite optimaux, simple mpi
output <- "output/normalized-time-bsize.pdf"
all_algo <- list("implicit-variable-bsize", "explicit-variable-bsize", "simple-mpi", "starpu", "implicit", "explicit")
# TODO récupérer l'ensemble des valeurs où il y a les 5
d1 <- subset(data, algo %in% all_algo)
d1 <- subset(d1, model == "cube" & npart == "70000000")
gen_normalized_time_plot(d1, all_algo, 0L)
#Plot for group size
data_all <- get_data_subset("loutre.db", 0L, 0L, "False", 0L)
# plot speed group size : implicit, explicit
output <- "output/bsize-speed.pdf"
all_algo <- list("implicit", "explicit")
d1 <- subset(data_all, algo %in% all_algo)
all_nnode <- unique(subset(d1, bsize != get_bsize_reference())$nnode)
d1 <- subset(d1, nnode %in% all_nnode)
gen_group_size_plot_speed(d1, 0L)
# plot comm group size : implicit
output <- "output/bsize-volume.pdf"
all_algo <- list("implicit")
d1 <- subset(data_all, algo %in% all_algo)
all_nnode <- unique(subset(d1, bsize != get_bsize_reference())$nnode)
d1 <- subset(d1, nnode %in% all_nnode)
gen_group_size_plot_comm(d1, 0L)
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