creams: fix indentation

This commit is contained in:
Rodrigo Arias Mallo 2020-12-18 12:43:06 +01:00
parent 76f2ef4b95
commit afd333adef

View File

@ -11,11 +11,11 @@ if (length(args)>0) { input_file = args[1] }
# Load the dataset in NDJSON format # Load the dataset in NDJSON format
dataset = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% dataset = jsonlite::stream_in(file(input_file), verbose=FALSE) %>%
jsonlite::flatten() jsonlite::flatten()
# We only need some colums # We only need some colums
df = select(dataset, unit, config.nodes, config.gitBranch, time) %>% df = select(dataset, unit, config.nodes, config.gitBranch, time) %>%
rename(nodes=config.nodes, gitBranch=config.gitBranch) rename(nodes=config.nodes, gitBranch=config.gitBranch)
df$unit = as.factor(df$unit) df$unit = as.factor(df$unit)
df$nnodes = df$nodes df$nnodes = df$nodes
@ -27,23 +27,23 @@ levels(df$gitBranch) <- substring((levels(df$gitBranch)), 8)
# Compute new columns # Compute new columns
D=group_by(df, unit) %>% D=group_by(df, unit) %>%
mutate(tnorm = time / median(time) - 1) %>% mutate(tnorm = time / median(time) - 1) %>%
mutate(bad = ifelse(max(abs(tnorm)) >= 0.01, 1, 0)) %>% mutate(bad = ifelse(max(abs(tnorm)) >= 0.01, 1, 0)) %>%
mutate(variability = ifelse(bad > 0, "large", "ok")) %>% mutate(variability = ifelse(bad > 0, "large", "ok")) %>%
mutate(mtime = median(time)) %>% mutate(mtime = median(time)) %>%
mutate(nmtime = mtime*nnodes) %>% mutate(nmtime = mtime*nnodes) %>%
mutate(ntime = time*nnodes) %>% mutate(ntime = time*nnodes) %>%
ungroup() %>% ungroup() %>%
mutate(min_nmtime = min(nmtime)) %>% mutate(min_nmtime = min(nmtime)) %>%
mutate(rnmtime = nmtime / min_nmtime) %>% mutate(rnmtime = nmtime / min_nmtime) %>%
mutate(rntime = ntime / min_nmtime) %>% mutate(rntime = ntime / min_nmtime) %>%
mutate(rmeff = 1.0 / rnmtime) %>% mutate(rmeff = 1.0 / rnmtime) %>%
mutate(reff = 1.0 / rntime) %>% mutate(reff = 1.0 / rntime) %>%
group_by(gitBranch) %>% group_by(gitBranch) %>%
mutate(tmax = max(mtime)) %>% mutate(tmax = max(mtime)) %>%
mutate(speedup=tmax/time) %>% mutate(speedup=tmax/time) %>%
mutate(eff=speedup/nnodes) %>% mutate(eff=speedup/nnodes) %>%
mutate(mspeedup=tmax/mtime) %>% mutate(mspeedup=tmax/mtime) %>%
mutate(meff=mspeedup/nnodes) %>% mutate(meff=mspeedup/nnodes) %>%
ungroup() ungroup()
@ -56,32 +56,32 @@ w=5
png("variability.png", width=1.5*w*ppi, height=h*ppi, res=ppi) png("variability.png", width=1.5*w*ppi, height=h*ppi, res=ppi)
p = ggplot(data=D, aes(x=nodes, y=tnorm, color=variability)) + p = ggplot(data=D, aes(x=nodes, y=tnorm, color=variability)) +
theme_bw() + theme_bw() +
theme(plot.subtitle=element_text(size=8)) + theme(plot.subtitle=element_text(size=8)) +
# Add the maximum allowed error lines # Add the maximum allowed error lines
geom_hline(yintercept=c(-0.01, 0.01), geom_hline(yintercept=c(-0.01, 0.01),
linetype="dashed", color="gray") + linetype="dashed", color="gray") +
# Draw boxplots # Draw boxplots
geom_boxplot(aes(fill=gitBranch)) + geom_boxplot(aes(fill=gitBranch)) +
scale_color_manual(values=c("brown", "black")) + scale_color_manual(values=c("brown", "black")) +
# Labels # Labels
labs(x="Nodes", y="Normalized time", title="Creams strong scaling", labs(x="Nodes", y="Normalized time", title="Creams strong scaling",
subtitle=input_file) subtitle=input_file)
print(p) print(p)
dev.off() dev.off()
png("time.png", width=w*1.5*ppi, height=h*ppi, res=ppi) png("time.png", width=w*1.5*ppi, height=h*ppi, res=ppi)
p = ggplot(D, aes(x=nodes, y=mtime, color=gitBranch)) + p = ggplot(D, aes(x=nodes, y=mtime, color=gitBranch)) +
theme_bw() + theme_bw() +
theme(plot.subtitle=element_text(size=8)) + theme(plot.subtitle=element_text(size=8)) +
geom_line(aes(group=gitBranch)) + geom_line(aes(group=gitBranch)) +
#geom_point() + #geom_point() +
geom_point(aes(shape=variability), size=3) + geom_point(aes(shape=variability), size=3) +
scale_shape_manual(values=c(21, 19)) + scale_shape_manual(values=c(21, 19)) +
# position=position_dodge(width=0.3)) + # position=position_dodge(width=0.3)) +
#scale_x_continuous(trans=log2_trans()) + #scale_x_continuous(trans=log2_trans()) +
scale_y_continuous(trans=log2_trans()) + scale_y_continuous(trans=log2_trans()) +
labs(x="Nodes", y="Time (s)", labs(x="Nodes", y="Time (s)",
title="Creams strong scaling (lower is better)", title="Creams strong scaling (lower is better)",
subtitle=input_file) subtitle=input_file)
print(p) print(p)
@ -89,18 +89,18 @@ dev.off()
png("refficiency.png", width=w*1.5*ppi, height=h*ppi, res=ppi) png("refficiency.png", width=w*1.5*ppi, height=h*ppi, res=ppi)
p = ggplot(D, aes(x=nodes, y=rmeff, color=gitBranch)) + p = ggplot(D, aes(x=nodes, y=rmeff, color=gitBranch)) +
theme_bw() + theme_bw() +
theme(plot.subtitle=element_text(size=8)) + theme(plot.subtitle=element_text(size=8)) +
geom_line(aes(group=gitBranch)) + geom_line(aes(group=gitBranch)) +
geom_point(aes(shape=variability), size=3) + geom_point(aes(shape=variability), size=3) +
#geom_boxplot(aes(y=reff), #geom_boxplot(aes(y=reff),
# position=position_dodge(width=0.0)) + # position=position_dodge(width=0.0)) +
scale_shape_manual(values=c(21, 19)) + scale_shape_manual(values=c(21, 19)) +
#geom_point(aes(y=rntime), #geom_point(aes(y=rntime),
# position=position_dodge(width=0.3)) + # position=position_dodge(width=0.3)) +
#scale_x_continuous(trans=log2_trans()) + #scale_x_continuous(trans=log2_trans()) +
#scale_y_continuous(trans=log2_trans()) + #scale_y_continuous(trans=log2_trans()) +
labs(x="Nodes", y="Relative efficiency (to best)", labs(x="Nodes", y="Relative efficiency (to best)",
title="Creams strong scaling (higher is better)", title="Creams strong scaling (higher is better)",
subtitle=input_file) subtitle=input_file)
print(p) print(p)