osu: add figure for latency tests

This commit is contained in:
Rodrigo Arias 2021-02-23 17:52:48 +01:00
parent 0c9e89dcc0
commit ceb25e5d18
5 changed files with 88 additions and 1 deletions

View File

@ -12,7 +12,7 @@
let
# Initial variable configuration
varConf = with bsc; {
mpi = [ impi bsc.openmpi mpich ];
mpi = [ impi bsc.openmpi mpich ]; #psmpi ];
};
# Generate the complete configuration for each unit

View File

@ -40,4 +40,16 @@ in
creams = with exp.creams; {
ss = rPlotExp ./creams/ss.R [ ss.hybrid ss.pure ];
};
osu = with exp.osu; {
#latency = pp.osu-latency latency.result;
latency =
let
resultJson = pp.osu-latency latency.result;
in
rPlot {
script = ./osu/latency.R;
dataset = resultJson;
};
};
}

43
garlic/fig/osu/latency.R Normal file
View File

@ -0,0 +1,43 @@
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.unitName, size, latency) %>%
rename(unitName=config.unitName)
df$unitName = as.factor(df$unitName)
df$sizeFactor = as.factor(df$size)
ppi=300
h=8
w=12
png("latency.png", width=w*ppi, height=h*ppi, res=ppi)
p = ggplot(data=df, aes(x=size, y=latency)) +
labs(x="Size (bytes)", y="Latency (us)",
title="OSU latency benchmark",
subtitle=input_file) +
geom_boxplot(aes(color=unitName, group=interaction(unitName, sizeFactor))) +
scale_y_continuous(trans=log10_trans()) +
scale_x_continuous(trans=log2_trans()) +
theme_bw() +
theme(legend.position = c(0.15, 0.9))
# Render the plot
print(p)
## Save the png image
dev.off()

View File

@ -111,6 +111,7 @@
inherit trebuchetStage;
});
timetable = callPackage ./pp/timetable.nix { };
osu-latency = callPackage ./pp/osu-latency.nix { };
rPlot = callPackage ./pp/rplot.nix { };
timetableFromTrebuchet = tre: timetable (resultFromTrebuchet tre);
mergeDatasets = callPackage ./pp/merge.nix { };

31
garlic/pp/osu-latency.nix Normal file
View File

@ -0,0 +1,31 @@
{
stdenv
, jq
}:
inputResult:
stdenv.mkDerivation {
name = "osu-latency.json";
preferLocalBuild = true;
phases = [ "installPhase" ];
buildInputs = [ jq ];
installPhase = ''
touch $out
cd ${inputResult}
for exp in *-experiment; do
cd ${inputResult}/$exp
for unit in *-unit; do
cd ${inputResult}/$exp/$unit
conf=garlic_config.json
for run in $(ls -d [0-9]* | sort -n); do
awk '/^[0-9]+ +[0-9\.]+$/{print $1, $2}' $run/stdout.log | (
while read -r size latency; do
jq -cn "{ exp:\"$exp\", unit:\"$unit\", config:inputs, run:$run, \
size:$size, latency:$latency }" $conf >> $out
done)
done
done
done
'';
}