HOT FIX: CPU binding cannot follow numactl's control (#16736)

* fix numactl command issue

* fix comments
This commit is contained in:
Sun Xiaoxia authored and GitHub committed 2023-04-06 13:47:34 +08:00
1 parent 1c564226f3
commit f95fd27c16
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -12,6 +12,8 @@
#include <string>
#include <vector>
#include "dev/threading/parallel_custom_arena.hpp"
namespace ov {
struct CPU {
@@ -24,8 +26,10 @@ struct CPU {
std::mutex _task_mutex;
int _plugin_status = PLUGIN_USED_START;
int _socket_idx = 0;
int _num_threads = 0;
CPU() {
_num_threads = parallel_get_max_threads();
init_cpu(*this);
}
void init_cpu(CPU& cpu);
+1 -1
View File
@@ -230,7 +230,7 @@ std::vector<std::vector<int>> get_num_available_cpu_cores() {
}
bool is_cpu_map_available() {
return cpu._cpu_mapping_table.size() > 0;
return cpu._proc_type_table.size() > 0 && cpu._num_threads == cpu._proc_type_table[0][ALL_PROC];
}
std::vector<int> reserve_available_cpus(const ColumnOfProcessorTypeTable core_type,