ATLAS Offline Software
Classes | Functions | Variables
rhadd Namespace Reference

Classes

class  haddJob
 
class  haddStep
 

Functions

def main ()
 
def doRecursiveMerge (args)
 

Variables

 level
 

Function Documentation

◆ doRecursiveMerge()

def rhadd.doRecursiveMerge (   args)
Setup the cascade of merge jobs and execute each level in turn

Definition at line 192 of file rhadd.py.

192 def doRecursiveMerge(args):
193  '''Setup the cascade of merge jobs and execute each level in turn'''
194  # First setup the cascade of merge steps
195  jobGraph = []
196  level = 0
197  jobGraph.append(haddStep(bunchNumber = args['bunchNumber'],
198  inputFiles = args['inputFiles'],
199  finalOutputFile = args['outputFile'], level = level))
200 
201  while jobGraph[-1].numHadds > 1:
202  level += 1
203  jobGraph.append(haddStep(bunchNumber = args['bunchNumber'],
204  inputFiles = jobGraph[-1].outputFiles,
205  finalOutputFile = args['outputFile'], level = level))
206  logging.debug(jobGraph[-1])
207 
208  # Now execute each merge stage in turn
209  for i, jobs in enumerate(jobGraph):
210  logging.info('Executing merge interation step %d' % i)
211  jobs.executeAll(args['parallelMerge'])
212 
213  logging.info('Final merge completed successfully.')
214 
215 

◆ main()

def rhadd.main ( )

Definition at line 164 of file rhadd.py.

164 def main():
165  parser = argparse.ArgumentParser(description='Recursive wrapper around the ROOT hadd script.',
166  epilog='Return codes: 0 All OK; 1 Problem with hadd; 2 Invalid arguments')
167  parser.add_argument('outputFile', help='Single merged output file')
168  parser.add_argument('inputFiles', nargs='+', help='Input files to merge')
169  parser.add_argument('-n', '--bunchNumber', type=int, help='File batching number for single hadds', default=10)
170  parser.add_argument('-p', '--parallelMerge', type=int,
171  help='Number of merges to do in parallel (experimental, please do not use in production)', default=1)
172 
173  args = vars(parser.parse_args(sys.argv[1:]))
174 
175  logging.debug(args)
176 
177  # Sanity checks
178  if args['bunchNumber'] <= 1:
179  logging.error('bunchNumber parameter must be greater than 1')
180  sys.exit(2)
181 
182  if args['parallelMerge'] < 1:
183  logging.error('parallelMerge parameter must be greater than 1')
184  sys.exit(2)
185 
186 
187  doRecursiveMerge(args)
188 
189  sys.exit(0)
190 
191 

Variable Documentation

◆ level

rhadd.level

Definition at line 40 of file rhadd.py.

rhadd.doRecursiveMerge
def doRecursiveMerge(args)
Definition: rhadd.py:192
rhadd.main
def main()
Definition: rhadd.py:164