Skip to content

Commit

Permalink
[DIST] fix distirbuted setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu authored and tqchen committed Feb 10, 2016
1 parent 5218438 commit 46be618
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cli_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ int CLIRunTask(int argc, char *argv[]) {
printf("Usage: <config>\n");
return 0;
}
rabit::Init(argc, argv);

std::vector<std::pair<std::string, std::string> > cfg;
cfg.push_back(std::make_pair("seed", "0"));
Expand All @@ -336,7 +337,6 @@ int CLIRunTask(int argc, char *argv[]) {
CLIParam param;
param.Configure(cfg);

rabit::Init(argc, argv);
switch (param.task) {
case kTrain: CLITrain(param); break;
case kDump2Text: CLIDump2Text(param); break;
Expand Down
12 changes: 8 additions & 4 deletions src/data/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ DMatrix* DMatrix::Load(const std::string& uri,
<< "Only one `#` is allowed in file path for cache file specification.";
if (load_row_split) {
std::ostringstream os;
os << cache_file << ".r" << rabit::GetRank();
os << "r" << rabit::GetRank()
<< "-" << rabit::GetWorldSize()
<< "." << cache_file;
cache_file = os.str();
}
} else {
Expand All @@ -154,9 +156,11 @@ DMatrix* DMatrix::Load(const std::string& uri,
} else {
// test option to load in part
npart = dmlc::GetEnv("XGBOOST_TEST_NPART", 1);
if (npart != 1) {
LOG(CONSOLE) << "Partial load option on npart=" << npart;
}
}

if (npart != 1) {
LOG(CONSOLE) << "Load part of data " << partid
<< " of " << npart << " parts";
}
// legacy handling of binary data loading
if (file_format == "auto" && !load_row_split) {
Expand Down

0 comments on commit 46be618

Please sign in to comment.