flowscheduler

package
v0.0.0-...-c392379 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRIORITYCOST = uint64(1 << 12)
	GPUNEEDCOST  = uint64(1 << 6)
	PREEMPTCOST  = uint64(1 << 18)
	NOTAVICOST   = uint64(1 << 24)
	NOTSCHECOST  = uint64(1 << 24)
)
View Source
const (
	ARC_RUNNING = 1
	ARC_OTHER   = 2
)
View Source
const (
	NODE_TASK     = 1
	NODE_RESOURCE = 2
	NODE_SINK     = 3
	NODE_AGGNODE  = 4
	//unscheduled node is the same as the job node
	NODE_UNSCEDULED = 5
	NODE_OTHER      = 6
)
View Source
const (
	JOB_CREATED   = 1 // is equal to Job_unscheduled
	JOB_RUNNING   = 2
	JOB_COMPLETED = 3
	JOB_FAILED    = 4
)
View Source
const (
	IN_SET         = 0
	NOT_IN_SET     = 1
	EXISTS_KEY     = 2
	NOT_EXISTS_KEY = 3
)
View Source
const (
	RES_PU    = 1
	RES_CORE  = 2
	RES_OTHER = 3
)
View Source
const (
	TASK_UNSCHEDULED = 1
	TASK_RUNNING     = 2
	TASK_FAILED      = 3
	TASK_COMPLETED   = 4
)

Variables

This section is empty.

Functions

func Compare

func Compare(i, j TaskDetail) bool

func GetTaskNumberWithGPULimit

func GetTaskNumberWithGPULimit(jd *JobDescriptor, num uint64) uint64

Feb 18, Changed

func LabelsTest

func LabelsTest()

func Test

func Test() string

func TestGraphMain

func TestGraphMain()

Types

type ArcDescriptor

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

type ArcType

type ArcType = uint8

type CostModel

type CostModel interface {
	UnschedAggToSink(jd *JobDescriptor) *ArcDescriptor
	TaskContinuation(td *TaskDescriptor) *ArcDescriptor
	LeafRescourceToSink(rd *ResDescriptor) *ArcDescriptor
	TaskToUnscheduledAgg(td *TaskDescriptor) *ArcDescriptor
	TaskPreferdResource(td *TaskDescriptor) []*ResDescriptor
	TaskNodeToResource(td *TaskDescriptor, rd *ResDescriptor) *ArcDescriptor
	UpdateTaskNode(td *TaskDescriptor)
	UpdateResNode(rd *ResDescriptor)
}

type Details

type Details []TaskDetail

func (Details) Len

func (tdl Details) Len() int

func (Details) Less

func (tdl Details) Less(i, j int) bool

func (Details) Swap

func (tdl Details) Swap(i, j int)

type Dispatcher

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

func NewDispatcher

func NewDispatcher(gm *GraphManager) *Dispatcher

func (*Dispatcher) CheckScheduleResult

func (dp *Dispatcher) CheckScheduleResult(temTaskMapping map[NodeID]NodeID) map[NodeID]NodeID

func (*Dispatcher) ExportGraphWithoutRunningTasks

func (dp *Dispatcher) ExportGraphWithoutRunningTasks() string

func (*Dispatcher) GPULimitSlover

func (dp *Dispatcher) GPULimitSlover() (string, map[NodeID]NodeID)

func (*Dispatcher) GetMappings

func (dp *Dispatcher) GetMappings(flow map[NodeID](map[NodeID]uint64)) (map[NodeID]NodeID, map[NodeID]NodeID)

func (*Dispatcher) ParseOutput

func (dp *Dispatcher) ParseOutput(output string) map[NodeID](map[NodeID]uint64)

func (*Dispatcher) PengChengSlover

func (dp *Dispatcher) PengChengSlover() (string, map[NodeID]NodeID, map[NodeID]NodeID)

func (*Dispatcher) RunGpuSlover

func (dp *Dispatcher) RunGpuSlover() (string, map[NodeID]NodeID)

