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

Function numa_node_count

engine/src/kernels/cpu/pool.cpp:691–700  ·  view source on GitHub ↗

The NUMA nodes with CPUs this machine has (0.2.2: the split is tried by itself from 2 on). Linux: the sysfs node folder (numa_pool.hpp); Windows: GetNumaHighestNodeNumber; any other system, or a sandbox that hides the folder: 1.

Source from the content-addressed store, hash-verified

689// The NUMA nodes with CPUs this machine has (0.2.2: the split is tried by itself from 2 on). Linux: the sysfs node folder
690// (numa_pool.hpp); Windows: GetNumaHighestNodeNumber; any other system, or a sandbox that hides the folder: 1.
691int numa_node_count() {
692#if defined(__linux__)
693 return (std::max)(1, numa_cpu_node_count_at(sysfs_root() + "/devices/system/node"));
694#elif defined(_WIN32)
695 ULONG highest = 0;
696 return GetNumaHighestNodeNumber(&highest) ? (int) highest + 1 : 1;
697#else
698 return 1;
699#endif
700}
701
702// The real-node split for threads on `thread_core` (numa_pool.hpp). On Linux it runs whenever >=2 nodes exist;
703// on Windows (#6523/#6554) it runs across processor groups when STRATA_NUMA_ARENA=1 or explicit STRATA_NUMA_SPLIT=1.

Callers 1

ExpertPoolMethod · 0.70

Calls 2

numa_cpu_node_count_atFunction · 0.85
sysfs_rootFunction · 0.70

Tested by

no test coverage detected