From 1c0a6dc050e979042c2ff33a8253fddaf18e39f4 Mon Sep 17 00:00:00 2001 From: "Shen, Wanglei" Date: Mon, 30 Dec 2024 09:01:10 +0800 Subject: [PATCH] fix CID issue --- src/inference/src/os/lin/lin_system_conf.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/inference/src/os/lin/lin_system_conf.cpp b/src/inference/src/os/lin/lin_system_conf.cpp index 29c8bfddbd1ca4..49fcff0e445cb5 100644 --- a/src/inference/src/os/lin/lin_system_conf.cpp +++ b/src/inference/src/os/lin/lin_system_conf.cpp @@ -195,9 +195,14 @@ CPU::CPU() { for (int i = 0; i < static_cast(socket_list.size()); i++) { sockets_map.insert(std::pair(socket_list[i], i)); } + int current_numa_nodes = 0; + { + std::lock_guard lock{_cpu_mutex}; + current_numa_nodes = _numa_nodes; + } for (int i = 0; i < static_cast(numa_node_list.size()); i++) { for (int j = 0; j < static_cast(numa_node_list[i].size()); j++) { - numa_node_map.insert(std::pair(numa_node_list[i][j], i * _numa_nodes / _sockets + j)); + numa_node_map.insert(std::pair(numa_node_list[i][j], i * current_numa_nodes / _sockets + j)); } } for (size_t i = 0; i < valid_cpu_mapping_table.size(); i++) {