Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
03654c0c
Unverified
Commit
03654c0c
authored
Aug 01, 2023
by
LuGY
Committed by
GitHub
Aug 01, 2023
Browse files
fix localhost measurement (#4320)
parent
45b08f08
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
colossalai/cli/launcher/hostinfo.py
colossalai/cli/launcher/hostinfo.py
+2
-5
No files found.
colossalai/cli/launcher/hostinfo.py
View file @
03654c0c
...
...
@@ -46,11 +46,8 @@ class HostInfo:
localhost
=
socket
.
gethostname
()
localaddrs
=
socket
.
getaddrinfo
(
localhost
,
port
)
targetaddrs
=
socket
.
getaddrinfo
(
hostname
,
port
)
for
(
family
,
socktype
,
proto
,
canonname
,
sockaddr
)
in
localaddrs
:
for
(
rfamily
,
rsocktype
,
rproto
,
rcanonname
,
rsockaddr
)
in
targetaddrs
:
if
rsockaddr
[
0
]
==
sockaddr
[
0
]:
return
True
return
False
return
localaddrs
==
targetaddrs
def
__str__
(
self
):
return
f
'hostname:
{
self
.
hostname
}
, port:
{
self
.
port
}
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment