Demonstrate how to activate and use the implicit parallelisation of TTree::GetEntry.
Such parallelisation creates one task per top-level branch of the tree being read. In this example, most of the branches are floating point numbers, which are very fast to read. This parallelisation can be used, though, on bigger trees with many (complex) branches, which are more likely to benefit from speedup gains.
int imt001_parBranchProcessing()
{
int nthreads = 4;
const auto nEntries =
tree->GetEntries();
}
tree->SetImplicitMT(
false);
}
tree->SetImplicitMT(
true);
}
return 0;
}
A pseudo container class which is a generator of indices.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
A TTree represents a columnar dataset.
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
void DisableImplicitMT()
Disables the implicit multi-threading in ROOT (see EnableImplicitMT).
- Date
- 26/09/2016
- Author
- Enric Tejedor
Definition in file imt001_parBranchProcessing.C.