From 67ca47902d111fae418801d753c7ce232c25c6ec Mon Sep 17 00:00:00 2001 From: christailu <44705085+christailu@users.noreply.github.com> Date: Mon, 18 Mar 2024 08:10:21 -0500 Subject: [PATCH] Issue warning if SimpleLauncher is used with multiple nodes per block (#3177) This addresses the issue where users could inadvertently attempt to use the SimpleLauncher with multiple nodes per block, which could lead to confusion and unexpected behavior. This enhancement ensures that a warning is raised when users try to use the SimpleLauncher with more than one node per block, unless explicitly permitted. --- parsl/launchers/launchers.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/parsl/launchers/launchers.py b/parsl/launchers/launchers.py index 1677325fac..4845284376 100644 --- a/parsl/launchers/launchers.py +++ b/parsl/launchers/launchers.py @@ -8,16 +8,14 @@ class SimpleLauncher(Launcher): """ Does no wrapping. Just returns the command as-is """ - def __init_(self, debug: bool = True) -> None: + def __init__(self, debug: bool = True) -> None: super().__init__(debug=debug) - def __call__(self, command: str, tasks_per_node: int, nodes_per_block: int) -> str: - """ - Args: - - command (string): The command string to be launched - - task_block (string) : bash evaluated string. + def __call__(self, command: str, tasks_per_node: int, nodes_per_block: int, permit_multiple_nodes: bool = False) -> str: - """ + if nodes_per_block > 1 and not permit_multiple_nodes: + logger.warning("SimpleLauncher only supports 1 node per block. " + "Set permit_multiple_nodes=True to allow multiple nodes per block.") return command