Skip to content

Commit c9b0789

Browse files
authored
[Benchmark] Fix check for SNC-3 mode. (#44)
1 parent 4f711db commit c9b0789

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

benchmark/run_benchmark.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ numa_nodes=$(lscpu | grep "NUMA node(s)" | awk -F ':' '{print $2}')
194194
# Multiply by 2 to avoid an float result in HBM flat mode that the NUMA count twice and it will be divided later.
195195
cores_per_numa=$(($sockets_num * $cores_per_socket * 2 / $numa_nodes))
196196

197-
if [ "${sockets_num}" -lt "${sockets}" ]; then
198-
Error "The number of available sockets (${sockets_num}) is less than the requested sockets (${sockets})."
197+
if [ "${sockets_num}" -lt "${sockets}" ] && [ "${numa_nodes}" -lt "${sockets}" ]; then
198+
Error "The number of available sockets (${sockets_num}) and numa nodes (${numa_nodes}) are less than the requested sockets (${sockets})."
199199
exit 1
200200
fi
201201

202-
if [ "${sockets}" -eq 1 ] && [ "${sockets_id}" -ge "${sockets_num}" ]; then
203-
Error "The socket ID (${sockets_id}) is out of available sockets range, max ID is ($((${sockets_num} - 1)))."
202+
if [ "${sockets}" -eq 1 ] && { [ "${sockets_id}" -ge "${sockets_num}" ] && [ "${sockets_id}" -ge "${numa_nodes}" ]; }; then
203+
Error "The socket ID (${sockets_id}) is out of available sockets or NUMA nodes range, max ID is $((${sockets_num} < ${numa_nodes} ? ${sockets_num} - 1 : ${numa_nodes} - 1))."
204204
exit 1
205205
fi
206206

0 commit comments

Comments
 (0)