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
2422a400
Commit
2422a400
authored
Nov 02, 2016
by
Qiwei Ye
Browse files
change Log::Error to Log::Warning
parent
cba6b245
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
include/LightGBM/utils/log.h
include/LightGBM/utils/log.h
+3
-3
src/application/application.cpp
src/application/application.cpp
+3
-3
src/io/config.cpp
src/io/config.cpp
+3
-3
src/io/dataset.cpp
src/io/dataset.cpp
+4
-4
src/io/parser.cpp
src/io/parser.cpp
+1
-1
src/network/linkers_socket.cpp
src/network/linkers_socket.cpp
+3
-3
No files found.
include/LightGBM/utils/log.h
View file @
2422a400
...
...
@@ -23,7 +23,7 @@ namespace LightGBM {
enum
class
LogLevel
:
int
{
Fatal
=
-
1
,
Error
=
0
,
Warning
=
0
,
Info
=
1
,
Debug
=
2
,
};
...
...
@@ -54,10 +54,10 @@ public:
Write
(
LogLevel
::
Info
,
"Info"
,
format
,
val
);
va_end
(
val
);
}
static
void
Error
(
const
char
*
format
,
...)
{
static
void
Warning
(
const
char
*
format
,
...)
{
va_list
val
;
va_start
(
val
,
format
);
Write
(
LogLevel
::
Error
,
"Error
"
,
format
,
val
);
Write
(
LogLevel
::
Warning
,
"Warning
"
,
format
,
val
);
va_end
(
val
);
}
static
void
Fatal
(
const
char
*
format
,
...)
{
...
...
src/application/application.cpp
View file @
2422a400
...
...
@@ -69,7 +69,7 @@ void Application::LoadParameters(int argc, char** argv) {
params
[
key
]
=
value
;
}
else
{
Log
::
Error
(
"Unknown parameter in command line: %s"
,
argv
[
i
]);
Log
::
Warning
(
"Unknown parameter in command line: %s"
,
argv
[
i
]);
}
}
// check for alias
...
...
@@ -101,11 +101,11 @@ void Application::LoadParameters(int argc, char** argv) {
}
}
else
{
Log
::
Error
(
"Unknown parameter in config file: %s"
,
line
.
c_str
());
Log
::
Warning
(
"Unknown parameter in config file: %s"
,
line
.
c_str
());
}
}
}
else
{
Log
::
Error
(
"Config file: %s doesn't exist, will ignore"
,
Log
::
Warning
(
"Config file: %s doesn't exist, will ignore"
,
params
[
"config_file"
].
c_str
());
}
}
...
...
src/io/config.cpp
View file @
2422a400
...
...
@@ -23,7 +23,7 @@ void OverallConfig::LoadFromString(const char* str) {
}
params
[
key
]
=
value
;
}
else
{
Log
::
Error
(
"Unknown parameter %s"
,
arg
.
c_str
());
Log
::
Warning
(
"Unknown parameter %s"
,
arg
.
c_str
());
}
}
ParameterAlias
::
KeyAliasTransform
(
&
params
);
...
...
@@ -60,7 +60,7 @@ void OverallConfig::Set(const std::unordered_map<std::string, std::string>& para
LightGBM
::
Log
::
ResetLogLevel
(
LightGBM
::
LogLevel
::
Info
);
}
else
if
(
io_config
.
verbosity
==
0
)
{
LightGBM
::
Log
::
ResetLogLevel
(
LightGBM
::
LogLevel
::
Error
);
LightGBM
::
Log
::
ResetLogLevel
(
LightGBM
::
LogLevel
::
Warning
);
}
else
if
(
io_config
.
verbosity
>=
2
)
{
LightGBM
::
Log
::
ResetLogLevel
(
LightGBM
::
LogLevel
::
Debug
);
...
...
@@ -172,7 +172,7 @@ void OverallConfig::CheckParamConflict() {
}
else
if
(
gbdt_config
->
tree_learner_type
==
TreeLearnerType
::
kDataParallelTreeLearner
)
{
is_parallel_find_bin
=
true
;
if
(
gbdt_config
->
tree_config
.
histogram_pool_size
>=
0
)
{
Log
::
Error
(
"Histogram LRU queue was enabled (histogram_pool_size=%f). Will disable this for reducing communication cost."
Log
::
Warning
(
"Histogram LRU queue was enabled (histogram_pool_size=%f). Will disable this for reducing communication cost."
,
gbdt_config
->
tree_config
.
histogram_pool_size
);
// Change pool size to -1(not limit) when using data parallel for reducing communication cost
gbdt_config
->
tree_config
.
histogram_pool_size
=
-
1
;
...
...
src/io/dataset.cpp
View file @
2422a400
...
...
@@ -336,7 +336,7 @@ void Dataset::ConstructBinMappers(int rank, int num_machines, const std::vector<
for
(
size_t
i
=
0
;
i
<
sample_values
.
size
();
++
i
)
{
if
(
bin_mappers
[
i
]
==
nullptr
)
{
Log
::
Error
(
"Ignore Feature %s "
,
feature_names_
[
i
].
c_str
());
Log
::
Warning
(
"Ignore Feature %s "
,
feature_names_
[
i
].
c_str
());
}
else
if
(
!
bin_mappers
[
i
]
->
is_trival
())
{
// map real feature index to used feature index
...
...
@@ -346,7 +346,7 @@ void Dataset::ConstructBinMappers(int rank, int num_machines, const std::vector<
num_data_
,
is_enable_sparse_
));
}
else
{
// if feature is trival(only 1 bin), free spaces
Log
::
Error
(
"Feature %s only contains one value, will be ignored"
,
feature_names_
[
i
].
c_str
());
Log
::
Warning
(
"Feature %s only contains one value, will be ignored"
,
feature_names_
[
i
].
c_str
());
delete
bin_mappers
[
i
];
}
}
...
...
@@ -394,7 +394,7 @@ void Dataset::ConstructBinMappers(int rank, int num_machines, const std::vector<
// restore features bins from buffer
for
(
int
i
=
0
;
i
<
total_num_feature
;
++
i
)
{
if
(
ignore_features_
.
count
(
i
)
>
0
)
{
Log
::
Error
(
"Ignore Feature %s "
,
feature_names_
[
i
].
c_str
());
Log
::
Warning
(
"Ignore Feature %s "
,
feature_names_
[
i
].
c_str
());
continue
;
}
BinMapper
*
bin_mapper
=
new
BinMapper
();
...
...
@@ -403,7 +403,7 @@ void Dataset::ConstructBinMappers(int rank, int num_machines, const std::vector<
used_feature_map_
[
i
]
=
static_cast
<
int
>
(
features_
.
size
());
features_
.
push_back
(
new
Feature
(
static_cast
<
int
>
(
i
),
bin_mapper
,
num_data_
,
is_enable_sparse_
));
}
else
{
Log
::
Error
(
"Feature %s only contains one value, will be ignored"
,
feature_names_
[
i
].
c_str
());
Log
::
Warning
(
"Feature %s only contains one value, will be ignored"
,
feature_names_
[
i
].
c_str
());
delete
bin_mapper
;
}
}
...
...
src/io/parser.cpp
View file @
2422a400
...
...
@@ -88,7 +88,7 @@ Parser* Parser::CreateParser(const char* filename, bool has_header, int num_feat
if
(
!
tmp_file
.
eof
())
{
std
::
getline
(
tmp_file
,
line2
);
}
else
{
Log
::
Error
(
"Data file: %s only have one line"
,
filename
);
Log
::
Warning
(
"Data file: %s only have one line"
,
filename
);
}
tmp_file
.
close
();
int
comma_cnt
=
0
,
comma_cnt2
=
0
;
...
...
src/network/linkers_socket.cpp
View file @
2422a400
...
...
@@ -95,7 +95,7 @@ void Linkers::ParseMachineList(const char * filename) {
continue
;
}
if
(
client_ips_
.
size
()
>=
static_cast
<
size_t
>
(
num_machines_
))
{
Log
::
Error
(
"The #machine in machine_list is larger than parameter num_machines, the redundant will ignored"
);
Log
::
Warning
(
"The #machine in machine_list is larger than parameter num_machines, the redundant will ignored"
);
break
;
}
str_after_split
[
0
]
=
Common
::
Trim
(
str_after_split
[
0
]);
...
...
@@ -104,7 +104,7 @@ void Linkers::ParseMachineList(const char * filename) {
client_ports_
.
push_back
(
atoi
(
str_after_split
[
1
].
c_str
()));
}
if
(
client_ips_
.
size
()
!=
static_cast
<
size_t
>
(
num_machines_
))
{
Log
::
Error
(
"The world size is bigger the #machine in machine list, change world size to %d ."
,
client_ips_
.
size
());
Log
::
Warning
(
"The world size is bigger the #machine in machine list, change world size to %d ."
,
client_ips_
.
size
());
num_machines_
=
static_cast
<
int
>
(
client_ips_
.
size
());
}
}
...
...
@@ -192,7 +192,7 @@ void Linkers::Construct() {
if
(
cur_socket
.
Connect
(
client_ips_
[
out_rank
].
c_str
(),
client_ports_
[
out_rank
]))
{
break
;
}
else
{
Log
::
Error
(
"Connect to rank %d failed, wait for %d milliseconds"
,
out_rank
,
connect_fail_delay_time
);
Log
::
Warning
(
"Connect to rank %d failed, wait for %d milliseconds"
,
out_rank
,
connect_fail_delay_time
);
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
connect_fail_delay_time
));
}
}
...
...
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