Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions doc/changelog.d/4611.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the slurm-launcher hang by closing stdout after reading
5 changes: 5 additions & 0 deletions src/ansys/fluent/core/launcher/slurm_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import time
from typing import Any, Callable, Dict

from ansys.fluent.core import config
from ansys.fluent.core._types import PathType
from ansys.fluent.core.exceptions import InvalidArgument
from ansys.fluent.core.launcher.launch_options import (
Expand Down Expand Up @@ -102,6 +103,10 @@ def _get_slurm_job_id(proc: subprocess.Popen):
for line in proc.stdout:
if line.startswith(prefix.encode()):
line = line.decode().removeprefix(prefix).strip()
# if the configuration setting 'launch_fluent_stdout' is None,
# close proc.stdout after reading the slurm job id to avoid hang in some systems
if config.launch_fluent_stdout is None and proc.stdout is not None:
proc.stdout.close()
return int(line)


Expand Down
Loading