-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 6.22/00
-
Component/s: None
-
Labels:None
-
Environment:
any
When TThreadExecutor creates the IMT thread pool (as opposed to when the thread pool is explicitly created by users via ROOT::EnableImplicitMT), it deletes it at destruction time:
{
|
TThreadExecutor p(3);
|
std::cout << ROOT::ImplicitMTPoolSize() << std::endl; // prints 3 |
}
|
std::cout << ROOT::ImplicitMTPoolSize() << std::endl; // prints 0 |
The same cannot be said for TTreeProcessorMT, although the two classes should have consistent behavior:
ROOT::TTreeProcessorMT proc("f.root", "t"); |
std::cout << ROOT::GetImplicitMTPoolSize() << std::endl; // prints n_cores |
proc.Process([](TTreeReader &) { });
|
}
|
|
std::cout << ROOT::GetImplicitMTPoolSize() << std::endl; // still prints n_cores!! |
This looks like a total accident: TTreeProcessorMT::Process makes use of TParTreeProcessingRAII, the constructor of which calls ROOT::EnableImplicitMT() (with no arguments) and the destructor of which never calls ROOT::DisableImplicitMT().
I don't think this is the desired behavior, but I'd like to hear other opinions. Also, I don't know how to fix it, I am not familiar with how TParTreeProcessingRAII is expected to behave.