Skip to content

Commit

Permalink
Tidy up htex worker pool start time recording (#3112)
Browse files Browse the repository at this point in the history
The start time is needed as part of upcoming work on walltime-based worker
draining (so this PR makes it into an instance attribute)...

... and it can be made more accurate than the previous implementation by
measuring it earlier (most especially, prior to invoking the often expensive
probe_addresses call)

This PR rephrases a nearby log line which uses the word "starting" despite
being not in the start() procedure of the manager, to reduce ambiguity when
reading the code vs logs.
  • Loading branch information
benclifford authored Feb 29, 2024
1 parent 2b3022a commit adf2f11
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions parsl/executors/high_throughput/process_worker_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ def __init__(self, *,
Path to the certificate directory.
"""

logger.info("Manager started")
logger.info("Manager initializing")

self._start_time = time.time()

try:
ix_address = probe_addresses(addresses.split(','), task_port, timeout=address_probe_timeout)
Expand Down Expand Up @@ -454,7 +456,6 @@ def start(self):
TODO: Move task receiving to a thread
"""
start = time.time()
self._kill_event = threading.Event()
self._tasks_in_progress = self._mp_manager.dict()

Expand Down Expand Up @@ -504,7 +505,7 @@ def start(self):
self.task_incoming.close()
self.result_outgoing.close()
self.zmq_context.term()
delta = time.time() - start
delta = time.time() - self._start_time
logger.info("process_worker_pool ran for {} seconds".format(delta))
return

Expand Down

0 comments on commit adf2f11

Please sign in to comment.