func (*Dispatcher) RunPCSlover

func (dp *Dispatcher) RunPCSlover() (string, map[NodeID]NodeID, map[TaskID]ResID)

func (*Dispatcher) RunSolver

func (dp *Dispatcher) RunSolver() (string, map[NodeID]NodeID, map[TaskID]ResID)

返回solver的输出

type FCFSModel

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

func NewFCFSCostModel

func NewFCFSCostModel(gm_ *GraphManager) *FCFSModel

func (*FCFSModel) LeafRescourceToSink

func (fm *FCFSModel) LeafRescourceToSink(rd *ResDescriptor) *ArcDescriptor

func (*FCFSModel) SetLimit

func (fm *FCFSModel) SetLimit(t uint64)

func (*FCFSModel) TaskContinuation

func (fm *FCFSModel) TaskContinuation(td *TaskDescriptor) *ArcDescriptor

func (*FCFSModel) TaskNodeToResource

func (fm *FCFSModel) TaskNodeToResource(td *TaskDescriptor, rd *ResDescriptor) *ArcDescriptor

arc from task to res.

func (*FCFSModel) TaskPreferdResource

func (fm *FCFSModel) TaskPreferdResource(td *TaskDescriptor) []*ResDescriptor

func (*FCFSModel) TaskToResCost

func (fm *FCFSModel) TaskToResCost(td *TaskDescriptor, rd *ResDescriptor) uint64

func (*FCFSModel) TaskToUnscheduledAgg

func (fm *FCFSModel) TaskToUnscheduledAgg(td *TaskDescriptor) *ArcDescriptor

func (*FCFSModel) UnschedAggToSink

func (fm *FCFSModel) UnschedAggToSink(jd *JobDescriptor) *ArcDescriptor

this arc will be updated during updating job

func (*FCFSModel) UpdateResNode

func (fm *FCFSModel) UpdateResNode(rd *ResDescriptor)

func (*FCFSModel) UpdateTaskNode

func (fm *FCFSModel) UpdateTaskNode(td *TaskDescriptor)

type FlowScheduler

type FlowScheduler struct {

	//if time has passed updateFrequncy(ms) ,then we update time based cost
	UpdateFrequency uint64
	// contains filtered or unexported fields
}

func NewFlowScheduler

func NewFlowScheduler() *FlowScheduler

func (*FlowScheduler) AddJob

func (fs *FlowScheduler) AddJob(jd *JobDescriptor)

func (*FlowScheduler) AddJobs

func (fs *FlowScheduler) AddJobs(jds []*JobDescriptor)

func (*FlowScheduler) AddResource

func (fs *FlowScheduler) AddResource(rd *ResDescriptor)

func (*FlowScheduler) ChangeJobDes

func (fs *FlowScheduler) ChangeJobDes(jd *JobDescriptor) bool

func (*FlowScheduler) CheckJobCompleted

func (fs *FlowScheduler) CheckJobCompleted(jd *JobDescriptor)

func (*FlowScheduler) ExportGraph

func (fs *FlowScheduler) ExportGraph() string

func (*FlowScheduler) GetResInfo

func (fs *FlowScheduler) GetResInfo() map[string]uint64

func (*FlowScheduler) GetTaskInfo

func (fs *FlowScheduler) GetTaskInfo() map[string]string

func (*FlowScheduler) HandleJobCompleted

func (fs *FlowScheduler) HandleJobCompleted(jd *JobDescriptor)

func (*FlowScheduler) HandleTaskCompeleted

func (fs *FlowScheduler) HandleTaskCompeleted(td *TaskDescriptor)

func (*FlowScheduler) HandleTaskCompeletedByID

func (fs *FlowScheduler) HandleTaskCompeletedByID(tid TaskID)

func (*FlowScheduler) HandleTaskFailed

func (fs *FlowScheduler) HandleTaskFailed(td *TaskDescriptor)

func (*FlowScheduler) HandleTaskFailedByID

