Class OSNuma.PreCalculatedNuma
java.lang.Object
ca.spottedleaf.concurrentutil.numa.OSNuma.PreCalculatedNuma
- All Implemented Interfaces:
OSNuma
- Direct Known Subclasses:
LinuxNuma,OSNuma.NoOp
- Enclosing interface:
OSNuma
-
Nested Class Summary
Nested classes/interfaces inherited from interface ca.spottedleaf.concurrentutil.numa.OSNuma
OSNuma.NoOp, OSNuma.PreCalculatedNuma -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]getCores(int numaId) Returns the cores associated with the specified NUMA node.intReturns the current NUMA node that this thread is running on.int[][]Returns an N by N array wherecost[i][j] = getNumaDistance(i,j)intgetNumaDistance(int n1, int n2) Returns the distance between the specified NUMA nodes.intgetNumaNode(int coreId) Returns the NUMA node associated with the specified core.intReturns the total number of cores on the system.intReturns the total number of nodes on the system.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.spottedleaf.concurrentutil.numa.OSNuma
getCurrentCore, getCurrentThreadAffinity, isAvailable, setCurrentNumaAffinity, setCurrentNumaAffinity, setCurrentThreadAffinity
-
Constructor Details
-
PreCalculatedNuma
public PreCalculatedNuma(int[] coreToNuma, int[][] costArray)
-
-
Method Details
-
getNumaDistance
public int getNumaDistance(int n1, int n2) Description copied from interface:OSNumaReturns the distance between the specified NUMA nodes. The return values are defined by the ACPI SLIT table present on the system.- Specified by:
getNumaDistancein interfaceOSNuma- Parameters:
n1- First noden2- Second node- Returns:
- The distance between the NUMA nodes.
- See Also:
-
getTotalNumaNodes
public int getTotalNumaNodes()Description copied from interface:OSNumaReturns the total number of nodes on the system.- Specified by:
getTotalNumaNodesin interfaceOSNuma- Returns:
- The total number of nodes on the system.
-
getNodeDistances
public int[][] getNodeDistances()Description copied from interface:OSNumaReturns an N by N array wherecost[i][j] = getNumaDistance(i,j)- Specified by:
getNodeDistancesin interfaceOSNuma- Returns:
- The node distance matrix.
- See Also:
-
getNumaNode
public int getNumaNode(int coreId) Description copied from interface:OSNumaReturns the NUMA node associated with the specified core. If the core is not valid, then returns-1.- Specified by:
getNumaNodein interfaceOSNuma- Parameters:
coreId- The specified core- Returns:
- The NUMA node for the core.
-
getTotalCores
public int getTotalCores()Description copied from interface:OSNumaReturns the total number of cores on the system.- Specified by:
getTotalCoresin interfaceOSNuma- Returns:
- The total number of cores on the system.
-
getCores
public int[] getCores(int numaId) Description copied from interface:OSNumaReturns the cores associated with the specified NUMA node. If the node is not valid, then returnsnull.Note that the returned array is not a bitset. It is simply a list of core numbers.
-
getCurrentNumaNode
public int getCurrentNumaNode()Description copied from interface:OSNumaReturns the current NUMA node that this thread is running on. If NUMA interaction is not available, then0will be returned.- Specified by:
getCurrentNumaNodein interfaceOSNuma- Returns:
- The current NUMA node that this thread is running on
-