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

fix: Option to clear Fluent parallel env vars #3441

Merged
merged 1 commit into from
Oct 31, 2024
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
3 changes: 3 additions & 0 deletions src/ansys/fluent/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,6 @@ def version_info() -> str:

# Whether to skip health check
CHECK_HEALTH = True

# Whether to clear environment variables related to Fluent parallel mode
CLEAR_FLUENT_PARA_ENVS = False
mkundu1 marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 5 additions & 2 deletions src/ansys/fluent/core/launcher/launcher_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def is_windows():


def _get_subprocess_kwargs_for_fluent(env: Dict[str, Any], argvals) -> Dict[str, Any]:
from ansys.fluent.core import CLEAR_FLUENT_PARA_ENVS, INFER_REMOTING_IP

scheduler_options = argvals.get("scheduler_options")
is_slurm = scheduler_options and scheduler_options["scheduler"] == "slurm"
kwargs: Dict[str, Any] = {}
Expand All @@ -33,10 +35,11 @@ def _get_subprocess_kwargs_for_fluent(env: Dict[str, Any], argvals) -> Dict[str,
fluent_env = os.environ.copy()
fluent_env.update({k: str(v) for k, v in env.items()})
fluent_env["REMOTING_THROW_LAST_TUI_ERROR"] = "1"
if CLEAR_FLUENT_PARA_ENVS:
del fluent_env["PARA_NPROCS"]
del fluent_env["PARA_MESH_NPROCS"]

if not is_slurm:
from ansys.fluent.core import INFER_REMOTING_IP

if INFER_REMOTING_IP and not "REMOTING_SERVER_ADDRESS" in fluent_env:
remoting_ip = find_remoting_ip()
if remoting_ip:
Expand Down
Loading