Saiph: adding granularity experiment and figures
This commit is contained in:
parent
86d1d426ec
commit
4ae66adb9a
@ -8,10 +8,15 @@
|
|||||||
, boost
|
, boost
|
||||||
, gitBranch ? "master"
|
, gitBranch ? "master"
|
||||||
, numComm ? null
|
, numComm ? null
|
||||||
|
, nbx ? null
|
||||||
|
, nby ? null
|
||||||
|
, nbz ? null
|
||||||
, vectFlags ? null
|
, vectFlags ? null
|
||||||
#, breakpointHook
|
#, breakpointHook
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "saiph";
|
name = "saiph";
|
||||||
|
|
||||||
@ -20,7 +25,7 @@ stdenv.mkDerivation rec {
|
|||||||
ref = "${gitBranch}";
|
ref = "${gitBranch}";
|
||||||
};
|
};
|
||||||
|
|
||||||
programPath = "/bin/ExHeat3D";
|
programPath = "/bin/Heat3D_vect";
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
@ -49,15 +54,18 @@ stdenv.mkDerivation rec {
|
|||||||
makeFlags = [
|
makeFlags = [
|
||||||
"-f" "Makefile.${cc.cc.CC}"
|
"-f" "Makefile.${cc.cc.CC}"
|
||||||
"apps"
|
"apps"
|
||||||
"APP=ExHeat3D"
|
"APP=Heat3D_vect"
|
||||||
( if (numComm != null) then "NUM_COMM=${toString numComm}" else "" )
|
] ++ optional (nbx != null) "NB_X=${toString nbx}"
|
||||||
( if (vectFlags != null) then "VECT_FLAGS=${toString vectFlags}" else "" )
|
++ optional (nby != null) "NB_Y=${toString nby}"
|
||||||
];
|
++ optional (nbz != null) "NB_Z=${toString nbz}"
|
||||||
|
++ optional (numComm != null) "NUM_COMM=${toString numComm}"
|
||||||
|
++ optional (vectFlags != null) "VECT_FLAGS=${toString vectFlags}"
|
||||||
|
;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp obj/libsaiphv2.so $out/lib/
|
cp obj/libsaiphv2.so $out/lib/
|
||||||
cp bin/ExHeat3D $out/bin/
|
cp bin/Heat3D_vect $out/bin/
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
68
garlic/exp/saiph/granularity.nix
Normal file
68
garlic/exp/saiph/granularity.nix
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
stdenv
|
||||||
|
, stdexp
|
||||||
|
, bsc
|
||||||
|
, targetMachine
|
||||||
|
, stages
|
||||||
|
}:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
# Initial variable configuration
|
||||||
|
varConf = with bsc; {
|
||||||
|
nb = [ 1 2 4 8 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Generate the complete configuration for each unit
|
||||||
|
genConf = with bsc; c: targetMachine.config // rec {
|
||||||
|
expName = "saiph.granularity";
|
||||||
|
unitName = "${expName}.nbx-nby-nbz-${toString nbx}-${toString nby}-${toString nbz}";
|
||||||
|
|
||||||
|
# saiph options
|
||||||
|
nbx = c.nb;
|
||||||
|
nby = c.nb;
|
||||||
|
nbz = c.nb;
|
||||||
|
mpi = impi;
|
||||||
|
gitBranch = "garlic/tampi+isend+oss+task+simd";
|
||||||
|
|
||||||
|
# Repeat the execution of each unit 50 times
|
||||||
|
loops = 50;
|
||||||
|
|
||||||
|
# Resources
|
||||||
|
qos = "debug";
|
||||||
|
time = "00:30:00";
|
||||||
|
ntasksPerNode = 1;
|
||||||
|
nodes = 1;
|
||||||
|
cpuBind = "sockets,verbose";
|
||||||
|
jobName = "${unitName}-${gitBranch}";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Compute the array of configurations
|
||||||
|
configs = stdexp.buildConfigs {
|
||||||
|
inherit varConf genConf;
|
||||||
|
};
|
||||||
|
|
||||||
|
exec = {nextStage, conf, ...}: with conf; stages.exec {
|
||||||
|
inherit nextStage;
|
||||||
|
env = ''
|
||||||
|
export OMP_NUM_THREADS=${toString hw.cpusPerSocket}
|
||||||
|
export NANOS6_REPORT_PREFIX="#"
|
||||||
|
export I_MPI_THREAD_SPLIT=1
|
||||||
|
export ASAN_SYMBOLIZER_PATH=${bsc.clangOmpss2Unwrapped}/bin/llvm-symbolizer
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
program = {nextStage, conf, ...}: with conf;
|
||||||
|
let
|
||||||
|
customPkgs = stdexp.replaceMpi conf.mpi;
|
||||||
|
in
|
||||||
|
customPkgs.apps.saiph.override {
|
||||||
|
inherit nbx nby nbz mpi gitBranch;
|
||||||
|
};
|
||||||
|
|
||||||
|
pipeline = stdexp.stdPipeline ++ [ exec program ];
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
stdexp.genExperiment { inherit configs pipeline; }
|
100
garlic/fig/saiph/granularity.R
Normal file
100
garlic/fig/saiph/granularity.R
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
library(ggplot2)
|
||||||
|
library(dplyr)
|
||||||
|
library(scales)
|
||||||
|
library(jsonlite)
|
||||||
|
|
||||||
|
args=commandArgs(trailingOnly=TRUE)
|
||||||
|
|
||||||
|
# Read the timetable from args[1]
|
||||||
|
input_file = "input.json"
|
||||||
|
if (length(args)>0) { input_file = args[1] }
|
||||||
|
|
||||||
|
# Load the dataset in NDJSON format
|
||||||
|
dataset = jsonlite::stream_in(file(input_file)) %>%
|
||||||
|
jsonlite::flatten()
|
||||||
|
|
||||||
|
|
||||||
|
# We only need the nblocks and time
|
||||||
|
df = select(dataset, config.nbx, time) %>%
|
||||||
|
rename(nbx=config.nbx)
|
||||||
|
|
||||||
|
df$nbx = as.factor(df$nbx)
|
||||||
|
|
||||||
|
# Normalize the time by the median
|
||||||
|
D=group_by(df, nbx) %>%
|
||||||
|
mutate(tnorm = time / median(time) - 1) %>%
|
||||||
|
mutate(bad = max(ifelse(abs(tnorm) >= 0.01, 1, 0)))
|
||||||
|
|
||||||
|
D$bad = as.factor(D$bad)
|
||||||
|
|
||||||
|
|
||||||
|
print(D)
|
||||||
|
|
||||||
|
ppi=300
|
||||||
|
h=5
|
||||||
|
w=5
|
||||||
|
|
||||||
|
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=nbx, y=tnorm, color=bad)) +
|
||||||
|
|
||||||
|
# Labels
|
||||||
|
labs(x="nbx", y="Normalized time",
|
||||||
|
title=sprintf("Saiph-Heat3D normalized time"),
|
||||||
|
subtitle=input_file) +
|
||||||
|
|
||||||
|
# Center the title
|
||||||
|
#theme(plot.title = element_text(hjust = 0.5)) +
|
||||||
|
|
||||||
|
# Black and white mode (useful for printing)
|
||||||
|
#theme_bw() +
|
||||||
|
|
||||||
|
# Add the maximum allowed error lines
|
||||||
|
geom_hline(yintercept=c(-0.01, 0.01),
|
||||||
|
linetype="dashed", color="gray") +
|
||||||
|
|
||||||
|
# Draw boxplots
|
||||||
|
geom_boxplot() +
|
||||||
|
scale_color_manual(values=c("black", "brown")) +
|
||||||
|
|
||||||
|
#scale_y_continuous(breaks = scales::pretty_breaks(n = 10)) +
|
||||||
|
|
||||||
|
theme_bw() +
|
||||||
|
|
||||||
|
theme(plot.subtitle=element_text(size=8)) +
|
||||||
|
theme(legend.position = "none")
|
||||||
|
#theme(legend.position = c(0.85, 0.85))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Render the plot
|
||||||
|
print(p)
|
||||||
|
|
||||||
|
## Save the png image
|
||||||
|
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=nbx, y=time)) +
|
||||||
|
|
||||||
|
labs(x="nbx", y="Time (s)",
|
||||||
|
title=sprintf("Saiph-Heat3D granularity"),
|
||||||
|
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_x_continuous(trans=log2_trans()) +
|
||||||
|
scale_y_continuous(trans=log2_trans())
|
||||||
|
|
||||||
|
# Render the plot
|
||||||
|
print(p)
|
||||||
|
|
||||||
|
# Save the png image
|
||||||
|
dev.off()
|
@ -330,6 +330,7 @@ let
|
|||||||
|
|
||||||
saiph = {
|
saiph = {
|
||||||
numcomm = callPackage ./garlic/exp/saiph/numcomm.nix { };
|
numcomm = callPackage ./garlic/exp/saiph/numcomm.nix { };
|
||||||
|
granularity = callPackage ./garlic/exp/saiph/granularity.nix { };
|
||||||
};
|
};
|
||||||
|
|
||||||
creams = {
|
creams = {
|
||||||
@ -371,6 +372,7 @@ let
|
|||||||
|
|
||||||
saiph = with exp.saiph; {
|
saiph = with exp.saiph; {
|
||||||
numcomm = merge [ numcomm ];
|
numcomm = merge [ numcomm ];
|
||||||
|
granularity = merge [ granularity ];
|
||||||
};
|
};
|
||||||
|
|
||||||
heat = with exp.heat; {
|
heat = with exp.heat; {
|
||||||
@ -402,6 +404,13 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
saiph = {
|
||||||
|
granularity = with ds.saiph; pp.rPlot {
|
||||||
|
script = ./garlic/fig/saiph/granularity.R;
|
||||||
|
dataset = granularity;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
heat = {
|
heat = {
|
||||||
test = with ds.heat; pp.rPlot {
|
test = with ds.heat; pp.rPlot {
|
||||||
script = ./garlic/fig/heat/test.R;
|
script = ./garlic/fig/heat/test.R;
|
||||||
|
Loading…
Reference in New Issue
Block a user