From 170b3f2f2525f7a3e50d9c69b9542a47c7a6a5d5 Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Thu, 4 Jul 2024 10:27:39 +0200 Subject: [PATCH] Add flag to disable batch mode --- k4FWCore/scripts/k4run | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/k4FWCore/scripts/k4run b/k4FWCore/scripts/k4run index 68066190..4c54a094 100755 --- a/k4FWCore/scripts/k4run +++ b/k4FWCore/scripts/k4run @@ -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 = [ @@ -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 @@ -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)