Skip to content

Commit

Permalink
Gather four block/job status structures together (#3528)
Browse files Browse the repository at this point in the history
This is part of work to make it easier to understand the four structures
and how they relate to each other.

This should not change any behaviour.
  • Loading branch information
benclifford authored Jul 18, 2024
1 parent 2c19a8f commit 13ae8e5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions parsl/executors/status_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,28 @@ def __init__(self, *,
else:
self.block_error_handler = block_error_handler

# errors can happen during the submit call to the provider; this is used
# to keep track of such errors so that they can be handled in one place
# together with errors reported by status()
self._simulated_status: Dict[str, JobStatus] = {}
self._executor_bad_state = threading.Event()
self._executor_exception: Optional[Exception] = None

self._block_id_counter = AtomicIDCounter()

self._tasks = {} # type: Dict[object, Future]

self._last_poll_time = 0.0

# these four structures track, in loosely coordinated fashion, the
# existence of blocks and jobs and how to map between their
# identifiers.
self.blocks_to_job_id = {} # type: Dict[str, str]
self.job_ids_to_block = {} # type: Dict[str, str]

self._last_poll_time = 0.0
# errors can happen during the submit call to the provider; this is used
# to keep track of such errors so that they can be handled in one place
# together with errors reported by status()
self._simulated_status: Dict[str, JobStatus] = {}

# this stores an approximation (sometimes delayed) of the latest status
# of pending, active and recently terminated blocks
self._status = {} # type: Dict[str, JobStatus]

def _make_status_dict(self, block_ids: List[str], status_list: List[JobStatus]) -> Dict[str, JobStatus]:
Expand Down

0 comments on commit 13ae8e5

Please sign in to comment.