Merge branch 'saiph' into 'master'

Saiph

See merge request rarias/bscpkgs!6
This commit is contained in:
Rodrigo Arias 2020-11-13 10:25:47 +01:00
commit 288318b556
6 changed files with 199 additions and 22 deletions

3
NOISE
View File

@ -121,6 +121,3 @@ ABSTRACT
within Nix, they will be copied with the current data and consequently within Nix, they will be copied with the current data and consequently
not updated during the Nix compilation process. not updated during the Nix compilation process.
See saiph devMode option and its implications at
bscpkgs/garlic/saiph/default.nix

View File

@ -6,24 +6,26 @@
, cc , cc
, vtk , vtk
, boost , boost
, devMode ? false
, 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";
src = (if (devMode == true) then ~/repos/saiph src = builtins.fetchGit {
else
builtins.fetchGit {
url = "ssh://git@bscpm02.bsc.es/DSLs/saiph.git"; url = "ssh://git@bscpm02.bsc.es/DSLs/saiph.git";
ref = "${gitBranch}"; ref = "${gitBranch}";
}); };
programPath = "/bin/ExHeat3D"; programPath = "/bin/Heat3D_vect";
enableParallelBuilding = true; enableParallelBuilding = true;
dontStrip = true; dontStrip = true;
@ -46,22 +48,24 @@ stdenv.mkDerivation rec {
cd saiphv2/cpp/src cd saiphv2/cpp/src
export VTK_VERSION=8.2 export VTK_VERSION=8.2
export VTK_HOME=${vtk} export VTK_HOME=${vtk}
'' make clean
+ (if (devMode == true) then "make clean" else "") '';
;
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/
''; '';
} }

View 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; }

View File

@ -20,7 +20,6 @@ let
unitName = "${expName}.nc-${toString numComm}"; unitName = "${expName}.nc-${toString numComm}";
# saiph options # saiph options
devMode = false;
inherit (c) numComm; inherit (c) numComm;
mpi = impi; mpi = impi;
gitBranch = "garlic/tampi+isend+oss+task+simd"; gitBranch = "garlic/tampi+isend+oss+task+simd";
@ -57,7 +56,7 @@ let
customPkgs = stdexp.replaceMpi conf.mpi; customPkgs = stdexp.replaceMpi conf.mpi;
in in
customPkgs.apps.saiph.override { customPkgs.apps.saiph.override {
inherit devMode numComm mpi gitBranch; inherit numComm mpi gitBranch;
}; };
pipeline = stdexp.stdPipeline ++ [ exec program ]; pipeline = stdexp.stdPipeline ++ [ exec program ];

View 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()

View File

@ -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;