fix(api): exclude finished jobs when load balancing
This commit is contained in:
parent
de6e3b4e27
commit
ed2e15a67e
|
@ -139,7 +139,7 @@ class DevicePoolExecutor:
|
||||||
if len(self.jobs) == 0:
|
if len(self.jobs) == 0:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
job_devices = [job.context.device_index.value for job in self.jobs]
|
job_devices = [job.context.device_index.value for job in self.jobs if not job.future.done()]
|
||||||
job_counts = Counter(range(len(self.devices)))
|
job_counts = Counter(range(len(self.devices)))
|
||||||
job_counts.update(job_devices)
|
job_counts.update(job_devices)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue