Skip to content

Commit

Permalink
set default for implicit multi-threading to a single thread so that d…
Browse files Browse the repository at this point in the history
…ockerized environment such as binder dont break
  • Loading branch information
stwunsch committed Feb 27, 2020
1 parent ec826b7 commit d620d69
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dimuonSpectrum.C
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ float computeInvariantMass(RVec<float>& pt, RVec<float>& eta, RVec<float>& phi,

void dimuonSpectrum() {
// Enable multi-threading
ROOT::EnableImplicitMT();
// The default here is set to a single thread. You can choose the number of threads based on your system.
ROOT::EnableImplicitMT(1);

// Create dataframe from NanoAOD files
ROOT::RDataFrame df("Events", "root://eospublic.cern.ch//eos/opendata/cms/derived-data/AOD2NanoAODOutreachTool/Run2012BC_DoubleMuParked_Muons.root");
Expand Down
6 changes: 4 additions & 2 deletions dimuonSpectrum.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Enable multi-threading"
"## Enable multi-threading\n",
"\n",
"The default here is set to a single thread. You can choose the number of threads based on your system."
]
},
{
Expand All @@ -64,7 +66,7 @@
"metadata": {},
"outputs": [],
"source": [
"ROOT.ROOT.EnableImplicitMT()"
"ROOT.ROOT.EnableImplicitMT(1)"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion dimuonSpectrum.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import ROOT

# Enable multi-threading
ROOT.ROOT.EnableImplicitMT()
# The default here is set to a single thread. You can choose the number of threads based on your system.
ROOT.ROOT.EnableImplicitMT(1)

# Create dataframe from NanoAOD files
df = ROOT.RDataFrame("Events", "root://eospublic.cern.ch//eos/opendata/cms/derived-data/AOD2NanoAODOutreachTool/Run2012BC_DoubleMuParked_Muons.root")
Expand Down

0 comments on commit d620d69

Please sign in to comment.