diff --git a/garlic/exp/hpccg/granularity.nix b/garlic/exp/hpccg/granularity.nix new file mode 100644 index 0000000000000000000000000000000000000000..d7fc8ca40af6e46d91faf1d8087b51be1a5b18b0 --- /dev/null +++ b/garlic/exp/hpccg/granularity.nix @@ -0,0 +1,62 @@ +{ + stdenv +, stdexp +, bsc +, targetMachine +, stages +, garlicTools +}: + +with stdenv.lib; +with garlicTools; + +let + # Initial variable configuration + varConf = with bsc; { + blocksize = [ 16 32 64 128 256 512 1024 2048 ]; + gitBranch = [ +# "garlic/mpi+isend+omp+fork" + "garlic/tampi+isend+oss+task" +# "garlic/tampi+isend+oss+taskfor" + ]; + }; + + # Generate the complete configuration for each unit + genConf = c: targetMachine.config // rec { + hw = targetMachine.config.hw; + blocksize = c.blocksize; + gitBranch = c.gitBranch; + + expName = "hpccg-granularity"; + unitName = expName + "-${toString gitBranch}" + "-bs${toString blocksize}"; + + # Modify to 30 + loops = 30; + + qos = "debug"; + ntasksPerNode = 1; + nodes = 1; + time = "02:00:00"; + cpusPerTask = hw.cpusPerSocket; + jobName = unitName; + }; + + # Compute the array of configurations + configs = stdexp.buildConfigs { + inherit varConf genConf; + }; + + exec = {nextStage, conf, ...}: stages.exec { + inherit nextStage; + argv = [ 512 512 256 10 conf.blocksize ]; + }; + + program = {nextStage, conf, ...}: with conf; bsc.garlic.apps.hpccg.override { + inherit (conf) gitBranch; + }; + + pipeline = stdexp.stdPipeline ++ [ exec program ]; + +in + + stdexp.genExperiment { inherit configs pipeline; } diff --git a/garlic/exp/hpccg/scaling.nix b/garlic/exp/hpccg/scaling.nix new file mode 100644 index 0000000000000000000000000000000000000000..73fc78488f4e90a0de4410ab595b1370fe03cc3d --- /dev/null +++ b/garlic/exp/hpccg/scaling.nix @@ -0,0 +1,65 @@ +{ + stdenv +, stdexp +, bsc +, targetMachine +, stages +, garlicTools +}: + +with stdenv.lib; +with garlicTools; + +let + # Initial variable configuration + varConf = with bsc; { + blocksize = [ 512 ]; + nodes = [ 1 2 4 8 16 ]; + gitBranch = [ +# "garlic/mpi+isend+omp+fork" + "garlic/tampi+isend+oss+task" +# "garlic/tampi+isend+oss+taskfor" + ]; + }; + + # Generate the complete configuration for each unit + genConf = c: targetMachine.config // rec { + hw = targetMachine.config.hw; + blocksize = c.blocksize; + numNodes = c.nodes; + gitBranch = c.gitBranch; + + zDimm = 256 / numNodes; + + expName = "hpccg-scaling"; + unitName = expName + "-${toString gitBranch}" + "-nodes${toString numNodes}"; + + loops = 30; + + nodes = numNodes; + qos = "debug"; + ntasksPerNode = 2; + time = "02:00:00"; + cpusPerTask = hw.cpusPerSocket; + jobName = unitName; + }; + + # Compute the array of configurations + configs = stdexp.buildConfigs { + inherit varConf genConf; + }; + + exec = {nextStage, conf, ...}: stages.exec { + inherit nextStage; + argv = [ 512 512 conf.zDimm 10 conf.blocksize ]; + }; + + program = {nextStage, conf, ...}: with conf; bsc.garlic.apps.hpccg.override { + inherit (conf) gitBranch; + }; + + pipeline = stdexp.stdPipeline ++ [ exec program ]; + +in + + stdexp.genExperiment { inherit configs pipeline; } diff --git a/garlic/exp/index.nix b/garlic/exp/index.nix index d467881b11fe837df27c08d1e8b3223613615aff..5681f2eca73fd89284f372cfc834863323a739b4 100644 --- a/garlic/exp/index.nix +++ b/garlic/exp/index.nix @@ -13,6 +13,11 @@ numa = callPackage ./nbody/numa.nix { }; }; + hpccg = { + granularity = callPackage ./hpccg/granularity.nix { }; + scaling = callPackage ./hpccg/scaling.nix { }; + }; + saiph = { granularity = callPackage ./saiph/granularity.nix { }; ss = callPackage ./saiph/ss.nix { }; diff --git a/garlic/fig/hpccg/granularity.R b/garlic/fig/hpccg/granularity.R new file mode 100644 index 0000000000000000000000000000000000000000..85871b2e35f71a1025ab2641f2a3766a4b55fab3 --- /dev/null +++ b/garlic/fig/hpccg/granularity.R @@ -0,0 +1,92 @@ +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" } + +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) %>% + + mutate(blocksize = as.factor(blocksize)) %>% + mutate(branch = as.factor(branch)) %>% + 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() + +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="HPCCG 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) + +# --------------------------------------------------------------------- + +p = ggplot(df, aes(x=blocksize, y=normalized.time, color=branch)) + + geom_boxplot() + + geom_hline(yintercept=c(-0.01, 0.01), linetype="dashed", color="red") + + facet_wrap(~ branch) + + theme_bw() + + labs(x="Blocksize", y="Normalized Time", title="HPCCG Granularity: Normalized Time", + subtitle=input_file) + + theme(plot.subtitle=element_text(size=5)) + + theme(legend.position="bottom") + + theme(legend.text = element_text(size=7)) + +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=branch)) + + geom_point(shape=21, size=3) + + theme_bw() + + labs(x="Blocksize", y="Time (s)", title="HPCCG 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.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="HPCCG 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/hpccg/scaling.R b/garlic/fig/hpccg/scaling.R new file mode 100644 index 0000000000000000000000000000000000000000..cbc6e5da7eb4d6ef17ff3e76f587480aa569da7c --- /dev/null +++ b/garlic/fig/hpccg/scaling.R @@ -0,0 +1,93 @@ +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" } + +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) %>% + + mutate(blocksize = as.factor(blocksize)) %>% + mutate(nodes = as.factor(nodes)) %>% + mutate(branch = as.factor(branch)) %>% + 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() + +dpi = 300 +h = 5 +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="HPCCG 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") + + facet_wrap(~ branch) + + theme_bw() + + labs(x="Nodes", y="Normalized time (s)", title="HPCCG Scaling: Normalized Time", + subtitle=input_file) + + theme(plot.subtitle=element_text(size=5)) + + theme(legend.position="bottom") + + theme(legend.text = element_text(size=7)) + +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=nodes, y=time, color=branch)) + + geom_point(shape=21, size=3) + + theme_bw() + + labs(x="Nodes", y="Time (s)", title="HPCCG 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.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="HPCCG 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) diff --git a/garlic/fig/index.nix b/garlic/fig/index.nix index 6f6ff4b527520130149ecad663536e4307eea504..9b5d99e1251982903e7ec8919caf6aff157d93fa 100644 --- a/garlic/fig/index.nix +++ b/garlic/fig/index.nix @@ -35,6 +35,11 @@ in numa = stdPlot ./nbody/numa.R [ numa ]; }; + hpccg = with exp.hpccg; { + granularity = stdPlot ./hpccg/granularity.R [ granularity ]; + scaling = stdPlot ./hpccg/scaling.R [ scaling ]; + }; + hpcg = with exp.hpcg; { ss = stdPlot ./hpcg/ss.R [ ss ]; ws = stdPlot ./hpcg/ws.R [ ws ];