Skip to content

Commit

Permalink
Add type annotation and error log to _filter_scale_in_ids (#3549)
Browse files Browse the repository at this point in the history
Especially this log message is intended to help user understanding when
Parsl is not scaling in as they expected - before this PR, any blocks
marked as not-scaled-in were not reported to the user (perhaps on the
assumption that it might work next time round?)
  • Loading branch information
benclifford authored Jul 31, 2024
1 parent 2981a28 commit 9c982c5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion parsl/executors/status_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,18 @@ def tasks(self) -> Dict[object, Future]:
def provider(self):
return self._provider

def _filter_scale_in_ids(self, to_kill, killed):
def _filter_scale_in_ids(self, to_kill: Sequence[Any], killed: Sequence[bool]) -> Sequence[Any]:
""" Filter out job id's that were not killed
"""
assert len(to_kill) == len(killed)

if False in killed:
killed_job_ids = [jid for jid, k in zip(to_kill, killed) if k]
not_killed_job_ids = [jid for jid, k in zip(to_kill, killed) if not k]
logger.warning("Some jobs were not killed successfully: "
f"killed jobs: {killed_job_ids}, "
f"not-killed jobs: {not_killed_job_ids}")

# Filters first iterable by bool values in second
return list(compress(to_kill, killed))

Expand Down

0 comments on commit 9c982c5

Please sign in to comment.