From adf2f116c69c3bee8a95f2e4ec6dc04a947ee589 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Thu, 29 Feb 2024 08:53:07 -0600 Subject: [PATCH] Tidy up htex worker pool start time recording (#3112) 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. --- parsl/executors/high_throughput/process_worker_pool.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parsl/executors/high_throughput/process_worker_pool.py b/parsl/executors/high_throughput/process_worker_pool.py index 21abb04d33..3e054ff26f 100755 --- a/parsl/executors/high_throughput/process_worker_pool.py +++ b/parsl/executors/high_throughput/process_worker_pool.py @@ -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) @@ -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() @@ -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