func (fs *FlowScheduler) HandleTaskFailedByID(tid TaskID)

func (*FlowScheduler) HandleTaskKilled

func (fs *FlowScheduler) HandleTaskKilled(tid TaskID)

func (*FlowScheduler) HandleTaskPlacement

func (fs *FlowScheduler) HandleTaskPlacement(tid TaskID, rid ResID)

func (*FlowScheduler) HaveEnoughResource

func (fs *FlowScheduler) HaveEnoughResource(td *TaskDescriptor, rd *ResDescriptor) bool

func (*FlowScheduler) ReplaceKilledTask

func (fs *FlowScheduler) ReplaceKilledTask()

func (*FlowScheduler) ResIDToResDes

func (fs *FlowScheduler) ResIDToResDes(rid ResID) *ResDescriptor

func (*FlowScheduler) RunScheduleIteration

func (fs *FlowScheduler) RunScheduleIteration() (map[TaskID]ResID, map[TaskID]ResID)

func (*FlowScheduler) ScheduleAllJobs

func (fs *FlowScheduler) ScheduleAllJobs() (map[TaskID]ResID, map[TaskID]ResID)

func (*FlowScheduler) ScheduleAllJobsToPoseidon

func (fs *FlowScheduler) ScheduleAllJobsToPoseidon() (map[TaskID]ResID, map[TaskID]ResID)

func (*FlowScheduler) ScheduleJobs

func (fs *FlowScheduler) ScheduleJobs(jobs []*JobDescriptor) (map[TaskID]ResID, map[TaskID]ResID)

func (*FlowScheduler) TaskIDToJobDes

func (fs *FlowScheduler) TaskIDToJobDes(tid TaskID) *JobDescriptor

func (*FlowScheduler) TaskIDToTaskDes

func (fs *FlowScheduler) TaskIDToTaskDes(tid TaskID) *TaskDescriptor

func (*FlowScheduler) Transform

func (fs *FlowScheduler) Transform(taskMappings map[TaskID]ResID) []SR

func (*FlowScheduler) UsedJobID

func (fs *FlowScheduler) UsedJobID(jid uint64) bool

func (*FlowScheduler) UsedResID

func (fs *FlowScheduler) UsedResID(rid uint64) bool

type GPUCostModel

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

func NewGpuCostModel

func NewGpuCostModel(gm_ *GraphManager) *GPUCostModel

func (*GPUCostModel) LeafRescourceToSink

func (gcs *GPUCostModel) LeafRescourceToSink(rd *ResDescriptor) *ArcDescriptor

func (*GPUCostModel) SetGpuNum

func (gcs *GPUCostModel) SetGpuNum(num uint64)

func (*GPUCostModel) TaskContinuation

func (gcs *GPUCostModel) TaskContinuation(td *TaskDescriptor) *ArcDescriptor

func (*GPUCostModel) TaskNodeToResource

func (gcs *GPUCostModel) TaskNodeToResource(td *TaskDescriptor, rd *ResDescriptor) *ArcDescriptor

arc from task to res.

func (*GPUCostModel) TaskPreferdResource

func (gcs *GPUCostModel) TaskPreferdResource(td *TaskDescriptor) []*ResDescriptor

func (*GPUCostModel) TaskToResCost

func (gcs *GPUCostModel) TaskToResCost(td *TaskDescriptor, rd *ResDescriptor) uint64

func (*GPUCostModel) TaskToUnscheduledAgg

func (gcs *GPUCostModel) TaskToUnscheduledAgg(td *TaskDescriptor) *ArcDescriptor

func (*GPUCostModel) UnschedAggToSink

func (gcs *GPUCostModel) UnschedAggToSink(jd *JobDescriptor) *ArcDescriptor

this arc will be updated during updating job

func (*GPUCostModel) UpdateResNode

func (gcs *GPUCostModel) UpdateResNode(rd *ResDescriptor)

func (*GPUCostModel) UpdateTaskNode

