diff --git a/src/python/TaskWorker/Main.py b/src/python/TaskWorker/Main.py index 8a7239c73d..9ab4f3b321 100644 --- a/src/python/TaskWorker/Main.py +++ b/src/python/TaskWorker/Main.py @@ -73,7 +73,7 @@ def main(): configuration = loadConfigurationFile(os.path.abspath(options.config)) configuration.section_('Adhoc') configuration.Adhoc.selection_limit = 10 - configuration.Adhoc.dry_run= True + configuration.Adhoc.dry_run= False status, msg = validateConfig(configuration) if not status: raise ConfigException(msg) diff --git a/src/python/TaskWorker/MasterWorker.py b/src/python/TaskWorker/MasterWorker.py index 948e5f53bf..26ae2e006c 100644 --- a/src/python/TaskWorker/MasterWorker.py +++ b/src/python/TaskWorker/MasterWorker.py @@ -252,7 +252,7 @@ def _externalScheduling(self, limit): External scheduling method using round-robin algorithm to get tasks in waiting status and consider resource utilization for fair share. """ - self.logger.info("Starting external scheduling with round-robin algorithm.") + self.logger.info("Starting external scheduling.") try: # Retrieve tasks with 'WAITING' status @@ -287,11 +287,13 @@ def _externalScheduling(self, limit): else: task_count[username] = 1 - if self.config.Adhoc.dry_run: - for username, count in task_count.items(): - self.logger.info('%d tasks for %s were selected during task scheduling.', count, username) + for username, count in task_count.items(): + self.logger.info('%d tasks for %s would have been selected if you had used task scheduling (Available in dry_run).', count, username) - return selected_tasks + if self.config.Adhoc.dry_run: + return selected_tasks #dry_run True (with Task Scheduling) + else: + return waiting_tasks #dry_run False (without Task Scheduling) except Exception as e: self.logger.exception("Exception occurred during external scheduling: %s", str(e))