update tree maker to make it more robust

This commit is contained in:
tqchen 2014-08-18 14:58:30 -07:00
parent 3de07b0abe
commit 1d8c2391e8
2 changed files with 3 additions and 1 deletions

View File

@ -3,3 +3,4 @@ python wrapper for xgboost using ctypes
see example for usage
to make the python module, type make in the root directory of project

View File

@ -271,7 +271,8 @@ class ColMaker: public IUpdater<FMatrix> {
}
// start enumeration
const unsigned nsize = static_cast<unsigned>(feat_set.size());
#pragma omp parallel for schedule(dynamic, 1)
const int batch_size = std::max(static_cast<int>(nsize / this->nthread / 32), 1);
#pragma omp parallel for schedule(dynamic, batch_size)
for (unsigned i = 0; i < nsize; ++i) {
const unsigned fid = feat_set[i];
const int tid = omp_get_thread_num();