@@ -35,11 +35,13 @@ public class LocalHostAssignment extends Entity
35
35
36
36
private int idleCoreUnits ;
37
37
private long idleMemory ;
38
- private long idleGpu ;
38
+ private int idleGpuUnits ;
39
+ private long idleGpuMemory ;
39
40
40
41
private long maxMemory ;
41
- private long maxGpu ;
42
+ private long maxGpuMemory ;
42
43
private int maxCoreUnits ;
44
+ private int maxGpuUnits ;
43
45
44
46
private int threads ;
45
47
@@ -52,34 +54,39 @@ public class LocalHostAssignment extends Entity
52
54
53
55
public LocalHostAssignment () { }
54
56
55
- public LocalHostAssignment (int maxCores , int threads , long maxMemory , long maxGpu ) {
57
+ public LocalHostAssignment (int maxCores , int threads , long maxMemory , int maxGpus , long maxGpuMemory ) {
56
58
this .maxCoreUnits = maxCores ;
57
59
this .threads = threads ;
58
60
this .maxMemory = maxMemory ;
59
- this .maxGpu = maxGpu ;
61
+ this .maxGpuUnits = maxGpus ;
62
+ this .maxGpuMemory = maxGpuMemory ;
60
63
}
61
64
62
65
@ Override
63
- public boolean hasAdditionalResources (int minCores , long minMemory , long minGpu ) {
66
+ public boolean hasAdditionalResources (int minCores , long minMemory , int minGpus , long minGpuMemory ) {
64
67
65
68
if (idleCoreUnits < minCores ) {
66
69
return false ;
67
70
}
68
71
else if (idleMemory < minMemory ) {
69
72
return false ;
70
73
}
71
- else if (idleGpu < minGpu ) {
74
+ else if (idleGpuUnits < minGpus ) {
75
+ return false ;
76
+ }
77
+ else if (idleGpuMemory < minGpuMemory ) {
72
78
return false ;
73
79
}
74
80
75
81
return true ;
76
82
}
77
83
78
84
@ Override
79
- public void useResources (int coreUnits , long memory , long gpu ) {
85
+ public void useResources (int coreUnits , long memory , int gpuUnits , long gpuMemory ) {
80
86
idleCoreUnits = idleCoreUnits - coreUnits ;
81
87
idleMemory = idleMemory - memory ;
82
- idleGpu = idleGpu - gpu ;
88
+ idleGpuUnits = idleGpuUnits - gpuUnits ;
89
+ idleGpuMemory = idleGpuMemory - gpuMemory ;
83
90
}
84
91
85
92
public int getThreads () {
@@ -110,16 +117,24 @@ public long getIdleMemory() {
110
117
return this .idleMemory ;
111
118
}
112
119
113
- public long getMaxGpu () {
114
- return maxGpu ;
120
+ public int getMaxGpuUnits () {
121
+ return maxGpuUnits ;
122
+ }
123
+
124
+ public void setMaxGpuUnits (int maxGpuUnits ) {
125
+ this .maxGpuUnits = maxGpuUnits ;
126
+ }
127
+
128
+ public long getMaxGpuMemory () {
129
+ return maxGpuMemory ;
115
130
}
116
131
117
- public void setMaxGpu (long maxGpu ) {
118
- this .maxGpu = maxGpu ;
132
+ public void setMaxGpuMemory (long maxGpuMemory ) {
133
+ this .maxGpuMemory = maxGpuMemory ;
119
134
}
120
135
121
- public long getIdleGpu () {
122
- return this .idleGpu ;
136
+ public long getIdleGpuMemory () {
137
+ return this .idleGpuMemory ;
123
138
}
124
139
125
140
public int getIdleCoreUnits () {
@@ -134,8 +149,16 @@ public void setIdleMemory(long idleMemory) {
134
149
this .idleMemory = idleMemory ;
135
150
}
136
151
137
- public void setIdleGpu (long idleGpu ) {
138
- this .idleGpu = idleGpu ;
152
+ public int getIdleGpuUnits () {
153
+ return this .idleGpuUnits ;
154
+ }
155
+
156
+ public void setIdleGpuUnits (int idleGpuUnits ) {
157
+ this .idleGpuUnits = idleGpuUnits ;
158
+ }
159
+
160
+ public void setIdleGpuMemory (long idleGpuMemory ) {
161
+ this .idleGpuMemory = idleGpuMemory ;
139
162
}
140
163
141
164
public String getHostId () {
0 commit comments