From ce7e8f6282b1a87b56e1fd6b9d55d5a6d5f5f921 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Mon, 31 Jul 2023 15:29:07 +0200 Subject: [PATCH 1/2] Reduce monitoring filesystem radio log volume (#2846) This PR moves most log messages in the filesystem radio to debug level, and sets the log level for the monitoring to INFO level. This gives one log message per monitoring message, without per-poll logging. This is more in line with log level styles in Parsl, logging at INFO when something happens. Output of DEBUG logs is not user-configurable, but I left those log lines there for debug hacking. Fixes #2845 --- parsl/monitoring/monitoring.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parsl/monitoring/monitoring.py b/parsl/monitoring/monitoring.py index fc937f1720..8a238d2b4e 100644 --- a/parsl/monitoring/monitoring.py +++ b/parsl/monitoring/monitoring.py @@ -314,7 +314,7 @@ def monitor_wrapper(f: Any, def filesystem_receiver(logdir: str, q: "queue.Queue[AddressedMonitoringMessage]", run_dir: str) -> None: logger = start_file_logger("{}/monitoring_filesystem_radio.log".format(logdir), name="monitoring_filesystem_radio", - level=logging.DEBUG) + level=logging.INFO) logger.info("Starting filesystem radio receiver") setproctitle("parsl: monitoring filesystem receiver") @@ -327,7 +327,7 @@ def filesystem_receiver(logdir: str, q: "queue.Queue[AddressedMonitoringMessage] os.makedirs(new_dir, exist_ok=True) while True: # this loop will end on process termination - logger.info("Start filesystem radio receiver loop") + logger.debug("Start filesystem radio receiver loop") # iterate over files in new_dir for filename in os.listdir(new_dir): @@ -336,7 +336,7 @@ def filesystem_receiver(logdir: str, q: "queue.Queue[AddressedMonitoringMessage] full_path_filename = f"{new_dir}/{filename}" with open(full_path_filename, "rb") as f: message = deserialize(f.read()) - logger.info(f"Message received is: {message}") + logger.debug(f"Message received is: {message}") assert isinstance(message, tuple) q.put(cast(AddressedMonitoringMessage, message)) os.remove(full_path_filename) From 4b8b0b88e2af79ae0e5ada65eeae4940767a8028 Mon Sep 17 00:00:00 2001 From: Yadu Nand Babuji Date: Mon, 31 Jul 2023 12:16:29 -0500 Subject: [PATCH 2/2] Adding typing info for HTEX (#2847) This PR only adds some typing info for these methods/properties on the HighThroughputExecutor: HTEX.outstanding HTEX.connected_workers HTEX.connected_managers --- parsl/executors/high_throughput/executor.py | 25 ++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/parsl/executors/high_throughput/executor.py b/parsl/executors/high_throughput/executor.py index b5689abf5a..cc499ef1c3 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,18 +524,22 @@ def hold_worker(self, worker_id: str) -> None: logger.debug("Sent hold request to manager: {}".format(worker_id)) @property - def outstanding(self): - outstanding_c = self.command_client.run("OUTSTANDING_C") - return outstanding_c + def outstanding(self) -> int: + """Returns the count of tasks outstanding across the interchange + and managers""" + return self.command_client.run("OUTSTANDING_C") @property - def connected_workers(self): - workers = self.command_client.run("WORKERS") - return workers - - def connected_managers(self): - managers = self.command_client.run("MANAGERS") - return managers + def connected_workers(self) -> int: + """Returns the count of workers across all connected managers""" + return self.command_client.run("WORKERS") + + 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) + """ + return self.command_client.run("MANAGERS") def _hold_block(self, block_id): """ Sends hold command to all managers which are in a specific block