forked from rarias/bscpkgs
WIP: postprocessing pipeline
Now each run is executed in a independent folder
This commit is contained in:
30
garlic/pp/timeResult.nix
Normal file
30
garlic/pp/timeResult.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
stdenv
|
||||
}:
|
||||
|
||||
inputResult:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "timeResult";
|
||||
preferLocalBuild = true;
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cd ${inputResult}
|
||||
for unit in *-experiment/*-unit; do
|
||||
outunit=$out/$unit
|
||||
mkdir -p $outunit
|
||||
|
||||
# Copy the unit config
|
||||
conf="$unit/garlic_config.json"
|
||||
cp "$conf" "$outunit/garlic_config.json"
|
||||
|
||||
# Merge all runs in one single CSV file
|
||||
echo "run time" > $outunit/data.csv
|
||||
for r in $(cd $unit; ls -d [0-9]* | sort -n); do
|
||||
log="$unit/$r/stdout.log"
|
||||
awk "/^time /{print \"$r\", \$2}" $log >> $outunit/data.csv
|
||||
done
|
||||
done
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user