Documentation ¶
Index ¶
- Constants
- func Compare(i, j TaskDetail) bool
- func GetTaskNumberWithGPULimit(jd *JobDescriptor, num uint64) uint64
- func LabelsTest()
- func Test() string
- func TestGraphMain()
- type ArcDescriptor
- type ArcType
- type CostModel
- type Details
- type Dispatcher
- func (dp *Dispatcher) CheckScheduleResult(temTaskMapping map[NodeID]NodeID) map[NodeID]NodeID
- func (dp *Dispatcher) ExportGraphWithoutRunningTasks() string
- func (dp *Dispatcher) GPULimitSlover() (string, map[NodeID]NodeID)
- func (dp *Dispatcher) GetMappings(flow map[NodeID](map[NodeID]uint64)) (map[NodeID]NodeID, map[NodeID]NodeID)
- func (dp *Dispatcher) ParseOutput(output string) map[NodeID](map[NodeID]uint64)
- func (dp *Dispatcher) PengChengSlover() (string, map[NodeID]NodeID, map[NodeID]NodeID)
- func (dp *Dispatcher) RunGpuSlover() (string, map[NodeID]NodeID)
- func (dp *Dispatcher) RunPCSlover() (string, map[NodeID]NodeID, map[TaskID]ResID)
- func (dp *Dispatcher) RunSolver() (string, map[NodeID]NodeID, map[TaskID]ResID)
- type FCFSModel
- func (fm *FCFSModel) LeafRescourceToSink(rd *ResDescriptor) *ArcDescriptor
- func (fm *FCFSModel) SetLimit(t uint64)
- func (fm *FCFSModel) TaskContinuation(td *TaskDescriptor) *ArcDescriptor
- func (fm *FCFSModel) TaskNodeToResource(td *TaskDescriptor, rd *ResDescriptor) *ArcDescriptor
- func (fm *FCFSModel) TaskPreferdResource(td *TaskDescriptor) []*ResDescriptor
- func (fm *FCFSModel) TaskToResCost(td *TaskDescriptor, rd *ResDescriptor) uint64
- func (fm *FCFSModel) TaskToUnscheduledAgg(td *TaskDescriptor) *ArcDescriptor
- func (fm *FCFSModel) UnschedAggToSink(jd *JobDescriptor) *ArcDescriptor
- func (fm *FCFSModel) UpdateResNode(rd *ResDescriptor)
- func (fm *FCFSModel) UpdateTaskNode(td *TaskDescriptor)
- type FlowScheduler
- func (fs *FlowScheduler) AddJob(jd *JobDescriptor)
- func (fs *FlowScheduler) AddJobs(jds []*JobDescriptor)
- func (fs *FlowScheduler) AddResource(rd *ResDescriptor)
- func (fs *FlowScheduler) ChangeJobDes(jd *JobDescriptor) bool
- func (fs *FlowScheduler) CheckJobCompleted(jd *JobDescriptor)
- func (fs *FlowScheduler) ExportGraph() string
- func (fs *FlowScheduler) GetResInfo() map[string]uint64
- func (fs *FlowScheduler) GetTaskInfo() map[string]string
- func (fs *FlowScheduler) HandleJobCompleted(jd *JobDescriptor)
- func (fs *FlowScheduler) HandleTaskCompeleted(td *TaskDescriptor)
- func (fs *FlowScheduler) HandleTaskCompeletedByID(tid TaskID)
- func (fs *FlowScheduler) HandleTaskFailed(td *TaskDescriptor)
- func (fs *FlowScheduler) HandleTaskFailedByID(tid TaskID)
- func (fs *FlowScheduler) HandleTaskKilled(tid TaskID)
- func (fs *FlowScheduler) HandleTaskPlacement(tid TaskID, rid ResID)
- func (fs *FlowScheduler) HaveEnoughResource(td *TaskDescriptor, rd *ResDescriptor) bool
- func (fs *FlowScheduler) ReplaceKilledTask()
- func (fs *FlowScheduler) ResIDToResDes(rid ResID) *ResDescriptor
- func (fs *FlowScheduler) RunScheduleIteration() (map[TaskID]ResID, map[TaskID]ResID)
- func (fs *FlowScheduler) ScheduleAllJobs() (map[TaskID]ResID, map[TaskID]ResID)
- func (fs *FlowScheduler) ScheduleAllJobsToPoseidon() (map[TaskID]ResID, map[TaskID]ResID)
- func (fs *FlowScheduler) ScheduleJobs(jobs []*JobDescriptor) (map[TaskID]ResID, map[TaskID]ResID)
- func (fs *FlowScheduler) TaskIDToJobDes(tid TaskID) *JobDescriptor
- func (fs *FlowScheduler) TaskIDToTaskDes(tid TaskID) *TaskDescriptor
- func (fs *FlowScheduler) Transform(taskMappings map[TaskID]ResID) []SR
- func (fs *FlowScheduler) UsedJobID(jid uint64) bool
- func (fs *FlowScheduler) UsedResID(rid uint64) bool
- type GPUCostModel
- func (gcs *GPUCostModel) LeafRescourceToSink(rd *ResDescriptor) *ArcDescriptor
- func (gcs *GPUCostModel) SetGpuNum(num uint64)
- func (gcs *GPUCostModel) TaskContinuation(td *TaskDescriptor) *ArcDescriptor
- func (gcs *GPUCostModel) TaskNodeToResource(td *TaskDescriptor, rd *ResDescriptor) *ArcDescriptor
- func (gcs *GPUCostModel) TaskPreferdResource(td *TaskDescriptor) []*ResDescriptor
- func (gcs *GPUCostModel) TaskToResCost(td *TaskDescriptor, rd *ResDescriptor) uint64
- func (gcs *GPUCostModel) TaskToUnscheduledAgg(td *TaskDescriptor) *ArcDescriptor
- func (gcs *GPUCostModel) UnschedAggToSink(jd *JobDescriptor) *ArcDescriptor
- func (gcs *GPUCostModel) UpdateResNode(rd *ResDescriptor)
- func (gcs *GPUCostModel) UpdateTaskNode(td *TaskDescriptor)
- type GpuNums
- type Graph
- func (g *Graph) AddArc(src_, dst_ *GraphNode, lower, upper uint64, cost_ uint64, comment_ string) *GraphArc
- func (g *Graph) AddNode(excess int64, ntype NodeType, comment string) *GraphNode
- func (g *Graph) ChangeArc(arc *GraphArc, lower, upper uint64, cost uint64)
- func (g *Graph) ExportGraph() string
- func (g *Graph) GetArc(src, dst *GraphNode) *GraphArc
- func (g *Graph) GetNextID() NodeID
- func (g *Graph) GetNode(nid NodeID) *GraphNode
- func (g *Graph) GetNodeByID(nid NodeID) *GraphNode
- func (g *Graph) Init()
- func (g *Graph) RemoveArc(arc *GraphArc)
- func (g *Graph) RemoveNode(node *GraphNode)
- type GraphArc
- type GraphChangeManager
- func (gcm *GraphChangeManager) AddArc(src, dst *GraphNode, lower, upper uint64, cost uint64, comment string) *GraphArc
- func (gcm *GraphChangeManager) AddNode(excess int64, ntype uint8, comment string) *GraphNode
- func (gcm *GraphChangeManager) ChangeArc(arc *GraphArc, lower, upper, cost uint64, comment string)
- func (gcm *GraphChangeManager) GetArc(src, dst *GraphNode) *GraphArc
- func (gcm *GraphChangeManager) GetNode(nid NodeID) *GraphNode
- func (gcm *GraphChangeManager) Init()
- func (gcm *GraphChangeManager) RemoveArc(arc *GraphArc)
- func (gcm *GraphChangeManager) RemoveNode(node *GraphNode)
- type GraphManager
- func (gm *GraphManager) AddAllTask(jd *JobDescriptor, newNode map[*GraphNode]bool)
- func (gm *GraphManager) AddOrUpdateAllResNodes(rds []*ResDescriptor) map[*GraphNode]bool
- func (gm *GraphManager) AddOrUpdateJobNodes(jobs []*JobDescriptor) map[*GraphNode]bool
- func (gm *GraphManager) AddRescourceNode(rd *ResDescriptor) *GraphNode
- func (gm *GraphManager) AddTaskNode(td *TaskDescriptor) *GraphNode
- func (gm *GraphManager) AddUnscehduleAggNode(jd *JobDescriptor) *GraphNode
- func (gm *GraphManager) ExportGraph() string
- func (gm *GraphManager) ExportGraphWithoutRunningTasks() string
- func (gm *GraphManager) GetArc(src, dst *GraphNode) *GraphArc
- func (gm *GraphManager) GetNode(nid NodeID) *GraphNode
- func (gm *GraphManager) GetResInfo() map[string]uint64
- func (gm *GraphManager) GetTaskInfo() map[string]string
- func (gm *GraphManager) GetUnExportNodes() map[NodeID]bool
- func (gm *GraphManager) HandleTaskKilled(tid TaskID)
- func (gm *GraphManager) Init()
- func (gm *GraphManager) JobCompleted(jd *JobDescriptor)
- func (gm *GraphManager) JobIDToUnscheNode(jid JobID) *GraphNode
- func (gm *GraphManager) PinTaskToResNode(tnode, rnode *GraphNode)
- func (gm *GraphManager) RemoveRescourceNode(rd *ResDescriptor)
- func (gm *GraphManager) RemoveTaskHelper(tnode *GraphNode)
- func (gm *GraphManager) RemoveTaskNode(td *TaskDescriptor) NodeID
- func (gm *GraphManager) RemoveUnscehduleAggNode(jd *JobDescriptor) *GraphNode
- func (gm *GraphManager) ResIDToNode(rid ResID) *GraphNode
- func (gm *GraphManager) SetCostModel(cs CostModel)
- func (gm *GraphManager) TaskCompleted(tnode *GraphNode)
- func (gm *GraphManager) TaskFailed(tnode *GraphNode)
- func (gm *GraphManager) TaskIDToNode(tid TaskID) *GraphNode
- func (gm *GraphManager) TaskScheduled(tnode, rnode *GraphNode)
- func (gm *GraphManager) UpdateArcsForScheduledTask(tnode, rnode *GraphNode)
- func (gm *GraphManager) UpdateFlowGraph()
- func (gm *GraphManager) UpdateResourceNode(rnode *GraphNode)
- func (gm *GraphManager) UpdateRunningTask(node *GraphNode)
- func (gm *GraphManager) UpdateTaskNode(node *GraphNode)
- func (gm *GraphManager) UpdateTaskToResourceArcs(tnode *GraphNode)
- func (gm *GraphManager) UpdateUnscheduledNode(node *GraphNode, cap_delta int64)
- type GraphNode
- type JIS
- type JobDescriptor
- type JobID
- type JobInfo
- type JobState
- type Label
- type LabelSelector
- func (ls *LabelSelector) SatisfiesLabels(labels []Label) bool
- func (ls *LabelSelector) SatisfiesLabelsExistsKey(labelsMap map[string]string) bool
- func (ls *LabelSelector) SatisfiesLabelsInSet(labelsMap map[string]string) bool
- func (ls *LabelSelector) SatisfiesLabelsNotExistsKey(labelsMap map[string]string) bool
- func (ls *LabelSelector) SatisfiesLabelsNotInSet(labelsMap map[string]string) bool
- func (ls *LabelSelector) SatisfiesLabelsUseMap(labelsMap map[string]string) bool
- func (ls *LabelSelector) SetLabelSelector(key string, values []string, lstype SelectorType)
- type NodeID
- type NodeType
- type PengChengCostModel
- func (pccm *PengChengCostModel) GetTaskKilled(temTaskMapping map[NodeID]NodeID) map[TaskID]ResID
- func (pccm *PengChengCostModel) LeafRescourceToSink(rd *ResDescriptor) *ArcDescriptor
- func (pccm *PengChengCostModel) SetGpunum(gpunum uint64)
- func (pccm *PengChengCostModel) SetMaxScheduleNum(msn uint64)
- func (pccm *PengChengCostModel) SetPriority(p uint64)
- func (pccm *PengChengCostModel) SetTinfo(detail TaskDetail)
- func (pccm *PengChengCostModel) SetminRandLim(mrl uint64)
- func (pccm *PengChengCostModel) TaskContinuation(td *TaskDescriptor) *ArcDescriptor
- func (pccm *PengChengCostModel) TaskNodeToResource(td *TaskDescriptor, rd *ResDescriptor) *ArcDescriptor
- func (pccm *PengChengCostModel) TaskPreferdResource(td *TaskDescriptor) []*ResDescriptor
- func (pccm *PengChengCostModel) TaskToResCost(td *TaskDescriptor, rd *ResDescriptor) uint64
- func (pccm *PengChengCostModel) TaskToUnscheduledAgg(td *TaskDescriptor) *ArcDescriptor
- func (pccm *PengChengCostModel) UnschedAggToSink(jd *JobDescriptor) *ArcDescriptor
- func (pccm *PengChengCostModel) UpdateResNode(rd *ResDescriptor)
- func (pccm *PengChengCostModel) UpdateTaskNode(td *TaskDescriptor)
- type ResDescriptor
- type ResID
- type ResType
- type ResVector
- type SR
- type ScheduleReslut
- type SelectorType
- type TaskDescriptor
- type TaskDetail
- type TaskID
- type TaskState
- type TaskType
Constants ¶
const ( PRIORITYCOST = uint64(1 << 12) GPUNEEDCOST = uint64(1 << 6) PREEMPTCOST = uint64(1 << 18) NOTAVICOST = uint64(1 << 24) NOTSCHECOST = uint64(1 << 24) )
const ( ARC_RUNNING = 1 ARC_OTHER = 2 )
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 )
const ( JOB_CREATED = 1 // is equal to Job_unscheduled JOB_RUNNING = 2 JOB_COMPLETED = 3 JOB_FAILED = 4 )
const ( IN_SET = 0 NOT_IN_SET = 1 EXISTS_KEY = 2 NOT_EXISTS_KEY = 3 )
const ( RES_PU = 1 RES_CORE = 2 RES_OTHER = 3 )
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 TestGraphMain ¶
func TestGraphMain()
Types ¶
type ArcDescriptor ¶
type ArcDescriptor struct {
// contains filtered or unexported fields
}
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
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 (*Dispatcher) ParseOutput ¶
func (dp *Dispatcher) ParseOutput(output string) map[NodeID](map[NodeID]uint64)
func (*Dispatcher) PengChengSlover ¶
func (*Dispatcher) RunGpuSlover ¶
func (dp *Dispatcher) RunGpuSlover() (string, map[NodeID]NodeID)
func (*Dispatcher) RunPCSlover ¶
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) 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 Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func (*Graph) ExportGraph ¶
func (*Graph) GetNodeByID ¶
func (*Graph) RemoveNode ¶
type GraphChangeManager ¶
type GraphChangeManager struct {
// contains filtered or unexported fields
}
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) 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) IsResourceNode ¶
func (*GraphNode) IsTaskNode ¶
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 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 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 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 }