saiph: add figures for blocking experiment

This commit is contained in:
Sandra 2021-02-19 11:09:27 +01:00 committed by Rodrigo Arias Mallo
parent a2306eb941
commit 0ac0205366
8 changed files with 744 additions and 0 deletions

100
garlic/fig/saiph/blocking.R Normal file
View File

@ -0,0 +1,100 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input.json"
if (length(args)>0) { input_file = args[1] }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df = select(dataset, config.nby, time) %>%
rename(nby=config.nby)
df$nby = as.factor(df$nby)
# Normalize the time by the median
D=group_by(df, nby) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D$bad = as.factor(D$bad)
print(D)
ppi=300
h=5
w=5
png("box.png", width=w*ppi, height=h*ppi, res=ppi)
#
#
#
# Create the plot with the normalized time vs nblocks
p = ggplot(data=D, aes(x=nby, y=tnorm, color=bad)) +
# Labels
labs(x="nb{y-z}", y="Normalized time",
title=sprintf("Saiph-Heat3D normalized time"),
subtitle=input_file) +
# Center the title
#theme(plot.title = element_text(hjust = 0.5)) +
# Black and white mode (useful for printing)
#theme_bw() +
# Add the maximum allowed error lines
geom_hline(yintercept=c(-0.01, 0.01),
linetype="dashed", color="gray") +
# Draw boxplots
geom_boxplot() +
scale_color_manual(values=c("black", "brown")) +
#scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = "none")
#theme(legend.position = c(0.85, 0.85))
# Render the plot
print(p)
## Save the png image
dev.off()
#
png("scatter.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot(D, aes(x=nby, y=time)) +
labs(x="nb{y-z}", y="Time (s)",
title=sprintf("Saiph-Heat3D blocking-granularity"),
subtitle=input_file) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = c(0.5, 0.88)) +
geom_point(shape=21, size=3) +
#scale_x_continuous(trans=log2_trans()) +
scale_y_continuous(trans=log2_trans())
# Render the plot
print(p)
# Save the png image
dev.off()

View File

