Commit 5bdaeeec authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas

Fix bugs in R script when there was no data available.

parent 9587ed5f
......@@ -6,36 +6,39 @@ gen_comm_plot <- function(db, d_breaks, model_wanted)
db <- subset(db, model == model_wanted)
db <- db[db$communication_vol > 0,]
g <- ggplot(data=db,aes_string(x="nnode", y="communication_vol", color="algo"))
g <- g + geom_line()
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 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("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))
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-comm.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
if (nrow(db) > 0)
{
g <- ggplot(data=db,aes_string(x="nnode", y="communication_vol", color="algo", group="algo"))
g <- g + geom_line()
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 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("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))
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-comm.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
}
gen_comm <- function(dbfile)
{
data <- get_data_subset(dbfile, 0L, 0L, "False", get_bsize_reference())
data <- subset(data, algo != get_one_node_reference_algorithm() & algo != "simple-mpi")
data <- subset(data, algo != get_one_node_reference_algorithm() & algo != "simple-mpi" & bsize == get_bsize_reference())
all_model <- unique(data$model)
for (i in 1:length(all_model))
{
......
......@@ -2,10 +2,44 @@ library(plyr)
library(ggplot2)
library(scales)
gen_group_size_plot <- function(d, model_wanted)
gen_group_size_plot_comm <- function(d, 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",
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("Communication volume (MB)")
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-bsize-volume.pdf", sep="")
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)
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",
......@@ -24,10 +58,12 @@ gen_group_size_plot <- function(d, model_wanted)
# 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))
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-bsize.pdf", sep="")
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)
}
}
gen_group_size <- function(dbfile)
......@@ -41,6 +77,7 @@ gen_group_size <- function(dbfile)
all_model <- unique(data$model)
for (i in 1:length(all_model))
{
gen_group_size_plot(data, all_model[i])
gen_group_size_plot_speed(data, all_model[i])
gen_group_size_plot_comm(data, all_model[i])
}
}
......@@ -43,28 +43,31 @@ gen_normalized_time_plot <- function(db, d_breaks, model_wanted)
db <- subset(db, algo != get_one_node_reference_algorithm())
db <- db[!(is.na(db$efficiency)),]
g <- ggplot(data=db,aes_string(x="nnode", y="efficiency", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
.default=label_both,
.multi_line=FALSE))
if(nrow(db) > 0)
{
g <- ggplot(data=db,aes_string(x="nnode", y="efficiency", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_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("Number of nodes")
g <- g + ylab("Normalized time")
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Normalized time")
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-normalized-time.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-normalized-time.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
}
gen_normalized_time <- function(dbfile)
......
......@@ -39,27 +39,30 @@ gen_pareff_plot <- function(db, d_breaks, model_wanted)
db <- calc_parallel_efficiency(db, d_breaks)
db <- db[!(is.na(db$efficiency)),]
g <- ggplot(data=db,aes_string(x="nnode", y="efficiency", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
.default=label_both,
.multi_line=FALSE))
if(nrow(db) > 0)
{
g <- ggplot(data=db,aes_string(x="nnode", y="efficiency", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_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("Number of nodes")
g <- g + ylab("Parallel efficiency")
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Parallel efficiency")
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-parallel-efficiency.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-parallel-efficiency.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
}
gen_pareff <- function(dbfile)
......
......@@ -16,6 +16,10 @@ calc_speedup <- function(data, ref_algo)
}
else
{
if(nrow(tmp_ref) > 1)
{
print(nrow(tmp_ref))
}
data$speedup[i] <- tmp_ref$global_time / data$global_time[i]
}
}
......
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