algorithm

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CellEqual added in v0.2.0

func CellEqual(c1 Cell, c2 Cell) bool

func NewTopologyAwareScheduler added in v0.2.0

func NewTopologyAwareScheduler(
	ccl ChainCellList,
	levelGpuNum map[CellLevel]int32,
	crossPriorityPack bool,
	considerSuggestedNodes bool) *topologyAwareScheduler

NewTopologyAwareScheduler initializes the scheduler by extracting node-level cells (lower-level if no node-level) from a free cell list.

func ParseConfig

func ParseConfig(sConfig *api.Config) (
	physicalFullCellList map[CellChain]ChainCellList,
	physicalFreeCellList map[CellChain]ChainCellList,
	vcFreeCellNum map[api.VirtualClusterName]map[CellChain]map[CellLevel]int32,
	virtualNonReservedFullCellList map[api.VirtualClusterName]map[CellChain]ChainCellList,
	virtualNonReservedFreeCellList map[api.VirtualClusterName]map[CellChain]ChainCellList,
	virtualReservedFullCellList map[api.VirtualClusterName]map[api.ReservationId]ChainCellList,
	reservedPhysicalCells map[api.VirtualClusterName]map[api.ReservationId]*PhysicalCell,
	cellLevelToGpuNum map[CellChain]map[CellLevel]int32,
	gpuTypeToChain map[string][]CellChain,
	cellLevelToType map[CellChain]map[CellLevel]api.CellType,
)

Types

type AlgoAffinityGroup

type AlgoAffinityGroup struct {
	// contains filtered or unexported fields
}

AlgoAffinityGroup is the algorithm-internal representation of an affinity group.

func (*AlgoAffinityGroup) ToAffinityGroup added in v0.2.4

func (aag *AlgoAffinityGroup) ToAffinityGroup() api.AffinityGroup

type Cell

type Cell interface {
	GetChain() CellChain
	GetLevel() CellLevel
	GetPriority() CellPriority
	SetPriority(CellPriority)
	GetAddress() api.CellAddress
	GetParent() Cell
	SetParent(Cell)
	GetChildren() CellList
	SetChildren(CellList)
	AtOrHigherThanNode() bool

	GetTotalGpuNum() int32
	GetUsedGpuNumAtPriorities() map[CellPriority]int32
	IncreaseUsedGpuNumAtPriority(CellPriority, int32)
}

A Cell represents a set of GPUs affinitized by their interconnection topology. Cells are organized as a tree through pointers to their parents / children.

type CellChain

type CellChain string // name of a cell chain (type of the top-level cell)

type CellLevel

type CellLevel int32 // starts from 1

type CellList

type CellList []Cell

CellList is a list of cells at a certain level of a chain.

func (CellList) String

func (cl CellList) String() string

type CellPriority

type CellPriority int32

type ChainCellList

type ChainCellList map[CellLevel]CellList

ChainCellList maps each level in a chain to a CellList.

func NewChainCellList

func NewChainCellList(top CellLevel) ChainCellList

func (ChainCellList) String

func (ccl ChainCellList) String() string

type GenericCell

type GenericCell struct {
	// contains filtered or unexported fields
}

func (*GenericCell) AtOrHigherThanNode added in v0.2.0

func (c *GenericCell) AtOrHigherThanNode() bool

func (*GenericCell) GetAddress added in v0.3.0

func (c *GenericCell) GetAddress() api.CellAddress

func (*GenericCell) GetChain

func (c *GenericCell) GetChain() CellChain

func (*GenericCell) GetChildren

func (c *GenericCell) GetChildren() CellList

func (*GenericCell) GetLevel

func (c *GenericCell) GetLevel() CellLevel

func (*GenericCell) GetParent

func (c *GenericCell) GetParent() Cell

func (*GenericCell) GetPriority

func (c *GenericCell) GetPriority() CellPriority

func (*GenericCell) GetTotalGpuNum added in v0.2.0

func (c *GenericCell) GetTotalGpuNum() int32

