Logo ROOT   6.12/07
Reference Guide
TDFNodes.cxx
Go to the documentation of this file.
1 // Author: Enrico Guiraud, Danilo Piparo CERN 03/2017
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2016, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #include "RConfigure.h" // R__USE_IMT
12 #include "ROOT/TDFNodes.hxx"
13 #include "ROOT/TSpinMutex.hxx"
15 #ifdef R__USE_IMT
16 #include "ROOT/TThreadExecutor.hxx"
17 #endif
18 #include "RtypesCore.h" // Long64_t
19 #include "TInterpreter.h"
20 #include "TROOT.h" // IsImplicitMTEnabled
21 #include "TTreeReader.h"
22 
23 #include <cassert>
24 #include <mutex>
25 #include <string>
26 class TDirectory;
27 class TTree;
28 using namespace ROOT::Detail::TDF;
29 using namespace ROOT::Internal::TDF;
30 
31 namespace ROOT {
32 namespace Internal {
33 namespace TDF {
34 
35 TActionBase::TActionBase(TLoopManager *implPtr, const unsigned int nSlots) : fImplPtr(implPtr), fNSlots(nSlots)
36 {
37 }
38 
39 } // end NS TDF
40 } // end NS Internal
41 } // end NS ROOT
42 
44  const bool isDSColumn)
45  : fImplPtr(implPtr), fName(name), fNSlots(nSlots), fIsDataSourceColumn(isDSColumn)
46 {
47 }
48 
49 std::string TCustomColumnBase::GetName() const
50 {
51  return fName;
52 }
53 
55 {
56  return fImplPtr;
57 }
58 
60 {
61  fLastCheckedEntry = std::vector<Long64_t>(fNSlots, -1);
62 }
63 
64 TFilterBase::TFilterBase(TLoopManager *implPtr, std::string_view name, const unsigned int nSlots)
65  : fImplPtr(implPtr), fLastResult(nSlots), fAccepted(nSlots), fRejected(nSlots), fName(name), fNSlots(nSlots)
66 {
67 }
68 
70 {
71  return fImplPtr;
72 }
73 
75 {
76  return !fName.empty();
77 };
78 
80 {
81  if (fName.empty()) // PrintReport is no-op for unnamed filters
82  return;
83  const auto accepted = std::accumulate(fAccepted.begin(), fAccepted.end(), 0ULL);
84  const auto all = accepted + std::accumulate(fRejected.begin(), fRejected.end(), 0ULL);
85  double perc = accepted;
86  if (all > 0)
87  perc /= all;
88  perc *= 100.;
89  Printf("%-10s: pass=%-10lld all=%-10lld -- %8.3f %%", fName.c_str(), accepted, all, perc);
90 }
91 
93 {
94  fLastCheckedEntry = std::vector<Long64_t>(fNSlots, -1);
95  if (!fName.empty()) // if this is a named filter we care about its report count
97 }
98 
99 void TSlotStack::ReturnSlot(unsigned int slotNumber)
100 {
101  auto &index = GetIndex();
102  auto &count = GetCount();
103  assert(count > 0U && "TSlotStack has a reference count relative to an index which will become negative.");
104  count--;
105  if (0U == count) {
106  index = UINT_MAX;
107  std::lock_guard<ROOT::TSpinMutex> guard(fMutex);
108  fBuf[fCursor++] = slotNumber;
109  assert(fCursor <= fBuf.size() && "TSlotStack assumes that at most a fixed number of values can be present in the "
110  "stack. fCursor is greater than the size of the internal buffer. This violates "
111  "such assumption.");
112  }
113 }
114 
115 unsigned int TSlotStack::GetSlot()
116 {
117  auto &index = GetIndex();
118  auto &count = GetCount();
119  count++;
120  if (UINT_MAX != index)
121  return index;
122  std::lock_guard<ROOT::TSpinMutex> guard(fMutex);
123  assert(fCursor > 0 && "TSlotStack assumes that a value can be always obtained. In this case fCursor is <=0 and this "
124  "violates such assumption.");
125  index = fBuf[--fCursor];
126  return index;
127 }
128 
129 TLoopManager::TLoopManager(TTree *tree, const ColumnNames_t &defaultBranches)
130  : fTree(std::shared_ptr<TTree>(tree, [](TTree *) {})), fDefaultColumns(defaultBranches),
133 {
134 }
135 
137  : fNEmptyEntries(nEmptyEntries), fNSlots(TDFInternal::GetNSlots()),
138  fLoopType(ROOT::IsImplicitMTEnabled() ? ELoopType::kNoFilesMT : ELoopType::kNoFiles)
139 {
140 }
141 
142 TLoopManager::TLoopManager(std::unique_ptr<TDataSource> ds, const ColumnNames_t &defaultBranches)
143  : fDefaultColumns(defaultBranches), fNSlots(TDFInternal::GetNSlots()),
144  fLoopType(ROOT::IsImplicitMTEnabled() ? ELoopType::kDataSourceMT : ELoopType::kDataSource),
145  fDataSource(std::move(ds))
146 {
147  fDataSource->SetNSlots(fNSlots);
148 }
149 
150 /// Run event loop with no source files, in parallel.
152 {
153 #ifdef R__USE_IMT
154  TSlotStack slotStack(fNSlots);
155  // Working with an empty tree.
156  // Evenly partition the entries according to fNSlots. Produce around 2 tasks per slot.
157  const auto nEntriesPerSlot = fNEmptyEntries / (fNSlots * 2);
158  auto remainder = fNEmptyEntries % (fNSlots * 2);
159  std::vector<std::pair<ULong64_t, ULong64_t>> entryRanges;
160  ULong64_t start = 0;
161  while (start < fNEmptyEntries) {
162  ULong64_t end = start + nEntriesPerSlot;
163  if (remainder > 0) {
164  ++end;
165  --remainder;
166  }
167  entryRanges.emplace_back(start, end);
168  start = end;
169  }
170 
171  // Each task will generate a subrange of entries
172  auto genFunction = [this, &slotStack](const std::pair<ULong64_t, ULong64_t> &range) {
173  auto slot = slotStack.GetSlot();
174  InitNodeSlots(nullptr, slot);
175  for (auto currEntry = range.first; currEntry < range.second; ++currEntry) {
176  RunAndCheckFilters(slot, currEntry);
177  }
178  CleanUpTask(slot);
179  slotStack.ReturnSlot(slot);
180  };
181 
183  pool.Foreach(genFunction, entryRanges);
184 
185 #endif // not implemented otherwise
186 }
187 
188 /// Run event loop with no source files, in sequence.
190 {
191  InitNodeSlots(nullptr, 0);
192  for (ULong64_t currEntry = 0; currEntry < fNEmptyEntries && fNStopsReceived < fNChildren; ++currEntry) {
193  RunAndCheckFilters(0, currEntry);
194  }
195 }
196 
197 /// Run event loop over one or multiple ROOT files, in parallel.
199 {
200 #ifdef R__USE_IMT
201  TSlotStack slotStack(fNSlots);
202  using ttpmt_t = ROOT::TTreeProcessorMT;
203  std::unique_ptr<ttpmt_t> tp;
204  tp.reset(new ttpmt_t(*fTree));
205 
206  tp->Process([this, &slotStack](TTreeReader &r) -> void {
207  auto slot = slotStack.GetSlot();
208  InitNodeSlots(&r, slot);
209  // recursive call to check filters and conditionally execute actions
210  while (r.Next()) {
212  }
213  CleanUpTask(slot);
214  slotStack.ReturnSlot(slot);
215  });
216 #endif // no-op otherwise (will not be called)
217 }
218 
219 /// Run event loop over one or multiple ROOT files, in sequence.
221 {
222  TTreeReader r(fTree.get());
223  if (0 == fTree->GetEntriesFast()) return;
224  InitNodeSlots(&r, 0);
225 
226  // recursive call to check filters and conditionally execute actions
227  // in the non-MT case processing can be stopped early by ranges, hence the check on fNStopsReceived
228  while (r.Next() && fNStopsReceived < fNChildren) {
229  RunAndCheckFilters(0, r.GetCurrentEntry());
230  }
231  fTree->GetEntry(0);
232 }
233 
234 /// Run event loop over data accessed through a DataSource, in sequence.
236 {
237  assert(fDataSource != nullptr);
238  fDataSource->Initialise();
239  auto ranges = fDataSource->GetEntryRanges();
240  while (!ranges.empty()) {
241  InitNodeSlots(nullptr, 0u);
242  fDataSource->InitSlot(0u, 0ull);
243  for (const auto &range : ranges) {
244  auto end = range.second;
245  for (auto entry = range.first; entry < end; ++entry) {
246  fDataSource->SetEntry(0u, entry);
247  RunAndCheckFilters(0u, entry);
248  }
249  }
250  fDataSource->FinaliseSlot(0u);
251  ranges = fDataSource->GetEntryRanges();
252  }
253  fDataSource->Finalise();
254 }
255 
256 /// Run event loop over data accessed through a DataSource, in parallel.
258 {
259 #ifdef R__USE_IMT
260  assert(fDataSource != nullptr);
261  TSlotStack slotStack(fNSlots);
263 
264  // Each task works on a subrange of entries
265  auto runOnRange = [this, &slotStack](const std::pair<ULong64_t, ULong64_t> &range) {
266  const auto slot = slotStack.GetSlot();
267  InitNodeSlots(nullptr, slot);
268  fDataSource->InitSlot(slot, range.first);
269  const auto end = range.second;
270  for (auto entry = range.first; entry < end; ++entry) {
271  fDataSource->SetEntry(slot, entry);
272  RunAndCheckFilters(slot, entry);
273  }
274  CleanUpTask(slot);
275  fDataSource->FinaliseSlot(slot);
276  slotStack.ReturnSlot(slot);
277  };
278 
279  fDataSource->Initialise();
280  auto ranges = fDataSource->GetEntryRanges();
281  while (!ranges.empty()) {
282  pool.Foreach(runOnRange, ranges);
283  ranges = fDataSource->GetEntryRanges();
284  }
285  fDataSource->Finalise();
286 #endif // not implemented otherwise (never called)
287 }
288 
289 /// Execute actions and make sure named filters are called for each event.
290 /// Named filters must be called even if the analysis logic would not require it, lest they report confusing results.
291 void TLoopManager::RunAndCheckFilters(unsigned int slot, Long64_t entry)
292 {
293  for (auto &actionPtr : fBookedActions) actionPtr->Run(slot, entry);
294  for (auto &namedFilterPtr : fBookedNamedFilters) namedFilterPtr->CheckFilters(slot, entry);
295  for (auto &callback : fCallbacks) callback(slot);
296 }
297 
298 /// Build TTreeReaderValues for all nodes
299 /// This method loops over all filters, actions and other booked objects and
300 /// calls their `InitTDFValues` methods. It is called once per node per slot, before
301 /// running the event loop. It also informs each node of the TTreeReader that
302 /// a particular slot will be using.
303 void TLoopManager::InitNodeSlots(TTreeReader *r, unsigned int slot)
304 {
305  // booked branches must be initialized first because other nodes might need to point to the values they encapsulate
306  for (auto &bookedBranch : fBookedCustomColumns) bookedBranch.second->InitSlot(r, slot);
307  for (auto &ptr : fBookedActions) ptr->InitSlot(r, slot);
308  for (auto &ptr : fBookedFilters) ptr->InitSlot(r, slot);
309  for (auto &callback : fCallbacksOnce) callback(slot);
310 }
311 
312 /// Initialize all nodes of the functional graph before running the event loop.
313 /// This method is called once per event-loop and performs generic initialization
314 /// operations that do not depend on the specific processing slot (i.e. operations
315 /// that are common for all threads).
317 {
319  for (auto &filter : fBookedFilters)
320  filter->InitNode();
321  for (auto &customColumn : fBookedCustomColumns)
322  customColumn.second->InitNode();
323  for (auto &range : fBookedRanges)
324  range->InitNode();
325 }
326 
327 /// Perform clean-up operations. To be called at the end of each event loop.
329 {
330  fMustRunNamedFilters = false;
331 
332  // forget TActions and detach TResultProxies
333  fBookedActions.clear();
334  for (auto readiness : fResProxyReadiness) {
335  *readiness.get() = true;
336  }
337  fResProxyReadiness.clear();
338 
339  // reset children counts
340  fNChildren = 0;
341  fNStopsReceived = 0;
342  for (auto &ptr : fBookedFilters)
343  ptr->ResetChildrenCount();
344  for (auto &ptr : fBookedRanges)
345  ptr->ResetChildrenCount();
346  for (auto &ptr : fBookedRanges)
347  ptr->ResetChildrenCount();
348 
349  fCallbacks.clear();
350  fCallbacksOnce.clear();
351 }
352 
353 /// Perform clean-up operations. To be called at the end of each task execution.
354 void TLoopManager::CleanUpTask(unsigned int slot)
355 {
356  for (auto &ptr : fBookedActions) ptr->ClearValueReaders(slot);
357  for (auto &ptr : fBookedFilters) ptr->ClearValueReaders(slot);
358  for (auto &pair : fBookedCustomColumns) pair.second->ClearValueReaders(slot);
359 }
360 
361 /// Jit all actions that required runtime column type inference, and clean the `fToJit` member variable.
363 {
364  auto error = TInterpreter::EErrorCode::kNoError;
365  gInterpreter->Calc(fToJit.c_str(), &error);
366  if (TInterpreter::EErrorCode::kNoError != error) {
367  std::string exceptionText =
368  "An error occurred while jitting. The lines above might indicate the cause of the crash\n";
369  throw std::runtime_error(exceptionText.c_str());
370  }
371  fToJit.clear();
372 }
373 
374 /// Trigger counting of number of children nodes for each node of the functional graph.
375 /// This is done once before starting the event loop. Each action sends an `increase children count` signal
376 /// upstream, which is propagated until TLoopManager. Each time a node receives the signal, in increments its
377 /// children counter. Each node only propagates the signal once, even if it receives it multiple times.
378 /// Named filters also send an `increase children count` signal, just like actions, as they always execute during
379 /// the event loop so the graph branch they belong to must count as active even if it does not end in an action.
381 {
382  for (auto &actionPtr : fBookedActions) actionPtr->TriggerChildrenCount();
383  for (auto &namedFilterPtr : fBookedNamedFilters) namedFilterPtr->TriggerChildrenCount();
384 }
385 
386 /// Start the event loop with a different mechanism depending on IMT/no IMT, data source/no data source.
387 /// Also perform a few setup and clean-up operations (jit actions if necessary, clear booked actions after the loop...).
389 {
390  if (!fToJit.empty())
391  JitActions();
392 
393  InitNodes();
394 
395  switch (fLoopType) {
399  case ELoopType::kNoFiles: RunEmptySource(); break;
400  case ELoopType::kROOTFiles: RunTreeReader(); break;
401  case ELoopType::kDataSource: RunDataSource(); break;
402  }
403 
404  CleanUpNodes();
405 }
406 
408 {
409  return this;
410 }
411 
412 /// Return the list of default columns -- empty if none was provided when constructing the TDataFrame
413 const ColumnNames_t &TLoopManager::GetDefaultColumnNames() const
414 {
415  return fDefaultColumns;
416 }
417 
418 TTree *TLoopManager::GetTree() const
419 {
420  return fTree.get();
421 }
422 
424 {
425  auto it = fBookedCustomColumns.find(name);
426  return it == fBookedCustomColumns.end() ? nullptr : it->second.get();
427 }
428 
430 {
431  return fDirPtr;
432 }
433 
434 void TLoopManager::Book(const ActionBasePtr_t &actionPtr)
435 {
436  fBookedActions.emplace_back(actionPtr);
437 }
438 
439 void TLoopManager::Book(const FilterBasePtr_t &filterPtr)
440 {
441  fBookedFilters.emplace_back(filterPtr);
442  if (filterPtr->HasName()) {
443  fBookedNamedFilters.emplace_back(filterPtr);
444  fMustRunNamedFilters = true;
445  }
446 }
447 
449 {
450  const auto &name = columnPtr->GetName();
451  fBookedCustomColumns[name] = columnPtr;
452  fCustomColumnNames.emplace_back(name);
453 }
454 
455 void TLoopManager::Book(const std::shared_ptr<bool> &readinessPtr)
456 {
457  fResProxyReadiness.emplace_back(readinessPtr);
458 }
459 
460 void TLoopManager::Book(const RangeBasePtr_t &rangePtr)
461 {
462  fBookedRanges.emplace_back(rangePtr);
463 }
464 
465 // dummy call, end of recursive chain of calls
466 bool TLoopManager::CheckFilters(int, unsigned int)
467 {
468  return true;
469 }
470 
471 /// Call `PrintReport` on all booked filters
473 {
474  for (const auto &fPtr : fBookedNamedFilters) fPtr->PrintReport();
475 }
476 
477 void TLoopManager::RegisterCallback(ULong64_t everyNEvents, std::function<void(unsigned int)> &&f)
478 {
479  if (everyNEvents == 0ull)
480  fCallbacksOnce.emplace_back(std::move(f), fNSlots);
481  else
482  fCallbacks.emplace_back(everyNEvents, std::move(f), fNSlots);
483 }
484 
485 TRangeBase::TRangeBase(TLoopManager *implPtr, unsigned int start, unsigned int stop, unsigned int stride,
486  const unsigned int nSlots)
487  : fImplPtr(implPtr), fStart(start), fStop(stop), fStride(stride), fNSlots(nSlots)
488 {
489 }
490 
492 {
493  return fImplPtr;
494 }
495 
497 {
498  fLastCheckedEntry = -1;
499  fNProcessedEntries = 0;
500  fHasStopped = false;
501 }
void Foreach(F func, unsigned nTimes)
Execute func (with no arguments) nTimes in parallel.
FilterBaseVec_t fBookedFilters
Definition: TDFNodes.hxx:126
void InitNodeSlots(TTreeReader *r, unsigned int slot)
Build TTreeReaderValues for all nodes This method loops over all filters, actions and other booked ob...
Definition: TDFNodes.cxx:303
long long Long64_t
Definition: RtypesCore.h:69
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
Definition: TTreeReader.h:43
basic_string_view< char > string_view
Definition: RStringView.h:35
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Long64_t GetCurrentEntry() const
Returns the index of the current entry being read.
Definition: TTreeReader.h:215
std::map< std::string, TCustomColumnBasePtr_t > fBookedCustomColumns
Definition: TDFNodes.hxx:128
void RunTreeProcessorMT()
Run event loop over one or multiple ROOT files, in parallel.
Definition: TDFNodes.cxx:198
TLoopManager * GetImplPtr() const
Definition: TDFNodes.cxx:69
TTree()
Default constructor and I/O constructor.
Definition: TTree.cxx:691
ColumnNames_t fCustomColumnNames
Contains names of all custom columns defined in the functional graph.
Definition: TDFNodes.hxx:129
const ColumnNames_t fDefaultColumns
Definition: TDFNodes.hxx:136
const std::unique_ptr< TDataSource > fDataSource
Owning pointer to a data-source object. Null if no data-source.
Definition: TDFNodes.hxx:144
TLoopManager * GetImplPtr() const
Definition: TDFNodes.cxx:491
TLoopManager(TTree *tree, const ColumnNames_t &defaultBranches)
Definition: TDFNodes.cxx:129
void InitNodes()
Initialize all nodes of the functional graph before running the event loop.
Definition: TDFNodes.cxx:316
#define gInterpreter
Definition: TInterpreter.h:526
STL namespace.
unsigned int fNChildren
Number of nodes of the functional graph hanging from this object.
Definition: TDFNodes.hxx:140
void Book(const ActionBasePtr_t &actionPtr)
Definition: TDFNodes.cxx:434
void CleanUpTask(unsigned int slot)
Perform clean-up operations. To be called at the end of each task execution.
Definition: TDFNodes.cxx:354
TCustomColumnBase(TLoopManager *df, std::string_view name, const unsigned int nSlots, const bool isDSColumn)
Definition: TDFNodes.cxx:43
TFilterBase(TLoopManager *df, std::string_view name, const unsigned int nSlots)
Definition: TDFNodes.cxx:64
std::vector< ULong64_t > fAccepted
Definition: TDFNodes.hxx:578
std::vector< ULong64_t > fRejected
Definition: TDFNodes.hxx:579
std::shared_ptr< TFilterBase > FilterBasePtr_t
Definition: TDFNodes.hxx:78
void RunDataSource()
Run event loop over data accessed through a DataSource, in sequence.
Definition: TDFNodes.cxx:235
void RunEmptySource()
Run event loop with no source files, in sequence.
Definition: TDFNodes.cxx:189
void Run()
Start the event loop with a different mechanism depending on IMT/no IMT, data source/no data source...
Definition: TDFNodes.cxx:388
void ReturnSlot(unsigned int slotNumber)
Definition: TDFNodes.cxx:99
TRangeBase(TLoopManager *implPtr, unsigned int start, unsigned int stop, unsigned int stride, const unsigned int nSlots)
Definition: TDFNodes.cxx:485
void Report() const
Call PrintReport on all booked filters.
Definition: TDFNodes.cxx:472
void CleanUpNodes()
Perform clean-up operations. To be called at the end of each event loop.
Definition: TDFNodes.cxx:328
bool CheckFilters(int, unsigned int)
Definition: TDFNodes.cxx:466
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:146
::TDirectory *const fDirPtr
Definition: TDFNodes.hxx:132
ActionBaseVec_t fBookedActions
Definition: TDFNodes.hxx:125
std::vector< Long64_t > fLastCheckedEntry
Definition: TDFNodes.hxx:453
This class provides a simple interface to execute the same task multiple times in parallel...
std::vector< TCallback > fCallbacks
Registered callbacks.
Definition: TDFNodes.hxx:147
void EvalChildrenCounts()
Trigger counting of number of children nodes for each node of the functional graph.
Definition: TDFNodes.cxx:380
const unsigned int fNSlots
number of thread slots used by this node, inherited from parent node.
Definition: TDFNodes.hxx:451
void RunAndCheckFilters(unsigned int slot, Long64_t entry)
Execute actions and make sure named filters are called for each event.
Definition: TDFNodes.cxx:291
void RunEmptySourceMT()
Run event loop with no source files, in parallel.
Definition: TDFNodes.cxx:151
ROOT::R::TRInterface & r
Definition: Object.C:4
const ColumnNames_t & GetDefaultColumnNames() const
Return the list of default columns – empty if none was provided when constructing the TDataFrame...
Definition: TDFNodes.cxx:413
unsigned int fNStopsReceived
Number of times that a children node signaled to stop processing entries.
Definition: TDFNodes.hxx:141
void RunTreeReader()
Run event loop over one or multiple ROOT files, in sequence.
Definition: TDFNodes.cxx:220
TLoopManager * fImplPtr
A raw pointer to the TLoopManager at the root of this functional graph.
Definition: TDFNodes.hxx:574
const unsigned int fNSlots
Definition: TDFNodes.hxx:138
std::string fToJit
string containing all BuildAndBook actions that should be jitted before running
Definition: TDFNodes.hxx:143
FilterBaseVec_t fBookedNamedFilters
Contains a subset of fBookedFilters, i.e. only the named filters.
Definition: TDFNodes.hxx:127
void RegisterCallback(ULong64_t everyNEvents, std::function< void(unsigned int)> &&f)
Definition: TDFNodes.cxx:477
const ELoopType fLoopType
The kind of event loop that is going to be run (e.g. on ROOT files, on no files)
Definition: TDFNodes.hxx:142
#define Printf
Definition: TGeoToOCC.h:18
bool fHasStopped
True if the end of the range has been reached.
Definition: TDFNodes.hxx:714
void JitActions()
Jit all actions that required runtime column type inference, and clean the fToJit member variable...
Definition: TDFNodes.cxx:362
Describe directory structure in memory.
Definition: TDirectory.h:34
unsigned long long ULong64_t
Definition: RtypesCore.h:70
std::vector< Long64_t > fLastCheckedEntry
Definition: TDFNodes.hxx:576
const unsigned int fNSlots
Number of thread slots used by this node.
Definition: TDFNodes.hxx:356
const ULong64_t fNEmptyEntries
Definition: TDFNodes.hxx:137
TLoopManager * fImplPtr
A raw pointer to the TLoopManager at the root of this functional graph.
Definition: TDFNodes.hxx:704
TCustomColumnBase * GetBookedBranch(const std::string &name) const
Definition: TDFNodes.cxx:423
std::shared_ptr< TDFInternal::TActionBase > ActionBasePtr_t
Definition: TDFNodes.hxx:73
unsigned int GetNSlots() const
Definition: TDFNodes.hxx:188
TLoopManager * fImplPtr
A raw pointer to the TLoopManager at the root of this functional graph.
Definition: TDFNodes.hxx:446
void RunDataSourceMT()
Run event loop over data accessed through a DataSource, in parallel.
Definition: TDFNodes.cxx:257
TLoopManager * GetImplPtr() const
Definition: TDFNodes.cxx:54
Bool_t Next()
Move to the next entry (or index of the TEntryList if that is set).
Definition: TTreeReader.h:171
std::shared_ptr< TTree > fTree
Definition: TDFNodes.hxx:133
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
Definition: TROOT.cxx:584
unsigned int GetNSlots()
Definition: TDFUtils.cxx:222
Definition: tree.py:1
std::shared_ptr< TCustomColumnBase > TCustomColumnBasePtr_t
Definition: TDFNodes.hxx:76
std::vector< std::shared_ptr< bool > > fResProxyReadiness
Definition: TDFNodes.hxx:131
const unsigned int fNSlots
Number of thread slots used by this node, inherited from parent node.
Definition: TDFNodes.hxx:583
TLoopManager * fImplPtr
A raw pointer to the TLoopManager at the root of this functional graph.
Definition: TDFNodes.hxx:353
A class to process the entries of a TTree in parallel.
char name[80]
Definition: TGX11.cxx:109
::TDirectory * GetDirectory() const
Definition: TDFNodes.cxx:429
std::vector< TOneTimeCallback > fCallbacksOnce
Registered callbacks to invoke just once before running the loop.
Definition: TDFNodes.hxx:148
std::shared_ptr< TRangeBase > RangeBasePtr_t
Definition: TDFNodes.hxx:81