diff --git a/libensemble/executors/mpi_executor.py b/libensemble/executors/mpi_executor.py index ec6d31619..14ee25f5c 100644 --- a/libensemble/executors/mpi_executor.py +++ b/libensemble/executors/mpi_executor.py @@ -138,7 +138,7 @@ def set_resources(self, resources: Resources) -> None: self.resources = resources def _launch_with_retries( - self, task: Task, subgroup_launch: bool, wait_on_start: Union[bool, int], run_cmd: List[str] + self, task: Task, subgroup_launch: bool, wait_on_start: Union[bool, int], run_cmd: List[str], use_shell: bool ) -> None: """Launch task with retry mechanism""" retry_count = 0 @@ -156,6 +156,7 @@ def _launch_with_retries( stdout=out, stderr=err, start_new_session=subgroup_launch, + shell=use_shell, ) except Exception as e: logger.warning(f"task {task.name} submit command failed on try {retry_count} with error {e}") @@ -367,8 +368,10 @@ def submit( if env_script is not None: run_cmd = Executor._process_env_script(task, runline, env_script) + use_shell = True else: run_cmd = runline + use_shell = False if dry_run: logger.info(f"Test (No submit) Runline: {' '.join(run_cmd)}") @@ -378,7 +381,7 @@ def submit( task._implement_env() # Launch Task - self._launch_with_retries(task, sglaunch, wait_on_start, run_cmd) + self._launch_with_retries(task, sglaunch, wait_on_start, run_cmd, use_shell) if not task.timer.timing and not task.finished: task.timer.start()