Documentation
¶
Index ¶
- Constants
- type CPUInfo
- type CPUMap
- type CoreType
- type GPUInfo
- type GPUMap
- type NodeInfo
- func (n *NodeInfo) GetDeviceRequestAllocationResult(ctx context.Context, kubeclient client.Client, ...) ([]resourcev1.DeviceRequestAllocationResult, error)
- func (n *NodeInfo) GetDeviceRequests(ctx context.Context, kubeclient client.Client, ...) ([]resourcev1.DeviceRequest, error)
- func (n *NodeInfo) GetGresAndGresConf() (gres, gresConf string)
Constants ¶
const ( DraDriverCpu_CpuID resourcev1.QualifiedName = "dra.cpu/cpuID" DraDriverCpu_CoreID resourcev1.QualifiedName = "dra.cpu/coreID" DraDriverCpu_SocketID resourcev1.QualifiedName = "dra.cpu/socketID" DraDriverCpu_CoreType resourcev1.QualifiedName = "dra.cpu/coreType" )
Resource attributes
const ( DraExampleDriver = "gpu.example.com" DraDriverGpuNvidia = "gpu.nvidia.com" )
const DraDriverCpu = "dra.cpu"
const (
DraExampleDriver_Index resourcev1.QualifiedName = "index"
)
Resource attributes. DraExampleDriver uses "index" in Device.Attributes. DraDriverGpuNvidia uses Name "gpu-<minor>", (e.g. "gpu-0", "gpu-1" from CanonicalName in NVIDIA k8s-dra-driver-gpu).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUInfo ¶
type CPUInfo struct {
// Name of enumerated CPU
Name string `json:"name"`
// CpuID is the enumerated CPU ID
CpuID int `json:"cpuID"`
// CoreID is the logical core ID, unique within each SocketID
CoreID int `json:"coreID"`
// SocketID is the physical socket ID
SocketID int `json:"socketID"`
// CPU Sibling of the CpuID
SiblingCpuID cpuset.CPUSet `json:"siblingCpuID"`
// Core Type (e-core or p-core)
CoreType CoreType `json:"coreType,omitempty"`
}
CPUInfo holds information about a single CPU.
func NewCPUInfos ¶
func NewCPUInfos(rSlice *resourcev1.ResourceSlice) []*CPUInfo
type CPUMap ¶
type CPUMap struct {
// CPUInfoMap stores the raw CPUInfos as a map,
// where the index is the CPU ID, and the value is the CPUInfo.
CPUInfoMap map[int]*CPUInfo `json:"cpuInfoMap"`
// AbstractToMachine is a map of abstract to machine cores,
// where the index is the core, and the value is the set of CpuIDs.
AbstractToMachine []cpuset.CPUSet `json:"abstractToMachine"`
// MachineToAbstract is the map of machine to abstract cores,
// where the index is CpuID, and the value is the core index from AbstractToMachine.
MachineToAbstract map[int]int `json:"machineToAbstract"`
}
CPUMap holds the Slurm abstract to machine core map.
func (CPUMap) GetOnesBitmap ¶
GetOnesBitmap returns a bitmap with all available bits set to one.
func (CPUMap) ToAbstractCPUs ¶
ToAbstractCPUs converts the machine CPU set into an abstract CPU Bitmap.
type CoreType ¶
type CoreType int
CoreType is an enum for the type of CPU core.
const ( // CoreTypeUndefined is the default zero value. CoreTypeUndefined CoreType = iota // CoreTypeStandard is a standard CPU core. CoreTypeStandard // CoreTypePerformance is a performance core (p-core). CoreTypePerformance // CoreTypeEfficiency is an efficiency core (e-core). CoreTypeEfficiency )
type GPUInfo ¶
type GPUInfo struct {
// Name of the GPU device
Name string `json:"name"`
// Index is the GPU Index
Index int `json:"index"`
}
GPUInfo holds information about a single GPU.
func NewGPUInfos ¶
func NewGPUInfos(ctx context.Context, rSlice *resourcev1.ResourceSlice) []*GPUInfo
type GPUMap ¶
type NodeInfo ¶
type NodeInfo struct {
// contains filtered or unexported fields
}
Represents a Kubernetes node for Slurm.
func NewNodeInfo ¶
func (*NodeInfo) GetDeviceRequestAllocationResult ¶
func (n *NodeInfo) GetDeviceRequestAllocationResult(ctx context.Context, kubeclient client.Client, resources *slurmcontrol.NodeResources) ([]resourcev1.DeviceRequestAllocationResult, error)
func (*NodeInfo) GetDeviceRequests ¶
func (n *NodeInfo) GetDeviceRequests(ctx context.Context, kubeclient client.Client, resources *slurmcontrol.NodeResources) ([]resourcev1.DeviceRequest, error)
func (*NodeInfo) GetGresAndGresConf ¶
GetGresAndGresConf returns Slurm GRES and GresConf strings for this node's devices. GRES and GresConf are derived from DRA ResourceSlices (e.g. GPU devices); CPU is not included. Returns ("", "") when the node has no GRES devices.