Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/libe env script shell #1392

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions libensemble/executors/mpi_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")
Expand Down Expand Up @@ -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)}")
Expand All @@ -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()
Expand Down
Loading