Inside RDataFrame::ForEachSlot, the ‘slot’ doesn’t seem to be updating. Here’s a reproducer:
void testSel()
{
// Set up multi-threading
const unsigned int n_thread_capacity = std::thread::hardware_concurrency();
std::cout << "System has " << n_thread_capacity << " threads." << std::endl;
ROOT::EnableThreadSafety();
ROOT::EnableImplicitMT(n_thread_capacity);
const unsigned int nSlots = ROOT::GetThreadPoolSize();
std::cout << "nSlots: " << nSlots << std::endl;
ROOT::RDataFrame d("DecayData","myrootfile.root");
auto applySelection = [](
unsigned int slot
)
{
std::cout << "Slot is " << slot << std::endl;
};
d.ForeachSlot( applySelection , {} );
}
The output is just:
------------------------------------------------------------------
| Welcome to ROOT 6.28/00 https://root.cern |
| (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Mar 05 2023, 06:52:00 |
| From tag , 3 February 2023 |
| With |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
Processing testSel.cc...
System has 8 threads.
nSlots: 8
Slot is 7
Slot is 7
...
Why does slot
seem to be stuck at 7?
ROOT Version: 6.28.00
Platform: Linux 6.2.2-arch1-1
Compiler: gcc (conda-forge gcc 11.3.0-19) 11.3.0