Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
add a new option --max-events-per-process
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiSakuma committed Mar 1, 2016
1 parent 646e9c2 commit dc159ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions AlphaTwirl/AlphaTwirl.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def buildReaderAndCollector(preTableReaders, tableConfigs, outDir, force, progre
return reader1, collector1

##__________________________________________________________________||
def createTreeReader(analyzerName, fileName, treeName, reader, collector, nevents, communicationChannel):
def createTreeReader(analyzerName, fileName, treeName, reader, collector, nevents, maxEventsPerRun, communicationChannel):
eventLoopRunner = MPEventLoopRunner(communicationChannel)
eventBuilder = EventBuilder(analyzerName, fileName, treeName, nevents)
eventReader = EventReader(eventBuilder, eventLoopRunner, reader, collector)
eventReader = EventReader(eventBuilder, eventLoopRunner, reader, collector, maxEventsPerRun)
return eventReader

##__________________________________________________________________||
Expand All @@ -126,6 +126,7 @@ def _add_arguments(self, parser):
parser.add_argument("-q", "--quiet", action = "store_true", default = False, help = "quiet mode")
parser.add_argument('-o', '--outDir', default = 'tbl/out', action = 'store')
parser.add_argument("-n", "--nevents", action = "store", default = -1, type = int, help = "maximum number of events to process for each component")
parser.add_argument("--max-events-per-process", action = "store", default = -1, type = int, help = "maximum number of events per process")
parser.add_argument("-c", "--components", default = None, nargs = '*', help = "the list of components")
parser.add_argument("--force", action = "store_true", default = False, dest="force", help = "recreate all output files")
return parser
Expand Down Expand Up @@ -168,6 +169,7 @@ def _build(self):
reader = reader,
collector = collector,
nevents = self.args.nevents,
maxEventsPerRun = self.args.max_events_per_process,
communicationChannel = self.communicationChannel,
)
self.addComponentReader(treeReader)
Expand Down

0 comments on commit dc159ee

Please sign in to comment.