Skip to content

Commit e57d3c0

Browse files
authored
Merge pull request #444 from radical-cybertools/fix/anvil_netface
Enable Anvil Infiniband interface
2 parents 74cf4d2 + 3d5430f commit e57d3c0

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

src/radical/utils/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ class DefaultConfig(Config, metaclass=DefaultConfigMeta):
441441
'report_dir' : str,
442442
'profile' : bool,
443443
'profile_dir': str,
444+
'iface' : list,
444445
}
445446

446447
# --------------------------------------------------------------------------

src/radical/utils/configs/utils_default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"report_tgt" : "${RADICAL_DEFAULT_REPORT_TGT:stderr}",
88
"report_dir" : "${RADICAL_DEFAULT_REPORT_DIR:$PWD}",
99
"profile" : "${RADICAL_DEFAULT_PROFILE:TRUE}",
10-
"profile_dir": "${RADICAL_DEFAULT_PROFILE_DIR:$PWD}"
10+
"profile_dir": "${RADICAL_DEFAULT_PROFILE_DIR:$PWD}",
11+
"iface" : "${RADICAL_DEFAULT_IFACE}"
1112
}
1213

src/radical/utils/host.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
from functools import reduce
1212

13-
from .misc import as_list, ru_open
13+
from .misc import as_list, ru_open
14+
from .config import DefaultConfig
1415

1516

1617
# ------------------------------------------------------------------------------
@@ -31,17 +32,10 @@ def get_hostname():
3132

3233
# ------------------------------------------------------------------------------
3334
#
34-
_hostip = None
35-
36-
3735
def get_hostip(req=None, log=None):
3836
"""Look up the IP address for a given requested interface name.
3937
If interface is not given, do some magic."""
4038

41-
global _hostip # pylint: disable=W0603
42-
if _hostip:
43-
return _hostip
44-
4539
AF_INET = netifaces.AF_INET
4640

4741
# We create an ordered preference list, consisting of:
@@ -52,11 +46,14 @@ def get_hostip(req=None, log=None):
5246
# Then this list is traversed, we check if the interface exists and has an
5347
# IP address. The first match is used.
5448

49+
if not req:
50+
req = DefaultConfig().get('iface')
51+
5552
req = as_list(req)
5653

5754
white_list = [
5855
'ens1f1', # amarel
59-
# 'ib0', # infiniband
56+
'ib0', # infiniband # NOTE: unusable on Amarel, use `req` there!
6057
'hsn0', # Frontier (HPE Cray EX)
6158
'ipogif0', # Cray's
6259
'br0', # SuperMIC
@@ -105,7 +102,6 @@ def get_hostip(req=None, log=None):
105102
log.debug('check iface %s: ip is %s', iface, ip)
106103

107104
if ip:
108-
_hostip = ip
109105
return ip
110106

111107
return '127.0.0.1'

src/radical/utils/profile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def __init__(self, name, ns=None, path=None):
180180

181181
ru_def = DefaultConfig()
182182

183-
184183
if not ns:
185184
ns = name
186185

0 commit comments

Comments
 (0)