mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 22:31:55 +00:00
update
This commit is contained in:
parent
526a9d8b4c
commit
9dc1237bd2
@ -80,9 +80,12 @@ func (jm *JobManager) start() {
|
|||||||
go func(index int) {
|
go func(index int) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
var UUIDs []string
|
var UUIDs []string
|
||||||
|
shouldWait := "0"
|
||||||
for _, GPU := range jm.resources[index].Status {
|
for _, GPU := range jm.resources[index].Status {
|
||||||
UUIDs = append(UUIDs, GPU.UUID)
|
UUIDs = append(UUIDs, GPU.UUID)
|
||||||
|
if GPU.MemoryUsed == GPU.MemoryTotal {
|
||||||
|
shouldWait = "1"
|
||||||
|
}
|
||||||
/* attach to GPUs */
|
/* attach to GPUs */
|
||||||
InstanceOfResourcePool().attach(GPU.UUID, jm.job)
|
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("mem_limit", strconv.Itoa(jm.job.Tasks[index].Memory)+"m")
|
||||||
v.Set("cpu_limit", strconv.Itoa(jm.job.Tasks[index].NumberCPU))
|
v.Set("cpu_limit", strconv.Itoa(jm.job.Tasks[index].NumberCPU))
|
||||||
v.Set("network", jm.network)
|
v.Set("network", jm.network)
|
||||||
v.Set("should_wait", "0")
|
v.Set("should_wait", shouldWait)
|
||||||
v.Set("output_dir", "/tmp/")
|
v.Set("output_dir", "/tmp/")
|
||||||
v.Set("hdfs_address", "http://192.168.100.104:50070/")
|
v.Set("hdfs_address", "http://192.168.100.104:50070/")
|
||||||
v.Set("hdfs_dir", "/user/yao/output/"+jm.job.Name)
|
v.Set("hdfs_dir", "/user/yao/output/"+jm.job.Name)
|
||||||
|
@ -811,6 +811,8 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
|
|||||||
}
|
}
|
||||||
node.Status[j].MemoryAllocated += task.MemoryGPU
|
node.Status[j].MemoryAllocated += task.MemoryGPU
|
||||||
res.Status[i].MemoryTotal = 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
|
node.Status[j].MemoryAllocated += task.MemoryGPU
|
||||||
res.Status[i].MemoryTotal = task.MemoryGPU
|
res.Status[i].MemoryTotal = task.MemoryGPU
|
||||||
|
/* being fully used, means ahead */
|
||||||
|
res.Status[i].MemoryUsed = task.MemoryGPU
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user