MCPcopy Create free account
hub / github.com/Niko1221/Strata / machine

Function machine

engine/src/kernels/cpu/card_node_test.cpp:30–38  ·  view source on GitHub ↗

A two-socket machine, one node per socket, 2-way SMT: node k has cores [0, cores_k), CPU numbers as Linux gives them (node 0's first threads, node 1's first threads, then node 0's siblings, node 1's siblings).

Source from the content-addressed store, hash-verified

28// A two-socket machine, one node per socket, 2-way SMT: node k has cores [0, cores_k), CPU numbers as Linux gives them
29// (node 0's first threads, node 1's first threads, then node 0's siblings, node 1's siblings).
30static std::vector<cpu::CardNodeCpu> machine(int cores0, int cores1) {
31 std::vector<cpu::CardNodeCpu> m;
32 int n = 0;
33 for (int pass = 0; pass < 2; ++pass) {
34 for (int c = 0; c < cores0; ++c) m.push_back({n++, 0, 0, c});
35 for (int c = 0; c < cores1; ++c) m.push_back({n++, 1, 1, c});
36 }
37 return m;
38}
39
40static std::vector<int> cpus_of(const std::vector<cpu::CardNodeCpu>& m, int node) {
41 std::vector<int> out;

Callers 2

podFunction · 0.70
decisionsFunction · 0.70

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected