From 11feab9496ef610fa01f088155549b4d2d5e5c08 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 12 Oct 2023 18:21:55 -0400 Subject: bench: Check for bfs -j support before using it --- bench/bench.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'bench') diff --git a/bench/bench.sh b/bench/bench.sh index be5a15b..ab56b79 100644 --- a/bench/bench.sh +++ b/bench/bench.sh @@ -467,7 +467,11 @@ bench-jobs-corpus() { if ((${#BFS[@]} + ${#FD[@]} == 1)); then cmds=() for bfs in "${BFS[@]}"; do - cmds+=("$bfs -j"{1,2,3,4,6,8,12,16}" $2 -false") + if "$bfs" -j1 -quit &>/dev/null; then + cmds+=("$bfs -j"{1,2,3,4,6,8,12,16}" $2 -false") + else + cmds+=("$bfs $2 -false") + fi done for fd in "${FD[@]}"; do @@ -481,14 +485,20 @@ bench-jobs-corpus() { cmds=() for bfs in "${BFS[@]}"; do - cmds+=("$bfs -j$j $2 -false") + if "$bfs" -j1 -quit &>/dev/null; then + cmds+=("$bfs -j$j $2 -false") + elif ((j == 1)); then + cmds+=("$bfs $2 -false") + fi done for fd in "${FD[@]}"; do cmds+=("$fd -j$j -u '^$' $2") done - do-hyperfine "${cmds[@]}" + if ((${#cmds[@]})); then + do-hyperfine "${cmds[@]}" + fi done fi } -- cgit v1.2.3