fwt_software/tools/camera-bench/run_common_frame.sh

53 lines
1.8 KiB
Bash

#!/bin/sh
# run_common_frame.sh - the processing tests on ONE frame shared by every tower
# (common-frame/, made from tower 121's lossless 12-bit capture of 2026-10-02),
# so the per-stage times, sizes and save pace are directly comparable between
# computers. ~25-40 min. Run where raw12_bench is built, tower program stopped:
#
# nohup sh run_common_frame.sh results-common > common.log 2>&1 &
set -u
R=${1:-results-common}
F=common-frame
B=./raw12_bench
O=/tmp/raw12-common-out
mkdir -p "$R"
touch /dev/shm/fgc_rapl_run
sudo -n sh -c 'while [ -e /dev/shm/fgc_rapl_run ]; do
cat /sys/class/powercap/intel-rapl:0/energy_uj > /dev/shm/fgc_rapl.tmp &&
chmod 644 /dev/shm/fgc_rapl.tmp && mv /dev/shm/fgc_rapl.tmp /dev/shm/fgc_rapl
sleep 0.25; done; rm -f /dev/shm/fgc_rapl' &
trap 'rm -f /dev/shm/fgc_rapl_run' EXIT
export FGC_RAPL=/dev/shm/fgc_rapl
sleep 1
step() { echo "$(date +%T) $*"; }
step "frame checksums"
md5sum $F/*.bin > "$R/frame_md5.txt"
step idle
$B idle $F $O 60 > "$R/idle.jsonl"
step checks
$B check $F $O > "$R/check.jsonl"
step matrix
$B matrix $F $O > "$R/matrix_common.jsonl"
# Back to back, 60 s: kind effort distance workers threads
for cfg in "c12_ea 3 1.0 1 4" "c12_ea 3 1.0 2 2" "c8_ea 3 1.0 1 4" "c8_ea 3 1.0 2 2" \
"rgb8 4 0.8 1 4" "rgb8 4 0.8 2 2" "raw12_planes 1 0 1 4"; do
set -- $cfg
step "max $1 e$2 d$3 workers=$4 threads=$5"
$B pipeline $F $O "$1" "$4" "$5" 60 0 "$2" "$3" >> "$R/throughput.jsonl"
done
# One frame per simulated waypoint, 120 s
for cfg in "c12_ea 3 1.0 1 4|1500 1000 700" "c12_ea 3 1.0 2 2|1000 700"; do
params=${cfg%|*}
periods=${cfg#*|}
set -- $params
for p in $periods; do
step "paced $1 e$2 d$3 workers=$4 threads=$5 period=$p"
$B pipeline $F $O "$1" "$4" "$5" 120 "$p" "$2" "$3" >> "$R/pileup.jsonl"
done
done
rm -rf $O
step done