From f57665238e35622ec08c1ab53523acf3fe244caa Mon Sep 17 00:00:00 2001 From: lb1192176991-lab Date: Tue, 2 Jun 2026 04:05:17 +0800 Subject: [PATCH] fix(run): validate job options before generating job script __generate_job_script() was called before __validate_job_options(), so an invalid invocation (e.g. --no-mpi with >1 rank, nodes <= 0, or a malformed --email) would write a stale .sh to disk and only then fail. Swap the call order so validation runs first. Fixes part (b) of #1511. --- toolchain/mfc/run/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/mfc/run/run.py b/toolchain/mfc/run/run.py index cd6987cd90..a91b76acb7 100644 --- a/toolchain/mfc/run/run.py +++ b/toolchain/mfc/run/run.py @@ -196,8 +196,8 @@ def run(targets=None, case=None): if ARG("nodes") > 1 or ARG("tasks_per_node") > 1: cons.print(f" [dim]MPI: {ARG('nodes')} nodes × {ARG('tasks_per_node')} tasks/node = {ARG('nodes') * ARG('tasks_per_node')} total ranks[/dim]") - __generate_job_script(targets, case) __validate_job_options() + __generate_job_script(targets, case) __generate_input_files(targets, case) if verbosity >= 2: