fix DMatrix load_row_split bug (#3431)

This commit is contained in:
hlsc 2018-07-29 08:21:30 +08:00 committed by Philip Hyunsu Cho
parent 8973f2cb0e
commit 5850a2558a

View File

@ -213,11 +213,13 @@ int XGDMatrixCreateFromFile(const char *fname,
int silent,
DMatrixHandle *out) {
API_BEGIN();
bool load_row_split = false;
if (rabit::IsDistributed()) {
LOG(CONSOLE) << "XGBoost distributed mode detected, "
<< "will split data among workers";
load_row_split = true;
}
*out = new std::shared_ptr<DMatrix>(DMatrix::Load(fname, silent != 0, true));
*out = new std::shared_ptr<DMatrix>(DMatrix::Load(fname, silent != 0, load_row_split));
API_END();
}