Add numHWThreads/numAccelerators filter

This commit is contained in:
Lou Knauer 2022-01-27 12:32:28 +01:00
parent 9e92d6076f
commit eca7ad0de0
5 changed files with 50 additions and 18 deletions

@ -1 +1 @@
Subproject commit 80650220a3d481b6fc82c305791073ed92fc9261 Subproject commit c04f69f8fbcb7a25a8c2f4d0b962bff2e35a8478

View File

@ -1352,7 +1352,11 @@ input JobFilter {
cluster: StringInput cluster: StringInput
partition: StringInput partition: StringInput
duration: IntRange duration: IntRange
numNodes: IntRange
numNodes: IntRange
numAccelerators: IntRange
numHWThreads: IntRange
startTime: TimeRange startTime: TimeRange
state: [JobState!] state: [JobState!]
flopsAnyAvg: FloatRange flopsAnyAvg: FloatRange
@ -7071,6 +7075,22 @@ func (ec *executionContext) unmarshalInputJobFilter(ctx context.Context, obj int
if err != nil { if err != nil {
return it, err return it, err
} }
case "numAccelerators":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numAccelerators"))
it.NumAccelerators, err = ec.unmarshalOIntRange2ᚖgithubᚗcomᚋClusterCockpitᚋccᚑbackendᚋgraphᚋmodelᚐIntRange(ctx, v)
if err != nil {
return it, err
}
case "numHWThreads":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("numHWThreads"))
it.NumHWThreads, err = ec.unmarshalOIntRange2ᚖgithubᚗcomᚋClusterCockpitᚋccᚑbackendᚋgraphᚋmodelᚐIntRange(ctx, v)
if err != nil {
return it, err
}
case "startTime": case "startTime":
var err error var err error

View File

@ -44,21 +44,23 @@ type IntRangeOutput struct {
} }
type JobFilter struct { type JobFilter struct {
Tags []string `json:"tags"` Tags []string `json:"tags"`
JobID *StringInput `json:"jobId"` JobID *StringInput `json:"jobId"`
ArrayJobID *int `json:"arrayJobId"` ArrayJobID *int `json:"arrayJobId"`
User *StringInput `json:"user"` User *StringInput `json:"user"`
Project *StringInput `json:"project"` Project *StringInput `json:"project"`
Cluster *StringInput `json:"cluster"` Cluster *StringInput `json:"cluster"`
Partition *StringInput `json:"partition"` Partition *StringInput `json:"partition"`
Duration *IntRange `json:"duration"` Duration *IntRange `json:"duration"`
NumNodes *IntRange `json:"numNodes"` NumNodes *IntRange `json:"numNodes"`
StartTime *TimeRange `json:"startTime"` NumAccelerators *IntRange `json:"numAccelerators"`
State []schema.JobState `json:"state"` NumHWThreads *IntRange `json:"numHWThreads"`
FlopsAnyAvg *FloatRange `json:"flopsAnyAvg"` StartTime *TimeRange `json:"startTime"`
MemBwAvg *FloatRange `json:"memBwAvg"` State []schema.JobState `json:"state"`
LoadAvg *FloatRange `json:"loadAvg"` FlopsAnyAvg *FloatRange `json:"flopsAnyAvg"`
MemUsedMax *FloatRange `json:"memUsedMax"` MemBwAvg *FloatRange `json:"memBwAvg"`
LoadAvg *FloatRange `json:"loadAvg"`
MemUsedMax *FloatRange `json:"memUsedMax"`
} }
type JobMetricWithName struct { type JobMetricWithName struct {

View File

@ -156,6 +156,12 @@ func buildWhereClause(filter *model.JobFilter, query sq.SelectBuilder) sq.Select
if filter.NumNodes != nil { if filter.NumNodes != nil {
query = buildIntCondition("job.num_nodes", filter.NumNodes, query) query = buildIntCondition("job.num_nodes", filter.NumNodes, query)
} }
if filter.NumAccelerators != nil {
query = buildIntCondition("job.num_acc", filter.NumAccelerators, query)
}
if filter.NumHWThreads != nil {
query = buildIntCondition("job.num_hwthreads", filter.NumHWThreads, query)
}
if filter.FlopsAnyAvg != nil { if filter.FlopsAnyAvg != nil {
query = buildFloatCondition("job.flops_any_avg", filter.FlopsAnyAvg, query) query = buildFloatCondition("job.flops_any_avg", filter.FlopsAnyAvg, query)
} }

View File

@ -174,7 +174,11 @@ input JobFilter {
cluster: StringInput cluster: StringInput
partition: StringInput partition: StringInput
duration: IntRange duration: IntRange
numNodes: IntRange
numNodes: IntRange
numAccelerators: IntRange
numHWThreads: IntRange
startTime: TimeRange startTime: TimeRange
state: [JobState!] state: [JobState!]
flopsAnyAvg: FloatRange flopsAnyAvg: FloatRange