func (gcs *GPUCostModel) UpdateTaskNode(td *TaskDescriptor)

type GpuNums

type GpuNums []uint64

func (GpuNums) Len

func (nums GpuNums) Len() int

func (GpuNums) Less

func (nums GpuNums) Less(i, j int) bool

func (GpuNums) Swap

func (nums GpuNums) Swap(i, j int)

type Graph

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

func (*Graph) AddArc

func (g *Graph) AddArc(src_, dst_ *GraphNode,
	lower, upper uint64,
	cost_ uint64,
	comment_ string) *GraphArc

func (*Graph) AddNode

func (g *Graph) AddNode(excess int64, ntype NodeType, comment string) *GraphNode

func (*Graph) ChangeArc

func (g *Graph) ChangeArc(arc *GraphArc,
	lower, upper uint64,
	cost uint64)

func (*Graph) ExportGraph

func (g *Graph) ExportGraph() string

func (*Graph) GetArc

func (g *Graph) GetArc(src, dst *GraphNode) *GraphArc

func (*Graph) GetNextID

func (g *Graph) GetNextID() NodeID

func (*Graph) GetNode

func (g *Graph) GetNode(nid NodeID) *GraphNode

func (*Graph) GetNodeByID

func (g *Graph) GetNodeByID(nid NodeID) *GraphNode

func (*Graph) Init

func (g *Graph) Init()

func (*Graph) RemoveArc

func (g *Graph) RemoveArc(arc *GraphArc)

func (*Graph) RemoveNode

func (g *Graph) RemoveNode(node *GraphNode)

type GraphArc

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

func (*GraphArc) Export

func (arc *GraphArc) Export() string

type GraphChangeManager

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

func (*GraphChangeManager) AddArc

func (gcm *GraphChangeManager) AddArc(src, dst *GraphNode,
	lower, upper uint64,
	cost uint64,
	comment string) *GraphArc

func (*GraphChangeManager) AddNode

func (gcm *GraphChangeManager) AddNode(excess int64, ntype uint8, comment string) *GraphNode

func (*GraphChangeManager) ChangeArc

func (gcm *GraphChangeManager) ChangeArc(arc *GraphArc, lower, upper, cost uint64, comment string)

func (*GraphChangeManager) GetArc

func (gcm *GraphChangeManager) GetArc(src, dst *GraphNode) *GraphArc

func (*GraphChangeManager) GetNode

func (gcm *GraphChangeManager) GetNode(nid NodeID) *GraphNode

func (*GraphChangeManager) Init

func (gcm *GraphChangeManager) Init()

func (*GraphChangeManager) RemoveArc

func (gcm *GraphChangeManager) RemoveArc(arc *GraphArc)

func (*GraphChangeManager) RemoveNode

func (gcm *GraphChangeManager) RemoveNode(node *GraphNode)

==--== maybe this is a problem

type GraphManager

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

