Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
wnuma.cpp File Reference
#include "precompiled.h"
#include "lib/sysdep/numa.h"
#include "lib/bits.h"
#include "lib/alignment.h"
#include "lib/lib.h"
#include "lib/timer.h"
#include "lib/module_init.h"
#include "lib/sysdep/vm.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/sysdep/os/win/acpi.h"
#include "lib/sysdep/os/win/win.h"
#include "lib/sysdep/os/win/wutil.h"
#include "lib/sysdep/os/win/wcpu.h"
#include <map>
#include <Psapi.h>
Include dependency graph for wnuma.cpp:

Classes

struct  Node
 
struct  SLIT
 

Functions

static NodeAddNode ()
 
static NodeFindNodeWithProcessorMask (uintptr_t processorMask)
 
static NodeFindNodeWithProcessor (size_t processor)
 
static UCHAR HighestNodeNumber ()
 
static void PopulateNodes ()
 
static Status InitTopology ()
 
size_t numa_NumNodes ()
 
size_t numa_NodeFromProcessor (size_t processor)
 
uintptr_t numa_ProcessorMaskFromNode (size_t node)
 
static UCHAR NodeNumberFromNode (size_t node)
 
size_t numa_AvailableMemory (size_t node)
 
static double ReadRelativeDistanceFromSLIT (const SLIT *slit)
 
static double MeasureRelativeDistance ()
 
static Status InitRelativeDistance ()
 
double numa_Factor ()
 
static bool IsMemoryInterleaved ()
 
static Status InitMemoryInterleaved ()
 
bool numa_IsMemoryInterleaved ()
 

Variables

static Node nodes [os_cpu_MaxProcessors]
 
static size_t numNodes
 
static ModuleInitState initState { 0 }
 
static double relativeDistance
 
static bool isMemoryInterleaved
 

Function Documentation

◆ AddNode()

static Node * AddNode ( )
static

◆ FindNodeWithProcessor()

static Node * FindNodeWithProcessor ( size_t  processor)
static

◆ FindNodeWithProcessorMask()

static Node * FindNodeWithProcessorMask ( uintptr_t  processorMask)
static

◆ HighestNodeNumber()

static UCHAR HighestNodeNumber ( )
static

◆ InitMemoryInterleaved()

static Status InitMemoryInterleaved ( )
static

◆ InitRelativeDistance()

static Status InitRelativeDistance ( )
static

◆ InitTopology()

static Status InitTopology ( )
static

◆ IsMemoryInterleaved()

static bool IsMemoryInterleaved ( )
static

◆ MeasureRelativeDistance()

static double MeasureRelativeDistance ( )
static

◆ NodeNumberFromNode()

static UCHAR NodeNumberFromNode ( size_t  node)
static

◆ numa_AvailableMemory()

size_t numa_AvailableMemory ( size_t  node)
Parameters
node
Returns
bytes of memory available for allocation on <node>.

◆ numa_Factor()

double numa_Factor ( )
Returns
the ratio between maximum and minimum times that one processor from each node required to fill a globally allocated array. in other words, this is the maximum slowdown for NUMA-oblivious memory accesses. Microsoft guidelines require it to be <= 3.

◆ numa_IsMemoryInterleaved()

bool numa_IsMemoryInterleaved ( )
Returns
an indication of whether memory pages are node-interleaved.

note: this requires ACPI access, which may not be available on least-permission accounts. the default is to return false so as not to cause callers to panic and trigger performance warnings.

◆ numa_NodeFromProcessor()

size_t numa_NodeFromProcessor ( size_t  processor)
Parameters
processor
Returns
node number (zero-based) to which <processor> belongs.

◆ numa_NumNodes()

size_t numa_NumNodes ( )
Returns
number of NUMA "nodes" (i.e. groups of CPUs with local memory).

◆ numa_ProcessorMaskFromNode()

uintptr_t numa_ProcessorMaskFromNode ( size_t  node)
Parameters
node
Returns
bit-mask of all processors constituting <node>.

◆ PopulateNodes()

static void PopulateNodes ( )
static

◆ ReadRelativeDistanceFromSLIT()

static double ReadRelativeDistanceFromSLIT ( const SLIT slit)
static

Variable Documentation

◆ initState

ModuleInitState initState { 0 }
static

◆ isMemoryInterleaved

bool isMemoryInterleaved
static

◆ nodes

Node nodes[os_cpu_MaxProcessors]
static

◆ numNodes

size_t numNodes
static

◆ relativeDistance

double relativeDistance
static