From 828a4a49e917cce0cf43e2f4cb0a1152612238c1 Mon Sep 17 00:00:00 2001 From: Walter Lampl <Walter.Lampl@cern.ch> Date: Wed, 3 May 2023 18:01:44 +0200 Subject: [PATCH] Add --interactive and --skipEvents option to CARunner.py --- Control/AthenaConfiguration/share/CARunner.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Control/AthenaConfiguration/share/CARunner.py b/Control/AthenaConfiguration/share/CARunner.py index 8f71dd7307e5..8704092e03be 100755 --- a/Control/AthenaConfiguration/share/CARunner.py +++ b/Control/AthenaConfiguration/share/CARunner.py @@ -7,10 +7,13 @@ import pickle if __name__=="__main__": import argparse parser= argparse.ArgumentParser(prog="CARunner.py",description="Executes a pickled ComponentAccumulator", - usage="CARunner.py [-h] [-d DEBUG] [--evtMax EVTMAX] [-l LOGLEVEL] <picklefile>") - parser.add_argument("-d","--debug", default=None, help="attach debugger (gdb) before run, <stage>: init, exec, fini") + usage="CARunner.py [options] <picklefile>") + parser.add_argument("-d","--debug", default=None, choices=["init", "exec", "fini"], help="attach debugger (gdb) before run, <stage>") + parser.add_argument("-i","--interactive", action='store_true', help="Drop into interactive mode") parser.add_argument("--evtMax", type=int, default=None, help="Max number of events to process") - parser.add_argument("-l", "--loglevel", default=None, help="logging level (ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, or FATAL") + parser.add_argument("--skipEvents", type=int, default=None, help="Number of events to skip") + parser.add_argument("-l", "--loglevel", default=None, choices=["ALL","VERBOSE","DEBUG","INFO","WARNING","ERROR","FATAL"], help="logging level") + (args,leftover)=parser.parse_known_args(sys.argv[1:]) @@ -60,4 +63,10 @@ if __name__=="__main__": print ("ERROR: Unknown log-level, allowed values are ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, FATAL") sys.exit(-1) + if args.interactive: + acc1.interactive="init" + + if args.skipEvents: + acc1.getService("EventSelector").SkipEvents=int(args.skipEvents) + acc1.run(nEvt) -- GitLab