gm中可能需要面对的情况: 添加,删除,更新任务节点 :添加,通过给定的jobdes中的taskdes 添加 :删除,指定任务,删除相应的节点,释放占用的资源(如果在running) 添加,删除,更新资源节点 :由flow schdduler 给定删除任务。(删除指令谁通知flowscheduler? :添加以及更新,通过resdes进行更新,如果模拟调度则在调度过程中进行更改(只需要更新resdes即可 处理 任务结束/job结束 :任务结束:释放相应资源(通过修该resdes) 处理 task调度 :占用相应资源(实际上调度过程已经更改?task调度后占用资源怎么体现?),

slover求解过程中的资源是直接占用还是保留

question 调度过程的调度结果出现问题:如果一部分资源不能满足(cpu,memory出现问题,如何处理?)

func (*GraphManager) AddAllTask

func (gm *GraphManager) AddAllTask(jd *JobDescriptor, newNode map[*GraphNode]bool)

func (*GraphManager) AddOrUpdateAllResNodes

func (gm *GraphManager) AddOrUpdateAllResNodes(rds []*ResDescriptor) map[*GraphNode]bool

func (*GraphManager) AddOrUpdateJobNodes

func (gm *GraphManager) AddOrUpdateJobNodes(jobs []*JobDescriptor) map[*GraphNode]bool

func (*GraphManager) AddRescourceNode

func (gm *GraphManager) AddRescourceNode(rd *ResDescriptor) *GraphNode

func (*GraphManager) AddTaskNode

func (gm *GraphManager) AddTaskNode(td *TaskDescriptor) *GraphNode

func (*GraphManager) AddUnscehduleAggNode

func (gm *GraphManager) AddUnscehduleAggNode(jd *JobDescriptor) *GraphNode

func (*GraphManager) ExportGraph

func (gm *GraphManager) ExportGraph() string

func (*GraphManager) ExportGraphWithoutRunningTasks

func (gm *GraphManager) ExportGraphWithoutRunningTasks() string

/ this func didn't handle : a job has more than two tasks

func (*GraphManager) GetArc

func (gm *GraphManager) GetArc(src, dst *GraphNode) *GraphArc

func (*GraphManager) GetNode

func (gm *GraphManager) GetNode(nid NodeID) *GraphNode

func (*GraphManager) GetResInfo

func (gm *GraphManager) GetResInfo() map[string]uint64

func (*GraphManager) GetTaskInfo

func (gm *GraphManager) GetTaskInfo() map[string]string

func (*GraphManager) GetUnExportNodes

func (gm *GraphManager) GetUnExportNodes() map[NodeID]bool

func (*GraphManager) HandleTaskKilled

func (gm *GraphManager) HandleTaskKilled(tid TaskID)

func (*GraphManager) Init

func (gm *GraphManager) Init()

func (*GraphManager) JobCompleted

func (gm *GraphManager) JobCompleted(jd *JobDescriptor)

func (*GraphManager) JobIDToUnscheNode

func (gm *GraphManager) JobIDToUnscheNode(jid JobID) *GraphNode

func (*GraphManager) PinTaskToResNode

func (gm *GraphManager) PinTaskToResNode(tnode, rnode *GraphNode)

func (*GraphManager) RemoveRescourceNode

func (gm *GraphManager) RemoveRescourceNode(rd *ResDescriptor)

func (*GraphManager) RemoveTaskHelper

func (gm *GraphManager) RemoveTaskHelper(tnode *GraphNode)

func (*GraphManager) RemoveTaskNode

func (gm *GraphManager) RemoveTaskNode(td *TaskDescriptor) NodeID

func (*GraphManager) RemoveUnscehduleAggNode

func (gm *GraphManager) RemoveUnscehduleAggNode(jd *JobDescriptor) *GraphNode

func (*GraphManager) ResIDToNode

func (gm *GraphManager) ResIDToNode(rid ResID) *GraphNode

func (*GraphManager) SetCostModel

func (gm *GraphManager) SetCostModel(cs CostModel)

func (*GraphManager) TaskCompleted

func (gm *GraphManager) TaskCompleted(tnode *GraphNode)

删除节点

func (*GraphManager) TaskFailed

func (gm *GraphManager) TaskFailed(tnode *GraphNode)

func (*GraphManager) TaskIDToNode

func (gm *GraphManager) TaskIDToNode(tid TaskID) *GraphNode

func (*GraphManager) TaskScheduled

func (gm *GraphManager) TaskScheduled(tnode, rnode *GraphNode)

func (*GraphManager) UpdateArcsForScheduledTask

func (gm *GraphManager) UpdateArcsForScheduledTask(tnode, rnode *GraphNode)

func (*GraphManager) UpdateFlowGraph

func (gm *GraphManager) UpdateFlowGraph()

func (*GraphManager) UpdateResourceNode

func (gm *GraphManager) UpdateResourceNode(rnode *GraphNode)

func (*GraphManager) UpdateRunningTask

func (gm *GraphManager) UpdateRunningTask(node *GraphNode)

func (*GraphManager) UpdateTaskNode

func (gm *GraphManager) UpdateTaskNode(node *GraphNode)

func (*GraphManager) UpdateTaskToResourceArcs

func (gm *GraphManager) UpdateTaskToResourceArcs(tnode *GraphNode)

func (*GraphManager) UpdateUnscheduledNode

func (gm *GraphManager) UpdateUnscheduledNode(node *GraphNode, cap_delta int64)

type GraphNode

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

func (*GraphNode) Export

func (node *GraphNode) Export() string

func (*GraphNode) IsResourceNode

func (n *GraphNode) IsResourceNode() bool

func (*GraphNode) IsTaskNode

func (n *GraphNode) IsTaskNode() bool

type JIS

type JIS []JobInfo

type JobDescriptor

type JobDescriptor struct {
	Name               string
	Uuid               string
	Jid                JobID
	Tasks              []*TaskDescriptor
	GangScheduleNum    int
	TaskUnscheduledNum int
	SubmitTime         uint64
	State              JobState
}

func GenerateJob

func GenerateJob(resreq JobInfo) []*JobDescriptor

func NewJob

func NewJob(reqs []uint64, p uint64) *JobDescriptor

func (*JobDescriptor) GetJobID

func (jd *JobDescriptor) GetJobID() JobID

type JobID

type JobID = uint64

type JobInfo

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

type JobState

type JobState = uint8

type Label

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

type LabelSelector

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

func NewLabelSelector

func NewLabelSelector() *LabelSelector

func (*LabelSelector) SatisfiesLabels

func (ls *LabelSelector) SatisfiesLabels(labels []Label) bool

check the labels can satisfy the selector

func (*LabelSelector) SatisfiesLabelsExistsKey

func (ls *LabelSelector) SatisfiesLabelsExistsKey(labelsMap map[string]string) bool

func (*LabelSelector) SatisfiesLabelsInSet

func (ls *LabelSelector) SatisfiesLabelsInSet(labelsMap map[string]string) bool

func (*LabelSelector) SatisfiesLabelsNotExistsKey

func (ls *LabelSelector) SatisfiesLabelsNotExistsKey(labelsMap map[string]string) bool

func (*LabelSelector) SatisfiesLabelsNotInSet

func (ls *LabelSelector) SatisfiesLabelsNotInSet(labelsMap map[string]string) bool

func (*LabelSelector) SatisfiesLabelsUseMap

func (ls *LabelSelector) SatisfiesLabelsUseMap(labelsMap map[string]string) bool

labelsMap is the map[Labelkey]LabelsValues labels 是某个节点上的labels,而selector是验证是否满足

func (*LabelSelector) SetLabelSelector

func (ls *LabelSelector) SetLabelSelector(key string, values []string, lstype SelectorType)

type NodeID

type NodeID = uint64

type NodeType

type NodeType = uint8

type PengChengCostModel

type PengChengCostModel struct {
	Gpunum   uint64
	Priority uint64
	Tinfo    TaskDetail

	// no more than maxschedulenum tasks can be scheduled to a resource node in every time schedule,it do not work in current settings
	MaxScheduleNum uint64
	// contains filtered or unexported fields
}

func NewPengChengCostModel

func NewPengChengCostModel(gm_ *GraphManager) *PengChengCostModel

func (*PengChengCostModel) GetTaskKilled

func (pccm *PengChengCostModel) GetTaskKilled(temTaskMapping map[NodeID]NodeID) map[TaskID]ResID

func (*PengChengCostModel) LeafRescourceToSink

func (pccm *PengChengCostModel) LeafRescourceToSink(rd *ResDescriptor) *ArcDescriptor

func (*PengChengCostModel) SetGpunum

func (pccm *PengChengCostModel) SetGpunum(gpunum uint64)

func (*PengChengCostModel) SetMaxScheduleNum

func (pccm *PengChengCostModel) SetMaxScheduleNum(msn uint64)

func (*PengChengCostModel) SetPriority

func (pccm *PengChengCostModel) SetPriority(p uint64)

func (*PengChengCostModel) SetTinfo

func (pccm *PengChengCostModel) SetTinfo(detail TaskDetail)

func (*PengChengCostModel) SetminRandLim

func (pccm *PengChengCostModel) SetminRandLim(mrl uint64)

func (*PengChengCostModel) TaskContinuation

func (pccm *PengChengCostModel) TaskContinuation(td *TaskDescriptor) *ArcDescriptor

func (*PengChengCostModel) TaskNodeToResource

func (pccm *PengChengCostModel) TaskNodeToResource(td *TaskDescriptor, rd *ResDescriptor) *ArcDescriptor

func (*PengChengCostModel) TaskPreferdResource

func (pccm *PengChengCostModel) TaskPreferdResource(td *TaskDescriptor) []*ResDescriptor

func (*PengChengCostModel) TaskToResCost

func (pccm *PengChengCostModel) TaskToResCost(td *TaskDescriptor, rd *ResDescriptor) uint64

func (*PengChengCostModel) TaskToUnscheduledAgg

func (pccm *PengChengCostModel) TaskToUnscheduledAgg(td *TaskDescriptor) *ArcDescriptor

func (*PengChengCostModel) UnschedAggToSink

func (pccm *PengChengCostModel) UnschedAggToSink(jd *JobDescriptor) *ArcDescriptor

this arc will be updated during updating job

func (*PengChengCostModel) UpdateResNode

func (pccm *PengChengCostModel) UpdateResNode(rd *ResDescriptor)

func (*PengChengCostModel) UpdateTaskNode

func (pccm *PengChengCostModel) UpdateTaskNode(td *TaskDescriptor)

type ResDescriptor

type ResDescriptor struct {
	Rid                 ResID
	Uuid                string
	Name                string
	CurrentRunningTasks []TaskID
	Rtype               ResType
	//labels []Label
	ResAvailable ResVector
	ResReserved  ResVector
	ResPreempt   ResVector
	ResTotal     ResVector
}

func GenerateRes

func GenerateRes(resavi map[uint64]uint64) []*ResDescriptor

func NewRes

func NewRes(avi uint64) *ResDescriptor

func (*ResDescriptor) AddCurrentRunningTask

func (rd *ResDescriptor) AddCurrentRunningTask(tid TaskID)

func (*ResDescriptor) GetResID

func (rd *ResDescriptor) GetResID() ResID

type ResID

type ResID = uint64

type ResType

type ResType = uint8

type ResVector

type ResVector struct {
	Cpu    uint64
	Memory uint64
	Gpu    uint64
}

type SR

type SR struct {
	Priority uint64
	Gpunum   uint64
	// contains filtered or unexported fields
}

type ScheduleReslut

type ScheduleReslut []SR

func (ScheduleReslut) Len

func (sr ScheduleReslut) Len() int

func (ScheduleReslut) Less

func (sr ScheduleReslut) Less(i, j int) bool

func (ScheduleReslut) Swap

func (sr ScheduleReslut) Swap(i, j int)

type SelectorType

type SelectorType = uint8

type TaskDescriptor

type TaskDescriptor struct {
	Tid                TaskID
	Name               string
	State              TaskState
	ResRequest         ResVector
	Jd                 *JobDescriptor
	Priority           uint64
	IsGangSchedule     bool
	TaskUnscheduledNum int
	SubmitTime         int64
	StartTime          int64
	FinishTime         int64
}

func (*TaskDescriptor) GetJobID

func (td *TaskDescriptor) GetJobID() JobID

func (*TaskDescriptor) GetTaskID

func (td *TaskDescriptor) GetTaskID() TaskID

type TaskDetail

type TaskDetail struct {
	Time int64
	// contains filtered or unexported fields
}

type TaskID

type TaskID = uint64

type TaskState

type TaskState = uint8

type TaskType

type TaskType = uint8

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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