Add postprocessing hist tool

This commit is contained in:
Rodrigo Arias 2020-10-02 11:58:04 +02:00
parent fd47044bfb
commit 61a2db03dc
3 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,25 @@
{
stdenv
, ministat
}:
stdenv.mkDerivation {
name = "hist";
preferLocalBuild = true;
src = ./.;
dontBuild = true;
dontConfigure = true;
inherit ministat;
patchPhase = ''
substituteAllInPlace hist.sh
'';
installPhase = ''
mkdir -p $out/bin
cp hist.sh $out/bin/hist
chmod +x $out/bin/hist
'';
}

View File

@ -0,0 +1,36 @@
#!/bin/sh
# Use it either reading from stdin or by specifing
# multiple files as arguments
# xeon07$ hist stdout.log
# x <stdin>
# +------------------------------------------------------------------------+
# | x |
# | x |
# | x |
# | x |
# | x |
# | xxx |
# | xxx |
# | xxxxx |
# | xxxxxx |
# | xxxxxxx x|
# ||________M_A___________| |
# +------------------------------------------------------------------------+
# N Min Max Median Avg Stddev
# x 30 3.585183 3.763913 3.591559 3.5973344 0.031719975
ministat=@ministat@/bin
export PATH="$PATH:$ministat"
files="$@"
if [ -z "$files" ]; then
files=/proc/self/fd/0
fi
for file in "$files"; do
awk '/^time /{print $2}' $file | \
ministat -w72
done

View File

@ -197,6 +197,9 @@ let
mpi = self.bsc.mpi; mpi = self.bsc.mpi;
}; };
# Post processing tools
hist = callPackage ./garlic/postprocess/hist { };
exp = { exp = {
noise = callPackage ./garlic/exp/noise.nix { }; noise = callPackage ./garlic/exp/noise.nix { };
nbody = { nbody = {