omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / tools / argus / bench_micro.sh
| 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # ARGUS_PERFORMANCE micro-op: interleaved RX_ARGUS=0/1/2(discard)/2(ingest) runs of |
| 18 | # bench_rx_argus pinned with taskset. Usage: bench_micro.sh OUT_DIR CPUS ROUNDS N S > out.jsonl |
| 19 | # CFGS (env) selects configs; 2dn/2in = discard/ingest with RX_ARGUS_CONSUMER_CPU=none |
| 20 | # (consumer unpinned, i.e. sharing the taskset CPUs; the default is auto placement). |
| 21 | # Run under: flock ~/workspace/.argus-bench.lock tools/argus/bench_micro.sh ... |
| 22 | set -u |
| 23 | D=${1:-build}; CPUS=${2:-7}; ROUNDS=${3:-7}; N=${4:-20000000}; S=${5:-200000} |
| 24 | for r in $(seq 1 "$ROUNDS"); do |
| 25 | for cfg in ${CFGS:-0 1 2d 2i}; do |
| 26 | case $cfg in |
| 27 | 0) b=$D/argus0/bench_rx_argus; env=();; |
| 28 | 1) b=$D/argus1/bench_rx_argus; env=();; |
| 29 | 2d) b=$D/argus2/bench_rx_argus; env=(RX_ARGUS_CONSUMER=discard);; |
| 30 | 2i) b=$D/argus2/bench_rx_argus; env=(RX_ARGUS_CONSUMER=ingest);; |
| 31 | 2dn) b=$D/argus2/bench_rx_argus; env=(RX_ARGUS_CONSUMER=discard RX_ARGUS_CONSUMER_CPU=none);; |
| 32 | 2in) b=$D/argus2/bench_rx_argus; env=(RX_ARGUS_CONSUMER=ingest RX_ARGUS_CONSUMER_CPU=none);; |
| 33 | esac |
| 34 | out=$(env "${env[@]}" taskset -c "$CPUS" "./$b" "$N" "$S" 2>/dev/null | tail -1) |
| 35 | printf '{"cfg":"%s","round":%d,"cpus":"%s","load1":%s,"res":%s}\n' "$cfg" "$r" "$CPUS" \ |
| 36 | "$(cut -d' ' -f1 /proc/loadavg)" "${out:-null}" |
| 37 | done |
| 38 | done |