Skip to content

Commit

Permalink
Update run_experiment: reduce zoombie workers
Browse files Browse the repository at this point in the history
  • Loading branch information
zuoxingdong committed Aug 5, 2019
1 parent 5fb4f14 commit 2c280e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lagom/experiment/run_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _run(job):
if max_workers is None:
results = [_run(job) for job in jobs]
else:
with ProcessPoolExecutor(max_workers=max_workers) as executor:
with ProcessPoolExecutor(max_workers=min(max_workers, len(jobs))) as executor:
results = list(executor.map(CloudpickleWrapper(_run), jobs, chunksize=chunksize))
print(color_str(f'\nExperiment finished. Loggings are stored in {log_path.absolute()}. ', 'cyan', 'bold'))
return results

0 comments on commit 2c280e2

Please sign in to comment.