From f4b47a6c8bfa65d0aba9bd2d6f500ddd6dbaae3a Mon Sep 17 00:00:00 2001 From: Yadu Babuji Date: Mon, 31 Jul 2023 11:18:13 -0500 Subject: [PATCH] Adding typing info for HTEX.outstanding, HTEX.connected_workers and HTEX.connected_managers --- parsl/executors/high_throughput/executor.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/parsl/executors/high_throughput/executor.py b/parsl/executors/high_throughput/executor.py index b5689abf5a..5bc2ea6655 100644 --- a/parsl/executors/high_throughput/executor.py +++ b/parsl/executors/high_throughput/executor.py @@ -1,3 +1,4 @@ +import typing from concurrent.futures import Future import typeguard import logging @@ -523,16 +524,23 @@ def hold_worker(self, worker_id: str) -> None: logger.debug("Sent hold request to manager: {}".format(worker_id)) @property - def outstanding(self): + def outstanding(self) -> int: + """Returns the count of tasks outstanding across the interchange + and managers""" outstanding_c = self.command_client.run("OUTSTANDING_C") return outstanding_c @property - def connected_workers(self): + def connected_workers(self) -> int: + """Returns the count of workers across all connected managers""" workers = self.command_client.run("WORKERS") return workers - def connected_managers(self): + def connected_managers(self) -> List[Dict[str, typing.Any]]: + """Returns a list of dicts one for each connected managers. + The dict contains info on manager(str:manager_id), block_id, + worker_count, tasks(int), idle_durations(float), active(bool) + """ managers = self.command_client.run("MANAGERS") return managers