1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-07 14:21:55 +00:00
This commit is contained in:
Newnius 2020-06-30 23:18:23 +08:00
parent 526a9d8b4c
commit 9dc1237bd2
2 changed files with 9 additions and 2 deletions

View File

@ -80,9 +80,12 @@ func (jm *JobManager) start() {
go func(index int) {
defer wg.Done()
var UUIDs []string
shouldWait := "0"
for _, GPU := range jm.resources[index].Status {
UUIDs = append(UUIDs, GPU.UUID)
if GPU.MemoryUsed == GPU.MemoryTotal {
shouldWait = "1"
}
/* attach to GPUs */
InstanceOfResourcePool().attach(GPU.UUID, jm.job)
}
@ -97,7 +100,7 @@ func (jm *JobManager) start() {
v.Set("mem_limit", strconv.Itoa(jm.job.Tasks[index].Memory)+"m")
v.Set("cpu_limit", strconv.Itoa(jm.job.Tasks[index].NumberCPU))
v.Set("network", jm.network)
v.Set("should_wait", "0")
v.Set("should_wait", shouldWait)
v.Set("output_dir", "/tmp/")
v.Set("hdfs_address", "http://192.168.100.104:50070/")
v.Set("hdfs_dir", "/user/yao/output/"+jm.job.Name)

View File

@ -811,6 +811,8 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
}
node.Status[j].MemoryAllocated += task.MemoryGPU
res.Status[i].MemoryTotal = task.MemoryGPU
/* being used, means share */
res.Status[i].MemoryUsed = 100
}
}
}
@ -922,6 +924,8 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
}
node.Status[j].MemoryAllocated += task.MemoryGPU
res.Status[i].MemoryTotal = task.MemoryGPU
/* being fully used, means ahead */
res.Status[i].MemoryUsed = task.MemoryGPU
}
}
}