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
tianlh
LightGBM-DCU
Commits
8639107f
Commit
8639107f
authored
Nov 23, 2016
by
Guolin Ke
Browse files
Add Fatal when machine file format error
parent
fa4ecfda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/network/linkers_socket.cpp
src/network/linkers_socket.cpp
+5
-4
No files found.
src/network/linkers_socket.cpp
View file @
8639107f
...
@@ -28,10 +28,6 @@ Linkers::Linkers(NetworkConfig config) {
...
@@ -28,10 +28,6 @@ Linkers::Linkers(NetworkConfig config) {
// parser clients from file
// parser clients from file
ParseMachineList
(
config
.
machine_list_filename
.
c_str
());
ParseMachineList
(
config
.
machine_list_filename
.
c_str
());
if
(
num_machines_
<=
1
)
{
return
;
}
if
(
rank_
==
-
1
)
{
if
(
rank_
==
-
1
)
{
// get ip list of local machine
// get ip list of local machine
std
::
unordered_set
<
std
::
string
>
local_ip_list
=
TcpSocket
::
GetLocalIpList
();
std
::
unordered_set
<
std
::
string
>
local_ip_list
=
TcpSocket
::
GetLocalIpList
();
...
@@ -101,10 +97,15 @@ void Linkers::ParseMachineList(const char * filename) {
...
@@ -101,10 +97,15 @@ void Linkers::ParseMachineList(const char * filename) {
client_ips_
.
push_back
(
str_after_split
[
0
]);
client_ips_
.
push_back
(
str_after_split
[
0
]);
client_ports_
.
push_back
(
atoi
(
str_after_split
[
1
].
c_str
()));
client_ports_
.
push_back
(
atoi
(
str_after_split
[
1
].
c_str
()));
}
}
if
(
client_ips_
.
size
()
==
0
)
{
Log
::
Fatal
(
"Machine list file doesn't contain any ip and port. \
Please check it again"
);
}
if
(
client_ips_
.
size
()
!=
static_cast
<
size_t
>
(
num_machines_
))
{
if
(
client_ips_
.
size
()
!=
static_cast
<
size_t
>
(
num_machines_
))
{
Log
::
Warning
(
"World size is larger than the machine_list size, change world size to %d"
,
client_ips_
.
size
());
Log
::
Warning
(
"World size is larger than the machine_list size, change world size to %d"
,
client_ips_
.
size
());
num_machines_
=
static_cast
<
int
>
(
client_ips_
.
size
());
num_machines_
=
static_cast
<
int
>
(
client_ips_
.
size
());
}
}
}
}
void
Linkers
::
TryBind
(
int
port
)
{
void
Linkers
::
TryBind
(
int
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