From f2e927e40121aeca27219aeb4d3c32fabcb77b19 Mon Sep 17 00:00:00 2001 From: karnem <mikhail.karnevskiy@desy.de> Date: Fri, 6 Mar 2020 14:22:50 +0100 Subject: [PATCH] Edit concurency parameters from the commend line --- xfel_calibrate/calibrate.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py index 9f77be0a9..353d2d8d1 100755 --- a/xfel_calibrate/calibrate.py +++ b/xfel_calibrate/calibrate.py @@ -56,6 +56,10 @@ def make_initial_parser(): help='Filename (and optionally path) for output' ' report') + parser.add_argument('--concurrency-par', type=str, + help='Name of cuncurrency parameter.' + 'If not given, it is taken from configuration.') + parser.add_argument('--priority', type=int, default=2, help="Priority of batch jobs. If priority<=1, reserved" " nodes become available.") @@ -755,6 +759,10 @@ def run(): except KeyError: print("Not one of the known calibrations or detectors") return + + if args["concurrency_par"] is not None: + concurrency["parameter"] = args["concurrency_par"] + with open(notebook, "r") as f: nb = nbformat.read(f, as_version=4) @@ -798,7 +806,7 @@ def run(): run_uuid = uuid4() - # check that a modules field is present if we run concurrently + # check if concurrency parameter is given and we run concurrently if not has_parm(parms, concurrency["parameter"]) and concurrency["parameter"] is not None: msg = "Notebook cannot be run concurrently: no {} parameter".format( concurrency["parameter"]) -- GitLab