Skip to content

Commit

Permalink
perform launch_if_ready asynchronously, at start of a new stack
Browse files Browse the repository at this point in the history
... rather than recursively deep in a dependency processing chain

probably some change in performance?

launch_if_ready was already intended to be launched multiple times
from multiple threads. this PR might make the invocation to
launch_if_ready happen a bit later, but correctness-wise that should
be fine: a task can only become *more* ready to run, not less *ready*.
  • Loading branch information
benclifford committed Jun 7, 2024
1 parent 862c6c3 commit 3764b93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,13 @@ def check_staging_inhibited(kwargs: Dict[str, Any]) -> bool:
return kwargs.get('_parsl_staging_inhibit', False)

def launch_if_ready(self, task_record: TaskRecord) -> None:
"""schedules a task record for re-inspection to see if it is ready
for launch. The call will return immediately, asynchronous to
whether than check and launch has happened or not.
"""
self.dependency_launch_pool.submit(self._launch_if_ready_async, task_record)

def _launch_if_ready_async(self, task_record: TaskRecord) -> None:
"""
launch_if_ready will launch the specified task, if it is ready
to run (for example, without dependencies, and in pending state).
Expand Down

0 comments on commit 3764b93

Please sign in to comment.