From 0a34651df3176dd7ad596ba2747dfda86c9d7c55 Mon Sep 17 00:00:00 2001 From: nishchaykarle Date: Tue, 14 Jan 2025 21:14:49 -0600 Subject: [PATCH] fix dfk logging to not print usage tracking messages when usage tracking is disabled --- parsl/dataflow/dflow.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/parsl/dataflow/dflow.py b/parsl/dataflow/dflow.py index 5e91268057..c2d45a6b83 100644 --- a/parsl/dataflow/dflow.py +++ b/parsl/dataflow/dflow.py @@ -47,6 +47,7 @@ from parsl.monitoring.message_type import MessageType from parsl.monitoring.remote import monitor_wrapper from parsl.process_loggers import wrap_with_logs +from parsl.usage_tracking.levels import DISABLED as USAGE_TRACKING_DISABLED from parsl.usage_tracking.usage import UsageTracker from parsl.utils import Timer, get_all_checkpoints, get_std_fname_mode, get_version @@ -1200,10 +1201,11 @@ def cleanup(self) -> None: self._checkpoint_timer.close() # Send final stats - logger.info("Sending end message for usage tracking") - self.usage_tracker.send_end_message() - self.usage_tracker.close() - logger.info("Closed usage tracking") + if self.usage_tracker.tracking_level != USAGE_TRACKING_DISABLED: + logger.info("Sending end message for usage tracking") + self.usage_tracker.send_end_message() + self.usage_tracker.close() + logger.info("Closed usage tracking") logger.info("Closing job status poller") self.job_status_poller.close()