diff --git a/garlic/fig/creams/granularity.R b/garlic/fig/creams/granularity.R index 998329d..524c987 100644 --- a/garlic/fig/creams/granularity.R +++ b/garlic/fig/creams/granularity.R @@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -62,7 +63,7 @@ p = ggplot(df, aes(x=granul, y=normalized.time)) + facet_wrap(branch ~ .) + labs(x="granul", y="Normalized time", title="Creams granularity: normalized time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -75,7 +76,7 @@ p = ggplot(df, aes(x=granul, y=time, color=branch)) + geom_line(aes(y=median.time, group=branch)) + theme_bw() + labs(x="granul", y="Time (s)", title="Creams granularity: time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/creams/ss.R b/garlic/fig/creams/ss.R index 1f09842..b367781 100644 --- a/garlic/fig/creams/ss.R +++ b/garlic/fig/creams/ss.R @@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -64,7 +65,7 @@ p = ggplot(df, aes(x=nodes, y=normalized.time, fill=granul, color=iterations)) + facet_wrap(branch ~ .) + labs(x="nodes", y="Normalized time", title="Creams strong scaling: normalized time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -78,7 +79,7 @@ p = ggplot(df, aes(x=nodes, y=time, color=gitBranch)) + theme_bw() + # facet_wrap(branch ~ .) + labs(x="nodes", y="Time (s)", title="Creams strong scaling: time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) @@ -92,7 +93,7 @@ p = ggplot(df, aes(x=nodes, y=median.time.nodes, color=branch)) + theme_bw() + #facet_wrap(branch ~ .) + labs(x="nodes", y="Median time * nodes (s)", title="Creams strong scaling: median time * nodes", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("median.time.nodes.png", plot=p, width=w, height=h, dpi=dpi) @@ -105,7 +106,7 @@ p = ggplot(df, aes(x=nodes, y=time.nodes, color=branch)) + theme_bw() + facet_wrap(branch ~ .) + labs(x="nodes", y="Time * nodes (s)", title="Creams strong scaling: time * nodes", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.nodes.boxplot.png", plot=p, width=w, height=h, dpi=dpi) @@ -120,7 +121,7 @@ ggsave("time.nodes.boxplot.pdf", plot=p, width=w, height=h, dpi=dpi) # #facet_wrap(branch ~ .) + # labs(x="nodes", y="Time * nodes / iterations (s)", # title="Creams strong scaling: time * nodes / iterations", -# subtitle=input_file) + +# subtitle=output) + # theme(plot.subtitle=element_text(size=8)) # #ggsave("time.nodes.iter.png", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/examples/granularity.R b/garlic/fig/examples/granularity.R index 2fddf5d..7577dca 100644 --- a/garlic/fig/examples/granularity.R +++ b/garlic/fig/examples/granularity.R @@ -28,6 +28,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } # Here we build of dataframe from the input dataset by chaining operations using # the magritte operator `%>%`, which is similar to a UNIX pipe. @@ -94,7 +95,7 @@ p = ggplot(df, aes(x=cbs, y=median.time, color=rbs)) + # Here we add the title and the labels of the axes labs(x="cbs", y="Median time (s)", title="Heat granularity: median time", - subtitle=input_file) + + subtitle=output) + # And set the subtitle font size a bit smaller, so it fits nicely theme(plot.subtitle=element_text(size=8)) @@ -126,7 +127,7 @@ p = ggplot(df, aes(x=cbs, y=normalized.time)) + # Here we add the title and the labels of the axes labs(x="cbs", y="Normalized time", title="Heat granularity: normalized time", - subtitle=input_file) + + subtitle=output) + # And set the subtitle font size a bit smaller, so it fits nicely theme(plot.subtitle=element_text(size=8)) @@ -151,7 +152,7 @@ p = ggplot(df, aes(x=cbs, y=time, color=rbs)) + # Here we add the title and the labels of the axes labs(x="cbs", y="Time (s)", title="Heat granularity: time", - subtitle=input_file) + + subtitle=output) + # And set the subtitle font size a bit smaller, so it fits nicely theme(plot.subtitle=element_text(size=8)) @@ -184,7 +185,7 @@ p = ggplot(df, aes(x=cbs, y=rbs, fill=median.time)) + # Here we add the title and the labels of the axes labs(x="cbs", y="rbs", title="Heat granularity: time", - subtitle=input_file) + + subtitle=output) + # And set the subtitle font size a bit smaller, so it fits nicely theme(plot.subtitle=element_text(size=8)) diff --git a/garlic/fig/fwi/granularity.R b/garlic/fig/fwi/granularity.R index ba4224b..da9f1a4 100644 --- a/garlic/fig/fwi/granularity.R +++ b/garlic/fig/fwi/granularity.R @@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -51,7 +52,7 @@ p = ggplot(df, aes(x=blocksize, y=normalized.time)) + facet_wrap(branch ~ .) + labs(y="Normalized time", title=sprintf("%s: normalized time", main_title), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -65,7 +66,7 @@ p = ggplot(df, aes(x=blocksize, y=time, color=branch)) + theme_bw() + labs(y="Time (s)", title=sprintf("%s: time", main_title), - subtitle=input_file) + + subtitle=output) + theme(legend.position="bottom") + theme(plot.subtitle=element_text(size=8)) diff --git a/garlic/fig/fwi/io.R b/garlic/fig/fwi/io.R index 61c71a4..e10e3dc 100644 --- a/garlic/fig/fwi/io.R +++ b/garlic/fig/fwi/io.R @@ -9,6 +9,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file)) %>% @@ -48,7 +49,7 @@ p = ggplot(df, aes(x=nodes, y=time, group=enableIO, color=enableIO)) + geom_line() + theme_bw() + labs(x="Nodes", y="Time (s)", title="FWI strong scaling for mpi+send+oss+task", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) + theme(legend.position = c(0.5, 0.88)) @@ -68,7 +69,7 @@ p = ggplot(df, aes(x=nodes, y=nxtime, group=enableIO, color=enableIO)) + geom_line() + theme_bw() + labs(x="Nodes", y="Time * Nodes (s)", title="FWI strong scaling for mpi+send+oss+task", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) + theme(legend.position = c(0.5, 0.88)) @@ -88,7 +89,7 @@ dev.off() # geom_line() + # theme_bw() + # labs(x="Nodes", y="Median Time (s)", title="FWI strong scaling", -# subtitle=input_file) + +# subtitle=output) + # theme(plot.subtitle=element_text(size=8)) + # theme(legend.position = c(0.5, 0.88)) # @@ -108,7 +109,7 @@ dev.off() # geom_line() + # theme_bw() + # labs(x="Nodes", y="Median Time * Nodes (s)", title="FWI strong scaling", -# subtitle=input_file) + +# subtitle=output) + # theme(plot.subtitle=element_text(size=8)) + # theme(legend.position = c(0.5, 0.88)) # diff --git a/garlic/fig/fwi/ss.R b/garlic/fig/fwi/ss.R index 4044d15..428d5c1 100644 --- a/garlic/fig/fwi/ss.R +++ b/garlic/fig/fwi/ss.R @@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -57,7 +58,7 @@ p = ggplot(df, aes(x=nodes, y=normalized.time)) + facet_wrap(branch ~ .) + labs(x="nodes", y="Normalized time", title=sprintf("%s: normalized time", main_title), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -72,7 +73,7 @@ p = ggplot(df, aes(x=nodes, y=time, color=gitBranch)) + # facet_wrap(branch ~ .) + labs(y="Time (s)", title=sprintf("%s: time", main_title), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) @@ -87,7 +88,7 @@ p = ggplot(df, aes(x=nodes, y=time.nodes, color=branch)) + #facet_wrap(branch ~ .) + labs(x="nodes", y="Time * nodes (s)", title=sprintf("%s: time * nodes", main_title), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.nodes.png", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/heat/cache.R b/garlic/fig/heat/cache.R index a9fa5eb..dca6baf 100644 --- a/garlic/fig/heat/cache.R +++ b/garlic/fig/heat/cache.R @@ -9,6 +9,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file)) %>% @@ -49,7 +50,7 @@ heatmap_plot = function(df, colname, title) { guides(fill = guide_colorbar(barwidth=12, title.vjust=0.8)) + labs(x="cbs", y="rbs", title=sprintf("Heat granularity: %s", title), - subtitle=input_file) + + subtitle=output) + theme(legend.position="bottom") k=1 diff --git a/garlic/fig/heat/granularity.R b/garlic/fig/heat/granularity.R index fb72e00..19c3f37 100644 --- a/garlic/fig/heat/granularity.R +++ b/garlic/fig/heat/granularity.R @@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -47,7 +48,7 @@ p = ggplot(df, aes(x=cbs, y=normalized.time)) + theme_bw() + labs(y="Normalized time", title="Heat granularity: normalized time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -60,7 +61,7 @@ p = ggplot(df, aes(x=cbs, y=time)) + geom_line(aes(y=median.time, group=0)) + theme_bw() + labs(y="Time (s)", title="Heat granularity: time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/heat/mode.R b/garlic/fig/heat/mode.R index 8e7e3ac..5e409bc 100644 --- a/garlic/fig/heat/mode.R +++ b/garlic/fig/heat/mode.R @@ -10,6 +10,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file)) %>% @@ -62,7 +63,7 @@ heatmap_plot = function(df, colname, title) { guides(fill = guide_colorbar(barwidth=12, title.vjust=0.8)) + labs(x="cbs", y="rbs", title=sprintf("Heat granularity: %s", title), - subtitle=input_file) + + subtitle=output) + theme(legend.position="bottom") k=1 @@ -103,7 +104,7 @@ p = ggplot(df_square, aes(x=cbs, y=acc.time)) + labels = c("Total time"), guide = "legend") + labs(x="Blocksize (side)", y="Time (s)", fill="Estimated", color="Direct measurement", - title="Heat granularity: time distribution", subtitle=input_file) + title="Heat granularity: time distribution", subtitle=output) ggsave("area.time.png", plot=p, width=6, height=6, dpi=300) ggsave("area.time.pdf", plot=p, width=6, height=6, dpi=300) @@ -115,7 +116,7 @@ p = ggplot(df_square, aes(x=cbs, y=acc.time)) + theme(legend.position=c(0.5, 0.7)) + labs(x="Blocksize (side)", y="Time (s)", fill="Estimated", color="Direct measurement", - title="Heat granularity: time distribution", subtitle=input_file) + title="Heat granularity: time distribution", subtitle=output) ggsave("col.time.png", plot=p, width=6, height=6, dpi=300) ggsave("col.time.pdf", plot=p, width=6, height=6, dpi=300) diff --git a/garlic/fig/hpcg/granularity.R b/garlic/fig/hpcg/granularity.R index fbd18c6..29126da 100644 --- a/garlic/fig/hpcg/granularity.R +++ b/garlic/fig/hpcg/granularity.R @@ -7,6 +7,7 @@ library(viridis, warn.conflicts = FALSE) args = commandArgs(trailingOnly=TRUE) if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -44,7 +45,7 @@ p = ggplot(df, aes(x=blocksPerCpu, y=normalized.time)) + geom_hline(yintercept=c(-0.01, 0.01), linetype="dashed", color="red") + theme_bw() + labs(x="Blocks per CPU", y="Normalized time", title="HPCG granularity: normalized time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -54,7 +55,7 @@ p = ggplot(df, aes(x=blocksPerCpu, y=time)) + geom_point(shape=21, size=3) + theme_bw() + labs(x="Blocks per CPU", y="Time (s)", title="HPCG granularity: time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/hpcg/size.R b/garlic/fig/hpcg/size.R index c23be74..a7cc5f1 100644 --- a/garlic/fig/hpcg/size.R +++ b/garlic/fig/hpcg/size.R @@ -7,6 +7,7 @@ library(viridis, warn.conflicts = FALSE) args = commandArgs(trailingOnly=TRUE) if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -62,7 +63,7 @@ p = ggplot(df, aes(x=sizePerCpu.z, y=time.nodes.elem)) + theme_bw() + labs(x="Size per CPU in Z", y="Time * nodes / spcz (s)", title="HPCG size: time * nodes / spcz", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8), legend.position="bottom") diff --git a/garlic/fig/hpcg/ss.R b/garlic/fig/hpcg/ss.R index a47ba12..3978618 100644 --- a/garlic/fig/hpcg/ss.R +++ b/garlic/fig/hpcg/ss.R @@ -7,6 +7,7 @@ library(viridis, warn.conflicts = FALSE) args = commandArgs(trailingOnly=TRUE) if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -61,7 +62,7 @@ p = ggplot(df, aes(x=nodes, y=time.nodes)) + theme_bw() + labs(x="Nodes", y="Time * nodes (s)", title="HPCG strong scalability in Z", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8), legend.position="bottom") @@ -73,7 +74,7 @@ p = ggplot(df, aes(x=nodes, y=time.sizeZ, fill=sizePerCpu.z)) + theme_bw() + labs(x="Nodes", y="Time / npcz (s)", title="HPCG strong scalability in Z", color="Size per CPU in Z", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8), legend.position="bottom") diff --git a/garlic/fig/hpcg/ws.R b/garlic/fig/hpcg/ws.R index 69dca29..d12f35b 100644 --- a/garlic/fig/hpcg/ws.R +++ b/garlic/fig/hpcg/ws.R @@ -7,6 +7,7 @@ library(viridis, warn.conflicts = FALSE) args = commandArgs(trailingOnly=TRUE) if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -62,7 +63,7 @@ p = ggplot(df, aes(x=nodes, y=time, fill=sizePerCpu.z)) + theme_bw() + labs(x="Nodes", y="Time (s)", title="HPCG weak scaling in Z", color="Size per CPU in Z", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8), legend.position="bottom") diff --git a/garlic/fig/nbody/granularity.R b/garlic/fig/nbody/granularity.R index eb9c829..85ee0b4 100644 --- a/garlic/fig/nbody/granularity.R +++ b/garlic/fig/nbody/granularity.R @@ -7,6 +7,7 @@ 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" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% jsonlite::flatten() %>% @@ -38,7 +39,7 @@ p = ggplot(df, aes(x=blocksize, y=normalized.time, color=branch)) + facet_wrap(~ branch) + theme_bw() + labs(x="Blocksize", y="Normalized Time", title="NBody Granularity: Normalized Time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) + theme(legend.position="bottom") + theme(legend.text = element_text(size=7)) @@ -52,7 +53,7 @@ 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) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) + theme(legend.position="bottom") + theme(legend.text = element_text(size=7)) diff --git a/garlic/fig/nbody/numa.R b/garlic/fig/nbody/numa.R index a76eb12..b080648 100644 --- a/garlic/fig/nbody/numa.R +++ b/garlic/fig/nbody/numa.R @@ -8,6 +8,7 @@ library(stringr) # Load the arguments (argv) args = commandArgs(trailingOnly=TRUE) if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% jsonlite::flatten() %>% @@ -60,7 +61,7 @@ p = ggplot(df, aes(x=blocksize, y=normalized.time, color=interleaveMem)) + labs(x="Blocksize", y="Normalized time", title=sprintf("NBody NUMA (%s | %d Nodes): Normalized time", branch, nodes), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) + theme(legend.position="bottom") @@ -77,7 +78,7 @@ p = ggplot(df, aes(x=blocksize, y=time, color=interleaveMem)) + labs(x="Blocksize", y="Time (s)", title=sprintf("NBody NUMA (%s | %d Nodes): Time", branch, nodes), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) + theme(legend.position="bottom") diff --git a/garlic/fig/nbody/old/baseline.R b/garlic/fig/nbody/old/baseline.R index 11584dd..5509d8e 100644 --- a/garlic/fig/nbody/old/baseline.R +++ b/garlic/fig/nbody/old/baseline.R @@ -9,6 +9,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file)) %>% @@ -79,7 +80,7 @@ p = ggplot(data=D, aes(x=blocksPerCpuFactor, y=tnorm, color=bad)) + # Labels labs(x="Blocks/CPU", y="Normalized time", title=sprintf("Nbody normalized time. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + # Center the title @@ -117,7 +118,7 @@ p1 = ggplot(D, aes(x=blocksizeFactor, y=time)) + labs(x="Blocksize", y="Time (s)", title=sprintf("Nbody granularity. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + theme_bw() + theme(plot.subtitle=element_text(size=8)) + #theme(legend.position = c(0.5, 0.8)) + @@ -138,7 +139,7 @@ p2 = ggplot(D, aes(x=blocksPerCpuFactor, y=time)) + labs(x="Blocks/CPU", y="Time (s)", title=sprintf("Nbody granularity. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + theme_bw() + theme(plot.subtitle=element_text(size=8)) + diff --git a/garlic/fig/nbody/old/freeCpu.R b/garlic/fig/nbody/old/freeCpu.R index f178734..cf97106 100644 --- a/garlic/fig/nbody/old/freeCpu.R +++ b/garlic/fig/nbody/old/freeCpu.R @@ -8,6 +8,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file)) %>% @@ -50,7 +51,7 @@ p = ggplot(data=D, aes(x=blocksPerCpuFactor, y=tnorm)) + # Labels labs(x="Blocks/CPU", y="Normalized time", title=sprintf("Nbody normalized time. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + # Center the title #theme(plot.title = element_text(hjust = 0.5)) + @@ -95,7 +96,7 @@ p = ggplot(D, aes(x=blocksPerCpuFactor, y=time, color=freeCpu)) + labs(x="Blocks/CPU", y="Time (s)", title=sprintf("Nbody granularity. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + theme_bw() + theme(plot.subtitle=element_text(size=8)) + theme(legend.position = c(0.5, 0.88)) + diff --git a/garlic/fig/nbody/old/jemalloc.R b/garlic/fig/nbody/old/jemalloc.R index 788149f..37fc991 100644 --- a/garlic/fig/nbody/old/jemalloc.R +++ b/garlic/fig/nbody/old/jemalloc.R @@ -8,6 +8,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file)) %>% @@ -52,7 +53,7 @@ p = ggplot(data=D, aes(x=nblocks, y=tnorm)) + # Labels labs(x="Num blocks", y="Normalized time", title=sprintf("Nbody normalized time. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + # Center the title #theme(plot.title = element_text(hjust = 0.5)) + @@ -96,7 +97,7 @@ p = ggplot(D, aes(x=blocksPerCpu, y=time, color=jemalloc)) + labs(x="Blocks/CPU", y="Time (s)", title=sprintf("Nbody granularity. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + theme_bw() + theme(plot.subtitle=element_text(size=8)) + theme(legend.position = c(0.5, 0.88)) + diff --git a/garlic/fig/nbody/old/scaling.R b/garlic/fig/nbody/old/scaling.R index cf91a87..1d50a37 100644 --- a/garlic/fig/nbody/old/scaling.R +++ b/garlic/fig/nbody/old/scaling.R @@ -8,6 +8,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file)) %>% @@ -53,7 +54,7 @@ p = ggplot(data=D, aes(x=blocksPerCpuFactor, y=tnorm, color=bad)) + # Labels labs(x="Blocks/CPU", y="Normalized time", title=sprintf("Nbody normalized time. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + # Center the title @@ -94,7 +95,7 @@ p = ggplot(D, aes(x=blocksPerCpuFactor, y=time)) + labs(x="Blocks/CPU", y="Time (s)", title=sprintf("Nbody granularity. Particles=%d", particles), - subtitle=input_file) + + subtitle=output) + theme_bw() + theme(plot.subtitle=element_text(size=8)) + theme(legend.position = c(0.5, 0.88)) + diff --git a/garlic/fig/nbody/ss.R b/garlic/fig/nbody/ss.R index 041cd82..2ce9b2c 100644 --- a/garlic/fig/nbody/ss.R +++ b/garlic/fig/nbody/ss.R @@ -7,6 +7,7 @@ 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" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% jsonlite::flatten() %>% @@ -41,7 +42,7 @@ p = ggplot(df, aes(x=nodes, y=normalized.time, color=branch)) + facet_wrap(~ branch) + theme_bw() + labs(x="Nodes", y="Normalized time (s)", title="NBody Scaling: Normalized Time", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=5)) + theme(legend.position="bottom") + theme(legend.text = element_text(size=7)) @@ -56,7 +57,7 @@ p = ggplot(df, aes(x=nodes, y=time.nodes, color=branch)) + geom_line(aes(y=median.time.nodes, group=branch)) + theme_bw() + labs(x="Nodes", y="Time * nodes (s)", title="NBody Scaling: Time * nodes", - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=5)) + theme(legend.position="bottom") + theme(legend.text = element_text(size=7)) diff --git a/garlic/fig/osu/bw.R b/garlic/fig/osu/bw.R index df11240..5307b87 100644 --- a/garlic/fig/osu/bw.R +++ b/garlic/fig/osu/bw.R @@ -11,6 +11,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -39,7 +40,7 @@ w=6 p = ggplot(data=df, aes(x=size, y=median.bw)) + labs(x="Message size", y="Bandwidth (GB/s)", #title=sprintf("OSU benchmark: osu_bw", nodes, tasksPerNode, cpusPerTask), - subtitle=gsub("-", "\uad", input_file)) + + subtitle=gsub("-", "\uad", output)) + geom_line(aes(linetype=unitName)) + geom_point(aes(shape=unitName), size=1.5) + scale_shape_discrete(name = "MPI version") + @@ -73,7 +74,7 @@ ggsave("median-lines.pdf", plot=p, width=w, height=h, dpi=ppi) p = ggplot(data=df, aes(x=size, y=bw)) + labs(x="Message size", y="Bandwidth (MB/s)", #title=sprintf("OSU benchmark: osu_bw", nodes, tasksPerNode, cpusPerTask), - subtitle=input_file) + + subtitle=output) + geom_line(aes(y=median.bw, linetype=unitName, group=unitName)) + geom_point(aes(shape=unitName), size=2) + scale_shape(solid = FALSE) + diff --git a/garlic/fig/osu/eager.R b/garlic/fig/osu/eager.R index 2ec73bc..aa9e573 100644 --- a/garlic/fig/osu/eager.R +++ b/garlic/fig/osu/eager.R @@ -8,6 +8,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -49,7 +50,7 @@ w=8 p = ggplot(data=df, aes(x=sizeKB, y=bw)) + labs(x="Message size (KB)", y="Bandwidth (MB/s)", title=sprintf("OSU benchmark: osu_bw --iterations %d", iterations), - subtitle=input_file) + + subtitle=output) + geom_point(shape=21, size=3) + geom_vline(aes(xintercept = PSM2_MQ_EAGER_SDMA_SZ/1024), color="blue") + geom_vline(xintercept = 10, color="red") + diff --git a/garlic/fig/osu/impi.R b/garlic/fig/osu/impi.R index e2b7418..c62a334 100644 --- a/garlic/fig/osu/impi.R +++ b/garlic/fig/osu/impi.R @@ -8,6 +8,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -36,7 +37,7 @@ p = ggplot(data=df, aes(x=size, y=bw)) + labs(x="Size (bytes)", y="Bandwidth (MB/s)", title=sprintf("OSU bandwidth benchmark: nodes=%d tasksPerNode=%d cpusPerTask=%d", nodes, tasksPerNode, cpusPerTask), - subtitle=input_file) + + subtitle=output) + geom_boxplot(aes(color=threshold, group=interaction(threshold, sizeFactor))) + scale_x_continuous(trans=log2_trans()) + #scale_y_log10(breaks = breaks, minor_breaks = minor_breaks) + @@ -53,7 +54,7 @@ p = ggplot(data=df, aes(x=size, y=medianBw)) + labs(x="Size (bytes)", y="Bandwidth (MB/s)", title=sprintf("OSU benchmark: osu_bw", nodes, tasksPerNode, cpusPerTask), - subtitle=input_file) + + subtitle=output) + geom_line(aes(color=threshold, linetype=threshold)) + geom_point(aes(color=threshold, shape=threshold)) + geom_hline(yintercept = 100e3 / 8, color="red") + diff --git a/garlic/fig/osu/latency.R b/garlic/fig/osu/latency.R index a316a0d..bb018e6 100644 --- a/garlic/fig/osu/latency.R +++ b/garlic/fig/osu/latency.R @@ -9,6 +9,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -39,7 +40,7 @@ w=6 p = ggplot(data=df, aes(x=size, y=medianLatency)) + labs(x="Message size", y="Median latency (µs)", #title=sprintf("OSU benchmark: osu_latency", nodes, tasksPerNode, cpusPerTask), - subtitle=gsub("-", "\uad", input_file)) + + subtitle=gsub("-", "\uad", output)) + geom_line(aes(linetype=unitName)) + geom_point(aes(shape=unitName), size=2) + scale_y_log10(breaks = breaks, minor_breaks = minor_breaks) + @@ -59,7 +60,7 @@ ggsave("median-lines.pdf", plot=p, width=w, height=h, dpi=ppi) p = ggplot(data=df, aes(x=size, y=latency)) + labs(x="Size (bytes)", y="Latency (us)", #title=sprintf("OSU benchmark: osu_latency", nodes, tasksPerNode, cpusPerTask), - subtitle=input_file) + + subtitle=output) + geom_line(aes(y=medianLatency, linetype=unitName, group=unitName)) + geom_point(aes(shape=unitName), size=2) + scale_y_log10(breaks = breaks, minor_breaks = minor_breaks) + diff --git a/garlic/fig/osu/mtu.R b/garlic/fig/osu/mtu.R index f4ea23c..c009a71 100644 --- a/garlic/fig/osu/mtu.R +++ b/garlic/fig/osu/mtu.R @@ -8,6 +8,7 @@ args=commandArgs(trailingOnly=TRUE) # Read the timetable from args[1] input_file = "input.json" if (length(args)>0) { input_file = args[1] } +if (length(args)>1) { output = args[2] } else { output = "?" } # Load the dataset in NDJSON format dataset = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -55,7 +56,7 @@ p = ggplot(data=df, aes(x=sizeKB, y=bw)) + geom_vline(aes(xintercept = PSM2_MTU.val/1024), color="red") + labs(x="Message size (KiB)", y="Bandwidth (GB/s)", #title=sprintf("OSU benchmark: osu_bw --iterations %d", iterations), - subtitle=gsub("-", "\uad", input_file)) + + subtitle=gsub("-", "\uad", output)) + geom_point(shape=21, size=2) + #annotate("text", x = 10.2, y = 8.5e3, label = "MTU = 10KB", color="red", hjust=0) + facet_wrap(vars(PSM2_MTU), nrow=3, labeller = "label_both") + diff --git a/garlic/fig/saiph/granularity.R b/garlic/fig/saiph/granularity.R index b4ba304..66bd7c6 100644 --- a/garlic/fig/saiph/granularity.R +++ b/garlic/fig/saiph/granularity.R @@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -72,7 +73,7 @@ p = ggplot(df, aes(x=nbly, y=normalized.time, fill=sizex)) + facet_wrap(branch ~ .) + labs(y="Normalized time", title=sprintf("%s: normalized time", maintitle), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -87,7 +88,7 @@ p = ggplot(df, aes(x=blocksPerCpu, y=time, color=sizex)) + scale_x_continuous(trans=log2_trans()) + labs(y="Time (s)", title=sprintf("%s: time", maintitle), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/fig/saiph/ss.R b/garlic/fig/saiph/ss.R index 2be666e..6498f30 100644 --- a/garlic/fig/saiph/ss.R +++ b/garlic/fig/saiph/ss.R @@ -9,6 +9,7 @@ args = commandArgs(trailingOnly=TRUE) # Set the input dataset if given in argv[1], or use "input" as default if (length(args)>0) { input_file = args[1] } else { input_file = "input" } +if (length(args)>1) { output = args[2] } else { output = "?" } df = jsonlite::stream_in(file(input_file), verbose=FALSE) %>% @@ -72,7 +73,7 @@ p = ggplot(df, aes(x=nodes, y=normalized.time, fill=sizex)) + facet_wrap(branch ~ .) + labs(x="nodes", y="Normalized time", title=sprintf("%s: normalized time", maintitle), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("normalized.time.png", plot=p, width=w, height=h, dpi=dpi) @@ -87,7 +88,7 @@ p = ggplot(df, aes(x=nodes, y=time, color=sizex)) + # facet_wrap(branch ~ .) + labs(x="nodes", y="Time (s)", title=sprintf("%s: time", maintitle), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.png", plot=p, width=w, height=h, dpi=dpi) @@ -102,7 +103,7 @@ p = ggplot(df, aes(x=nodes, y=time.nodes, color=sizex)) + #facet_wrap(branch ~ .) + labs(x="nodes", y="Time * nodes (s)", title=sprintf("%s: time * nodes", maintitle), - subtitle=input_file) + + subtitle=output) + theme(plot.subtitle=element_text(size=8)) ggsave("time.nodes.png", plot=p, width=w, height=h, dpi=dpi) diff --git a/garlic/pp/rplot.nix b/garlic/pp/rplot.nix index 35609a2..faaef53 100644 --- a/garlic/pp/rplot.nix +++ b/garlic/pp/rplot.nix @@ -147,7 +147,7 @@ in stdenv.mkDerivation { dataset="${dataset}" ln -s $dataset input - Rscript --vanilla ${script} ${dataset} + Rscript --vanilla ${script} ${dataset} "$out" if [ "''${dataset##*.}" == gz ]; then gunzip --stdout $dataset