mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
[RfC] Make CI faster
We can straightforwardly parallelize the `check_universal.sh` script, which takes quite a bit of time for the x86 builds. closes https://github.com/official-stockfish/Stockfish/pull/6919 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
74a0a73715
commit
31e89adf70
+29
-13
@@ -44,26 +44,42 @@ if [ "$BINARY_SIZE" -gt "$MAX_SIZE" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FAIL=0
|
||||
WORK=$(mktemp -d)
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
|
||||
i=0
|
||||
for pair in $PAIRS; do
|
||||
i=$((i + 1))
|
||||
cpu=${pair%%:*}
|
||||
expected_compiler=${pair##*:}
|
||||
compiler_out=$("$SDE_EXE" "-$cpu" -- "$STOCKFISH_EXE" compiler 2>&1 || true)
|
||||
bench_out=$("$SDE_EXE" "-$cpu" -- "$STOCKFISH_EXE" bench 2>&1 || true)
|
||||
actual_compiler=$(printf '%s\n' "$compiler_out" | awk -F: '/Compilation architecture/ {
|
||||
sub(/^[[:space:]]+/, "", $2); sub(/[[:space:]]+$/, "", $2); print $2; exit
|
||||
}')
|
||||
actual_bench=$(printf '%s\n' "$bench_out" | awk -F: '/Nodes searched/ {
|
||||
sub(/^[[:space:]]+/, "", $2); sub(/[[:space:]]+$/, "", $2); print $2; exit
|
||||
}')
|
||||
if [ "$actual_compiler" != "$expected_compiler" ] || [ "$actual_bench" != "$EXPECTED_BENCH" ]; then
|
||||
printf '===== CPU %s output (expected %s/%s, got %s/%s) =====\n' \
|
||||
"$cpu" "$expected_compiler" "$EXPECTED_BENCH" "${actual_compiler:--}" "$actual_bench" >&2
|
||||
(
|
||||
compiler_out=$("$SDE_EXE" "-$cpu" -- "$STOCKFISH_EXE" compiler 2>&1 || true)
|
||||
bench_out=$("$SDE_EXE" "-$cpu" -- "$STOCKFISH_EXE" bench 2>&1 >/dev/null || true)
|
||||
actual_compiler=$(printf '%s\n' "$compiler_out" | awk -F: '/Compilation architecture/ {
|
||||
sub(/^[[:space:]]+/, "", $2); sub(/[[:space:]]+$/, "", $2); print $2; exit
|
||||
}')
|
||||
actual_bench=$(printf '%s\n' "$bench_out" | awk -F: '/Nodes searched/ {
|
||||
sub(/^[[:space:]]+/, "", $2); sub(/[[:space:]]+$/, "", $2); print $2; exit
|
||||
}')
|
||||
if [ "$actual_compiler" != "$expected_compiler" ] || [ "$actual_bench" != "$EXPECTED_BENCH" ]; then
|
||||
printf '===== CPU %s output (expected %s/%s, got %s/%s) =====\n' \
|
||||
"$cpu" "$expected_compiler" "$EXPECTED_BENCH" "${actual_compiler:--}" "$actual_bench" > "$WORK/$i.fail"
|
||||
else
|
||||
printf 'CPU %s ok\n' "$cpu" > "$WORK/$i.log"
|
||||
fi
|
||||
) &
|
||||
done
|
||||
wait
|
||||
|
||||
FAIL=0
|
||||
i=0
|
||||
for pair in $PAIRS; do
|
||||
i=$((i + 1))
|
||||
if [ -f "$WORK/$i.fail" ]; then
|
||||
cat "$WORK/$i.fail" >&2
|
||||
FAIL=1
|
||||
else
|
||||
printf 'CPU %s ok\n' "$cpu" >&2
|
||||
cat "$WORK/$i.log" >&2
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user