File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,13 +27,14 @@ nvm use 18
2727# run each test in parallel for a given version of Node.js
2828# once all of the tests have complete move on to the next version
2929
30- export CPU_AFFINITY=" ${CPU_START_ID:- 24} " # Benchmarking Platform convention
30+ TOTAL_CPU_CORES=$( nproc 2> /dev/null || echo " 24" )
31+ export CPU_AFFINITY=" ${CPU_START_ID:- $TOTAL_CPU_CORES } " # Benchmarking Platform convention
3132
3233nvm use $MAJOR_VERSION # provided by each benchmark stage
3334export VERSION=` nvm current`
3435export ENABLE_AFFINITY=true
3536echo " using Node.js ${VERSION} "
36- CPU_AFFINITY=" ${CPU_START_ID:- 24 } " # reset for each node.js version
37+ CPU_AFFINITY=" ${CPU_START_ID:- $TOTAL_CPU_CORES } " # reset for each node.js version
3738SPLITS=${SPLITS:- 1}
3839GROUP=${GROUP:- 1}
3940
@@ -54,7 +55,7 @@ BENCH_END=$(($GROUP_SIZE*$GROUP))
5455BENCH_START=$(( $BENCH_END - $GROUP_SIZE ))
5556
5657if [[ ${GROUP_SIZE} -gt 24 ]]; then
57- echo " Group size ${GROUP_SIZE} is larger than available number of CPU cores on Benchmarking Platform machines (24 cores)"
58+ echo " Group size ${GROUP_SIZE} is larger than available number of CPU cores on Benchmarking Platform machines (${TOTAL_CPU_CORES} cores)"
5859 exit 1
5960fi
6061
You can’t perform that action at this time.
0 commit comments