1 #!/usr/bin/env bash
2 # Builds and runs the slice and its wake benchmark, and prints the host clock.
3 # The numbers are only meaningful next to the clock; a 4x4 node at 50 MHz is a
4 # different machine, and the per-message cost is what has to be compared.
5 set -uo pipefail
6 cd "$(dirname "$0")"
7 ROOT="$(cd ../.. && pwd)"
8 MOXIE="${MOXIE:-$ROOT/moxie}"
9 OUT="${TMPDIR:-/tmp}/moxie-slice-$$"
10 mkdir -p "$OUT"
11 trap 'rm -rf "$OUT"' EXIT
12 13 echo "# host: $(grep -m1 'model name' /proc/cpuinfo | cut -d: -f2- | xargs), $(grep -m1 'cpu MHz' /proc/cpuinfo | cut -d: -f2- | xargs) MHz"
14 "$MOXIE" build -o "$OUT/waitbench" ./waitbench || exit 1
15 "$MOXIE" build -o "$OUT/slice" . || exit 1
16 "$OUT/waitbench"
17 "$OUT/slice"
18