"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "fedf3971832201849c2bcdac334289cc97e46217"
Commit fdf1f326 authored by Guolin Ke's avatar Guolin Ke
Browse files

Merge branch 'master' of https://github.com/Microsoft/LightGBM

parents 24f1f9cd 572cc07b
......@@ -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, ...) {
......
......@@ -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());
}
}
......
......@@ -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;
......
......@@ -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;
}
}
......
......@@ -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;
......
......@@ -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));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment