Table of Contents

Class NumaTopology

Namespace
DotCompute.Backends.CPU.Threading.NUMA
Assembly
DotCompute.Backends.CPU.dll

NUMA topology information with advanced features.

public sealed class NumaTopology
Inheritance
NumaTopology
Inherited Members

Properties

CacheLineSize

Gets the cache line size in bytes.

public int CacheLineSize { get; init; }

Property Value

int

DistanceMatrix

Gets the NUMA distance matrix (relative latency between nodes).

public IReadOnlyList<IReadOnlyList<int>>? DistanceMatrix { get; init; }

Property Value

IReadOnlyList<IReadOnlyList<int>>

IsNumaSystem

Checks if the system is a NUMA system.

public bool IsNumaSystem { get; }

Property Value

bool

NodeCount

Gets the number of NUMA nodes.

public required int NodeCount { get; init; }

Property Value

int

Nodes

Gets the NUMA nodes.

public required IReadOnlyList<NumaNode> Nodes { get; init; }

Property Value

IReadOnlyList<NumaNode>

PageSize

Gets the page size in bytes.

public int PageSize { get; init; }

Property Value

int

ProcessorCount

Gets the total processor count.

public required int ProcessorCount { get; init; }

Property Value

int

SupportsMemoryBinding

Gets whether the system supports memory binding to specific nodes.

public bool SupportsMemoryBinding { get; init; }

Property Value

bool

SupportsMemoryPolicy

Gets whether the system supports memory policy configuration.

public bool SupportsMemoryPolicy { get; init; }

Property Value

bool

TotalMemoryBytes

Gets the total memory size across all NUMA nodes in bytes.

public long TotalMemoryBytes { get; }

Property Value

long

Methods

GetClosestNodes(int)

Gets the closest nodes to a given node, ordered by distance.

public IEnumerable<int> GetClosestNodes(int nodeId)

Parameters

nodeId int

The reference node ID.

Returns

IEnumerable<int>

Enumerable of node IDs ordered by proximity.

GetDistance(int, int)

Gets the distance between two NUMA nodes.

public int GetDistance(int fromNode, int toNode)

Parameters

fromNode int

Source node ID.

toNode int

Target node ID.

Returns

int

Distance value (lower is closer).

GetLoadBalanceInfo()

Gets load balancing statistics for all nodes.

public NumaLoadBalanceInfo GetLoadBalanceInfo()

Returns

NumaLoadBalanceInfo

Load balancing information.

GetNodeForProcessor(int)

Gets the node for a specific processor.

public int GetNodeForProcessor(int processorId)

Parameters

processorId int

The processor ID.

Returns

int

The node ID containing the processor.

GetNodesByAvailableMemory()

Gets nodes sorted by available memory.

public IEnumerable<int> GetNodesByAvailableMemory()

Returns

IEnumerable<int>

Enumerable of node IDs sorted by memory availability.

GetOptimalNodeForProcessors(IEnumerable<int>)

Gets the optimal node for memory allocation based on processor affinity.

public int GetOptimalNodeForProcessors(IEnumerable<int> processorIds)

Parameters

processorIds IEnumerable<int>

Processor IDs to consider.

Returns

int

Optimal node ID for allocation.

GetProcessorsForNode(int)

Gets processors for a specific node.

public IEnumerable<int> GetProcessorsForNode(int nodeId)

Parameters

nodeId int

The node ID.

Returns

IEnumerable<int>

Enumerable of processor IDs in the node.