Skip to content
Merged
Changes from 1 commit
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
8 changes: 5 additions & 3 deletions src/ansys/mapdl/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ def get_value(
variable: str,
kwargs: Dict[str, str],
default: Optional[Union[str, int, float]] = 1,
astype: Optional[Callable[[Any], Any]] = int,
astype: Optional[Callable[[Any], Any]] = None,
) -> str | int | float:
value_from_env_vars = os.environ.get(variable)
value_from_kwargs = kwargs.pop(variable, None)
Expand All @@ -2077,8 +2077,10 @@ def get_value(

if astype and value:
return astype(value)
elif default is not None:
return type(default)(value)
else:
return value
return int(value)

## Getting env vars
SLURM_NNODES = get_value("SLURM_NNODES", kwargs)
Expand Down Expand Up @@ -2112,7 +2114,7 @@ def get_value(
LOG.info(f"SLURM_MEM_PER_NODE: {SLURM_MEM_PER_NODE}")

SLURM_NODELIST = str(
get_value("SLURM_NODELIST", kwargs, default="") # type: ignore
get_value("SLURM_NODELIST", kwargs, default="", astype=str) # type: ignore
).lower() # type: ignore
LOG.info(f"SLURM_NODELIST: {SLURM_NODELIST}")

Expand Down
Loading