[coll] Allow using local host for testing. (#10526)
- Don't try to retrieve the IP address if a host is specified. - Fix compiler deprecation warning.
This commit is contained in:
parent
a39fef2c67
commit
d33043a348
@ -111,12 +111,14 @@ RabitTracker::WorkerProxy::WorkerProxy(std::int32_t world, TCPSocket sock, SockA
|
|||||||
}
|
}
|
||||||
|
|
||||||
RabitTracker::RabitTracker(Json const& config) : Tracker{config} {
|
RabitTracker::RabitTracker(Json const& config) : Tracker{config} {
|
||||||
std::string self;
|
|
||||||
auto rc = Success() << [&] {
|
auto rc = Success() << [&] {
|
||||||
return collective::GetHostAddress(&self);
|
host_.clear();
|
||||||
|
host_ = OptionalArg<String>(config, "host", std::string{});
|
||||||
|
if (host_.empty()) {
|
||||||
|
return collective::GetHostAddress(&host_);
|
||||||
|
}
|
||||||
|
return Success();
|
||||||
} << [&] {
|
} << [&] {
|
||||||
host_ = OptionalArg<String>(config, "host", self);
|
|
||||||
|
|
||||||
auto addr = MakeSockAddress(xgboost::StringView{host_}, 0);
|
auto addr = MakeSockAddress(xgboost::StringView{host_}, 0);
|
||||||
listener_ = TCPSocket::Create(addr.IsV4() ? SockDomain::kV4 : SockDomain::kV6);
|
listener_ = TCPSocket::Create(addr.IsV4() ? SockDomain::kV4 : SockDomain::kV6);
|
||||||
return listener_.Bind(host_, &this->port_);
|
return listener_.Bind(host_, &this->port_);
|
||||||
|
|||||||
@ -61,6 +61,8 @@ class pinned_allocator {
|
|||||||
XGBOOST_DEVICE inline ~pinned_allocator() {} // NOLINT: host/device markup ignored on defaulted functions
|
XGBOOST_DEVICE inline ~pinned_allocator() {} // NOLINT: host/device markup ignored on defaulted functions
|
||||||
XGBOOST_DEVICE inline pinned_allocator(pinned_allocator const&) {} // NOLINT: host/device markup ignored on defaulted functions
|
XGBOOST_DEVICE inline pinned_allocator(pinned_allocator const&) {} // NOLINT: host/device markup ignored on defaulted functions
|
||||||
|
|
||||||
|
pinned_allocator& operator=(pinned_allocator const& that) = default;
|
||||||
|
pinned_allocator& operator=(pinned_allocator&& that) = default;
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
XGBOOST_DEVICE inline pinned_allocator(pinned_allocator<U> const&) {} // NOLINT
|
XGBOOST_DEVICE inline pinned_allocator(pinned_allocator<U> const&) {} // NOLINT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user