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

DM-38146: Update Princeton site interface from ib0 to op0 #13

Merged
merged 1 commit into from
Feb 28, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ plugins = pydantic.mypy
[mypy-parsl.*]
ignore_missing_imports = True

[mypy-psutil.*]
ignore_missing_imports = True

# Don't check LSST packages generally or even try to import them, since most
# don't have type annotations.
[mypy-lsst.*]
Expand Down
12 changes: 8 additions & 4 deletions python/lsst/ctrl/bps/parsl/sites/princeton.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from parsl.addresses import address_by_interface
from parsl.executors.base import ParslExecutor
from parsl.launchers import SrunLauncher
from psutil import net_if_addrs

from ..configuration import get_bps_config_value
from ..environment import export_environment
Expand Down Expand Up @@ -91,10 +92,10 @@ def select_executor(self, job: "ParslJob") -> str:
return "tiger"

def get_address(self) -> str:
"""Return the IP address of the machine hosting the driver/submission
"""Return the IP address of the machine hosting the driver/submission.

This address should be accessible from the workers. This should
generally by the return value of one of the functions in
This host machine address should be accessible from the workers and
should generally be the return value of one of the functions in
``parsl.addresses``.

This is used by the default implementation of ``get_monitor``, but will
Expand All @@ -104,4 +105,7 @@ def get_address(self) -> str:
interface, because the cluster nodes can't connect to the head node
through the regular internet.
"""
return address_by_interface("ib0")
net_interfaces = [interface for interface in net_if_addrs().keys() if interface[:2] in ["ib", "op"]]
if net_interfaces:
return address_by_interface(net_interfaces[0])
raise RuntimeError("No Infiniband network interface found.")