diff --git a/garlic/fig/index.nix b/garlic/fig/index.nix index 263a574..6f6ff4b 100644 --- a/garlic/fig/index.nix +++ b/garlic/fig/index.nix @@ -31,8 +31,8 @@ in { nbody = with exp.nbody; { granularity = stdPlot ./nbody/granularity.R [ granularity ]; - nodesorsockets = stdPlot ./nbody/nodes-or-sockets.R [ nodesorsockets ]; - scaling = stdPlot ./nbody/scaling.R [ scaling ]; + ss = stdPlot ./nbody/ss.R [ ss ]; + numa = stdPlot ./nbody/numa.R [ numa ]; }; hpcg = with exp.hpcg; { diff --git a/garlic/fig/nbody/granularity.R b/garlic/fig/nbody/granularity.R index 495f0e3..eb9c829 100644 --- a/garlic/fig/nbody/granularity.R +++ b/garlic/fig/nbody/granularity.R @@ -10,10 +10,11 @@ if (length(args)>0) { input_file = args[1] } else { input_file = "input" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% jsonlite::flatten() %>% - select(config.blocksize, config.gitBranch, unit, time) %>% - rename(blocksize=config.blocksize, branch=config.gitBranch) %>% + select(config.blocksize, config.gitBranch, config.particles, unit, time) %>% + rename(blocksize=config.blocksize, particles=config.particles, branch=config.gitBranch) %>% mutate(blocksize = as.factor(blocksize)) %>% + mutate(particles = as.factor(particles)) %>% mutate(branch = as.factor(branch)) %>% mutate(unit = as.factor(unit)) %>% @@ -27,22 +28,7 @@ df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% dpi = 300 h = 5 -w = 8 - -# --------------------------------------------------------------------- - -p = ggplot(df, aes(x=blocksize, y=median.time, color=branch)) + - geom_point() + - geom_line(aes(group=branch)) + - theme_bw() + - labs(x="Blocksize", y="Median time (s)", title="NBody Granularity: Median Time", - subtitle=input_file) + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - theme(legend.text = element_text(size=7)) - -ggsave("median.time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("median.time.pdf", plot=p, width=w, height=h, dpi=dpi) +w = 5 # --------------------------------------------------------------------- @@ -53,7 +39,7 @@ p = ggplot(df, aes(x=blocksize, y=normalized.time, color=branch)) + theme_bw() + labs(x="Blocksize", y="Normalized Time", title="NBody Granularity: Normalized Time", subtitle=input_file) + - theme(plot.subtitle=element_text(size=5)) + + theme(plot.subtitle=element_text(size=8)) + theme(legend.position="bottom") + theme(legend.text = element_text(size=7)) @@ -62,31 +48,14 @@ ggsave("normalized.time.pdf", plot=p, width=w, height=h, dpi=dpi) # --------------------------------------------------------------------- -p = ggplot(df, aes(x=blocksize, y=time, color=branch)) + - geom_point(shape=21, size=3) + +p = ggplot(df, aes(x=blocksize, y=time)) + + geom_boxplot() + theme_bw() + labs(x="Blocksize", y="Time (s)", title="NBody Granularity: Time", subtitle=input_file) + - theme(plot.subtitle=element_text(size=5)) + + theme(plot.subtitle=element_text(size=8)) + theme(legend.position="bottom") + theme(legend.text = element_text(size=7)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) ggsave("time.pdf", plot=p, width=w, height=h, dpi=dpi) - - -# --------------------------------------------------------------------- - -p = ggplot(df, aes(x=blocksize, y=branch, fill=median.time)) + - geom_raster() + - scale_fill_viridis(option="plasma") + - coord_fixed() + - theme_bw() + - labs(x="Blocksize", y="Branch", title="NBody Granularity: Time", - subtitle=input_file) + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - theme(legend.text = element_text(size=7)) - -ggsave("time.heatmap.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("time.heatmap.pdf", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/nbody/nodes-or-sockets.R b/garlic/fig/nbody/nodes-or-sockets.R deleted file mode 100644 index 21b6b3f..0000000 --- a/garlic/fig/nbody/nodes-or-sockets.R +++ /dev/null @@ -1,168 +0,0 @@ -library(ggplot2) -library(dplyr, warn.conflicts = FALSE) -library(scales) -library(jsonlite) -library(viridis, warn.conflicts = FALSE) - -# Load the arguments (argv) -args = commandArgs(trailingOnly=TRUE) -if (length(args)>0) { input_file = args[1] } else { input_file = "input" } - -dfNuma = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% - jsonlite::flatten() %>% - select(config.blocksize, config.gitBranch, config.socketAtt, config.useNumact, unit, time) %>% - rename(blocksize=config.blocksize, branch=config.gitBranch, attachment=config.socketAtt, usenuma=config.useNumact) %>% - - mutate(blocksize = as.factor(blocksize)) %>% - mutate(branch = as.factor(branch)) %>% - mutate(attachment = as.factor(attachment)) %>% - mutate(usenuma = as.factor(usenuma)) %>% - mutate(unit = as.factor(unit)) %>% - - group_by(unit) %>% - - mutate(median.time = median(time)) %>% - mutate(normalized.time = time / median.time - 1) %>% - mutate(log.median.time = log(median.time)) %>% - - filter(usenuma == TRUE) %>% - - ungroup() - -dfNonuma = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% - jsonlite::flatten() %>% - select(config.blocksize, config.gitBranch, config.socketAtt, config.useNumact, unit, time) %>% - rename(blocksize=config.blocksize, branch=config.gitBranch, attachment=config.socketAtt, usenuma=config.useNumact) %>% - - mutate(blocksize = as.factor(blocksize)) %>% - mutate(branch = as.factor(branch)) %>% - mutate(attachment = as.factor(attachment)) %>% - mutate(usenuma = as.factor(usenuma)) %>% - mutate(unit = as.factor(unit)) %>% - - group_by(unit) %>% - - mutate(median.time = median(time)) %>% - mutate(normalized.time = time / median.time - 1) %>% - mutate(log.median.time = log(median.time)) %>% - - filter(usenuma == FALSE) %>% - - ungroup() - -dpi = 300 -h = 5 -w = 8 - - -# --------------------------------------------------------------------- - -p = ggplot(dfNuma, aes(x=blocksize, y=median.time, color=attachment)) + - geom_point() + - geom_line(aes(group=attachment)) + - theme_bw() + - labs(x="Blocksize", y="Median time (s)", title="NBody Granularity (tampi+send+oss+task | numactl ON | 4 Nodes): Median Time", - subtitle=input_file, color="Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - -ggsave("median-numactl.time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("median-numactl.time.pdf", plot=p, width=w, height=h, dpi=dpi) - -p = ggplot(dfNonuma, aes(x=blocksize, y=median.time, color=attachment)) + - geom_point() + - geom_line(aes(group=attachment)) + - theme_bw() + - labs(x="Blocksize", y="Median time (s)", title="NBody Granularity (tampi+send+oss+task | numactl OFF | 4 Nodes): Median Time", - subtitle=input_file, color="Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - -ggsave("median.time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("median.time.pdf", plot=p, width=w, height=h, dpi=dpi) -# --------------------------------------------------------------------- - -p = ggplot(dfNuma, aes(x=blocksize, y=normalized.time, color=attachment)) + - geom_boxplot() + - geom_hline(yintercept=c(-0.01, 0.01), linetype="dashed", color="red") + - facet_wrap(~ attachment) + - theme_bw() + - labs(x="Blocksize", y="Normalized Time", title="NBody Granularity (tampi+send+oss+task | numactl ON | 4 Nodes): Normalized Time", - subtitle=input_file, color="Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - -ggsave("normalized-numactl.time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("normalized-numactl.time.pdf", plot=p, width=w, height=h, dpi=dpi) - -p = ggplot(dfNonuma, aes(x=blocksize, y=normalized.time, color=attachment)) + - geom_boxplot() + - geom_hline(yintercept=c(-0.01, 0.01), linetype="dashed", color="red") + - facet_wrap(~ attachment) + - theme_bw() + - labs(x="Blocksize", y="Normalized Time", title="NBody Granularity (tampi+send+oss+task | 4 Nodes): Normalized Time", - subtitle=input_file, color="Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - -ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("normalized.time.pdf", plot=p, width=w, height=h, dpi=dpi) -# --------------------------------------------------------------------- - -p = ggplot(dfNuma, aes(x=blocksize, y=time, color=attachment)) + - geom_point(shape=21, size=3) + - theme_bw() + - labs(x="Blocksize", y="Time (s)", title="NBody Granularity (tampi+send+oss+task | numactl ON | 4 Nodes): Time", - subtitle=input_file, color="Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - -ggsave("time-numactl.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("time-numactl.pdf", plot=p, width=w, height=h, dpi=dpi) - -p = ggplot(dfNonuma, aes(x=blocksize, y=time, color=attachment)) + - geom_point(shape=21, size=3) + - theme_bw() + - labs(x="Blocksize", y="Time (s)", title="NBody Granularity (tampi+send+oss+task | 4 Nodes): Time", - subtitle=input_file, color="Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - - -ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("time.pdf", plot=p, width=w, height=h, dpi=dpi) -# --------------------------------------------------------------------- - -p = ggplot(dfNuma, aes(x=blocksize, y=attachment, fill=median.time)) + - geom_raster() + - scale_fill_viridis(option="plasma") + - coord_fixed() + - theme_bw() + - labs(x="Blocksize", y="Attachment", title="NBody Granularity (tampi+send+oss+task | numactl ON | 4 Nodes): Time", - subtitle=input_file, color = "Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - -ggsave("time-numactl.heatmap.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("time-numactl.heatmap.pdf", plot=p, width=w, height=h, dpi=dpi) - -p = ggplot(dfNonuma, aes(x=blocksize, y=attachment, fill=median.time)) + - geom_raster() + - scale_fill_viridis(option="plasma") + - coord_fixed() + - theme_bw() + - labs(x="Blocksize", y="Attachment", title="NBody Granularity (tampi+send+oss+task | 4 Nodes): Time", - subtitle=input_file, color = "Rank Attachment") + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - scale_color_manual(labels = c("RanksPerNode", "RanksPerSocket"), values=c("blue", "red")) - -ggsave("time.heatmap.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("time.heatmap.pdf", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/nbody/numa.R b/garlic/fig/nbody/numa.R new file mode 100644 index 0000000..a76eb12 --- /dev/null +++ b/garlic/fig/nbody/numa.R @@ -0,0 +1,85 @@ +library(ggplot2) +library(dplyr, warn.conflicts = FALSE) +library(scales) +library(jsonlite) +library(viridis, warn.conflicts = FALSE) +library(stringr) + +# Load the arguments (argv) +args = commandArgs(trailingOnly=TRUE) +if (length(args)>0) { input_file = args[1] } else { input_file = "input" } + +df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% + jsonlite::flatten() %>% + select(unit, + config.blocksize, + config.gitBranch, + config.attachToSocket, + config.interleaveMem, + config.nodes, + unit, + time) %>% + + rename(blocksize=config.blocksize, + gitBranch=config.gitBranch, + nodes=config.nodes, + attachToSocket=config.attachToSocket, + interleaveMem=config.interleaveMem) %>% + + # Remove the "garlic/" prefix from the gitBranch + mutate(branch = str_replace(gitBranch, "garlic/", "")) %>% + + mutate(blocksize = as.factor(blocksize)) %>% + mutate(branch = as.factor(branch)) %>% + mutate(attachToSocket = as.factor(attachToSocket)) %>% + mutate(interleaveMem = as.factor(interleaveMem)) %>% + mutate(unit = as.factor(unit)) %>% + + group_by(unit) %>% + + mutate(median.time = median(time)) %>% + mutate(normalized.time = time / median.time - 1) %>% + mutate(log.median.time = log(median.time)) %>% + + ungroup() + +branch = unique(df$branch) +nodes = unique(df$nodes) + +dpi = 300 +h = 5 +w = 8 + +# --------------------------------------------------------------------- + +p = ggplot(df, aes(x=blocksize, y=normalized.time, color=interleaveMem)) + + geom_boxplot() + + geom_hline(yintercept=c(-0.01, 0.01), linetype="dashed", color="red") + + theme_bw() + + facet_wrap(~ attachToSocket, labeller=label_both) + + labs(x="Blocksize", y="Normalized time", + title=sprintf("NBody NUMA (%s | %d Nodes): Normalized time", + branch, nodes), + subtitle=input_file) + + theme(plot.subtitle=element_text(size=8)) + + theme(legend.position="bottom") + +ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) +ggsave("normalized.time.pdf", plot=p, width=w, height=h, dpi=dpi) + +# --------------------------------------------------------------------- + +p = ggplot(df, aes(x=blocksize, y=time, color=interleaveMem)) + + geom_boxplot() + + geom_line(aes(y=median.time)) + + theme_bw() + + facet_wrap(~ attachToSocket, labeller=label_both) + + labs(x="Blocksize", y="Time (s)", + title=sprintf("NBody NUMA (%s | %d Nodes): Time", + branch, nodes), + subtitle=input_file) + + theme(plot.subtitle=element_text(size=8)) + + theme(legend.position="bottom") + +ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) +ggsave("time.pdf", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/nbody/scaling.R b/garlic/fig/nbody/ss.R similarity index 52% rename from garlic/fig/nbody/scaling.R rename to garlic/fig/nbody/ss.R index 60a9e4a..041cd82 100644 --- a/garlic/fig/nbody/scaling.R +++ b/garlic/fig/nbody/ss.R @@ -10,8 +10,10 @@ if (length(args)>0) { input_file = args[1] } else { input_file = "input" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% jsonlite::flatten() %>% - select(config.blocksize, config.gitBranch, config.numNodes, unit, time) %>% - rename(nodes = config.numNodes, blocksize=config.blocksize, branch=config.gitBranch) %>% + select(config.blocksize, config.gitBranch, config.nodes, unit, time) %>% + rename(nodes = config.nodes, blocksize=config.blocksize, branch=config.gitBranch) %>% + + mutate(time.nodes = time * nodes) %>% mutate(blocksize = as.factor(blocksize)) %>% mutate(nodes = as.factor(nodes)) %>% @@ -21,6 +23,7 @@ df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% group_by(unit) %>% mutate(median.time = median(time)) %>% + mutate(median.time.nodes = median(time.nodes)) %>% mutate(normalized.time = time / median.time - 1) %>% mutate(log.median.time = log(median.time)) %>% @@ -32,21 +35,6 @@ w = 8 # --------------------------------------------------------------------- -p = ggplot(df, aes(x=nodes, y=median.time, color=branch)) + - geom_point() + - geom_line(aes(group=branch)) + - theme_bw() + - labs(x="Nodes", y="Median time (s)", title="NBody Scaling: Median Time", - subtitle=input_file) + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - theme(legend.text = element_text(size=7)) - -ggsave("median.time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("median.time.pdf", plot=p, width=w, height=h, dpi=dpi) - -# --------------------------------------------------------------------- - p = ggplot(df, aes(x=nodes, y=normalized.time, color=branch)) + geom_boxplot() + geom_hline(yintercept=c(-0.01, 0.01), linetype="dashed", color="red") + @@ -63,31 +51,15 @@ ggsave("normalized.time.pdf", plot=p, width=w, height=h, dpi=dpi) # --------------------------------------------------------------------- -p = ggplot(df, aes(x=nodes, y=time, color=branch)) + +p = ggplot(df, aes(x=nodes, y=time.nodes, color=branch)) + geom_point(shape=21, size=3) + + geom_line(aes(y=median.time.nodes, group=branch)) + theme_bw() + - labs(x="Nodes", y="Time (s)", title="NBody Scaling: Time", + labs(x="Nodes", y="Time * nodes (s)", title="NBody Scaling: Time * nodes", subtitle=input_file) + theme(plot.subtitle=element_text(size=5)) + theme(legend.position="bottom") + theme(legend.text = element_text(size=7)) -ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("time.pdf", plot=p, width=w, height=h, dpi=dpi) - - -# --------------------------------------------------------------------- - -p = ggplot(df, aes(x=nodes, y=branch, fill=median.time)) + - geom_raster() + - scale_fill_viridis(option="plasma") + - coord_fixed() + - theme_bw() + - labs(x="Nodes", y="Branch", title="NBody Scaling: Time", - subtitle=input_file) + - theme(plot.subtitle=element_text(size=5)) + - theme(legend.position="bottom") + - theme(legend.text = element_text(size=7)) - -ggsave("time.heatmap.png", plot=p, width=w, height=h, dpi=dpi) -ggsave("time.heatmap.pdf", plot=p, width=w, height=h, dpi=dpi) +ggsave("time.nodes.png", plot=p, width=w, height=h, dpi=dpi) +ggsave("time.nodes.pdf", plot=p, width=w, height=h, dpi=dpi)