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

public abstract static class OSNuma.PreCalculatedNuma extends Object implements OSNuma
  • Constructor Details

    • PreCalculatedNuma

      public PreCalculatedNuma(int[] coreToNuma, int[][] costArray)
  • Method Details

    • getNumaDistance

      public int getNumaDistance(int n1, int n2)
      Description copied from interface: OSNuma
      Returns the distance between the specified NUMA nodes. The return values are defined by the ACPI SLIT table present on the system.
      Specified by:
      getNumaDistance in interface OSNuma
      Parameters:
      n1 - First node
      n2 - Second node
      Returns:
      The distance between the NUMA nodes.
      See Also:
    • getTotalNumaNodes

      public int getTotalNumaNodes()
      Description copied from interface: OSNuma
      Returns the total number of nodes on the system.
      Specified by:
      getTotalNumaNodes in interface OSNuma
      Returns:
      The total number of nodes on the system.
    • getNodeDistances

      public int[][] getNodeDistances()
      Description copied from interface: OSNuma
      Returns an N by N array where cost[i][j] = getNumaDistance(i,j)
      Specified by:
      getNodeDistances in interface OSNuma
      Returns:
      The node distance matrix.
      See Also:
    • getNumaNode

      public int getNumaNode(int coreId)
      Description copied from interface: OSNuma
      Returns the NUMA node associated with the specified core. If the core is not valid, then returns -1.
      Specified by:
      getNumaNode in interface OSNuma
      Parameters:
      coreId - The specified core
      Returns:
      The NUMA node for the core.
    • getTotalCores

      public int getTotalCores()
      Description copied from interface: OSNuma
      Returns the total number of cores on the system.
      Specified by:
      getTotalCores in interface OSNuma
      Returns:
      The total number of cores on the system.
    • getCores

      public int[] getCores(int numaId)
      Description copied from interface: OSNuma
      Returns the cores associated with the specified NUMA node. If the node is not valid, then returns null.

      Note that the returned array is not a bitset. It is simply a list of core numbers.

      Specified by:
      getCores in interface OSNuma
      Parameters:
      numaId - The specified NUMA node.
      Returns:
      The cores associated with the specified NUMA node.
    • getCurrentNumaNode

      public int getCurrentNumaNode()
      Description copied from interface: OSNuma
      Returns the current NUMA node that this thread is running on. If NUMA interaction is not available, then 0 will be returned.
      Specified by:
      getCurrentNumaNode in interface OSNuma
      Returns:
      The current NUMA node that this thread is running on