mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 08:16:43 +00:00
add group manager
This commit is contained in:
19
src/util.go
19
src/util.go
@@ -43,7 +43,7 @@ type MsgResource struct {
|
||||
type MsgJobList struct {
|
||||
Code int `json:"code"`
|
||||
Error string `json:"error"`
|
||||
Jobs []Job `json:"jobs"`
|
||||
Jobs []Job `json:"jobs"`
|
||||
}
|
||||
|
||||
type MsgLog struct {
|
||||
@@ -136,6 +136,23 @@ type Task struct {
|
||||
MemoryGPU int `json:"gpu_memory"`
|
||||
}
|
||||
|
||||
type Group struct {
|
||||
Name string `json:"name"`
|
||||
Weight int `json:"weight"`
|
||||
NumGPU int `json:"gpu_number"`
|
||||
}
|
||||
|
||||
type MsgGroupCreate struct {
|
||||
Code int `json:"code"`
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
type MsgGroupList struct {
|
||||
Code int `json:"code"`
|
||||
Error string `json:"error"`
|
||||
Groups []Group `json:"groups"`
|
||||
}
|
||||
|
||||
func str2int(str string, defaultValue int) int {
|
||||
i, err := strconv.Atoi(str)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user