control: save total execution time

This commit is contained in:
Rodrigo Arias 2021-02-08 14:14:08 +01:00
parent ed1cd75d56
commit e5561b8735
3 changed files with 15 additions and 7 deletions

View File

@ -25,7 +25,10 @@ stdenv.mkDerivation {
echo "check stdout log file: ${inputResult}/$exp/$unit/$run/stdout.log" echo "check stdout log file: ${inputResult}/$exp/$unit/$run/stdout.log"
exit 1 exit 1
fi fi
jq -cn "{ exp:\"$exp\", unit:\"$unit\", config:inputs, time:$time, run:$run }" $conf >> $out start_time=$(cat $run/.garlic/total_time_start)
end_time=$(cat $run/.garlic/total_time_end)
total_time=$(($end_time - $start_time))
jq -cn "{ exp:\"$exp\", unit:\"$unit\", config:inputs, time:$time, run:$run, total_time:$total_time }" $conf >> $out
done done
done done
done done

View File

@ -136,6 +136,8 @@ do_fetch() {
--include='*/*/garlic_config.json' \ --include='*/*/garlic_config.json' \
--include='*/*/std*.log' \ --include='*/*/std*.log' \
--include='*/*/*/std*.log' \ --include='*/*/*/std*.log' \
--include='*/*/*/.garlic' \
--include='*/*/*/.garlic/*' \
--exclude='*/*/*/*' \ --exclude='*/*/*/*' \
$exp $garlicTemp $exp $garlicTemp

View File

@ -16,14 +16,17 @@ stdenv.mkDerivation {
phases = [ "installPhase" ]; phases = [ "installPhase" ];
dontPatchShebangs = true; dontPatchShebangs = true;
installPhase = '' installPhase = ''
cat > $out <<EOF cat > $out <<"EOF"
#!/bin/sh -e #!/bin/sh -e
for n in \$(seq 1 ${toString loops}); do for n in $(seq 1 ${toString loops}); do
export GARLIC_RUN="\$n" export GARLIC_RUN="$n"
echo "running \$n of ${toString loops}" > status echo "running $n of ${toString loops}" > status
mkdir "\$n" mkdir "$n"
cd "\$n" cd "$n"
mkdir .garlic
date +%s > .garlic/total_time_start
${stageProgram nextStage} ${stageProgram nextStage}
date +%s > .garlic/total_time_end
cd .. cd ..
done done
echo "completed" > status echo "completed" > status