diff --git a/src/tree/param.h b/src/tree/param.h index aab11ad1e..4a7c790a6 100644 --- a/src/tree/param.h +++ b/src/tree/param.h @@ -57,7 +57,7 @@ struct TrainParam{ opt_dense_col = 1.0f; nthread = 0; size_leaf_vector = 0; - parallel_option = 0; + parallel_option = 2; } /*! * \brief set parameters from outside diff --git a/src/tree/updater_colmaker-inl.hpp b/src/tree/updater_colmaker-inl.hpp index 1ccf32a41..9c2740264 100644 --- a/src/tree/updater_colmaker-inl.hpp +++ b/src/tree/updater_colmaker-inl.hpp @@ -418,7 +418,11 @@ class ColMaker: public IUpdater { #if defined(_OPENMP) const int batch_size = std::max(static_cast(nsize / this->nthread / 32), 1); #endif - if (param.parallel_option == 0) { + int poption = param.parallel_option; + if (poption == 2) { + poption = nsize * 2 < nthread ? 1 : 0; + } + if (poption == 0) { #pragma omp parallel for schedule(dynamic, batch_size) for (bst_omp_uint i = 0; i < nsize; ++i) { const bst_uint fid = batch.col_index[i];