Skip to content
Prev Previous commit
Next Next commit
[TDF] Make TLoopManager the entity setting the TDS number of slots
  • Loading branch information
dpiparo committed Sep 16, 2017
commit d66c3f3767968ed7df07a92ab780f19c44a2d194
2 changes: 2 additions & 0 deletions tree/treeplayer/src/TDFNodes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ TLoopManager::TLoopManager(std::unique_ptr<TDataSource> ds, const ColumnNames_t
: fDefaultColumns(defaultBranches), fNSlots(TDFInternal::GetNSlots()), fLoopType(ELoopType::kDataSource),
fDataSource(std::move(ds))
{
const auto nSlots = TDFInternal::GetNSlots();
fDataSource->SetNSlots( 0U == nSlots ? 1U : nSlots);
}

/// Run event loop with no source files, in parallel.
Expand Down
2 changes: 0 additions & 2 deletions tree/treeplayer/src/TDataFrame.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,4 @@ TDataFrame::TDataFrame(ULong64_t numEntries)
TDataFrame::TDataFrame(std::unique_ptr<TDataSource> ds, const ColumnNames_t &defaultBranches)
: TInterface<TDFDetail::TLoopManager>(std::make_shared<TDFDetail::TLoopManager>(std::move(ds), defaultBranches))
{
const auto nSlots = ROOT::GetImplicitMTPoolSize();
GetProxiedPtr()->GetDataSource()->SetNSlots( 0U == nSlots ? 1U : nSlots);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change these two lines with fDataSource->SetNSlots(fNSlots) in TDFNodes.cxx:129 (TLoopManager's ctor) to keep TLoopManager the sole authority when it comes to TDF's number of slots.