diff --git a/garlic/postprocess/hist/default.nix b/garlic/postprocess/hist/default.nix new file mode 100644 index 00000000..4a3d464b --- /dev/null +++ b/garlic/postprocess/hist/default.nix @@ -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 + ''; +} diff --git a/garlic/postprocess/hist/hist.sh b/garlic/postprocess/hist/hist.sh new file mode 100644 index 00000000..55d54c8d --- /dev/null +++ b/garlic/postprocess/hist/hist.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# Use it either reading from stdin or by specifing +# multiple files as arguments + +# xeon07$ hist stdout.log +# x +# +------------------------------------------------------------------------+ +# | 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 diff --git a/overlay.nix b/overlay.nix index f6007bdf..ce8ed510 100644 --- a/overlay.nix +++ b/overlay.nix @@ -197,6 +197,9 @@ let mpi = self.bsc.mpi; }; + # Post processing tools + hist = callPackage ./garlic/postprocess/hist { }; + exp = { noise = callPackage ./garlic/exp/noise.nix { }; nbody = {