Skip to content

Commit

Permalink
Add flag to disable batch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel committed Jul 5, 2024
1 parent 8826f02 commit 21f3adf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions k4FWCore/scripts/k4run
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import argparse
import logging

from k4FWCore.utils import load_file
from ROOT import gROOT

# these default properties are filtered as otherwise they will clutter the argument list
FILTER_GAUDI_PROPS = [
Expand Down Expand Up @@ -156,6 +155,12 @@ def main():
help="Print all the configurable components available in the framework and exit",
)
parser.add_argument("--gdb", action="store_true", help="Attach gdb debugger")
parser.add_argument(
"--disableROOTBatchMode",
action="store_true",
help="Do not enforce ROOT batch mode",
default=False,
)

# Once to parse the files and another time below to have the new parameters
# in the namespace since parsing of the file happens when the namespace
Expand Down Expand Up @@ -229,8 +234,11 @@ def main():

c = gaudimain()
if not opts.dry_run:
# ensure ROOT runs in batch mode
gROOT.SetBatch(True)
if not opts.disableROOTBatchMode:
# ensure ROOT runs in batch mode
from ROOT import gROOT

gROOT.SetBatch(True)

# Do the real processing
retcode = c.run(opts.gdb)
Expand Down

0 comments on commit 21f3adf

Please sign in to comment.