mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
update
This commit is contained in:
parent
00b2858180
commit
9609c500dc
@ -91,3 +91,9 @@ type MsgJobReq struct {
|
|||||||
MemGPU int `json:"gpu_mem"`
|
MemGPU int `json:"gpu_mem"`
|
||||||
BW int `json:"bw"`
|
BW int `json:"bw"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MsgJobReqPredict struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
Labels map[string]float64 `json:"labels"`
|
||||||
|
}
|
||||||
|
@ -467,9 +467,10 @@ func (optimizer *Optimizer) PredictReq(job Job, role string) MsgJobReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := MsgJobReq{CPU: 4, Mem: 4096, UtilGPU: 100, MemGPU: 8192, BW: 0}
|
req := MsgJobReq{CPU: 4, Mem: 4096, UtilGPU: 100, MemGPU: 8192, BW: 0}
|
||||||
var tmp map[string]float64
|
var msg MsgJobReqPredict
|
||||||
err = json.Unmarshal([]byte(string(body)), &tmp)
|
err = json.Unmarshal([]byte(string(body)), &msg)
|
||||||
if err == nil {
|
if err == nil && msg.Code == 0 {
|
||||||
|
tmp := msg.Labels
|
||||||
if v, ok := tmp["cpu"]; ok {
|
if v, ok := tmp["cpu"]; ok {
|
||||||
req.CPU = int(math.Ceil(v / 100))
|
req.CPU = int(math.Ceil(v / 100))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user