@ -0,0 +1,77 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input1.json"
if (length(args)>0) { input_file = args[1] }
input_file2 = "input2.json"
if (length(args)>0) { input_file2 = args[1] }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
jsonlite::flatten()
dataset2 = jsonlite::stream_in(file(input_file2)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df = select(dataset, config.nby, time) %>%
rename(nby=config.nby)
df$nby = as.factor(df$nby)
df2 = select(dataset2, config.nbz, time) %>%
rename(nbz=config.nbz)
df2$nbz = as.factor(df2$nbz)
# Normalize the time by the median
D=group_by(df, nby) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D$bad = as.factor(D$bad)
print(D)
D2=group_by(df2, nbz) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D2$bad = as.factor(D2$bad)
print(D)
print(D2)
png("scatter-blockY8Z_yZ8.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot() +
geom_point(data=D, aes(x=nby, y=time, colour="nby blocks - nbz = 8"), shape=1, size=3) +
geom_point(data=D2, aes(x=nbz, y=time, colour="nby = 8 - nbz blocks"), shape=1, size=3) +
labs(x="nb", y="Time (s)",
title=sprintf("Saiph-Heat3D blockingY/Z"),
subtitle=input_file) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = "right") +
geom_point(shape=21, size=3) +
scale_colour_discrete("Blocked directions")
#+ scale_x_continuous(trans=log2_trans())
#+ scale_y_continuous(trans=log2_trans())
# Render the plot
print(p)
# Save the png image
dev.off()

View File

@ -0,0 +1,100 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input.json"
if (length(args)>0) { input_file = args[1] }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df = select(dataset, config.nby, time) %>%
rename(nby=config.nby)
df$nby = as.factor(df$nby)
# Normalize the time by the median
D=group_by(df, nby) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D$bad = as.factor(D$bad)
print(D)
ppi=300
h=5
w=5
png("box.png", width=w*ppi, height=h*ppi, res=ppi)
#
#
#
# Create the plot with the normalized time vs nblocks
p = ggplot(data=D, aes(x=nby, y=tnorm, color=bad)) +
# Labels
labs(x="nby", y="Normalized time",
title=sprintf("Saiph-Heat3D normalized time"),
subtitle=input_file) +
# Center the title
#theme(plot.title = element_text(hjust = 0.5)) +
# Black and white mode (useful for printing)
#theme_bw() +
# Add the maximum allowed error lines
geom_hline(yintercept=c(-0.01, 0.01),
linetype="dashed", color="gray") +
# Draw boxplots
geom_boxplot() +
scale_color_manual(values=c("black", "brown")) +
#scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = "none")
#theme(legend.position = c(0.85, 0.85))
# Render the plot
print(p)
## Save the png image
dev.off()
#
png("scatter.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot(D, aes(x=nby, y=time)) +
labs(x="nby", y="Time (s)",
title=sprintf("Saiph-Heat3D blockingY"),
subtitle=input_file) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = c(0.5, 0.88)) +
geom_point(shape=21, size=3)
#+ scale_x_continuous(trans=log2_trans())
#+ scale_y_continuous(trans=log2_trans())
# Render the plot
print(p)
# Save the png image
dev.off()

View File

@ -0,0 +1,100 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input.json"
if (length(args)>0) { input_file = args[1] }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df = select(dataset, config.nbz, time) %>%
rename(nbz=config.nbz)
df$nbz = as.factor(df$nbz)
# Normalize the time by the median
D=group_by(df, nbz) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D$bad = as.factor(D$bad)
print(D)
ppi=300
h=5
w=5
png("box.png", width=w*ppi, height=h*ppi, res=ppi)
#
#
#
# Create the plot with the normalized time vs nblocks
p = ggplot(data=D, aes(x=nbz, y=tnorm, color=bad)) +
# Labels
labs(x="nbz", y="Normalized time",
title=sprintf("Saiph-Heat3D normalized time - nby = 8"),
subtitle=input_file) +
# Center the title
#theme(plot.title = element_text(hjust = 0.5)) +
# Black and white mode (useful for printing)
#theme_bw() +
# Add the maximum allowed error lines
geom_hline(yintercept=c(-0.01, 0.01),
linetype="dashed", color="gray") +
# Draw boxplots
geom_boxplot() +
scale_color_manual(values=c("black", "brown")) +
#scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = "none")
#theme(legend.position = c(0.85, 0.85))
# Render the plot
print(p)
## Save the png image
dev.off()
#
png("scatter.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot(D, aes(x=nbz, y=time)) +
labs(x="nbz", y="Time (s)",
title=sprintf("Saiph-Heat3D blockingZ - nby = 8"),
subtitle=input_file) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = c(0.5, 0.88)) +
geom_point(shape=21, size=3)
#+ scale_x_continuous(trans=log2_trans())
#+ scale_y_continuous(trans=log2_trans())
# Render the plot
print(p)
# Save the png image
dev.off()

View File

@ -0,0 +1,100 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input.json"
if (length(args)>0) { input_file = args[1] }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df = select(dataset, config.nbz, time) %>%
rename(nbz=config.nbz)
df$nbz = as.factor(df$nbz)
# Normalize the time by the median
D=group_by(df, nbz) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D$bad = as.factor(D$bad)
print(D)
ppi=300
h=5
w=5
png("box.png", width=w*ppi, height=h*ppi, res=ppi)
#
#
#
# Create the plot with the normalized time vs nblocks
p = ggplot(data=D, aes(x=nbz, y=tnorm, color=bad)) +
# Labels
labs(x="nbz", y="Normalized time",
title=sprintf("Saiph-Heat3D normalized time"),
subtitle=input_file) +
# Center the title
#theme(plot.title = element_text(hjust = 0.5)) +
# Black and white mode (useful for printing)
#theme_bw() +
# Add the maximum allowed error lines
geom_hline(yintercept=c(-0.01, 0.01),
linetype="dashed", color="gray") +
# Draw boxplots
geom_boxplot() +
scale_color_manual(values=c("black", "brown")) +
#scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = "none")
#theme(legend.position = c(0.85, 0.85))
# Render the plot
print(p)
## Save the png image
dev.off()
#
png("scatter.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot(D, aes(x=nbz, y=time)) +
labs(x="nbz", y="Time (s)",
title=sprintf("Saiph-Heat3D blockingZ"),
subtitle=input_file) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = c(0.5, 0.88)) +
geom_point(shape=21, size=3)
#+ scale_x_continuous(trans=log2_trans())
#+ scale_y_continuous(trans=log2_trans())
# Render the plot
print(p)
# Save the png image
dev.off()

View File

@ -0,0 +1,100 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input.json"
if (length(args)>0) { input_file = args[1] }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df = select(dataset, config.nby, time) %>%
rename(nby=config.nby)
df$nby = as.factor(df$nby)
# Normalize the time by the median
D=group_by(df, nby) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D$bad = as.factor(D$bad)
print(D)
ppi=300
h=5
w=5
png("box.png", width=w*ppi, height=h*ppi, res=ppi)
#
#
#
# Create the plot with the normalized time vs nblocks
p = ggplot(data=D, aes(x=nby, y=tnorm, color=bad)) +
# Labels
labs(x="nby", y="Normalized time",
title=sprintf("Saiph-Heat3D normalized time - nbz = 8"),
subtitle=input_file) +
# Center the title
#theme(plot.title = element_text(hjust = 0.5)) +
# Black and white mode (useful for printing)
#theme_bw() +
# Add the maximum allowed error lines
geom_hline(yintercept=c(-0.01, 0.01),
linetype="dashed", color="gray") +
# Draw boxplots
geom_boxplot() +
scale_color_manual(values=c("black", "brown")) +
#scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = "none")
#theme(legend.position = c(0.85, 0.85))
# Render the plot
print(p)
## Save the png image
dev.off()
#
png("scatter.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot(D, aes(x=nby, y=time)) +
labs(x="nby", y="Time (s)",
title=sprintf("Saiph-Heat3D blockingY - nbz = 8"),
subtitle=input_file) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = c(0.5, 0.88)) +
geom_point(shape=21, size=3)
#+ scale_x_continuous(trans=log2_trans())
#+ scale_y_continuous(trans=log2_trans())
# Render the plot
print(p)
# Save the png image
dev.off()

View File

@ -0,0 +1,67 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file1 = "input1.json"
if (length(args)>0) { input_file1 = args[1] }
input_file2 = "input2.json"
if (length(args)>1) { input_file2 = args[2] }
# Load the dataset in NDJSON format
dataset1 = jsonlite::stream_in(file(input_file1)) %>%
jsonlite::flatten()
dataset2 = jsonlite::stream_in(file(input_file2)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df1 = select(dataset1, config.nbx, time) %>%
rename(nb1=config.nbx)
df2 = select(dataset2, config.nby, time) %>%
rename(nb2=config.nby)
df1$nb1 = as.factor(df1$nb1)
df2$nb2 = as.factor(df2$nb2)
# Normalize the time by the median
D1=group_by(df1, nb1)
D2=group_by(df2, nb2)
print(D1)
print(D2)
ppi=300
h=5
w=7
png("scatter_granularity_and_blocking.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot() +
geom_point(data=D1, aes(x=nb1, y=time, colour = 'nbx-nby-nbz'), shape=1, size=4) +
geom_point(data=D2, aes(x=nb2, y=time, colour = 'nby-nbz'), shape=1, size=4) +
labs(x="nb", y="Time (s)",
title=sprintf("Saiph-Heat3D granularity & blocking"),
subtitle=input_file1) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
#theme(legend.position = c(0.5, 0.88)) +
theme(legend.position = "right") +
geom_point(shape=21, size=3) +
#scale_x_continuous(trans=log2_trans()) +
scale_y_continuous(trans=log2_trans()) +
scale_colour_discrete("Blocked directions")
# Render the plot
print(p)
# Save the png image
dev.off()

View File

@ -0,0 +1,100 @@
library(ggplot2)
library(dplyr)
library(scales)
library(jsonlite)
args=commandArgs(trailingOnly=TRUE)
# Read the timetable from args[1]
input_file = "input.json"
if (length(args)>0) { input_file = args[1] }
# Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file)) %>%
jsonlite::flatten()
# We only need the nblocks and time
df = select(dataset, config.nodes, time) %>%
rename(nodes=config.nodes)
df$nodes = as.factor(df$nodes)
# Normalize the time by the median
D=group_by(df, nodes) %>%
mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
D$bad = as.factor(D$bad)
print(D)
ppi=300
h=5
w=5
png("box.png", width=w*ppi, height=h*ppi, res=ppi)
#
#
#
# Create the plot with the normalized time vs nblocks
p = ggplot(data=D, aes(x=nodes, y=tnorm, color=bad)) +
# Labels
labs(x="#nodes", y="Normalized time",
title=sprintf("Saiph-Heat3D Strong-Scaling\nLocal blocking nb{y-z} = 4"),
subtitle=input_file) +
# Center the title
#theme(plot.title = element_text(hjust = 0.5)) +
# Black and white mode (useful for printing)
#theme_bw() +
# Add the maximum allowed error lines
geom_hline(yintercept=c(-0.01, 0.01),
linetype="dashed", color="gray") +
# Draw boxplots
geom_boxplot() +
scale_color_manual(values=c("black", "brown")) +
#scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = "none")
#theme(legend.position = c(0.85, 0.85))
# Render the plot
print(p)
## Save the png image
dev.off()
#
png("scatter.png", width=w*ppi, height=h*ppi, res=ppi)
#
## Create the plot with the normalized time vs nblocks
p = ggplot(D, aes(x=nodes, y=time)) +
labs(x="#nodes", y="Time (s)",
title=sprintf("Saiph-Heat3D Strong-Scaling\nLocal blocking nb{y-z} = 4"),
subtitle=input_file) +
theme_bw() +
theme(plot.subtitle=element_text(size=8)) +
theme(legend.position = c(0.5, 0.88)) +
geom_point(shape=21, size=3) +
#scale_x_continuous(trans=log2_trans()) +
scale_y_continuous(trans=log2_trans())
# Render the plot
print(p)
# Save the png image
dev.off()