This repository was archived by the owner on May 25, 2023. It is now read-only.
File tree 2 files changed +6
-16
lines changed
2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -175,13 +175,14 @@ func (alloc *allocateAction) Execute(ssn *framework.Session) {
175
175
}
176
176
}
177
177
178
- if assigned {
179
- jobs .Push (job )
180
- // Handle one assigned task in each loop.
178
+ if ! assigned {
181
179
break
182
180
}
183
181
184
- // If current task is not assgined, try to fit all rest tasks.
182
+ if ssn .JobReady (job ) {
183
+ jobs .Push (job )
184
+ break
185
+ }
185
186
}
186
187
187
188
// Added Queue back until no job in Queue.
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ func (gp *gangPlugin) OnSessionOpen(ssn *framework.Session) {
107
107
for _ , preemptee := range preemptees {
108
108
job := ssn .Jobs [preemptee .Job ]
109
109
occupid := readyTaskNum (job )
110
- preemptable := job .MinAvailable <= occupid - 1
110
+ preemptable := job .MinAvailable <= occupid - 1 || job . MinAvailable == 1
111
111
112
112
if ! preemptable {
113
113
glog .V (3 ).Infof ("Can not preempt task <%v/%v> because of gang-scheduling" ,
@@ -148,17 +148,6 @@ func (gp *gangPlugin) OnSessionOpen(ssn *framework.Session) {
148
148
return - 1
149
149
}
150
150
151
- if ! lReady && ! rReady {
152
- if lv .CreationTimestamp .Equal (& rv .CreationTimestamp ) {
153
- if lv .UID < rv .UID {
154
- return - 1
155
- }
156
- } else if lv .CreationTimestamp .Before (& rv .CreationTimestamp ) {
157
- return - 1
158
- }
159
- return 1
160
- }
161
-
162
151
return 0
163
152
}
164
153
You can’t perform that action at this time.
0 commit comments