This commit is contained in:
tqchen 2014-09-12 21:26:38 -07:00
parent bf2426f3cd
commit 91e34c6fb4
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -418,7 +418,11 @@ class ColMaker: public IUpdater {
#if defined(_OPENMP)
const int batch_size = std::max(static_cast<int>(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];