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

Supporting launching MAPDL from WSL #2324

Merged
merged 19 commits into from
Sep 12, 2023
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: 6 additions & 2 deletions src/ansys/mapdl/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
CONFIG_FILE = os.path.join(SETTINGS_DIR, "config.txt")
ALLOWABLE_MODES = ["corba", "console", "grpc"]

ON_WSL = bool(os.environ.get("WSL_DISTRO_NAME", None)) or bool(
os.environ.get("WSL_INTEROP", None)
)

LOCALHOST = "127.0.0.1"
MAPDL_DEFAULT_PORT = 50052
Expand Down Expand Up @@ -524,7 +527,7 @@
LOG.debug("Checking file error is created")
_check_file_error_created(run_location, timeout)

if os.name == "posix":
if os.name == "posix" and not ON_WSL:
LOG.debug("Checking if gRPC server is alive.")
_check_server_is_alive(stdout_queue, run_location, timeout)

Expand Down Expand Up @@ -1358,7 +1361,8 @@
LOG.debug(
"Because ``PYMAPDL_IP is not None, an attempt is made to connect to a remote session. ('START_INSTANCE' is set to False.`)"
)
start_instance = False
if not ON_WSL:
germa89 marked this conversation as resolved.
Show resolved Hide resolved
start_instance = False

Check warning on line 1365 in src/ansys/mapdl/core/launcher.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/launcher.py#L1364-L1365

Added lines #L1364 - L1365 were not covered by tests
ip = socket.gethostbyname(ip) # Converting ip or hostname to ip

check_valid_ip(ip) # double check
Expand Down
Loading