From caf7c97a1c91c5489b4d5fe9acab7e1a5cf56a79 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 14 Jan 2025 12:54:41 +0100 Subject: [PATCH 1/2] [bench] detect number of CPU cores dynamically --- benchmark/sirun/runall.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/benchmark/sirun/runall.sh b/benchmark/sirun/runall.sh index d28806383ea..7344de3e1bb 100755 --- a/benchmark/sirun/runall.sh +++ b/benchmark/sirun/runall.sh @@ -27,13 +27,14 @@ nvm use 18 # run each test in parallel for a given version of Node.js # once all of the tests have complete move on to the next version -export CPU_AFFINITY="${CPU_START_ID:-24}" # Benchmarking Platform convention +TOTAL_CPU_CORES=$(nproc:-24) +export CPU_AFFINITY="${CPU_START_ID:-$TOTAL_CPU_CORES}" # Benchmarking Platform convention nvm use $MAJOR_VERSION # provided by each benchmark stage export VERSION=`nvm current` export ENABLE_AFFINITY=true echo "using Node.js ${VERSION}" -CPU_AFFINITY="${CPU_START_ID:-24}" # reset for each node.js version +CPU_AFFINITY="${CPU_START_ID:-$TOTAL_CPU_CORES}" # reset for each node.js version SPLITS=${SPLITS:-1} GROUP=${GROUP:-1} @@ -54,7 +55,7 @@ BENCH_END=$(($GROUP_SIZE*$GROUP)) BENCH_START=$(($BENCH_END-$GROUP_SIZE)) if [[ ${GROUP_SIZE} -gt 24 ]]; then - echo "Group size ${GROUP_SIZE} is larger than available number of CPU cores on Benchmarking Platform machines (24 cores)" + echo "Group size ${GROUP_SIZE} is larger than available number of CPU cores on Benchmarking Platform machines (${TOTAL_CPU_CORES} cores)" exit 1 fi From 8db24fea11753b5db57d39c8efde09d803931a71 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 14 Jan 2025 13:17:56 +0100 Subject: [PATCH 2/2] fix --- benchmark/sirun/runall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/sirun/runall.sh b/benchmark/sirun/runall.sh index 7344de3e1bb..d6de9b83f31 100755 --- a/benchmark/sirun/runall.sh +++ b/benchmark/sirun/runall.sh @@ -27,7 +27,7 @@ nvm use 18 # run each test in parallel for a given version of Node.js # once all of the tests have complete move on to the next version -TOTAL_CPU_CORES=$(nproc:-24) +TOTAL_CPU_CORES=$(nproc 2>/dev/null || echo "24") export CPU_AFFINITY="${CPU_START_ID:-$TOTAL_CPU_CORES}" # Benchmarking Platform convention nvm use $MAJOR_VERSION # provided by each benchmark stage