diff --git a/jobrunner/__meta__.py b/jobrunner/__meta__.py index ef683e1..1c9c0b7 100644 --- a/jobrunner/__meta__.py +++ b/jobrunner/__meta__.py @@ -1,7 +1,7 @@ """Metadata for jobrunner""" __pkgname__ = "PyJobRunner" -__version__ = "2023.11.3" +__version__ = "2023.11.4" __authors__ = "Akash Dhruv" __license__ = "Apache Software License" __copyright__ = "Copyright (c) Akash Dhruv 2023. All Rights Reserved." diff --git a/jobrunner/instruments/flashx.py b/jobrunner/instruments/flashx.py index c130651..0ffb57b 100644 --- a/jobrunner/instruments/flashx.py +++ b/jobrunner/instruments/flashx.py @@ -18,6 +18,10 @@ def CreateParfile(workdir): # reserved environment variable for input_dict = toml.load(workdir + os.sep + "job.input") + # Create an empty list to track keys that are being + # entered into the parfile + key_list = [] + # Open flash.par in write mode in JobWorkDir, reserved environment # variable for working node along the directory tree. with open(workdir + os.sep + "flash.par", "w") as parfile: @@ -49,6 +53,13 @@ def CreateParfile(workdir): + "during Flash-X parfile generation" ) + elif key in key_list: + raise ValueError( + f'[jobrunner] parameter "{key}" associated with "{group}" is already ' + + "entered into the parfile using a different group. Please fix your toml " + + "files along the directory tree." + ) + else: # Deal with True/False values if isinstance(value, bool): @@ -62,6 +73,8 @@ def CreateParfile(workdir): else: parfile.write(f"{key} = {value}\n") + key_list.append(key) + def CreateHeater(workdir): """ diff --git a/jobrunner/lib/_filetools.py b/jobrunner/lib/_filetools.py index e96d563..ca44413 100644 --- a/jobrunner/lib/_filetools.py +++ b/jobrunner/lib/_filetools.py @@ -80,6 +80,7 @@ def CreateInputFile(config): job_toml[group].update(node_toml[group]) else: job_toml[group] = node_toml[group] + # start writing the job.input file with open(config.job.workdir + os.sep + "job.input", "w") as inputfile: