MCPcopy Create free account
hub / github.com/apache/impala / SetupFakeNuma

Method SetupFakeNuma

be/src/testutil/cpu-util.h:67–73  ·  view source on GitHub ↗

Setup a fake NUMA setup where CpuInfo will report a NUMA configuration other than the system's actual configuration. If 'has_numa' is true, sets it up as three NUMA nodes with the cores distributed between them. Otherwise sets it up as a single NUMA node.

Source from the content-addressed store, hash-verified

65 /// nodes with the cores distributed between them. Otherwise sets it up as a single
66 /// NUMA node.
67 static void SetupFakeNuma(bool has_numa) {
68 std::vector<int> core_to_node(CpuInfo::GetMaxNumCores());
69 int num_nodes = has_numa ? 3 : 1;
70 for (int i = 0; i < core_to_node.size(); ++i) core_to_node[i] = i % num_nodes;
71 CpuInfo::InitFakeNumaForTest(num_nodes, core_to_node);
72 LOG(INFO) << CpuInfo::DebugString();
73 }
74
75 /// Set CpuInfo::max_num_cores_ to 'max_num_cores'. The caller is responsible for
76 /// resetting it to its original value.

Callers

nothing calls this directly

Calls 2

DebugStringFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected