From 43991e9173eb725611f4edcede3faf10386fd8f9 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 27 Oct 2020 10:49:00 +0100 Subject: [PATCH] nbody: plot nblocks in test --- garlic/fig/nbody/test.R | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/garlic/fig/nbody/test.R b/garlic/fig/nbody/test.R index 21cb225..3db1610 100644 --- a/garlic/fig/nbody/test.R +++ b/garlic/fig/nbody/test.R @@ -22,7 +22,6 @@ df = select(dataset, config.nblocks, config.hw.cpusPerSocket, time) %>% df = df %>% mutate(blocksPerCpu = nblocks / cpusPerSocket) df$nblocks = as.factor(df$nblocks) -df$blocksPerCpuFactor = as.factor(df$blocksPerCpu) # Normalize the time by the median D=group_by(df, nblocks) %>% @@ -42,10 +41,10 @@ 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=blocksPerCpuFactor, y=tnorm)) + +p = ggplot(data=D, aes(x=nblocks, y=tnorm)) + # Labels - labs(x="Blocks/CPU", y="Normalized time", + labs(x="Blocks", y="Normalized time", title=sprintf("Nbody normalized time. Particles=%d", particles), subtitle=input_file) + @@ -56,13 +55,13 @@ p = ggplot(data=D, aes(x=blocksPerCpuFactor, y=tnorm)) + #theme_bw() + # Add the maximum allowed error lines - geom_hline(yintercept=c(-0.01, 0.01), - linetype="dashed", color="red") + + #geom_hline(yintercept=c(-0.01, 0.01), + # linetype="dashed", color="red") + # Draw boxplots geom_boxplot() + - scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) + + #scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) + theme_bw() + @@ -84,17 +83,17 @@ 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=blocksPerCpuFactor, y=time)) + +p = ggplot(D, aes(x=nblocks, y=time)) + - labs(x="Blocks/CPU", y="Time (s)", + labs(x="Blocks", y="Time (s)", title=sprintf("Nbody granularity. Particles=%d", particles), 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_y_continuous(trans=log2_trans()) + geom_point(shape=21, size=3) # + + #scale_y_continuous(trans=log2_trans()) # Render the plot print(p)