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
00b2858180
commit
9609c500dc
@ -91,3 +91,9 @@ type MsgJobReq struct {
|
||||
MemGPU int `json:"gpu_mem"`
|
||||
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}
|
||||
var tmp map[string]float64
|
||||
err = json.Unmarshal([]byte(string(body)), &tmp)
|
||||
if err == nil {
|
||||
var msg MsgJobReqPredict
|
||||
err = json.Unmarshal([]byte(string(body)), &msg)
|
||||
if err == nil && msg.Code == 0 {
|
||||
tmp := msg.Labels
|
||||
if v, ok := tmp["cpu"]; ok {
|
||||
req.CPU = int(math.Ceil(v / 100))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user