Skip to content

Commit 283c53c

Browse files
stwunscheguiraud
authored andcommitted
Refactor df102* benchmarks
* Use nthreads argument for df102*.py benchmarks instead of a flag to enable/disable imt * Use smaller file with only the muon collections to improve reliability in the CI and for faster download of the data
1 parent b8a5d71 commit 283c53c

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

root/tree/dataframe/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endif()
1111
if(rootbench-datafiles)
1212
RB_ADD_GBENCHMARK(gbenchmark-df102_NanoAODDimuonAnalysis
1313
df102_NanoAODDimuonAnalysis.C
14-
DOWNLOAD_DATAFILES Run2012B_DoubleMuParked.root Run2012C_DoubleMuParked.root
14+
DOWNLOAD_DATAFILES Run2012BC_DoubleMuParked_Muons.root
1515
LABEL long
1616
LIBRARIES Core Hist Imt RIO Tree TreePlayer ROOTDataFrame ROOTVecOps Gpad Graf)
1717

@@ -23,7 +23,7 @@ if(rootbench-datafiles)
2323

2424
RB_ADD_PYTESTBENCHMARK(pytest-df102_NanoAODDimuonAnalysis
2525
df102_NanoAODDimuonAnalysis.py
26-
DOWNLOAD_DATAFILES Run2012B_DoubleMuParked.root Run2012C_DoubleMuParked.root
26+
DOWNLOAD_DATAFILES Run2012BC_DoubleMuParked_Muons.root
2727
LABEL long)
2828

2929
RB_ADD_PYTESTBENCHMARK(pytest-df104_HiggsToTwoPhotons

root/tree/dataframe/df102_NanoAODDimuonAnalysis.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
using namespace ROOT::VecOps;
1919

20-
static const std::vector<std::string> local_files = {RB::GetDataDir() + "/Run2012B_DoubleMuParked.root",
21-
RB::GetDataDir() + "/Run2012C_DoubleMuParked.root"};
20+
static const std::vector<std::string> local_files = {RB::GetDataDir() + "/Run2012BC_DoubleMuParked_Muons.root"};
2221

2322
void payload(const std::vector<std::string>& files, unsigned int nthreads)
2423
{

root/tree/dataframe/df102_NanoAODDimuonAnalysis.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
import os
77

88

9-
files = ROOT.std.vector("string")(2)
10-
files[0] = os.path.join(os.environ["RB_DATASETDIR"], "Run2012B_DoubleMuParked.root")
11-
files[1] = os.path.join(os.environ["RB_DATASETDIR"], "Run2012C_DoubleMuParked.root")
9+
files = os.path.join(os.environ["RB_DATASETDIR"], "Run2012BC_DoubleMuParked_Muons.root")
1210

13-
def payload(files, enable_imt):
11+
def payload(files, nthreads):
1412
# Enable multi-threading
15-
if enable_imt:
16-
ROOT.ROOT.EnableImplicitMT()
13+
if nthreads > 1:
14+
ROOT.ROOT.EnableImplicitMT(nthreads)
1715
else:
1816
ROOT.ROOT.DisableImplicitMT()
1917

@@ -61,8 +59,8 @@ def payload(files, enable_imt):
6159

6260

6361
def test_df102_NanoAODDimuonAnalysis_imt(benchmark):
64-
benchmark.pedantic(payload, kwargs={'files': files, 'enable_imt': True}, iterations=1, rounds=1)
62+
benchmark.pedantic(payload, kwargs={'files': files, 'nthreads': 8}, iterations=1, rounds=1)
6563

6664

6765
def test_df102_NanoAODDimuonAnalysis_noimt(benchmark):
68-
benchmark.pedantic(payload, kwargs={'files': files, 'enable_imt': False}, iterations=1, rounds=1)
66+
benchmark.pedantic(payload, kwargs={'files': files, 'nthreads': 1}, iterations=1, rounds=1)

0 commit comments

Comments
 (0)