From ce9b6f6917b66d31b0593e287758996ef896342f Mon Sep 17 00:00:00 2001 From: Timo Reents Date: Wed, 22 May 2024 12:18:45 +0200 Subject: [PATCH] Fix number of submitted `WorkChain`s Currently, the number of submitted `WorkChain`s is determined by the number of available slots. This is not the expected behavior, as this number might be unequal to 0, causing a logging message that states that `n` `WorkChain`s have been submitted, even though no processes were left. --- aiida_submission_controller/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiida_submission_controller/base.py b/aiida_submission_controller/base.py index 15096f5..af3c837 100644 --- a/aiida_submission_controller/base.py +++ b/aiida_submission_controller/base.py @@ -215,10 +215,10 @@ def submit_new_batch(self, dry_run=False, sort=False, verbose=False, sleep=0): console = Console() console.print(table) - if number_to_submit <= 0: + if number_to_submit <= 0 or self.num_to_run == 0: print("[bold blue]Info:[/] 😴 Nothing to submit.") else: - print(f"[bold blue]Info:[/] 🚀 Submitting {number_to_submit} new workchains!") + print(f"[bold blue]Info:[/] 🚀 Submitting {min(number_to_submit, self.num_to_run)} new workchains!") submitted = {}