Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make htex scale_in pick longest idle blocks #3135

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion parsl/executors/high_throughput/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,12 @@ class BlockInfo:
block_info[b_id].tasks += manager['tasks']
block_info[b_id].idle = min(block_info[b_id].idle, manager['idle_duration'])

sorted_blocks = sorted(block_info.items(), key=lambda item: (item[1].idle, item[1].tasks))
# The scaling policy is that longest idle blocks should be scaled down
# in preference to least idle (most recently used) blocks.
# Other policies could be implemented here.

sorted_blocks = sorted(block_info.items(), key=lambda item: (-item[1].idle, item[1].tasks))

logger.debug(f"Scale in selecting from {len(sorted_blocks)} blocks")
if max_idletime is None:
block_ids_to_kill = [x[0] for x in sorted_blocks[:blocks]]
Expand Down
Loading