Skip to content

Commit

Permalink
[Benchmark] Fix check for SNC-3 mode. (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duyi-Wang authored Oct 9, 2024
1 parent 4f711db commit c9b0789
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmark/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ numa_nodes=$(lscpu | grep "NUMA node(s)" | awk -F ':' '{print $2}')
# Multiply by 2 to avoid an float result in HBM flat mode that the NUMA count twice and it will be divided later.
cores_per_numa=$(($sockets_num * $cores_per_socket * 2 / $numa_nodes))

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

if [ "${sockets}" -eq 1 ] && [ "${sockets_id}" -ge "${sockets_num}" ]; then
Error "The socket ID (${sockets_id}) is out of available sockets range, max ID is ($((${sockets_num} - 1)))."
if [ "${sockets}" -eq 1 ] && { [ "${sockets_id}" -ge "${sockets_num}" ] && [ "${sockets_id}" -ge "${numa_nodes}" ]; }; then
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))."
exit 1
fi

Expand Down

0 comments on commit c9b0789

Please sign in to comment.