func (*GenericCell) GetUsedGpuNumAtPriorities added in v0.2.0

func (c *GenericCell) GetUsedGpuNumAtPriorities() map[CellPriority]int32

func (*GenericCell) IncreaseUsedGpuNumAtPriority added in v0.2.0

func (c *GenericCell) IncreaseUsedGpuNumAtPriority(p CellPriority, delta int32)

func (*GenericCell) SetParent

func (c *GenericCell) SetParent(p Cell)

type HivedAlgorithm

type HivedAlgorithm struct {
	// contains filtered or unexported fields
}

HivedAlgorithm implements an internal.SchedulerAlgorithm. It schedules pods using the algorithm of HiveD. Note that the topologyAwareScheduler used in this struct is not another implementation of SchedulerAlgorithm; that is a specific algorithm for pod placement, used in intra-VC scheduling and opportunistic pod scheduling.

func NewHivedAlgorithm

func NewHivedAlgorithm(sConfig *api.Config) *HivedAlgorithm

NewHivedAlgorithm initializes a HivedAlgorithm from the config file.

func (*HivedAlgorithm) AddAllocatedPod

func (h *HivedAlgorithm) AddAllocatedPod(pod *core.Pod)

func (*HivedAlgorithm) AddNode

func (h *HivedAlgorithm) AddNode(node *core.Node)

func (*HivedAlgorithm) AddUnallocatedPod added in v0.3.0

func (h *HivedAlgorithm) AddUnallocatedPod(pod *core.Pod)

func (*HivedAlgorithm) DeleteAllocatedPod

func (h *HivedAlgorithm) DeleteAllocatedPod(pod *core.Pod)

func (*HivedAlgorithm) DeleteNode

func (h *HivedAlgorithm) DeleteNode(node *core.Node)

func (*HivedAlgorithm) DeleteUnallocatedPod added in v0.3.0

func (h *HivedAlgorithm) DeleteUnallocatedPod(pod *core.Pod)

func (*HivedAlgorithm) GetAffinityGroup added in v0.2.4

func (h *HivedAlgorithm) GetAffinityGroup(name string) api.AffinityGroup

func (*HivedAlgorithm) GetAllAffinityGroups added in v0.3.0

func (h *HivedAlgorithm) GetAllAffinityGroups() api.AffinityGroupList

func (*HivedAlgorithm) GetAllVirtualClustersStatus added in v0.3.0

func (h *HivedAlgorithm) GetAllVirtualClustersStatus() map[api.VirtualClusterName]api.VirtualClusterStatus

func (*HivedAlgorithm) GetClusterStatus added in v0.3.0

func (h *HivedAlgorithm) GetClusterStatus() api.ClusterStatus

func (*HivedAlgorithm) GetPhysicalClusterStatus added in v0.3.0

func (h *HivedAlgorithm) GetPhysicalClusterStatus() api.PhysicalClusterStatus

func (*HivedAlgorithm) GetVirtualClusterStatus added in v0.3.0

func (h *HivedAlgorithm) GetVirtualClusterStatus(vcn api.VirtualClusterName) api.VirtualClusterStatus

func (*HivedAlgorithm) Schedule

func (h *HivedAlgorithm) Schedule(pod *core.Pod, suggestedNodes []string) internal.PodScheduleResult

func (*HivedAlgorithm) UpdateNode

func (h *HivedAlgorithm) UpdateNode(oldNode, newNode *core.Node)

type PhysicalCell

type PhysicalCell struct {
	GenericCell
	// contains filtered or unexported fields
}

PhysicalCell defines a cell in the physical cluster.

func NewPhysicalCell

func NewPhysicalCell(c CellChain, l CellLevel, g bool, n int32, cellType api.CellType, address api.CellAddress) *PhysicalCell

func (*PhysicalCell) AddAffinityGroup added in v0.2.0

func (c *PhysicalCell) AddAffinityGroup(g *AlgoAffinityGroup)

