Skip to content

Commit f576652

Browse files
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.
1 parent 4a73bf3 commit f576652

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

toolchain/mfc/run/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ def run(targets=None, case=None):
196196
if ARG("nodes") > 1 or ARG("tasks_per_node") > 1:
197197
cons.print(f" [dim]MPI: {ARG('nodes')} nodes × {ARG('tasks_per_node')} tasks/node = {ARG('nodes') * ARG('tasks_per_node')} total ranks[/dim]")
198198

199-
__generate_job_script(targets, case)
200199
__validate_job_options()
200+
__generate_job_script(targets, case)
201201
__generate_input_files(targets, case)
202202

203203
if verbosity >= 2:

0 commit comments

Comments
 (0)