Changing omp_get_num_threads to omp_get_max_threads (#1831)

* Updating dmlc-core

* Changing omp_get_num_threads to omp_get_max_threads
This commit is contained in:
Simon DENEL
2016-12-04 20:26:45 +01:00
committed by Tianqi Chen
parent 47ba2de7d4
commit 7078c41dad
10 changed files with 22 additions and 71 deletions

View File

@@ -301,11 +301,7 @@ class GBTree : public GradientBooster {
void PredictLeaf(DMatrix* p_fmat,
std::vector<bst_float>* out_preds,
unsigned ntree_limit) override {
int nthread;
#pragma omp parallel
{
nthread = omp_get_num_threads();
}
const int nthread = omp_get_max_threads();
InitThreadTemp(nthread);
this->PredPath(p_fmat, out_preds, ntree_limit);
}
@@ -365,11 +361,7 @@ class GBTree : public GradientBooster {
unsigned tree_begin,
unsigned tree_end) {
const MetaInfo& info = p_fmat->info();
int nthread;
#pragma omp parallel
{
nthread = omp_get_num_threads();
}
const int nthread = omp_get_max_threads();
CHECK_EQ(num_group, mparam.num_output_group);
InitThreadTemp(nthread);
std::vector<bst_float> &preds = *out_preds;