func (*PhysicalCell) DeleteAffinityGroup added in v0.2.0

func (c *PhysicalCell) DeleteAffinityGroup(g *AlgoAffinityGroup)

func (*PhysicalCell) GetAPIStatus added in v0.3.0

func (c *PhysicalCell) GetAPIStatus() *api.PhysicalCellStatus

func (*PhysicalCell) GetAffinityGroup added in v0.2.0

func (c *PhysicalCell) GetAffinityGroup() *AlgoAffinityGroup

func (*PhysicalCell) GetPhysicalPlacement

func (c *PhysicalCell) GetPhysicalPlacement() ([]string, []int32)

func (*PhysicalCell) GetPhysicalPlacementString

func (c *PhysicalCell) GetPhysicalPlacementString() string

func (*PhysicalCell) GetPreBoundVirtualCell added in v0.2.0

func (c *PhysicalCell) GetPreBoundVirtualCell() *VirtualCell

func (*PhysicalCell) GetVirtualCell

func (c *PhysicalCell) GetVirtualCell() *VirtualCell

func (*PhysicalCell) IsReserved

func (c *PhysicalCell) IsReserved() bool

func (*PhysicalCell) IsSplit added in v0.2.0

func (c *PhysicalCell) IsSplit() bool

func (*PhysicalCell) SetChildren added in v0.3.0

func (c *PhysicalCell) SetChildren(children CellList)

func (*PhysicalCell) SetPhysicalResources

func (c *PhysicalCell) SetPhysicalResources(nodes []string, gpuIndices []int32)

func (*PhysicalCell) SetPreBoundVirtualCell added in v0.2.0

func (c *PhysicalCell) SetPreBoundVirtualCell(cell *VirtualCell)

func (*PhysicalCell) SetPriority added in v0.3.0

func (c *PhysicalCell) SetPriority(p CellPriority)

func (*PhysicalCell) SetReserved

func (c *PhysicalCell) SetReserved(reserved bool)

func (*PhysicalCell) SetSplit added in v0.2.0

func (c *PhysicalCell) SetSplit(split bool)

func (*PhysicalCell) SetVirtualCell

func (c *PhysicalCell) SetVirtualCell(cell *VirtualCell)

type VirtualCell

type VirtualCell struct {
	GenericCell
	// contains filtered or unexported fields
}

VirtualCell defines a cell in a VC.

func NewVirtualCell

func NewVirtualCell(
	vcn api.VirtualClusterName,
	c CellChain,
	l CellLevel,
	g bool,
	n int32,
	pac *VirtualCell,
	cellType api.CellType,
	address api.CellAddress) *VirtualCell

func (*VirtualCell) GetAPIStatus added in v0.3.0

func (c *VirtualCell) GetAPIStatus() *api.VirtualCellStatus

func (*VirtualCell) GetPhysicalCell

func (c *VirtualCell) GetPhysicalCell() *PhysicalCell

func (*VirtualCell) GetPreAssignedCell

func (c *VirtualCell) GetPreAssignedCell() *VirtualCell

func (*VirtualCell) GetPreBoundPhysicalCell added in v0.2.0

func (c *VirtualCell) GetPreBoundPhysicalCell() *PhysicalCell

func (*VirtualCell) SetChildren added in v0.3.0

func (c *VirtualCell) SetChildren(children CellList)

func (*VirtualCell) SetPhysicalCell

func (c *VirtualCell) SetPhysicalCell(cell *PhysicalCell)

func (*VirtualCell) SetPreAssignedCell

func (c *VirtualCell) SetPreAssignedCell(cell *VirtualCell)

func (*VirtualCell) SetPreBoundPhysicalCell added in v0.2.0

func (c *VirtualCell) SetPreBoundPhysicalCell(cell *PhysicalCell)

func (*VirtualCell) SetPriority added in v0.3.0

func (c *VirtualCell) SetPriority(p CellPriority)

func (*VirtualCell) SetReservation

func (c *VirtualCell) SetReservation(rid api.ReservationId)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL