# How to train a BDT with ROOT::EnableImplicitMT() on LXPLUS

**URL:** <https://root-forum.cern.ch/t/how-to-train-a-bdt-with-root-enableimplicitmt-on-lxplus/43651>\
**Category:** TMVA\
**Created:** [February 22, 2021, 8:16am UTC](https://root-forum.cern.ch/t/how-to-train-a-bdt-with-root-enableimplicitmt-on-lxplus/43651 "2021-02-22T08:16:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oguloncel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oguloncel/32/20692_2.png) [@oguloncel](https://root-forum.cern.ch/u/oguloncel)\
**Post date:** [February 22, 2021, 8:16am UTC](https://root-forum.cern.ch/t/how-to-train-a-bdt-with-root-enableimplicitmt-on-lxplus/43651/1 "2021-02-22T08:16:36Z")

</div>

Dear Experts,

I have [read](https://root.cern/doc/master/namespaceROOT.html#a06f2b8b216b615e5abbc872c9feff40f) that ROOT has the functionality to parallelise GradBoost BDT training in TMVA via using the ROOT::EnableImplicitMT().

I am trying to do this on LXPLUS (also tried it on HTCondor with setting RequestCpus along) with ROOT (I tried 6.20.06-x86\_64-centos7-gcc8-opt and 6.22.06-x86\_64-centos7-gcc8-opt) by adding at the top of my code the ROOT::EnableImplicitMT(4), to request 4 threads. Based on some other posts I read [here](https://root-forum.cern.ch/t/how-to-make-sure-that-reading-a-tree-is-really-parallel/29256), I also added ROOT::GetImplicitMTPoolSize() command to see if the command is actually received, which gives a positive result. The program runs without errors.

However, despite large file size (several millions of training events with around 25 branches each) I don’t see any notable difference in execution times. According to performance studies in this [paper](https://www.epj-conferences.org/articles/epjconf/pdf/2019/19/epjconf_chep2018_06014.pdf), BDT training with 4-cores should perform about twice faster than single-core case.

I failed to find a TMVA BDT training (not NN) example that demonstrates how this functionality works. All replies point to a simple inclusion of the command ROOT::EnableImplicitMT(n) into the code. Could you kindly provide a minimal setup that shows this functionality applied to TMVA BDT training?

Cheers,

Ogul

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 23, 2021, 12:53pm UTC](https://root-forum.cern.ch/t/how-to-train-a-bdt-with-root-enableimplicitmt-on-lxplus/43651/2 "2021-02-23T12:53:10Z")

</div>

May be @moneta has an idea.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [February 23, 2021, 5:49pm UTC](https://root-forum.cern.ch/t/how-to-train-a-bdt-with-root-enableimplicitmt-on-lxplus/43651/3 "2021-02-23T17:49:57Z")

</div>

Hi,  
Yes, this should be enough to enable to run it with multi-thread. Can you check , for example using `top` if you are actually running in multiple threads or a single thread mode ? You can see if CPU utilisation is more than 100%,

Cheers

Lorenzo

---

<div class="post-metadata">

**Author:** ![11132](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/1/c68b51/32.png) [@11132](https://root-forum.cern.ch/u/11132)\
**Post date:** [February 28, 2021, 9:49am UTC](https://root-forum.cern.ch/t/how-to-train-a-bdt-with-root-enableimplicitmt-on-lxplus/43651/4 "2021-02-28T09:49:43Z")

</div>

Hi,

I have the same problem with DNN, too. I would like to train DNN with multi-threading but it showed the number of threads is =1. I tried with ROOT v6.22.06 on HTCondor.

I use the example in $ROOTSYS/tutorials.

Best,  
Jie

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 1, 2021, 3:29pm UTC](https://root-forum.cern.ch/t/how-to-train-a-bdt-with-root-enableimplicitmt-on-lxplus/43651/5 "2021-03-01T15:29:22Z")

</div>

Hi,  
What is printing if you are doing from the ROOT prompt ?

```auto
root [1] ROOT::EnableImplicitMT(0)
root [2] ROOT::GetThreadPoolSize()
(unsigned int) 16

```
